vim/lualine: add diff and show diagnostics only in active window
This commit is contained in:
parent
24133d1cff
commit
d96cc5b1d8
1 changed files with 10 additions and 6 deletions
|
@ -140,12 +140,19 @@ local config = function()
|
|||
local inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = { parts.visual_multi, parts.branch },
|
||||
lualine_c = { parts.filename, parts.status },
|
||||
lualine_x = { 'diagnostics', parts.filetype },
|
||||
lualine_c = { diff, parts.filename, parts.status },
|
||||
lualine_x = { parts.filetype },
|
||||
lualine_y = { parts.fileformat, 'progress' },
|
||||
lualine_z = { 'location' },
|
||||
}
|
||||
|
||||
local concat = require('fschauen.util').concat
|
||||
|
||||
local active_sections = vim.tbl_extend('force', inactive_sections, {
|
||||
lualine_a = concat({ parts.paste, parts.mode }, inactive_sections.lualine_a),
|
||||
lualine_x = concat({ 'diagnostics' }, inactive_sections.lualine_x),
|
||||
})
|
||||
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
|
@ -154,10 +161,7 @@ local config = function()
|
|||
theme = 'gruvbox',
|
||||
},
|
||||
|
||||
sections = vim.tbl_extend('force', inactive_sections, {
|
||||
lualine_a = { parts.paste, parts.mode },
|
||||
}),
|
||||
|
||||
sections = active_sections,
|
||||
inactive_sections = inactive_sections,
|
||||
|
||||
extensions = {
|
||||
|
|
Loading…
Add table
Reference in a new issue