Creating a ctrl+tab keybinding in PuTTY

2019-03-12 19:06发布

问题:

I'd like to be able to map the vim commands :tabnext and :tabprev to CTRL+TAB and CTRL+SHIFT+TAB respectively. Unfortunately, I seem to be running into the problem where PuTTY eats these character combinations.

I've tried searching for information, but to no avail. I'm pretty sure this is a PuTTY thing but there doesn't seem to be any sort of help/reference area for the application.

I am curious if anyone here has any experience or suggestions for figuring this out.

@rmeador: try mapping the key combo within vim.
I have attempted to do this, but it doesn't appear like vim is getting the combo. I'm not certain if this is related to the term settings or an issue with PuTTY.

回答1:

PuTTY doesn't send anything when you press Ctrl+Tab.

You can patch PuTTY as it is described here: Using Ctrl+Tab in GNU Screen over PuTTY



回答2:

I believe that at this time, using Ctrl+Tab is not possible with PuTTY, because PuTTY does not allow you to configure specific translations for keys. Here is a decent article that shows how you would set this up if PuTTY did support this feature:

http://www.staldal.nu/tech/2009/01/10/how-to-use-ctrl-tab-in-gnu-screen/

If you use (or would consider using) a hotkey/macro program like Autohotkey, you could emulate this behavior yourself. For example, this Autohotkey config script would do exactly what you want:

#IfWinActive PuTTY
^Tab::Send :tabnext
^+Tab::Send :tabprev
#IfWinActive

(Note that this example is just looking for any window title starting with PuTTY, so you'd have to adjust based on your title configuration.)