feat(lualine): Add winbar and modify overseer

This commit is contained in:
Jiří Štefka 2024-09-26 04:58:13 +02:00
parent 8ad3a834ce
commit c1fe17012b
Signed by: jiriks74
GPG key ID: 1D5E30D3DB2264DE
2 changed files with 60 additions and 22 deletions

View file

@ -1,3 +1,8 @@
if vim.g.did_load_c_plugin then
return
end
vim.g.did_load_c_plugin = true
-- Exit if the language server isn't available -- Exit if the language server isn't available
if vim.fn.executable('clangd') ~= 1 then if vim.fn.executable('clangd') ~= 1 then
return return
@ -16,6 +21,9 @@ vim.lsp.start {
cmd = { 'clangd' }, cmd = { 'clangd' },
root_dir = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]), root_dir = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]),
capabilities = require('user.lsp').make_client_capabilities(), capabilities = require('user.lsp').make_client_capabilities(),
on_attach = function(client, bufnr)
require("nvim-navic").attach(client, bufnr)
end
} }
local dap = require("dap") local dap = require("dap")

View file

@ -3,8 +3,8 @@ if vim.g.did_load_lualine_plugin then
end end
vim.g.did_load_lualine_plugin = true vim.g.did_load_lualine_plugin = true
-- local navic = require('nvim-navic') local navic = require('nvim-navic')
-- avic.setup {} navic.setup {}
---Indicators for special modes, ---Indicators for special modes,
---@return string status ---@return string status
@ -30,11 +30,15 @@ end
require('lualine').setup { require('lualine').setup {
globalstatus = true, globalstatus = true,
sections = { sections = {
lualine_c = { lualine_a = { 'mode' },
-- nvim-navic lualine_b = { 'branch', 'diff', 'diagnostics' },
-- { navic.get_location, cond = navic.is_available }, lualine_c = { "overseer" },
}, -- lualine_c = {
lualine_y = { "overseer" }, -- -- nvim-navic
-- navic.get_location, cond = navic.is_available
-- },
lualine_x = { 'encoding', 'fileformat', 'filetype' },
lualine_y = { 'progress' },
lualine_z = { lualine_z = {
-- (see above) -- (see above)
{ extra_mode_status }, { extra_mode_status },
@ -43,9 +47,9 @@ require('lualine').setup {
options = { options = {
theme = 'auto', theme = 'auto',
-- component_separators = { left = '', right = ''}, -- component_separators = { left = '', right = ''},
component_separators = { left = '', right = ''}, component_separators = { left = '', right = '' },
-- section_separators = { left = '', right = ''}, -- section_separators = { left = '', right = ''},
section_separators = { left = '', right = ''}, section_separators = { left = '', right = '' },
ignore_focus = { ignore_focus = {
"dapui_scopes", "dapui_scopes",
"dapui_breakpoints", "dapui_breakpoints",
@ -63,7 +67,6 @@ require('lualine').setup {
-- mode = 1, -- mode = 1,
-- }, -- },
-- }, -- },
-- lualine_b = {
-- lualine_a = { -- lualine_a = {
-- { -- {
-- 'buffers', -- 'buffers',
@ -82,13 +85,38 @@ require('lualine').setup {
-- }, -- },
-- }, -- },
-- }, -- },
-- lualine_b = {
-- lualine_c = {}, -- lualine_c = {},
-- lualine_x = {}, -- lualine_x = {},
-- lualine_y = {}, -- lualine_y = {},
-- -- lualine_z = {}, -- Commented out so that buffers and file path are on the same line -- lualine_z = {}, -- Commented out so that buffers and file path are on the same line
-- }, -- },
-- winbar = { winbar = {
-- lualine_z = { lualine_a = {
-- {
-- "navic",
-- color_correction = nil,
-- navic_opts = nil
-- }
},
lualine_b = {},
lualine_c = {
{
'filename',
path = 1,
file_status = true,
newfile_status = true,
},
{
function()
return navic.get_location()
end,
cond = function()
return navic.is_available()
end
},
},
-- lualine_x = {
-- { -- {
-- 'filename', -- 'filename',
-- path = 1, -- path = 1,
@ -96,6 +124,8 @@ require('lualine').setup {
-- newfile_status = true, -- newfile_status = true,
-- }, -- },
-- }, -- },
-- }, lualine_y = {'searchcount','selectioncount'},
lualine_z = {'location'},
},
extensions = { 'fugitive', 'fzf', 'toggleterm', 'quickfix' }, extensions = { 'fugitive', 'fzf', 'toggleterm', 'quickfix' },
} }