LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 12: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, 12:21 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

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

And what sequence is Ctrl+1 meant to be?


Cheers,
Tink
 
Old 11-01-2010, 12: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, 01: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, 01:17 PM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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, 02: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, 02:55 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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, 03: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:	14
Size:	5.8 KB
ID:	5050   Click image for larger version

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

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

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

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

fred.
 
Old 11-11-2010, 04: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 04:13 AM
Keystroke Launcher? gohmifune Linux - Software 0 05-10-2007 11:47 AM
Keystroke issue?? sil3ntOn3 Linux - Newbie 1 11-25-2006 07:49 PM
keystroke macros squip Programming 1 10-09-2003 12:46 PM
emacs keystroke kev82 Programming 9 07-16-2003 10:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:47 AM.

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
Open Source Consulting | Domain Registration