Hi, I'm trying to get the Ctrl+6 key command working with vi in Linux. This is the function that causes vi to switch to the previous file. But I'm not sure what value to use to map the key. Any ideas?
Thanks,
Russell
[size=1][ January 09, 2007, 04:59 PM: Message edited by: Brian T. Pence ][/size]
In vi, :n will go to the next file and :N will go to the previous file. I'm not sure what ctrl-6 is supposed to do unless you had that mapped to :N (for previous file).
You can certainly do the same mapping in AbsoluteTelnet under the Options->Properties->VTOptions->Edit Keymap.
Brian
Thanks for the reply.
Ctrl+6 is the same as :N, and also :e#. They all change to the previous file. Ctrl+6 is just another way of doing it that's built into vi, and the one I use all the time. 🙂
I realized just now that I could map :N or :e# if I added a backslash followed by xD onto the end of it, to get the Return key. I tried it, and it works great, so problem solved.
One odd thing is that all the other Ctrl sequences work fine, like Ctrl+B, Ctrl+G, etc. It's just Ctrl+6 that doesn't work. Actually in the vi docs it refers to it as Ctrl-^, but I've never thought that was technically correct, since there's no shift key involved (and even Absolute recognizes it as "6(CONTROL)").
Is there a way to figure out what keycode is sent when you press a key sequence like Ctrl+6? I'm a programmer, so if there was a C/C++/Perl/Shell function I could call to print it out I could try it that way, but I noticed that getch() doesn't recognize that a key was pressed at all when I do Ctrl+6.
Anyway, thanks for the quick response, it's working fine now.
Russell
Just doing a little more testing and I tried the obvious choice (ctrl-shift-6) and it works. At list it works with the version of vi I am using. Nothing special to configure in Absolute.
Interesting -- in all the years I've been using vi, I never knew that ctrl+shift+6 would do the same as ctrl+6. Good to know. And you're right, it works fine in Absolute.
Thanks,
Russell