diff --git a/plugins/toggleterm.nix b/plugins/toggleterm.nix index cf75cd1..809bdb7 100644 --- a/plugins/toggleterm.nix +++ b/plugins/toggleterm.nix @@ -79,5 +79,19 @@ _: action = ""; options.desc = "Switch to normal mode"; } + { + mode = [ "n" "t" ]; + key = "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"; + } ]; }