add nvim-navic for code context instead of nvim-treesitter-context

This commit is contained in:
Baipyrus 2024-10-28 17:50:01 +01:00
parent 44b45b7c11
commit 735b2ed90b
3 changed files with 20 additions and 1 deletions

View File

@ -28,6 +28,9 @@ return {
-- Allows extra capabilities provided by nvim-cmp
'hrsh7th/cmp-nvim-lsp',
-- Code context using LSP info
'SmiteshP/nvim-navic',
},
config = function()
-- Brief aside: **What is LSP?**
@ -206,6 +209,20 @@ return {
},
}
-- Setup code context via nvim-navic
require('nvim-navic').setup {
lsp = {
auto_attach = true,
preference = {
'svelte',
'intelephense',
'ts_ls',
'tailwindcss',
},
},
highlight = true,
}
-- Ensure the servers and tools above are installed
-- To check the current status of installed tools and/or manually install
-- other tools, you can run

View File

@ -2,7 +2,6 @@ return {
{ -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
dependencies = {
'nvim-treesitter/nvim-treesitter-context',
'nvim-treesitter/nvim-treesitter-textobjects',
},
build = ':TSUpdate',

View File

@ -96,6 +96,9 @@ vim.opt.guicursor = 'n-v-i-c:block-Cursor'
vim.o.laststatus = 3
vim.api.nvim_set_hl(0, 'WinSeparator', { bg = nil })
-- Set winbar to nvim-navic for code context
vim.o.winbar = "%{%v:lua.require'nvim-navic'.get_location()%}"
vim.api.nvim_create_autocmd('UIEnter', {
group = vim.api.nvim_create_augroup('SetGUISettings', { clear = true }),
callback = function()