feat(keymaps): Get rename command from inc_rename configuration (#579)

Gets the rename command from the inc_rename module (when installed), rather than assuming the default `IncRename`, allowing the user to modify the inc_rename options without having to create a new keymap.
This commit is contained in:
Aaron Dill 2023-04-16 03:43:14 -05:00 committed by GitHub
parent 1defd5f670
commit a099b2d3ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,8 +49,8 @@ function M.get()
M._keys[#M._keys + 1] = {
"<leader>cr",
function()
require("inc_rename")
return ":IncRename " .. vim.fn.expand("<cword>")
local inc_rename = require("inc_rename")
return ":" .. inc_rename.config.cmd_name .. " " .. vim.fn.expand("<cword>")
end,
expr = true,
desc = "Rename",