vim/lualine: add diff and show diagnostics only in active window

This commit is contained in:
Fernando Schauenburg 2023-08-08 00:52:52 +02:00
parent 24133d1cff
commit d96cc5b1d8

View file

@ -140,12 +140,19 @@ local config = function()
local inactive_sections = { local inactive_sections = {
lualine_a = {}, lualine_a = {},
lualine_b = { parts.visual_multi, parts.branch }, lualine_b = { parts.visual_multi, parts.branch },
lualine_c = { parts.filename, parts.status }, lualine_c = { diff, parts.filename, parts.status },
lualine_x = { 'diagnostics', parts.filetype }, lualine_x = { parts.filetype },
lualine_y = { parts.fileformat, 'progress' }, lualine_y = { parts.fileformat, 'progress' },
lualine_z = { 'location' }, 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 { require('lualine').setup {
options = { options = {
icons_enabled = true, icons_enabled = true,
@ -154,10 +161,7 @@ local config = function()
theme = 'gruvbox', theme = 'gruvbox',
}, },
sections = vim.tbl_extend('force', inactive_sections, { sections = active_sections,
lualine_a = { parts.paste, parts.mode },
}),
inactive_sections = inactive_sections, inactive_sections = inactive_sections,
extensions = { extensions = {