1833730 Members
2684 Online
110063 Solutions
New Discussion

Re: VI command

 
SOLVED
Go to solution
j773303
Super Advisor

VI command

Could somebody teach me how to go to the first
line of the file which opened by VI?

Thanks .
Hero
6 REPLIES 6
Ashwani Kashyap
Honored Contributor
Solution

Re: VI command

press esc key . Then :1 . Hit enter . YOu are now at the first line .
Jeff Schussele
Honored Contributor

Re: VI command

Hi Jeff,

enter the number 1 followed by shift-G.
Shift-G by itself takes you to the end of the file.
A number preceeding shift-G takes you to THAT line number.
You can turn on line numbering by entering : then typing set nu

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Michael Tully
Honored Contributor

Re: VI command

Hi,

There are quite a number of commands and tasks that can be achieved in vi. Here is a tutorial which is well worth a look.

http://www.eng.hawaii.edu/Tutor/vi.html

Cheers
Michael
Anyone for a Mutiny ?
Nicolas Portais
Frequent Advisor

Re: VI command

Hi,

you'll find a vi refcards in this URL:
http://www.magma.ca/~raywood/vim/vi-ref.pdf

Regards,
Nicolas
kish_1
Valued Contributor

Re: VI command

see this thread is very usefull
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x6b2aeea29889d611abdb0090277a778c,00.html
share the power of the knowledge
Oren_3
Occasional Contributor

Re: VI command

if you would like to go to a certain line number you can press simply esc. and the number of the line, as said before.
another useful command is "se nu" - se(t) nu(mber)
witch states for each line it's number - very good for big files and compilation error with line number.

regards, Oren.