05 Jan 2010
Mastering Vi Common in just 10 minutes
I have just finished my Unix exam. I know somebody hates VI very much, because it is very hard to use. It is so command-line, something like that. But learning to use this editor is very useful because you never know when will you unable to use X-Window or when will you face with command-line configuration.
So, just easing you in. VI is an editor in Unix and Unix-like system. It is command-line-based and very easy to use. You can learn its basics in just 10 minutes. VI has two modes; command mode and insert mode. Command mode is where you put your command and insert mode is where you put your text. Easy!
How to switch between two modes
- In VI editor, press ESC to switch command mode, and press ESC again to insert mode. If you’re not sure, always press ESC two times, it will always be command mode. You will hear the beep sound.
How to insert text
- In VI editor, press ESC two times to command mode, and press “i” or “a” and then type your text. “i” is insert, “a” is append your text
How to delete your text
- In VI editor, press ESC two times to command mode, and where the cursor is press “x” to delete the character you want.
How to navigate in VI
- In VI editor, you cannot use arrow keys in your keyboard to up, down, left or right. So how?, In VI editor, press ESC two times to command mode, and press “h” to navigate left, “j” to go down, “k” to go up and “l” to go left.
How to save and exit in VI
- In VI editor, press ESC two times to command mode and then press “:wq” to save and exit the program.
See how easy is that, but VI is more than this you can read its documentation or visit this
Til next time,
noppanit
at 00:00