mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 08:41:43 +05:30
feat(neovim): Rust dev with rustaceanvim & LSP servers installation through OS installer and NOT mason
- Use `rustaceanvim` for Rust development - `rustaceanvim` keymaps in NeoVim `after` file - Remove Rust LSP setup through builtin LSP - Remove LSP installations from Mason when equivalent available through OS installers - All LSP plugins in `code-lsp.lua`
This commit is contained in:
23
common/.config/nvim/after/ftplugin/rust.lua
Normal file
23
common/.config/nvim/after/ftplugin/rust.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
-- TODO: Map all native Nvim 0.11 LSP commands to corresponding rustaceanvim ones
|
||||
-- grn -> Rename
|
||||
-- grr -> References
|
||||
-- gri -> Implementation
|
||||
-- gO -> document_symbol
|
||||
-- gra -> code_action
|
||||
-- Mine
|
||||
-- F2 -> Rename
|
||||
-- gD -> Go to definition
|
||||
-- <leader>cr -> References
|
||||
-- <leader>co -> document_symbol
|
||||
|
||||
if pcall(require, "rustaceanvim") then
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
|
||||
vim.keymap.set("n", "<C-.>", function()
|
||||
vim.cmd.RustLsp("codeAction")
|
||||
end, { silent = true, buffer = bufnr })
|
||||
|
||||
vim.keymap.set("n", "K", function()
|
||||
vim.cmd.RustLsp({ "hover", "actions" })
|
||||
end, { silent = true, buffer = bufnr })
|
||||
end
|
||||
Reference in New Issue
Block a user