VIM editor series II

Here is second post on the vi editor commands.
Insert a file content

example: Need to paste the info from file B to 

Copied the content to file A from file B using command :r B 

Repeat the Last Action

  • Suppose you press dd to delete the line. Next if  you want to delete the next line you press dd or .(dot)
  • Suppose you press Hi and you like to repeat the action then just press .(dot) in normal mode of vi editor

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