VIM editor series I

Search A Pattern

  • Press Esc
  • Then type / or ? and the pattern need to search

To do Substitution


Converting the Tab to Spaces


To control the number of space character need to be inserted when the tab was used



After the expandtab option is set all the new tab characters entered will be changed to spaces. This will not affect the exiting tab characters. To change all the existing tab characters to match the current tab settings use


Display the line numbers
enable the line number

disable the line numbers


Reversing the Order of lines

:—- start the command line mode
g—- action will be taken all lines in the files
^—-matches the starting of the line
m—moves the elements
0—Is the destination line, beginning of the buffer

If i need to reverse the lines between a certain range(like between 30 and 40 lines), then we can use the following command


To control the position of split window


Undo and Redo
        In normal mode conditions

  • use u for undo the action
  • cntrl+r for redo the action        

Leave a Reply