feat(plugins/toggleterm): add keymap to rename terminal

This commit is contained in:
Nicolas Goudry 2024-06-12 12:04:00 +02:00
parent d2cfded674
commit 714a000001
No known key found for this signature in database
GPG key ID: 5FC434D9FFD1DF44

View file

@ -79,5 +79,19 @@ _:
action = "<C-\\><C-n>";
options.desc = "Switch to normal mode";
}
{
mode = [ "n" "t" ];
key = "<Leader>tn";
action.__raw = ''
function()
local curterm = require("toggleterm.terminal").get_focused_id()
if curterm ~= nil then
vim.cmd(curterm .. "ToggleTermSetName")
end
end
'';
options.desc = "Rename current terminal";
}
];
}