feat: configure blink.cmp
This commit is contained in:
parent
01a7ce066a
commit
5119403850
6 changed files with 57 additions and 4 deletions
5
init.lua
5
init.lua
|
|
@ -5,6 +5,11 @@ vim.lsp.enable({ "lua_ls", "nixd" })
|
|||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
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 }
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
||||
vim.keymap.set("n", "<leader>gd", vim.lsp.buf.definition, opts)
|
||||
|
|
|
|||
|
|
@ -2,10 +2,13 @@
|
|||
"blink.cmp": { "branch": "main", "commit": "4b18c32adef2898f95cdef6192cbd5796c1a332d" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "7fa433a83118a70fe24c1ce88d5f0bd3453c0970" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
|
||||
"fzf-lua": { "branch": "main", "commit": "9004cbb4c065a32b690e909c49903967b45301eb" },
|
||||
"fzf-lua": { "branch": "main", "commit": "76ddd6b56875bf4f6fd13848728207e738bb75a3" },
|
||||
"gruvbox.nvim": { "branch": "main", "commit": "561126520034a1dac2f78ab063db025d12555998" },
|
||||
"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" },
|
||||
"rustaceanvim": { "branch": "master", "commit": "13f7f5c46d2db0b8daee64a842d8faebfe9064c0" }
|
||||
}
|
||||
|
|
|
|||
15
lua/plugins/autopairs.lua
Normal file
15
lua/plugins/autopairs.lua
Normal 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',
|
||||
},
|
||||
}
|
||||
|
|
@ -6,11 +6,28 @@ return {
|
|||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
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 = {
|
||||
trigger = {
|
||||
show_on_insert_on_trigger_character = false,
|
||||
},
|
||||
documentation = {
|
||||
auto_show = false,
|
||||
},
|
||||
menu = {
|
||||
auto_show = true,
|
||||
},
|
||||
},
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer' }
|
||||
|
|
@ -20,4 +37,3 @@ return {
|
|||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,4 +2,18 @@ return {
|
|||
'mrcjkb/rustaceanvim',
|
||||
version = '^8',
|
||||
lazy = false,
|
||||
init = function()
|
||||
vim.g.rustaceamvim = {
|
||||
server = {
|
||||
settings = {
|
||||
['rust-analyzer'] = {
|
||||
completion = {
|
||||
postfix = { enable = true },
|
||||
autoimport = { enable = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue