Files
dotfiles/common/.config/nvim/after/ftplugin/rust.lua
Pratik Tripathy dd9246cda7 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`
2025-07-28 10:51:51 +05:30

24 lines
656 B
Lua

-- 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