On 2009-05-21, Danny wrote: > On Apr 29, 12:25 am, Danny <[email protected]> wrote: > > I have been attempting to bind Ctrl+Tab and Ctrl+Shift+Tab as > > the :tabnext and :tabprev commands in vim. From what I have learned, > > PuTTY does not send these commands. I found a post describing how to > > patch putty to send these keys along. (http://scnr.net/blog/index.php/ > > archives/61). However, the keycodes it suggests are not ones that vim > > is expecting. I'm assuming there is some set of keycodes that would be > > appropriate, however I do not know what they are. I'm hoping someone > > here might be able to shed some light on this. > > > > I have looked through this mailing list, and found a similiar question > > "Problems with mappings using the Shift in the terminal" (http:// > > groups.google.com/group/vim_use/browse_thread/thread/8449c75c87c7ef4). > > I investigated one of the responses that suggested using ^V to see > > what vim recieves from the terminal. From what I can tell the tab key > > comes through as well, a tab. Not very helpful. I'm not sure how to go > > about dealing with this. > > > > I've also asked this question on SO a couple of days ago which is > > where I was able to get some leads (http://stackoverflow.com/questions/ > > 736004/creating-a-ctrltab-keybinding-in-putty). > > > > If anyone is able to lend more information, I'd love to hear it!
> I have yet to find a solution for this problem. If anyone is able to > direct me to any other resources where I might find some answers it'd > be much appreciated! > > Reformatted the links to save them from being mangled? > Patching putty to add key codes: > http://scnr.net/blog/index.php/archives/61 > Stack Overflow question: > http://stackoverflow.com/questions/736004/creating-a-ctrltab-keybinding-in-putty > Problems with mappings using the Shift in the terminal from this > vim_use mailing list: > http://groups.google.com/group/vim_use/browse_thread/thread/8449c75c87c7ef4 > > Thanks. I'm not sure what information you're missing. No, I didn't read all the references. As I understand it, you have patched PuTTY to emit unique character sequences for each of Tab, Ctrl+Tab and Ctrl+Shift+Tab. The next step is to run vim in that PuTTY, enter insert mode, type Ctrl-V, then type Tab, then Enter. Repeat this for Ctrl+Tab, Ctrl+Shift+Tab, and for my own curiosity, Shift+Tab. The result should be four lines of character sequences. You may need to ":set list" to see the Tab in the first line. The four lines should contain unique sequences. If they're not unique, vim will have no way to distinguish among them. That problem would have to be fixed within PuTTY. The terminal I'm using at the moment generates the following sequence when I type Ctrl-V followed by Shift-Tab: ^[[Z where the leading ^[ pair represents the single character Escape and appears in blue on my terminal. Assuming at this point that PuTTY does generate sequences of characters when Ctrl+Tab and Ctrl+Shift+Tab are typed and that these sequences are different from those generated by any other key combination you care about, here's how you would map the first to the :tabnext command. First type :nnoremap followed by a space, then Ctrl-V, then Ctrl+Tab, another space, then :tabnext<CR> That should do it. Mapping Ctrl+Shift+Tab is done the same way. HTH, Gary --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
