aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Weigl-Bosker <stefan@s00.xyz>2025-11-16 17:57:16 -0500
committerStefan Weigl-Bosker <stefan@s00.xyz>2025-11-16 17:57:16 -0500
commit3773747c7035c7395984b6c0b8bf384f16cc9ee7 (patch)
treeb3fa3fd6b295bc6c57994c4c9918c4d04915a397
parent47aa63261f84d0cada49d3c167888139b5de2eb7 (diff)
downloadhome-3773747c7035c7395984b6c0b8bf384f16cc9ee7.tar.gz
modules/neovim: uses blink.cmp for completion
-rw-r--r--modules/neovim/nvim/init.lua1
-rw-r--r--modules/neovim/nvim/lua/config/blink.lua18
-rw-r--r--modules/neovim/nvim/lua/config/lsp/init.lua36
3 files changed, 37 insertions, 18 deletions
diff --git a/modules/neovim/nvim/init.lua b/modules/neovim/nvim/init.lua
index 7453ac2..011bcdb 100644
--- a/modules/neovim/nvim/init.lua
+++ b/modules/neovim/nvim/init.lua
@@ -6,3 +6,4 @@ require("config.dap")
require("config.treesitter")
require("config.tmux")
require("config.textobjects")
+require("config.blink")
diff --git a/modules/neovim/nvim/lua/config/blink.lua b/modules/neovim/nvim/lua/config/blink.lua
new file mode 100644
index 0000000..00491ad
--- /dev/null
+++ b/modules/neovim/nvim/lua/config/blink.lua
@@ -0,0 +1,18 @@
+require("blink.cmp").setup({
+ keymap = {
+ preset = "enter",
+ },
+ sources = { default = { "lsp", "path", "snippets", "buffer" } },
+ completion = {
+ menu = {
+ auto_show = true,
+ max_height=5,
+ },
+ list = {
+ max_items = 6,
+ },
+ documentation = { auto_show = true, auto_show_delay_ms = 500 },
+ ghost_text = { enabled = true },
+ },
+ signature = { enabled = true },
+})
diff --git a/modules/neovim/nvim/lua/config/lsp/init.lua b/modules/neovim/nvim/lua/config/lsp/init.lua
index 5e9f27f..a57e093 100644
--- a/modules/neovim/nvim/lua/config/lsp/init.lua
+++ b/modules/neovim/nvim/lua/config/lsp/init.lua
@@ -71,24 +71,24 @@ vim.api.nvim_create_autocmd("LspAttach", { callback = function(args)
vim.lsp.buf.definition()
end, { desc = "Goto definition (LSP)" })
- if client:supports_method(methods.textDocument_completion) then
- local chars = {}; for i = 32, 126 do table.insert(chars, string.char(i)) end
- client.server_capabilities.completionProvider.triggerCharacters = chars
- vim.lsp.completion.enable(true, client.id, args.buf, { autotrigger = true })
-
- map('i', "<CR>", function()
- return pumvisible() and '<C-y>' or '<CR>'
- end, { expr = true })
-
- -- TODO: this ignores/overwrites default omnifunc rn
- map('i', "<C-n>", function()
- return pumvisible() and '<C-n>' or vim.lsp.completion.get()
- end, { expr = true })
-
- map('i', '<Esc>', function()
- return pumvisible() and '<C-E>' or '<Esc>'
- end, { expr = true })
- end
+ -- if client:supports_method(methods.textDocument_completion) then
+ -- local chars = {}; for i = 32, 126 do table.insert(chars, string.char(i)) end
+ -- client.server_capabilities.completionProvider.triggerCharacters = chars
+ -- vim.lsp.completion.enable(true, client.id, args.buf, { autotrigger = true })
+ --
+ -- map('i', "<CR>", function()
+ -- return pumvisible() and '<C-y>' or '<CR>'
+ -- end, { expr = true })
+ --
+ -- -- TODO: this ignores/overwrites default omnifunc rn
+ -- map('i', "<C-n>", function()
+ -- return pumvisible() and '<C-n>' or vim.lsp.completion.get()
+ -- end, { expr = true })
+ --
+ -- map('i', '<Esc>', function()
+ -- return pumvisible() and '<C-E>' or '<Esc>'
+ -- end, { expr = true })
+ -- end
-- if client:supports_method(methods.textDocument_semanticTokens) then
-- end