This commit is contained in:
2026-04-01 17:33:34 +02:00
parent 2963b7e45f
commit ad3a58bcff
4 changed files with 103 additions and 18 deletions

View File

@@ -28,7 +28,7 @@ Plug 'HerringtonDarkholme/yats.vim'
Plug 'm-pilia/vim-ccls'
Plug 'm-pilia/vim-yggdrasil'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'nvim-treesitter/nvim-treesitter', {'branch': 'main', 'do': ':TSUpdate'}
" Fish shell
Plug 'dag/vim-fish'
@@ -76,14 +76,15 @@ Plug 'godlygeek/tabular'
Plug 'neovim/nvim-lspconfig'
Plug 'tamago324/nlsp-settings.nvim'
Plug 'williamboman/nvim-lsp-installer'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'folke/lsp-colors.nvim'
" Plug 'jose-elias-alvarez/null-ls.nvim'
Plug 'onsails/lspkind.nvim'
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-buffer'
" Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-cmdline'
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-nvim-lsp'
" For luasnip users.
Plug 'saadparwaiz1/cmp_luasnip'
@@ -117,7 +118,7 @@ Plug 'nvim-telescope/telescope.nvim'
Plug 'MunifTanjim/nui.nvim'
Plug 'nvim-neo-tree/neo-tree.nvim'
Plug 'jiangmiao/auto-pairs'
" Plug 'jiangmiao/auto-pairs'
call plug#end()
@@ -434,11 +435,61 @@ local has_words_before = function()
end
require("luasnip.loaders.from_vscode").lazy_load()
local lspkind = require("lspkind")
lspkind.init({
-- enables text annotations
--
-- default: true
mode = 'symbol_text',
-- default symbol map
-- can be either 'default' (requires nerd-fonts font) or
-- 'codicons' for codicon preset (requires vscode-codicons font)
--
-- default: 'default'
preset = 'codicons',
-- override preset symbols
--
-- default: {}
symbol_map = {
Text = "󰉿 ",
Method = "󰆧 ",
Function = "󰊕 ",
Constructor = " ",
Field = "󰜢 ",
Variable = " ",
Class = "󰠱 ",
Interface = " ",
Module = " ",
Property = "󰜢 ",
Unit = "󰑭 ",
Value = "󰎠 ",
Enum = " ",
Keyword = "󰌋 ",
Snippet = " ",
Color = "󰏘 ",
File = "󰈙 ",
Reference = "󰈇 ",
Folder = "󰉋 ",
EnumMember = " ",
Constant = "󰏿 ",
Struct = "󰙅 ",
Event = " ",
Operator = "󰆕 ",
TypeParameter = ""
},
})
cmp.setup({
experimental = {
ghost_text = { hl_group = 'Comment' }
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
@@ -491,7 +542,33 @@ cmp.setup({
{ name = 'luasnip' }, -- For luasnip users.
}, {
{ name = 'buffer' },
})
}),
formatting = {
fields = { 'abbr', 'icon', 'kind', 'menu' },
format = lspkind.cmp_format({
menu = ({
buffer = "[buffer] ",
nvim_lsp = "[lsp] ",
luasnip = "[snippet] ",
}),
maxwidth = {
-- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
-- can also be a function to dynamically calculate max width such as
-- menu = function() return math.floor(0.45 * vim.o.columns) end,
menu = 50, -- leading text (labelDetails)
abbr = 50, -- actual suggestion item
},
ellipsis_char = '...', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
show_labelDetails = true, -- show labelDetails in menu. Disabled by default
-- The function below will be called before any actual modifications from lspkind
-- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30))
before = function (entry, vim_item)
-- ...
return vim_item
end
})
}
})
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
@@ -677,6 +754,18 @@ require("neo-tree").setup({
-- buf_set_keymap('n', '<Leader>tn', '<cmd>lua require('neotest').run.run()<CR>', opts)
-- buf_set_keymap('n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
-- vim.api.nvim_create_autocmd("FileType", {
-- pattern = { "cs", "gdscript", "gdshader", "ruby", "js", "json", "markdown" },
-- callback = function()
-- vim.treesitter.start()
-- vim.opt_local.foldexpr = "v:lua.vim.treesitter.foldexpr()"
-- vim.opt_local.foldmethod = "expr"
-- vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
-- end,
-- })
EOF
" neotest keybindings