Replace lspsaga with my fork of lspsaga which contains more options for the winbar which makes it easier to integrate it with lualine, which I've also done here. Additionally, set cmdheight=0, and refactor some calls to add_keymaps.
This commit is contained in:
parent
fc96fc96fc
commit
b9ffc6647e
6 changed files with 119 additions and 21 deletions
|
|
@ -3,7 +3,7 @@ local g = vim.g
|
|||
g.mapleader = " "
|
||||
g.maplocalleader = " "
|
||||
|
||||
local keymaps = {
|
||||
require("utils").add_keymaps({
|
||||
n = {
|
||||
-- Navigation
|
||||
["<C-d>"] = {
|
||||
|
|
@ -98,6 +98,4 @@ local keymaps = {
|
|||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
require("utils").add_keymaps(keymaps)
|
||||
})
|
||||
|
|
|
|||
9
nvim/lua/lualine_extension_lspsaga.lua
Normal file
9
nvim/lua/lualine_extension_lspsaga.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
local M = {}
|
||||
|
||||
function M.get_breadcrumbs()
|
||||
local breadcrumbs = require("lspsaga.symbol.winbar").get_bar()
|
||||
-- Return breadcrumbs if the string exists and is not empty, otherwise, get the filename and return it
|
||||
return breadcrumbs and breadcrumbs ~= "" and breadcrumbs or vim.fn.expand("%:t")
|
||||
end
|
||||
|
||||
return M
|
||||
65
nvim/lua/plugs/lspsaga.lua
Normal file
65
nvim/lua/plugs/lspsaga.lua
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
return {
|
||||
"LarssonMartin1998/lspsaga.nvim",
|
||||
branch = "improved_winbar",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
config = function()
|
||||
require("lspsaga").setup({
|
||||
symbol_in_winbar = {
|
||||
enable = false,
|
||||
separator = " › ",
|
||||
hide_keyword = true,
|
||||
ignore_patterns = nil,
|
||||
show_file = true,
|
||||
folder_level = 3,
|
||||
color_mode = true,
|
||||
dely = 300,
|
||||
show_nodes = true,
|
||||
max_nodes = 3,
|
||||
},
|
||||
implement = {
|
||||
enable = false,
|
||||
},
|
||||
})
|
||||
|
||||
require("utils").add_keymaps({
|
||||
n = {
|
||||
["<F2>"] = {
|
||||
cmd = ":Lspsaga diagnostic_jump_next<CR>"
|
||||
},
|
||||
["<S-F2>"] = {
|
||||
cmd = ":Lspsaga diagnostic_jump_prev<CR>"
|
||||
},
|
||||
["K"] = {
|
||||
cmd = ":Lspsaga hover_doc<CR>"
|
||||
},
|
||||
["<leader>lo"] = {
|
||||
cmd = ":Lspsaga outline<CR>"
|
||||
},
|
||||
["<leader>lr"] = {
|
||||
cmd = ":Lspsaga rename<CR>"
|
||||
},
|
||||
["<leader>h"] = {
|
||||
cmd = ":Lspsaga term_toggle<CR>"
|
||||
},
|
||||
["<leader>lf"] = {
|
||||
cmd = ":Lspsaga finder<CR>"
|
||||
},
|
||||
["<leader>lpt"] = {
|
||||
cmd = ":Lspsaga peek_type_definition<CR>"
|
||||
},
|
||||
["<leader>lph"] = {
|
||||
cmd = ":Lspsaga peek_definition<CR>"
|
||||
},
|
||||
["<leader>ca"] = {
|
||||
cmd = ":Lspsaga code_action<CR>"
|
||||
},
|
||||
["<leader>lc"] = {
|
||||
cmd = ":Lspsaga incoming_calls<CR>"
|
||||
},
|
||||
}
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -3,7 +3,31 @@ return {
|
|||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
opts = {
|
||||
theme = "tokyonight-storm",
|
||||
},
|
||||
config = function()
|
||||
require("lualine").setup {
|
||||
options = {
|
||||
theme = "tokyonight",
|
||||
section_separators = {"", ""},
|
||||
component_separators = {"", ""},
|
||||
icons_enabled = true,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {"mode"},
|
||||
lualine_b = {"branch"},
|
||||
lualine_c = { "require(\"lualine_extension_lspsaga\").get_breadcrumbs()" },
|
||||
lualine_x = {"encoding", "fileformat", "filetype"},
|
||||
lualine_y = {"progress"},
|
||||
lualine_z = {"location"}
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = {"location"},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
tabline = {},
|
||||
}
|
||||
end
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ return {
|
|||
require("telescope").setup({ })
|
||||
require("telescope").load_extension("fzf")
|
||||
|
||||
local keymaps = {
|
||||
require("utils").add_keymaps({
|
||||
n = {
|
||||
-- File search
|
||||
["<leader>to"] = {
|
||||
|
|
@ -38,8 +38,7 @@ return {
|
|||
cmd = "<cmd> Telescope marks <CR>",
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
require("utils").add_keymaps(keymaps)
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,4 +52,7 @@ opt.swapfile = false
|
|||
opt.splitright = true
|
||||
opt.splitbelow = true
|
||||
|
||||
-- Removes the extra command line bar at the bottom, using lualine instead
|
||||
opt.cmdheight = 0
|
||||
|
||||
return opt
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue