feat(nvim/rust): load crates plugin
This commit is contained in:
parent
8ca3f4820d
commit
a909ea3bf3
@ -57,7 +57,9 @@ cmp.setup({
|
|||||||
keep_all_entries = false,
|
keep_all_entries = false,
|
||||||
enable_in_context = function() return true end
|
enable_in_context = function() return true end
|
||||||
}
|
}
|
||||||
}, {name = 'conventionalcommits', keyword_length = 1 },
|
},
|
||||||
|
{name = 'conventionalcommits', keyword_length = 1 },
|
||||||
|
{name = 'crates'},
|
||||||
},
|
},
|
||||||
window = {
|
window = {
|
||||||
completion = cmp.config.window.bordered(),
|
completion = cmp.config.window.bordered(),
|
||||||
@ -73,6 +75,7 @@ cmp.setup({
|
|||||||
path = '📁',
|
path = '📁',
|
||||||
spell = '💬',
|
spell = '💬',
|
||||||
calc = '√',
|
calc = '√',
|
||||||
|
crates = '📦',
|
||||||
}
|
}
|
||||||
item.menu = menu_icon[entry.source.name]
|
item.menu = menu_icon[entry.source.name]
|
||||||
return item
|
return item
|
||||||
|
2
rust.lua
2
rust.lua
@ -118,8 +118,10 @@ rt.setup({
|
|||||||
cmd = {(deps.rust_analyzer_path .. "/bin/rust-analyzer")},
|
cmd = {(deps.rust_analyzer_path .. "/bin/rust-analyzer")},
|
||||||
capabilities = require("cmp_nvim_lsp").default_capabilities(c),
|
capabilities = require("cmp_nvim_lsp").default_capabilities(c),
|
||||||
on_attach = function(_, bufnr)
|
on_attach = function(_, bufnr)
|
||||||
|
require('crates').setup()
|
||||||
local keymap_opts = {buffer = bufnr}
|
local keymap_opts = {buffer = bufnr}
|
||||||
-- Hover actions
|
-- Hover actions
|
||||||
|
-- call twice to focus
|
||||||
vim.keymap.set("n", "<leader>h", rt.hover_actions.hover_actions,
|
vim.keymap.set("n", "<leader>h", rt.hover_actions.hover_actions,
|
||||||
keymap_opts)
|
keymap_opts)
|
||||||
-- Code action groups
|
-- Code action groups
|
||||||
|
Loading…
x
Reference in New Issue
Block a user