This repository has been archived on 2025-01-07. You can view files and clone it, but cannot push or open issues or pull requests.
opdavies.nvim/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
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 {}
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 }