Forum

vi and Ctrl+6 key c...
 
Notifications
Clear all

vi and Ctrl+6 key command

0 Posts
2 Users
0 Reactions
435 Views
(@russellg)
Eminent Member
Joined: 18 years ago
Posts: 14
Topic starter  

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]


   
ReplyQuote
(@bpence)
Member Admin
Joined: 1 year ago
Posts: 1375
 

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


   
ReplyQuote
(@russellg)
Eminent Member
Joined: 18 years ago
Posts: 14
Topic starter  

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


   
ReplyQuote
(@bpence)
Member Admin
Joined: 1 year ago
Posts: 1375
 

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.


   
ReplyQuote
(@russellg)
Eminent Member
Joined: 18 years ago
Posts: 14
Topic starter  

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


   
ReplyQuote
Share: