feat: configure blink.cmp

This commit is contained in:
ZotyDev 2026-02-23 14:54:34 -03:00
parent 01a7ce066a
commit 5119403850
Signed by: Zoty
SSH key fingerprint: SHA256:WsGEGivgl37t3Mth6uugXMOgMCTR7QolIepNbC+j/tA
6 changed files with 57 additions and 4 deletions

View file

@ -5,6 +5,11 @@ vim.lsp.enable({ "lua_ls", "nixd" })
vim.api.nvim_create_autocmd("LspAttach", { vim.api.nvim_create_autocmd("LspAttach", {
callback = function(ev) callback = function(ev)
local client = vim.lsp.get_client_by_id(ev.data.client_id)
if client and client.supports_method('textDocument/inlayHint') then
vim.lsp.inlay_hint.enable(true, { bufnr = ev.buf })
end
local opts = { buffer = ev.buf } local opts = { buffer = ev.buf }
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
vim.keymap.set("n", "<leader>gd", vim.lsp.buf.definition, opts) vim.keymap.set("n", "<leader>gd", vim.lsp.buf.definition, opts)

View file

@ -2,10 +2,13 @@
"blink.cmp": { "branch": "main", "commit": "4b18c32adef2898f95cdef6192cbd5796c1a332d" }, "blink.cmp": { "branch": "main", "commit": "4b18c32adef2898f95cdef6192cbd5796c1a332d" },
"fidget.nvim": { "branch": "main", "commit": "7fa433a83118a70fe24c1ce88d5f0bd3453c0970" }, "fidget.nvim": { "branch": "main", "commit": "7fa433a83118a70fe24c1ce88d5f0bd3453c0970" },
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
"fzf-lua": { "branch": "main", "commit": "9004cbb4c065a32b690e909c49903967b45301eb" }, "fzf-lua": { "branch": "main", "commit": "76ddd6b56875bf4f6fd13848728207e738bb75a3" },
"gruvbox.nvim": { "branch": "main", "commit": "561126520034a1dac2f78ab063db025d12555998" }, "gruvbox.nvim": { "branch": "main", "commit": "561126520034a1dac2f78ab063db025d12555998" },
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
"nvim-treesitter": { "branch": "main", "commit": "dc42c209f3820bdfaae0956f15de29689aa6b451" }, "nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" },
"nvim-treesitter": { "branch": "main", "commit": "d660b7c002f3922b6bb3da47206645488a698426" },
"nvim-treesitter-endwise": { "branch": "master", "commit": "8fe8a95630f4f2c72a87ba1927af649e0bfaa244" },
"nvim-ts-autotag": { "branch": "main", "commit": "8e1c0a389f20bf7f5b0dd0e00306c1247bda2595" },
"nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" }, "nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" },
"rustaceanvim": { "branch": "master", "commit": "13f7f5c46d2db0b8daee64a842d8faebfe9064c0" } "rustaceanvim": { "branch": "master", "commit": "13f7f5c46d2db0b8daee64a842d8faebfe9064c0" }
} }

15
lua/plugins/autopairs.lua Normal file
View file

@ -0,0 +1,15 @@
return {
{
'windwp/nvim-autopairs',
event = "InsertEnter",
config = true,
},
{
'windwp/nvim-ts-autotag',
ft = { 'html', 'jsx', 'tsx', 'xml', 'svelte', 'vue' },
config = true,
},
{
'RRethy/nvim-treesitter-endwise',
},
}

View file

@ -6,11 +6,28 @@ return {
---@module 'blink.cmp' ---@module 'blink.cmp'
---@type blink.cmp.Config ---@type blink.cmp.Config
opts = { opts = {
keymap = { preset = 'default' }, keymap = {
preset = 'none',
['<C-space>'] = { 'show', 'fallback' },
['<C-e>'] = { 'cancel', 'fallback' },
['<CR>'] = { 'accept', 'fallback' },
['<Tab>'] = { 'select_next', 'fallback' },
['<S-Tab>'] = { 'select_prev', 'fallback' },
['<C-n>'] = { 'select_next', 'fallback' },
['<C-p>'] = { 'select_prev', 'fallback' },
['<C-d>'] = { 'scroll_documentation_down', 'fallback' },
['<C-u>'] = { 'scroll_documentation_up', 'fallback' },
},
completion = { completion = {
trigger = {
show_on_insert_on_trigger_character = false,
},
documentation = { documentation = {
auto_show = false, auto_show = false,
}, },
menu = {
auto_show = true,
},
}, },
sources = { sources = {
default = { 'lsp', 'path', 'snippets', 'buffer' } default = { 'lsp', 'path', 'snippets', 'buffer' }
@ -20,4 +37,3 @@ return {
}, },
}, },
} }

View file

@ -2,4 +2,18 @@ return {
'mrcjkb/rustaceanvim', 'mrcjkb/rustaceanvim',
version = '^8', version = '^8',
lazy = false, lazy = false,
init = function()
vim.g.rustaceamvim = {
server = {
settings = {
['rust-analyzer'] = {
completion = {
postfix = { enable = true },
autoimport = { enable = true },
},
},
},
},
}
end,
} }