Jan 30, 2009

VIM some commands

vi testing.txt
will open a testing.txt text file in the current directory.

press i
It will cause vim to go to insert mode.

press escape
This will cause you to come into command mode out of writing inside the text file.

:wq
This will help you to exit vi with saving on the file lines i have written.

:wq filename.extension
this will save the file with the name filename and with extension.

vi +36 foo.c
Start at line number 36 in foo.c

If you are already in the vi
:14
G to go to the end of file

No comments: