1
0
Fork 0

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
1 changed files with 25 additions and 7 deletions

View File

@ -63,6 +63,14 @@ require("nvim-tree").setup({
map('n', '<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
require('lualine').setup({
options = {
@ -73,12 +81,22 @@ require('lualine').setup({
},
sections = {
lualine_a = { 'mode' },
lualine_b = { { 'branch', icons_enabled = true },
{ 'require("my.functions").lsp_status()', padding = 0 },
'diagnostics' },
lualine_c = { { 'filename', path = 1 } },
lualine_x = { 'filetype' },
lualine_y = { 'progress' },
lualine_z = { 'location', { '"🍄"', padding = 0 } }
lualine_b = { {
'branch',
icons_enabled = true,
cond = over70
}, {
'require("my.functions").lsp_status()',
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 }
}
},
})