VKontakte.DJ
forum traveling
 

Celestial Software

...better by design

Home Support SSH Client Forums
Welcome, Guest
Please Login or Register.    Lost Password?
vi and Ctrl+6 key command (1 viewing) (1) Guest
Go to bottom Favoured: 0
TOPIC: vi and Ctrl+6 key command
#1252
vi and Ctrl+6 key command 13 Years, 10 Months ago  
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

[ January 09, 2007, 04:59 PM: Message edited by: Brian T. Pence ]
russellg (User)
Fresh Boarder
Posts: 8
graphgraph
User Offline Click here to see the profile of this user
Logged Logged  
 
The administrator has disabled public write access.  
#1253
Re: vi and Ctrl+6 key command 13 Years, 10 Months ago  
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
bpence (Admin)
Admin
Posts: 1343
graph
User Offline Click here to see the profile of this user
Logged Logged  
 
Brian Pence
Celestial Software
SSH , SFTP, and Telnet in a tabbed interface for Windows XP, Vista, Mobile, and others
 
The administrator has disabled public write access.  
#1254
Re: vi and Ctrl+6 key command 13 Years, 10 Months ago  
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
russellg (User)
Fresh Boarder
Posts: 8
graphgraph
User Offline Click here to see the profile of this user
Logged Logged  
 
Last Edit: 2012/05/18 16:50 By russellg.
 
The administrator has disabled public write access.  
#1255
Re: vi and Ctrl+6 key command 13 Years, 10 Months ago  
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.
bpence (Admin)
Admin
Posts: 1343
graph
User Offline Click here to see the profile of this user
Logged Logged  
 
Brian Pence
Celestial Software
SSH , SFTP, and Telnet in a tabbed interface for Windows XP, Vista, Mobile, and others
 
The administrator has disabled public write access.  
#1256
Re: vi and Ctrl+6 key command 13 Years, 10 Months ago  
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
russellg (User)
Fresh Boarder
Posts: 8
graphgraph
User Offline Click here to see the profile of this user
Logged Logged  
 
The administrator has disabled public write access.  
Go to top