summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/rustaceanvim.lua
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2025-04-24 11:36:39 +0300
committerKyren223 <Kyren223@proton.me>2025-04-24 11:36:39 +0300
commit6bef8f32b19778fdfe52f0eb39719425508dcc7b (patch)
treef293141ed7e8676b76bb06c07a0fa9472b10e2ac /.config/nvim/lua/rustaceanvim.lua
parentdbd9a6fdd0c44e26b200fb706aacd120a2e09c47 (diff)
Refactored nvim config to make it easier and less insanely nested
Diffstat (limited to '.config/nvim/lua/rustaceanvim.lua')
-rw-r--r--.config/nvim/lua/rustaceanvim.lua37
1 files changed, 37 insertions, 0 deletions
diff --git a/.config/nvim/lua/rustaceanvim.lua b/.config/nvim/lua/rustaceanvim.lua
new file mode 100644
index 0000000..91b1092
--- /dev/null
+++ b/.config/nvim/lua/rustaceanvim.lua
@@ -0,0 +1,37 @@
+---@type RustaceanOpts
+vim.g.rustaceanvim = {
+ ---@type RustaceanToolsOpts
+ tools = {
+ float_win_config = {
+ border = 'rounded',
+ },
+ },
+ ---@type RustaceanLspClientOpts
+ server = {
+ on_attach = function(_, bufnr)
+ local keymaps = {
+ { { 'n', 'i' }, '<M-Enter>', '<cmd>RustLsp codeAction<cr>', { desc = 'Code Action' } },
+ }
+
+ for _, keymap in ipairs(keymaps) do
+ local modes = keymap[1]
+ local lhs = keymap[2]
+ local rhs = keymap[3]
+ local opts = keymap[4]
+ opts.buffer = bufnr
+
+ vim.keymap.set(modes, lhs, rhs, opts)
+ end
+ end,
+ default_settings = {
+ ['rust-analyzer'] = {
+ semanticHighlighting = {
+ operator = { specialization = { enable = true } },
+ punctuation = { enable = true, specialization = { enable = true } },
+ },
+ },
+ },
+ },
+ ---@type RustaceanDapOpts
+ dap = {},
+}