diff --git a/config/nvim/doc/config.txt b/config/nvim/doc/config.txt index d1d0037..5947721 100644 --- a/config/nvim/doc/config.txt +++ b/config/nvim/doc/config.txt @@ -27,7 +27,7 @@ Global helpers defined in init.lua: Default (no LSP, no completion): >bash curl -fsSL https://raw.githubusercontent.com/harivansh-afk/nvim/main/install.sh | bash < -Full install (LSP + Supermaven): >bash +Full install (LSP + completion): >bash curl -fsSL https://raw.githubusercontent.com/harivansh-afk/nvim/main/install.sh | bash -s -- --bells-and-whistles < Options: > @@ -54,7 +54,8 @@ Options: > rust_analyzer.lua ts_ls.lua plugins/ - editor.lua Autopairs, flash, surround, ufo, supermaven + editor.lua Autopairs, flash, surround, ufo + cmp.lua Blink.cmp completion fzf.lua Fzf-lua fuzzy finder git.lua Fugitive, gitsigns, diffs.nvim lsp.lua nvim-lspconfig @@ -100,7 +101,7 @@ All plugins load at startup via `defaults = { lazy = false }`. kylechui/nvim-surround Surround operations folke/flash.nvim Jump/search motions kevinhwang91/nvim-ufo Code folding - supermaven-inc/supermaven-nvim Inline AI suggestions + saghen/blink.cmp Autocompletion (LSP, path, buffer, snippets) ============================================================================== 5. KEYMAPS *config-keymaps* diff --git a/config/nvim/lazy-lock.json b/config/nvim/lazy-lock.json index ba99eb4..94b3150 100644 --- a/config/nvim/lazy-lock.json +++ b/config/nvim/lazy-lock.json @@ -20,6 +20,5 @@ "pending.nvim": { "branch": "main", "commit": "077e4121b4fec369ad9da00a00228a3daf4e9031" }, "preview.nvim": { "branch": "main", "commit": "39406c559cf90255bc3046df0dbad48b7c1e8319" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, - "supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" }, "vim-fugitive": { "branch": "master", "commit": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0" } } diff --git a/config/nvim/lua/config/lsp.lua b/config/nvim/lua/config/lsp.lua index e7790e5..f179c1b 100644 --- a/config/nvim/lua/config/lsp.lua +++ b/config/nvim/lua/config/lsp.lua @@ -17,7 +17,12 @@ function M.on_attach(_, bufnr) end function M.capabilities() - return vim.lsp.protocol.make_client_capabilities() + local caps = vim.lsp.protocol.make_client_capabilities() + local ok, blink = pcall(require, 'blink.cmp') + if ok then + caps = blink.get_lsp_capabilities(caps) + end + return caps end return M diff --git a/config/nvim/lua/plugins/cmp.lua b/config/nvim/lua/plugins/cmp.lua new file mode 100644 index 0000000..7b57f20 --- /dev/null +++ b/config/nvim/lua/plugins/cmp.lua @@ -0,0 +1,46 @@ +return { + 'saghen/blink.cmp', + version = '*', + event = { 'InsertEnter', 'LspAttach' }, + opts = { + keymap = { + [''] = { 'select_and_accept', 'snippet_forward', 'fallback' }, + [''] = { 'snippet_backward', 'fallback' }, + [''] = { 'select_prev', 'fallback' }, + [''] = { 'show', 'select_next', 'fallback' }, + [''] = { 'select_and_accept', 'fallback' }, + [''] = { 'cancel', 'fallback' }, + [''] = { 'scroll_documentation_up', 'fallback' }, + [''] = { 'scroll_documentation_down', 'fallback' }, + }, + cmdline = { enabled = false }, + completion = { + accept = { + auto_brackets = { enabled = true }, + }, + documentation = { + auto_show = true, + window = { + border = 'single', + scrollbar = false, + }, + }, + menu = { + auto_show = true, + border = 'single', + scrollbar = false, + draw = { + treesitter = { 'lsp' }, + columns = { + { 'label', 'label_description', gap = 1 }, + { 'kind' }, + }, + }, + }, + ghost_text = { enabled = true }, + }, + sources = { + default = { 'lsp', 'path', 'buffer', 'snippets' }, + }, + }, +} diff --git a/config/nvim/lua/plugins/editor.lua b/config/nvim/lua/plugins/editor.lua index 09fcc23..d4911d5 100644 --- a/config/nvim/lua/plugins/editor.lua +++ b/config/nvim/lua/plugins/editor.lua @@ -147,21 +147,6 @@ return { map('n', 'co', open_current_cp_problem_url, { desc = 'CP open problem url' }) end, }, - { - 'supermaven-inc/supermaven-nvim', - opts = { - keymaps = { - accept_suggestion = '', - clear_suggestion = '', - accept_word = '', - }, - ignore_filetypes = { gitcommit = true }, - color = { - suggestion_color = vim.api.nvim_get_hl(0, { name = 'Comment' }).fg, - cterm = 244, - }, - }, - }, { 'barrettruth/pending.nvim', init = function()