diff options
Diffstat (limited to '.config')
-rw-r--r-- | .config/nvim/lua/plugin_settings.lua | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/.config/nvim/lua/plugin_settings.lua b/.config/nvim/lua/plugin_settings.lua index 55a4eae..78b0792 100644 --- a/.config/nvim/lua/plugin_settings.lua +++ b/.config/nvim/lua/plugin_settings.lua | |||
@@ -47,6 +47,18 @@ local conditions = { | |||
47 | end | 47 | end |
48 | } | 48 | } |
49 | 49 | ||
50 | -- https://www.reddit.com/r/neovim/comments/u2uc4p/your_lualine_custom_features/i4muvp6/ | ||
51 | -- override 'encoding': don't display if encoding is utf-8. | ||
52 | local encoding = function() | ||
53 | local ret, _ = (vim.bo.fenc).gsub("^utf%-8$", "") | ||
54 | return ret | ||
55 | end | ||
56 | |||
57 | -- fileformat: don't display if &ff is unix. | ||
58 | local fileformat = function() | ||
59 | local ret, _ = vim.bo.fileformat.gsub("^unix$", "") | ||
60 | return ret | ||
61 | end | ||
50 | 62 | ||
51 | require'lualine'.setup { | 63 | require'lualine'.setup { |
52 | options = { | 64 | options = { |
@@ -72,16 +84,13 @@ require'lualine'.setup { | |||
72 | cond = conditions.spell_on, | 84 | cond = conditions.spell_on, |
73 | }}, | 85 | }}, |
74 | lualine_c = {'filename'}, | 86 | lualine_c = {'filename'}, |
75 | lualine_x = {'encoding', 'fileformat', 'filetype'}, | 87 | lualine_x = {encoding, fileformat, 'filetype'}, |
76 | lualine_y = {'progress'}, | 88 | lualine_y = {'progress'}, |
77 | lualine_z = { | 89 | lualine_z = { |
78 | 'location', { | 90 | 'location', { |
79 | 'diagnostics', | 91 | 'diagnostics', |
80 | sources = {'nvim_diagnostic'}, | 92 | sources = {'nvim_diagnostic'}, |
81 | sections = {'error', 'warn', 'info', 'hint'}, | 93 | sections = {'error', 'warn', 'info', 'hint'}, |
82 | diagnostics_color = { | ||
83 | warn = { fg = '#6e6a86' }, | ||
84 | }, | ||
85 | symbols = {error = 'e', warn = 'w', info = 'i', hint = 'h'} | 94 | symbols = {error = 'e', warn = 'w', info = 'i', hint = 'h'} |
86 | } | 95 | } |
87 | } | 96 | } |