nvim: new: add nvim-navic
This commit is contained in:
parent
1d4aca589e
commit
8d7de190f9
2 changed files with 40 additions and 2 deletions
|
@ -15,7 +15,18 @@ vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
-- Installing plugins
|
-- Installing plugins
|
||||||
require('lazy').setup({
|
require('lazy').setup({
|
||||||
{ "catppuccin/nvim", name = "catppuccin" }, -- Color scheme
|
{
|
||||||
|
"catppuccin/nvim",
|
||||||
|
name = "catppuccin",
|
||||||
|
config = function()
|
||||||
|
require("catppuccin").setup({
|
||||||
|
flavour = "macchiato",
|
||||||
|
integrations = {
|
||||||
|
navic = true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}, -- Color scheme
|
||||||
{
|
{
|
||||||
dir = "./lua/term_powershell.lua",
|
dir = "./lua/term_powershell.lua",
|
||||||
event = "CmdlineEnter",
|
event = "CmdlineEnter",
|
||||||
|
@ -140,6 +151,18 @@ require('lazy').setup({
|
||||||
'folke/trouble.nvim',
|
'folke/trouble.nvim',
|
||||||
-- config = function
|
-- config = function
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'SmiteshP/nvim-navic',
|
||||||
|
-- event = 'BufReadPre',
|
||||||
|
dependencies = {
|
||||||
|
'neovim/nvim-lspconfig',
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require 'nvim-navic'.setup {
|
||||||
|
highlight = true,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'Julian/lean.nvim',
|
'Julian/lean.nvim',
|
||||||
event = { 'BufReadPre *.lean', 'BufNewFile *.lean' },
|
event = { 'BufReadPre *.lean', 'BufNewFile *.lean' },
|
||||||
|
@ -479,6 +502,7 @@ require 'nvim-treesitter.configs'.setup {
|
||||||
-- LSP config
|
-- LSP config
|
||||||
|
|
||||||
local lspconfig = require 'lspconfig'
|
local lspconfig = require 'lspconfig'
|
||||||
|
local navic = require 'nvim-navic'
|
||||||
|
|
||||||
-- Mapping for language server
|
-- Mapping for language server
|
||||||
-- See `:help vim.diagnostic.* for documentation on any of the below functions
|
-- See `:help vim.diagnostic.* for documentation on any of the below functions
|
||||||
|
@ -512,6 +536,10 @@ local on_attach = function(client, bufnr)
|
||||||
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
||||||
vim.keymap.set('n', 'grf', vim.lsp.buf.references, bufopts)
|
vim.keymap.set('n', 'grf', vim.lsp.buf.references, bufopts)
|
||||||
vim.keymap.set('n', '<space>f', function() vim.lsp.buf.format { async = true } end, bufopts)
|
vim.keymap.set('n', '<space>f', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||||
|
|
||||||
|
if client.server_capabilities.documentSymbolProvider then
|
||||||
|
navic.attach(client, bufnr)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- cmp_nvim_lsp supports additional LSP completion capabilities
|
-- cmp_nvim_lsp supports additional LSP completion capabilities
|
||||||
|
|
|
@ -7,6 +7,8 @@ local lsp_names = function ()
|
||||||
return ' ' .. table.concat(clients, ', ')
|
return ' ' .. table.concat(clients, ', ')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local navic = require('nvim-navic')
|
||||||
|
|
||||||
require('lualine').setup {
|
require('lualine').setup {
|
||||||
options = {
|
options = {
|
||||||
icons_enabled = true,
|
icons_enabled = true,
|
||||||
|
@ -43,7 +45,15 @@ require('lualine').setup {
|
||||||
lualine_z = {}
|
lualine_z = {}
|
||||||
},
|
},
|
||||||
tabline = {},
|
tabline = {},
|
||||||
winbar = {},
|
winbar = {
|
||||||
|
lualine_c = {
|
||||||
|
{
|
||||||
|
"navic",
|
||||||
|
color_correction = nil,
|
||||||
|
navic_opts = nil,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
inactive_winbar = {},
|
inactive_winbar = {},
|
||||||
extensions = {}
|
extensions = {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue