diff --git a/rust.lua b/rust.lua index 3b6e9c6..839ba0b 100644 --- a/rust.lua +++ b/rust.lua @@ -117,33 +117,30 @@ vim.g.rustaceanvim = { cmd = {(deps.rust_analyzer_path .. "/bin/rust-analyzer")}, capabilities = require("cmp_nvim_lsp").default_capabilities(c), on_attach = function(client, bufnr) - require("lsp-inlayhints").on_attach(client, bufnr) - require('crates').setup() + require("lsp-inlayhints").on_attach(client, bufnr) + require('crates').setup() local keymap_opts = {buffer = bufnr} -- Hover actions - -- call twice to focus + -- call twice to focus vim.keymap.set("n", "K", - function() - vim.cmd.RustLsp { 'hover', 'actions' } - end, keymap_opts) + function() + vim.cmd.RustLsp {'hover', 'actions'} + end, keymap_opts) -- Code action groups vim.keymap.set("n", "as", - function() - vim.cmd.RustLsp { 'hover', 'actions' } - end, keymap_opts) - vim.keymap.set('n', 'cc', - function() - vim.cmd.RustLsp('openCargo') - end, keymap_opts) - vim.keymap.set('n', 'cr', - function() - vim.cmd.RustLsp {'runnables', 'last' --[[ optional ]] } - end, keymap_opts) - vim.keymap.set('n', 'cd', - function() - vim.cmd.RustLsp {'debuggables', 'last' --[[ optional ]] } - end, keymap_opts) --- vim.keymap.set("n", "g0", vim.lsp.buf.document_symbol, keymap_opts) + function() + vim.cmd.RustLsp {'hover', 'actions'} + end, keymap_opts) + vim.keymap.set('n', 'cc', + function() vim.cmd.RustLsp('openCargo') end, + keymap_opts) + vim.keymap.set('n', 'cr', function() + vim.cmd.RustLsp {'runnables', 'last' --[[ optional ]] } + end, keymap_opts) + vim.keymap.set('n', 'cd', function() + vim.cmd.RustLsp {'debuggables', 'last' --[[ optional ]] } + end, keymap_opts) + -- vim.keymap.set("n", "g0", vim.lsp.buf.document_symbol, keymap_opts) local diag_float_grp = vim.api.nvim_create_augroup( "DiagnosticFloat", {clear = true}) vim.api.nvim_create_autocmd("CursorHold", {