dotfiles/config/neovim/after/plugin/refactoring.lua

19 lines
745 B
Lua
Raw Normal View History

local status_ok, refactoring = pcall(require, "refactoring")
if not status_ok then
return
end
2022-03-23 19:35:21 +00:00
local nmap = require("opdavies.keymap").nmap
local vmap = require("opdavies.keymap").vmap
-- TODO: add keymaps - https://github.com/ThePrimeagen/refactoring.nvim#configuration-for-refactoring-operations
refactoring.setup {}
2022-03-23 19:35:21 +00:00
local opts = { silent = true }
nmap { "<Leader>ri", "<Cmd>lua require 'refactoring'.refactor 'Inline Variable'<Cr>", opts }
vmap { "<Leader>re", "<Esc><Cmd>lua require 'refactoring'.refactor 'Extract Function'<Cr>", opts }
vmap { "<Leader>ri", "<Esc><Cmd>lua require 'refactoring'.refactor 'Inline Variable'<Cr>", opts }
vmap { "<Leader>rv", "<Esc><Cmd>lua require 'refactoring'.refactor 'Extract Variable'<Cr>", opts }