feat(nvim/rust): load crates plugin

This commit is contained in:
u2515h 2023-12-27 18:43:44 +01:00
parent 8ca3f4820d
commit a909ea3bf3
2 changed files with 6 additions and 1 deletions

View File

@ -57,7 +57,9 @@ cmp.setup({
keep_all_entries = false,
enable_in_context = function() return true end
}
}, {name = 'conventionalcommits', keyword_length = 1 },
},
{name = 'conventionalcommits', keyword_length = 1 },
{name = 'crates'},
},
window = {
completion = cmp.config.window.bordered(),
@ -73,6 +75,7 @@ cmp.setup({
path = '📁',
spell = '💬',
calc = '',
crates = '📦',
}
item.menu = menu_icon[entry.source.name]
return item

View File

@ -118,8 +118,10 @@ rt.setup({
cmd = {(deps.rust_analyzer_path .. "/bin/rust-analyzer")},
capabilities = require("cmp_nvim_lsp").default_capabilities(c),
on_attach = function(_, bufnr)
require('crates').setup()
local keymap_opts = {buffer = bufnr}
-- Hover actions
-- call twice to focus
vim.keymap.set("n", "<leader>h", rt.hover_actions.hover_actions,
keymap_opts)
-- Code action groups