From 721435ae71d2be4e9d9317ddf98f23bc02d3da04 Mon Sep 17 00:00:00 2001 From: Christian Nieves Date: Thu, 11 Jan 2024 23:48:19 +0000 Subject: [PATCH] move rust --- vim/.vim/lua/config/lsp-google.lua | 1 + vim/.vim/lua/plugins/base.lua | 14 ------------ vim/.vim/lua/plugins/google.lua | 2 +- vim/.vim/lua/plugins/lsp.lua | 2 +- vim/.vim/lua/plugins/refactoring.lua | 32 ++++++---------------------- vim/.vim/lua/plugins/rust.lua | 21 ++++++++++++++++++ vim/.vim/lua/plugins/scroll.lua | 15 ++++++++++--- 7 files changed, 42 insertions(+), 45 deletions(-) create mode 100644 vim/.vim/lua/plugins/rust.lua diff --git a/vim/.vim/lua/config/lsp-google.lua b/vim/.vim/lua/config/lsp-google.lua index 107d6d2..e575847 100644 --- a/vim/.vim/lua/config/lsp-google.lua +++ b/vim/.vim/lua/config/lsp-google.lua @@ -11,6 +11,7 @@ function M.setup(capabilities) "/google/bin/releases/cider/ciderlsp/ciderlsp", "--tooltag=nvim-lsp", "--forward_sync_responses", + "--debug_relay", }, offset_encoding = "utf-8", filetypes = { diff --git a/vim/.vim/lua/plugins/base.lua b/vim/.vim/lua/plugins/base.lua index 1490d5d..3700a85 100644 --- a/vim/.vim/lua/plugins/base.lua +++ b/vim/.vim/lua/plugins/base.lua @@ -29,20 +29,6 @@ return { { "udalov/kotlin-vim", ft = "kotlin" }, { "ray-x/go.nvim", ft = "go" }, { "ray-x/guihua.lua", ft = "go" }, - { - "mrcjkb/rustaceanvim", - version = "^3", -- Recommended - ft = { "rust" }, - }, - { - "saecki/crates.nvim", - ft = "rust", - version = "v0.3.0", - dependencies = { "nvim-lua/plenary.nvim" }, - config = function() - require("crates").setup() - end, - }, { "rafcamlet/nvim-luapad", config = function() diff --git a/vim/.vim/lua/plugins/google.lua b/vim/.vim/lua/plugins/google.lua index b4bf94c..b4b56dd 100644 --- a/vim/.vim/lua/plugins/google.lua +++ b/vim/.vim/lua/plugins/google.lua @@ -19,7 +19,7 @@ return { { import = "nvgoog.google.misc" }, -- maktaba is required by all google plugins glug("maktaba", { - lazy = false, + lazy = true, dependencies = {}, config = function() -- init? vim.cmd("source /usr/share/vim/google/glug/bootstrap.vim") diff --git a/vim/.vim/lua/plugins/lsp.lua b/vim/.vim/lua/plugins/lsp.lua index 5ef44c2..4c7b072 100644 --- a/vim/.vim/lua/plugins/lsp.lua +++ b/vim/.vim/lua/plugins/lsp.lua @@ -37,7 +37,7 @@ return { dependencies = deps, keys = { { "rn", "lua vim.lsp.buf.rename()" }, - { "ca", "lua vim.lsp.buf.code_action()" }, + { "?", "lua vim.lsp.buf.code_action()" }, { "L", "lua vim.lsp.buf.hover()" }, { "g0", "lua vim.lsp.buf.document_symbol()" }, { "gr", "Telescope lsp_references" }, diff --git a/vim/.vim/lua/plugins/refactoring.lua b/vim/.vim/lua/plugins/refactoring.lua index a2f7996..4a684b1 100644 --- a/vim/.vim/lua/plugins/refactoring.lua +++ b/vim/.vim/lua/plugins/refactoring.lua @@ -11,50 +11,30 @@ return { keys = { -- remap to open the Telescope refactoring menu in visual mode { - "rr", - "lua require('telescope').extensions.refactoring.refactors()", + "R", + "lua require('telescope').extensions.refactoring.refactors()", }, -- Remaps for the refactoring operations currently offered by the plugin { "rx", - [[ lua require('refactoring').refactor('Extract Function')]], + [[ lua require('refactoring').refactor('Extract Function')]], mode = "v", }, { "rxf", - [[ lua require('refactoring').refactor('Extract Function To File')]], + [[ lua require('refactoring').refactor('Extract Function To File')]], mode = "v", }, { "rxv", - [[ lua require('refactoring').refactor('Extract Variable')]], + [[ lua require('refactoring').refactor('Extract Variable')]], mode = "v", }, - { - "ri", - [[ lua require('refactoring').refactor('Inline Variable')]], - mode = "v", - }, - - -- Extract block doesn't need visual mode - { - "rxb", - [[ lua require('refactoring').refactor('Extract Block')]], - }, - { - "rxbf", - [[ lua require('refactoring').refactor('Extract Block To File')]], - }, - - -- Inline variable can also pick up the identifier currently under the cursor without visual mode { "ri", [[ lua require('refactoring').refactor('Inline Variable')]], - }, - { - "rx", - [[ lua require('refactoring').refactor('Extract Variable')]], + mode = "v", }, }, }, diff --git a/vim/.vim/lua/plugins/rust.lua b/vim/.vim/lua/plugins/rust.lua new file mode 100644 index 0000000..310210b --- /dev/null +++ b/vim/.vim/lua/plugins/rust.lua @@ -0,0 +1,21 @@ +return { + { + "mrcjkb/rustaceanvim", + version = "^3", -- Recommended + ft = { "rust" }, + keys = { + { "rd", ":RustLsp renderDiagnostic" }, + { "ree", ":RustLsp explainError" }, + { "rem", ":RustLsp expandMacro" }, + }, + }, + { + "saecki/crates.nvim", + ft = "rust", + version = "v0.3.0", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + require("crates").setup() + end, + }, +} diff --git a/vim/.vim/lua/plugins/scroll.lua b/vim/.vim/lua/plugins/scroll.lua index 402e71a..3954a6b 100644 --- a/vim/.vim/lua/plugins/scroll.lua +++ b/vim/.vim/lua/plugins/scroll.lua @@ -33,10 +33,19 @@ return { { "kevinhwang91/nvim-hlslens", config = function() - -- require('hlslens').setup() is not required - require("scrollbar.handlers.search").setup({ - -- hlslens config overrides + require("hlslens").setup({ + nearest_only = true, + build_position_cb = function(plist, _, _, _) + require("scrollbar.handlers.search").handler.show(plist.start_pos) + end, }) + + vim.cmd([[ + augroup scrollbar_search_hide + autocmd! + autocmd CmdlineLeave : lua require('scrollbar.handlers.search').handler.hide() + augroup END + ]]) end, }, }