neovim/fw
This commit is contained in:
parent
8d5e0e6566
commit
c4f7a64329
16 changed files with 427 additions and 24 deletions
100
home-manager/modules/neovim/plugins/refactoring.nix
Normal file
100
home-manager/modules/neovim/plugins/refactoring.nix
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins = {
|
||||
refactoring = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
telescope.enabledExtensions = ["refactoring"];
|
||||
|
||||
which-key.settings.spec = [
|
||||
{
|
||||
__unkeyed = "<leader>r";
|
||||
mode = "x";
|
||||
group = " Refactor";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = "x";
|
||||
key = "<leader>re";
|
||||
action = ":Refactor extract ";
|
||||
options = {
|
||||
desc = "Extract";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "x";
|
||||
key = "<leader>rE";
|
||||
action = ":Refactor extract_to_file ";
|
||||
options = {
|
||||
desc = "Extract to file";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "x";
|
||||
key = "<leader>rv";
|
||||
action = ":Refactor extract_var ";
|
||||
options = {
|
||||
desc = "Extract var";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>ri";
|
||||
action = ":Refactor inline_var<CR>";
|
||||
options = {
|
||||
desc = "Inline var";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>rI";
|
||||
action = ":Refactor inline_func<CR>";
|
||||
options = {
|
||||
desc = "Inline Func";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>rb";
|
||||
action = ":Refactor extract_block<CR>";
|
||||
options = {
|
||||
desc = "Extract block";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>rB";
|
||||
action = ":Refactor extract_block_to_file<CR>";
|
||||
options = {
|
||||
desc = "Extract block to file";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>fR";
|
||||
action.__raw =
|
||||
# lua
|
||||
''
|
||||
function()
|
||||
require('telescope').extensions.refactoring.refactors()
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
desc = "Refactoring";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue