nvim: lualine: don't display some things in small windows

This commit is contained in:
tastytea 2022-08-26 04:08:10 +02:00
parent 60a65be22c
commit 7783bb9c0d
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM

View File

@ -63,6 +63,14 @@ require("nvim-tree").setup({
map('n', '<F9>', require("nvim-tree.api").tree.toggle, 'Open nvim-tree') map('n', '<F9>', require("nvim-tree.api").tree.toggle, 'Open nvim-tree')
map('i', '<F9>', require("nvim-tree.api").tree.toggle, 'Open nvim-tree') map('i', '<F9>', require("nvim-tree.api").tree.toggle, 'Open nvim-tree')
local function over40()
return vim.fn.winwidth(0) > 40
end
local function over70()
return vim.fn.winwidth(0) > 70
end
vim.o.showmode = false vim.o.showmode = false
require('lualine').setup({ require('lualine').setup({
options = { options = {
@ -73,12 +81,22 @@ require('lualine').setup({
}, },
sections = { sections = {
lualine_a = { 'mode' }, lualine_a = { 'mode' },
lualine_b = { { 'branch', icons_enabled = true }, lualine_b = { {
{ 'require("my.functions").lsp_status()', padding = 0 }, 'branch',
'diagnostics' }, icons_enabled = true,
lualine_c = { { 'filename', path = 1 } }, cond = over70
lualine_x = { 'filetype' }, }, {
lualine_y = { 'progress' }, 'require("my.functions").lsp_status()',
lualine_z = { 'location', { '"🍄"', padding = 0 } } padding = 0,
cond = over70
}, {
'diagnostics',
cond = over70
} },
lualine_c = { { 'filename', path = 1, cond = over40 } },
lualine_x = { { 'filetype', cond = over70 } },
lualine_y = { { 'progress', cond = over40 } },
lualine_z = { 'location', { '"🍄"', padding = 0, cond = over40 }
}
}, },
}) })