Monday, September 28, 2020

VI Basic Commands

  

Editing 

  • i - insert at the cursor

  • I - insert at the beginning of the line

  • a - write after the cursor

  • A - write at the end of line.

  • o - write at the next line 

    • 3o - insert the 3 blank line. 

  • O - write at the previous line. 


Cut, Copy and Paste

  • x - delete one character at a time. 

  • X - delete one character in opposite direction

  • yy - copy the lines

  • 5yy - copy next 5 lines.  

  • yw - copy the single word. 

  • dd - delete entire line

  • dw - delete word

  • d^ - delete from the cursor to beginning of the line.

  • d$ - delete from the cursor to end of the line.


Navigation

  • :n 🡪 jumps to nth line number

    • :32 🡪 Jumps to 32nd line

  • $ → end of line. 

  • w - move forward one word

  • W - move forward one word without punctuation.

  • b - move back one word

  • B - move back one word without punctuation. 


Find and Replace

  • :%s/find/replace/g


Searching

  • /pattern  == forward searching

  • ?pattern == Backward Searching

  • n  == Repeat search in same direction

  • N == Repeat search in opposite direction


Other Commands

  • J - join the two lines. 

  • . -  repeat your last commands (dot)

  • r - replace the character.

  • R - overwrite characters from cursor onwards. 





No comments:

Post a Comment

Minicom

 Installation sudo apt install minicom Configuration Giving permission to user for accessing the serial port chmod 666 /dev/ttyUSB0 after th...