diff options
| author | Ruben Beltran del Rio <jj@r.bdr.sh> | 2025-11-28 16:54:53 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <jj@r.bdr.sh> | 2025-12-02 10:18:52 +0100 |
| commit | 2187a08bd3ec76dc4d9c008331493be699e6ab00 (patch) | |
| tree | c56011d61eafdd4f273ff0f0c8b2e7d4ef45154c /config/nvim/lua | |
| parent | ca13f790e2ca8c6389334213dddef701c7626d1f (diff) | |
Use blink.cmp and jannotate in neovim
Diffstat (limited to 'config/nvim/lua')
| -rw-r--r-- | config/nvim/lua/lsp.lua | 32 | ||||
| -rw-r--r-- | config/nvim/lua/plugins.lua | 44 |
2 files changed, 43 insertions, 33 deletions
diff --git a/config/nvim/lua/lsp.lua b/config/nvim/lua/lsp.lua index 6c69119..3482564 100644 --- a/config/nvim/lua/lsp.lua +++ b/config/nvim/lua/lsp.lua @@ -1,34 +1,32 @@ -local coq = require('coq') - -vim.lsp.config('ts_ls', coq.lsp_ensure_capabilities({ +vim.lsp.config('ts_ls', { cmd = { 'typescript-language-server', '--stdio' }, filetypes = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact' }, root_markers = { 'package.json', 'tsconfig.json', 'jsconfig.json' } -})) +}) vim.lsp.enable('ts_ls') -vim.lsp.config('eslint', coq.lsp_ensure_capabilities({ +vim.lsp.config('eslint', { cmd = { 'vscode-eslint-language-server', '--stdio' }, filetypes = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact' }, root_markers = { '.eslintrc', '.eslintrc.js', '.eslintrc.json', 'package.json' } -})) +}) vim.lsp.enable('eslint') -vim.lsp.config('svelte', coq.lsp_ensure_capabilities({ +vim.lsp.config('svelte', { cmd = { 'svelteserver', '--stdio' }, filetypes = { 'svelte' }, root_markers = { 'package.json', 'svelte.config.js' } -})) +}) vim.lsp.enable('svelte') -vim.lsp.config('pyright', coq.lsp_ensure_capabilities({ +vim.lsp.config('pyright', { cmd = { 'pyright-langserver', '--stdio' }, filetypes = { 'python' }, root_markers = { 'pyproject.toml', 'setup.py', 'requirements.txt' } -})) +}) vim.lsp.enable('pyright') -vim.lsp.config('rust_analyzer', coq.lsp_ensure_capabilities({ +vim.lsp.config('rust_analyzer', { cmd = { 'rust-analyzer' }, filetypes = { 'rust' }, root_markers = { 'Cargo.toml', 'rust-project.json' }, @@ -54,21 +52,21 @@ vim.lsp.config('rust_analyzer', coq.lsp_ensure_capabilities({ } }, }, -})) +}) vim.lsp.enable('rust_analyzer') -vim.lsp.config('lua_ls', coq.lsp_ensure_capabilities({ +vim.lsp.config('lua_ls', { cmd = { 'lua-language-server' }, filetypes = { 'lua' }, root_markers = { '.luarc.json', '.luarc.jsonc', '.luacheckrc', 'stylua.toml', 'selene.toml' }, -})) +}) vim.lsp.enable('lua_ls') -vim.lsp.config('gleam', coq.lsp_ensure_capabilities({ +vim.lsp.config('gleam', { cmd = { 'gleam', 'lsp' }, filetypes = { 'gleam' }, root_markers = { 'gleam.toml' }, -})) +}) vim.lsp.enable('gleam') -- Enable inlay hints for Rust when LSP attaches @@ -94,7 +92,7 @@ vim.api.nvim_create_autocmd('LspAttach', { callback = function(ev) -- Enable completion triggered by <c-x><c-o> vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' - + -- Buffer local mappings local opts = { buffer = ev.buf } vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index 9695d44..5876b51 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -88,16 +88,26 @@ require('lazy').setup({ { 'neovim/nvim-lspconfig', lazy = false, - dependencies = { - { 'ms-jpq/coq_nvim', branch = 'coq' }, - { 'ms-jpq/coq.artifacts', branch = 'artifacts' }, - { 'ms-jpq/coq.thirdparty', branch = '3p' } + }, + { + 'saghen/blink.cmp', + dependencies = { 'rafamadriz/friendly-snippets' }, + version = '1.*', + + ---@module 'blink.cmp' + ---@type blink.cmp.Config + opts = { + keymap = { + preset = 'enter', + ['<Tab>'] = { 'snippet_forward', 'select_next', 'fallback' }, + ['<S-Tab>'] = { 'snippet_backward', 'select_prev', 'fallback' }, + }, + sources = { + default = { 'lsp', 'path', 'snippets', 'buffer' }, + }, + fuzzy = { implementation = "prefer_rust_with_warning" }, }, - init = function() - vim.g.coq_settings = { - auto_start = 'shut-up', - } - end, + opts_extend = { "sources.default" } }, { "folke/lazydev.nvim", @@ -107,8 +117,6 @@ require('lazy').setup({ -- Tools 'mbbill/undotree', - 'vim-scripts/LargeFile', - 'tpope/vim-fugitive', 'milkypostman/vim-togglelist', { 'folke/which-key.nvim', @@ -119,13 +127,17 @@ require('lazy').setup({ end, opts = {} }, - { 'stevearc/oil.nvim', opts = { - keymaps = { - ['<C-p>'] = false, - ['<C-S-p>'] = 'actions.preview' + { + 'stevearc/oil.nvim', + opts = { + keymaps = { + ['<C-p>'] = false, + ['<C-S-p>'] = 'actions.preview' + } } - } }, + }, 'https://git.sr.ht/~rbdr/nota.nvim', 'https://git.sr.ht/~rbdr/oleoboard.nvim', + 'https://git.sr.ht/~rbdr/jannotate.nvim', }) |