From 6e3d4f420161ca7e5e8c5ab6170785000f9bbf12 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Wed, 27 Jul 2022 23:09:25 -0700 Subject: [PATCH 1/2] aliases: improvement to paru alias --- .config/shell/aliases | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/shell/aliases b/.config/shell/aliases index a8dd4ac..5cd6aa6 100644 --- a/.config/shell/aliases +++ b/.config/shell/aliases @@ -56,7 +56,7 @@ alias \ # super duper paru alias # shellcheck disable=SC2139 command -v paru > /dev/null && alias \ - parue="$(which paru) --color=auto --sudoloop --newsonupgrade --pgpfetch --upgrademenu --bottomup --fm nvim" \ + parue='\paru --color=auto --sudoloop --newsonupgrade --pgpfetch --upgrademenu --bottomup --fm nvim' \ paru='parue --skipreview' \ # TODO: make sure IS_TTY is set to a value in the env file, in case the profile is not installed. From 1ceeb627174d93a1c0c760334ac9a7d5a2af766b Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Mon, 8 Aug 2022 15:58:02 -0700 Subject: [PATCH 2/2] nvim: add refactoring and null-ls --- .config/nvim/lua/blake/plugins.lua | 43 ++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/.config/nvim/lua/blake/plugins.lua b/.config/nvim/lua/blake/plugins.lua index ed72ac2..5861bbd 100644 --- a/.config/nvim/lua/blake/plugins.lua +++ b/.config/nvim/lua/blake/plugins.lua @@ -158,6 +158,49 @@ return require('packer').startup({function() -- vim.g.ale_disable_lsp = 1 -- end -- } + use { -- null-ls: Support for lots of programming tools, but through nvim lsp + 'jose-elias-alvarez/null-ls.nvim', + requires = 'nvim-lua/plenary.nvim', + config = function() + local null_ls = require("null-ls") + require("null-ls").setup({ + sources = { + null_ls.builtins.code_actions.refactoring, + null_ls.builtins.formatting.clang_format, + } + }) + end + } + use { -- refactoring: Refactoring for neovim + 'ThePrimeagen/refactoring.nvim', + requires = { + {"nvim-lua/plenary.nvim"}, + {"nvim-treesitter/nvim-treesitter"} + }, + config = function() + require('refactoring').setup({}) + -- Remaps for the refactoring operations currently offered by the plugin + vim.api.nvim_set_keymap("v", "re", [[ lua require('refactoring').refactor('Extract Function')]], {noremap = true, silent = true, expr = false}) + vim.api.nvim_set_keymap("v", "rf", [[ lua require('refactoring').refactor('Extract Function To File')]], {noremap = true, silent = true, expr = false}) + vim.api.nvim_set_keymap("v", "rv", [[ lua require('refactoring').refactor('Extract Variable')]], {noremap = true, silent = true, expr = false}) + vim.api.nvim_set_keymap("v", "ri", [[ lua require('refactoring').refactor('Inline Variable')]], {noremap = true, silent = true, expr = false}) + -- Extract block doesn't need visual mode + vim.api.nvim_set_keymap("n", "rb", [[ lua require('refactoring').refactor('Extract Block')]], {noremap = true, silent = true, expr = false}) + vim.api.nvim_set_keymap("n", "rbf", [[ lua require('refactoring').refactor('Extract Block To File')]], {noremap = true, silent = true, expr = false}) + -- Inline variable can also pick up the identifier currently under the cursor without visual mode + vim.api.nvim_set_keymap("n", "ri", [[ lua require('refactoring').refactor('Inline Variable')]], {noremap = true, silent = true, expr = false}) + -- Refactoring telescope integration + -- load refactoring Telescope extension + require("telescope").load_extension("refactoring") + -- remap to open the Telescope refactoring menu in visual mode + vim.api.nvim_set_keymap( + "v", + "rr", + "lua require('telescope').extensions.refactoring.refactors()", + { noremap = true } + ) + end, + } ---- DAP (Debug Adapter Protocol) use { -- nvim-dap: DAP support 'mfussenegger/nvim-dap',