LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-01-2010, 01:19 PM   #1
d072330
Member
 
Registered: Nov 2007
Location: USA
Distribution: CentOS 5/6
Posts: 186

Rep: Reputation: 6
Question How to add a keystroke using VI


All,

I have a co-worker who is trying to add the ^1 to his vi file as a single character. Can this be done? I have searched and searched but do not see a way to do it.

Thanks
DR
 
Old 11-01-2010, 01:21 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Hi, welcome to LQ!

And what sequence is Ctrl+1 meant to be?


Cheers,
Tink
 
Old 11-01-2010, 01:32 PM   #3
d072330
Member
 
Registered: Nov 2007
Location: USA
Distribution: CentOS 5/6
Posts: 186

Original Poster
Rep: Reputation: 6
Wink

That is what I am in the process of finding out. Will post his answer once he responds to my email.

Cheers,
DR
 
Old 11-01-2010, 02:04 PM   #4
d072330
Member
 
Registered: Nov 2007
Location: USA
Distribution: CentOS 5/6
Posts: 186

Original Poster
Rep: Reputation: 6
I know how to get such things in the file as ^M or ^H etc etc but does anyone know how to get ^1 in the file using VIM?

I have just started this job and they are just now updating servers etc and some of the code they use is pre-historic (LOL). I am told they used to be able to do this with an EDT editor.
 
Old 11-01-2010, 02:17 PM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Hi,

I do hope you talk about vim and not the classic vi....

This maps F1 to 'something' in vim:
map <F1> what_to_map_to

You haven't answered Tinkster's question and that part is reflected by the what_to_map_to part.

Hope this help[s.
 
Old 11-01-2010, 03:00 PM   #6
d072330
Member
 
Registered: Nov 2007
Location: USA
Distribution: CentOS 5/6
Posts: 186

Original Poster
Rep: Reputation: 6
It is needed (so they say) to terminate a field within a concatenated barcode sequence.
 
Old 11-01-2010, 03:55 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally Posted by d072330 View Post
I know how to get such things in the file as ^M or ^H etc etc but does anyone know how to get ^1 in the file using VIM?

I have just started this job and they are just now updating servers etc and some of the code they use is pre-historic (LOL). I am told they used to be able to do this with an EDT editor.
And what OS/environment was that in?

What is the ASCII (or EBCDIC) value they're after?
Ctrl-1 to me bears no meaning.


Cheers,
Tink
 
Old 11-01-2010, 04:52 PM   #8
d072330
Member
 
Registered: Nov 2007
Location: USA
Distribution: CentOS 5/6
Posts: 186

Original Poster
Rep: Reputation: 6
The OS is Red Hat Enterprise Linux Server release 5.5 (Tikanga)

It looks like the ^1 is defined in our label system. Which has a GUI interface and it looks like you can just type in ^1 when defining it.

It is represented by ^1 – not a traditional ASCII caret notation, it seems to be specific to barcodes.

So at this point I am thinking it cannot be done via VI, VIM, NANO etc etc.

I have attached a picture of what it looks like for your viewing pleasure.

Thanks,
DR
Attached Thumbnails
Click image for larger version

Name:	char1_1.jpg
Views:	9
Size:	5.8 KB
ID:	5050   Click image for larger version

Name:	char1_2.jpg
Views:	8
Size:	7.9 KB
ID:	5051  

Last edited by d072330; 11-01-2010 at 04:55 PM.
 
Old 11-02-2010, 03:51 AM   #9
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Could it be literally ^1 rather than Ctrl+1 displayed as ^1?
 
Old 11-02-2010, 04:01 AM   #10
Fred Caro
Member
 
Registered: May 2007
Posts: 999

Rep: Reputation: 166Reputation: 166
ctl+1 or ^1 are two or thee keystrokes, not one

fred.
 
Old 11-11-2010, 05:34 PM   #11
d072330
Member
 
Registered: Nov 2007
Location: USA
Distribution: CentOS 5/6
Posts: 186

Original Poster
Rep: Reputation: 6
Seems nobody knows. I told the co-worker could not be done. He was fine with it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
keystroke for linux igsen Linux - Newbie 2 04-12-2009 05:13 AM
Keystroke Launcher? gohmifune Linux - Software 0 05-10-2007 12:47 PM
Keystroke issue?? sil3ntOn3 Linux - Newbie 1 11-25-2006 08:49 PM
keystroke macros squip Programming 1 10-09-2003 01:46 PM
emacs keystroke kev82 Programming 9 07-16-2003 11:15 AM


All times are GMT -5. The time now is 08:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration