Visit Our UNIX and Linux User Community


abbreviation vi


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting abbreviation vi
# 1  
Old 09-04-2010
abbreviation vi

hi all,

i want to write a script using vi editor ...the problem is given below...

Set the abbreviation for “Infosys Technologies Limited” as ITL and list it.
  1. Type ITL in the insert mode and check whether the ITL is getting substituted by “Infosys Technologies Limited”
  2. Unabbreviate ITL and check it

....
# 2  
Old 09-04-2010
This sounds a bit like homework.. But here is how to do it: add this line to your ~/.vimrc:
Code:
inoremap ITL Infosys Technologies Limited

create new file with vim and type "ITL" (try to be fast with typing). It will be substituted by the desired string. When you want to disble this behaviour, just put " at the beggining of the added line in .vimrc to comment it out, or just delete it entirely.
# 3  
Old 09-04-2010
To set an abbreviation
Code:
:ab itl Infosys Technologies Limited

To unset it
Code:
:una itl

# 4  
Old 09-05-2010
Quote:
Originally Posted by sonu_pal
hi all,

i want to write a script using vi editor ...the problem is given below...

Set the abbreviation for “Infosys Technologies Limited” as ITL and list it.
  1. Type ITL in the insert mode and check whether the ITL is getting substituted by “Infosys Technologies Limited”
  2. Unabbreviate ITL and check it

....
From vim window,
Code:
:h ab
:h iab


Previous Thread | Next Thread
Test Your Knowledge in Computers #673
Difficulty: Medium
Norman Abramson, a professor at the University of Hawaii, developed the first wireless computer communication network, ALOHAnet.
True or False?

2 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

what is the meaning of the nu abbreviation in vi

Does anyone know what nu stands for in vi? That is so much easier to remember then number and nonumber for line numbers. Show Line Numbers In vim Text Editor, Linux (1 Reply)
Discussion started by: cokedude
1 Replies

2. UNIX for Dummies Questions & Answers

OEM - what does this abbreviation stand for?

Just saw this OEM abbreviation during installation of Solaris 8. I'm curious to know what the letters stand for and what OEM actually is. (3 Replies)
Discussion started by: Kanu77
3 Replies

Featured Tech Videos