Fix so rustacean vim adds keymaps to buffer and use the inlay hints
handler.
This commit is contained in:
parent
0c466f10ae
commit
f5d5920d67
1 changed files with 9 additions and 4 deletions
|
|
@ -1,3 +1,6 @@
|
||||||
|
local utils = require("utils")
|
||||||
|
local inlay_hints_handler = require("inlay_hints_handler")
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"mrcjkb/rustaceanvim",
|
"mrcjkb/rustaceanvim",
|
||||||
version = "^5",
|
version = "^5",
|
||||||
|
|
@ -14,7 +17,7 @@ return {
|
||||||
},
|
},
|
||||||
server = {
|
server = {
|
||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
||||||
vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
|
inlay_hints_handler.add_buffer(bufnr)
|
||||||
|
|
||||||
if client.server_capabilities.documentFormattingProvider then
|
if client.server_capabilities.documentFormattingProvider then
|
||||||
vim.api.nvim_buf_create_user_command(bufnr, "Format", vim.lsp.buf.format, { nargs = 0 })
|
vim.api.nvim_buf_create_user_command(bufnr, "Format", vim.lsp.buf.format, { nargs = 0 })
|
||||||
|
|
@ -26,7 +29,7 @@ return {
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
require("utils").add_keymaps({
|
utils.add_keymaps({
|
||||||
n = {
|
n = {
|
||||||
["gd"] = {
|
["gd"] = {
|
||||||
cmd = function()
|
cmd = function()
|
||||||
|
|
@ -34,7 +37,8 @@ return {
|
||||||
end,
|
end,
|
||||||
opts = {
|
opts = {
|
||||||
noremap = true,
|
noremap = true,
|
||||||
silent = true
|
silent = true,
|
||||||
|
buffer = bufnr,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
["gD"] = {
|
["gD"] = {
|
||||||
|
|
@ -43,7 +47,8 @@ return {
|
||||||
end,
|
end,
|
||||||
opts = {
|
opts = {
|
||||||
noremap = true,
|
noremap = true,
|
||||||
silent = true
|
silent = true,
|
||||||
|
buffer = bufnr,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue