summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/plugins/lualine.lua
blob: c1000efe1645af3ebf935474456934dfce6e8825 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
return {
  "nvim-lualine/lualine.nvim",
  dependencies = { "nvim-tree/nvim-web-devicons" },

  config = function()
    local theme = function()
      local colors = {
        black         = '#282828',
        black_hard    = '#1d2021',
        white         = '#ebdbb2',
        red           = '#fb4934',
        green         = '#b8bb26',
        yellow        = '#d79921',
        yellow_bright = '#fabd2f',
        blue          = '#83a598',
        purple        = '#d3859b',
        aqua          = '#8ec07c',
        orange        = '#d65d0e',
        orange_bright = '#fe8019',
        gray          = '#a89984',
        darkgray      = '#3c3836',
        lightgray     = '#504945',
        inactivegray  = '#7c6f64',
      }

      return {
        normal = {
          a = { bg = colors.yellow, fg = colors.black, gui = 'bold' },
          b = { bg = colors.darkgray, fg = colors.white },
          c = { bg = colors.darkgray, fg = colors.white }
        },
        insert = {
          a = { bg = colors.yellow, fg = colors.black, gui = 'bold' },
          b = { bg = colors.darkgray, fg = colors.white },
          c = { bg = colors.darkgray, fg = colors.white }
        },
        visual = {
          a = { bg = colors.yellow, fg = colors.black, gui = 'bold' },
          b = { bg = colors.darkgray, fg = colors.white },
          c = { bg = colors.darkgray, fg = colors.white }
        },
        replace = {
          a = { bg = colors.yellow, fg = colors.black, gui = 'bold' },
          b = { bg = colors.darkgray, fg = colors.white },
          c = { bg = colors.darkgray, fg = colors.white }
        },
        command = {
          a = { bg = colors.yellow, fg = colors.black, gui = 'bold' },
          b = { bg = colors.darkgray, fg = colors.white },
          c = { bg = colors.darkgray, fg = colors.white }
        },
        inactive = {
          a = { bg = colors.darkgray, fg = colors.gray, gui = 'bold' },
          b = { bg = colors.darkgray, fg = colors.gray },
          c = { bg = colors.darkgray, fg = colors.gray }
        }
      }
    end


    local tty = function()
      local colors = {
        black    = '#000000',
        -- white         = '#ffffff',
        white    = '#ebdbb2',
        yellow   = '#d79921',
        gray     = '#a89984',
        darkgray = '#3c3836',
      }

      return {
        normal = {
          a = { bg = colors.yellow, fg = colors.black },
          b = { bg = colors.darkgray, fg = colors.white },
          c = { bg = colors.darkgray, fg = colors.white }
        },
        insert = {
          a = { bg = colors.yellow, fg = colors.black },
          b = { bg = colors.darkgray, fg = colors.white },
          c = { bg = colors.darkgray, fg = colors.white }
        },
        visual = {
          a = { bg = colors.yellow, fg = colors.black },
          b = { bg = colors.darkgray, fg = colors.white },
          c = { bg = colors.darkgray, fg = colors.white }
        },
        replace = {
          a = { bg = colors.yellow, fg = colors.black },
          b = { bg = colors.darkgray, fg = colors.white },
          c = { bg = colors.darkgray, fg = colors.white }
        },
        command = {
          a = { bg = colors.yellow, fg = colors.black },
          b = { bg = colors.darkgray, fg = colors.white },
          c = { bg = colors.darkgray, fg = colors.white }
        },
        inactive = {
          a = { bg = colors.darkgray, fg = colors.white },
          b = { bg = colors.darkgray, fg = colors.white },
          c = { bg = colors.darkgray, fg = colors.white }
        }
      }
    end

    require('lualine').setup {
      options = {
        icons_enabled = false,
        theme = theme, -- theme or tty
        component_separators = { left = '', right = '' },
        section_separators = { left = '', right = '' },
        disabled_filetypes = {
          statusline = {},
          winbar = {},
        },
        ignore_focus = {},
        always_divide_middle = true,
        always_show_tabline = true,
        globalstatus = false,
        refresh = {
          statusline = 1000,
          tabline = 1000,
          winbar = 1000,
          refresh_time = 16,
          events = {
            'WinEnter',
            'BufEnter',
            'BufWritePost',
            'SessionLoadPost',
            'FileChangedShellPost',
            'VimResized',
            'Filetype',
            'CursorMoved',
            'CursorMovedI',
            'ModeChanged',
          },
        }
      },
      sections = {
        lualine_a = { 'mode' },
        lualine_b = { 'branch', 'diff', 'diagnostics' },
        lualine_c = { 'filename' },
        lualine_x = { 'encoding', 'fileformat', 'filetype' },
        -- lualine_y = { 'progress' },
        lualine_y = { '' },
        lualine_z = { 'location' }
      },
      inactive_sections = {
        lualine_a = {},
        lualine_b = {},
        lualine_c = { 'filename' },
        lualine_x = { 'location' },
        lualine_y = {},
        lualine_z = {}
      },
      tabline = {},
      winbar = {},
      inactive_winbar = {},
      extensions = {}
    }
  end,
}