aboutsummaryrefslogtreecommitdiff
path: root/env/.config/nvim/after/plugin/lualine.lua
blob: de94ed30527d631a631c58b361709117dcf4c8e0 (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
local ok, lualine = pcall(require, 'lualine')
if ok then
    local custom_gruvbox = require'lualine.themes.base16'

    -- Change the background of lualine_c section for normal mode
    custom_gruvbox.normal.c.bg = '#222222'

    local hide_in_width = function()
        return vim.fn.winwidth(0) > 80
    end

    local diagnostics = {
        'diagnostics',
        sources = { 'nvim_diagnostic' },
        sections = { 'error' , 'warn' },
        symbols = { error = ' ', warn = ' ', info = ' ', hint = ' ' },
        update_in_insert = false,
        allways_visible = false,
        cond = hide_in_width,
    }

    lualine.setup {
        options = {
            theme  = custom_gruvbox,
            icons_enabled = true,
            disabled_filetypes = {'undotree', 'diff'},
        },
        sections = {
            lualine_a = {{
                'mode',
                fmt = function(str)
                    return ' ' .. str
                end,
            }},
            lualine_b = {'branch', 'diff', diagnostics},
            lualine_c = {{
                'filename',
                file_status = true,
                path = 0,
            }},
            --lualine_x = {'encoding', 'fileformat', 'filetype'},
            lualine_x = {{'encoding', cond=hide_in_width}, {'filetype',cond=hide_in_width}},
            lualine_y = {'progress'},
            lualine_z = {'location'}
        }
    }
end