nvim: use global status line

This commit is contained in:
tastytea 2022-08-26 04:20:49 +02:00
parent 6d678df2f0
commit 6b85f5bddf
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
2 changed files with 13 additions and 26 deletions

View File

@ -20,6 +20,7 @@ local options = {
pumheight = 10, -- maximum entries in popup menu pumheight = 10, -- maximum entries in popup menu
smartindent = true, -- indent after { and so on smartindent = true, -- indent after { and so on
statusline = '%<%f %h%m%r%=%y %l,%c%V (%P)', statusline = '%<%f %h%m%r%=%y %l,%c%V (%P)',
laststatus = 3, -- global statusline
formatoptions = vim.o.formatoptions .. 'n', formatoptions = vim.o.formatoptions .. 'n',
splitright = true, -- split vertical window right splitright = true, -- split vertical window right
} }

View File

@ -63,40 +63,26 @@ 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 = {
icons_enabled = nerdfont_installed, icons_enabled = nerdfont_installed,
component_separators = {}, component_separators = {},
section_separators = {}, section_separators = {},
extensions = {} extensions = {},
globalstatus = true
}, },
sections = { sections = {
lualine_a = { 'mode' }, lualine_a = { { 'mode' } },
lualine_b = { { lualine_b = {
'branch', { 'branch', icons_enabled = true },
icons_enabled = true, { 'require("my.functions").lsp_status()', padding = 0 },
cond = over70 { 'diagnostics' }
}, { },
'require("my.functions").lsp_status()', lualine_c = { { 'filename', path = 1 } },
padding = 0, lualine_x = { { 'filetype' } },
cond = over70 lualine_y = { { 'progress' } },
}, { lualine_z = { { 'location' }, { '"🍄"', padding = 0 }
'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 }
} }
}, },
}) })