Monday, 29 August 2011

VI Essentials

Sometimes you visit a client and you have got only access to the vi editor. While this editor can be frustrating to learn especially for Windows and Mac users I believe that learning or referring to the below commands might become handy to any IT professional.

vi [+n] <file_name>
Open filename positioning the cursor at line number n
Save the file to disk and quit
Quit without saving any changes

Moving Cursor
h (or Left arrow key)
l  (or Right arrow key)
k (or Up arrow key)
j  (or Down arrow key)
End of file
Beginning of current line
End of current line

Searching Text
Search down for string
Search up for string
Repeat last search
Search and replace old-string with new-string

Copying and Pasting Text
Copying n lines into buffer
Paste the buffer after the current line

Inserting and Deleting Text
Insert starting left of cursor
Delete single character
Delete n lines
Undo last change

:set nu / :set nonu
Turn on line numbering / Turn off line numbering
:set ic / :set noic
Ignore case when searching / Ignore case off


  1. Greetings. I know this is somewhat off-topic, but I was wondering if you knew where I could get a captcha plugin for my comment form? I’m using the same blog platform like yours, and I’m having difficulty finding one? Thanks a lot.
    AWS Training in Bangalore | Amazon Web Services Training in Bangalore

    Amazon Web Services Training in Pune | Best AWS Training in Pune

  2. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.

    angularjs-Training in velachery

    angularjs Training in bangalore

    angularjs Training in bangalore

    angularjs Training in btm

    angularjs Training in electronic-city

  3. Fantastic work! This is the type of information that should follow collective approximately the web. Embarrassment captivating position Google for not positioning this transmit higher! Enlarge taking place greater than and visit my web situate
    online Python certification course | python training in OMR | python training course in chennai

  4. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
    Java interview questions and answers | Core Java interview questions and answers

  5. Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.
    Data Science training in Chennai | Data science training in bangalore

    Data science training in pune | Data science online training

    Data Science Interview questions and answers