Commenting Multiple Lines

  • Highlight the lines you want to comment out.

  • :, the status line will become :'<,'>.

  • Complete the line as below, followed by the Enter key:



Remove all trailing whitespace at end of lines:


Note: \s finds whitespace (a space or a tab), and \+ finds one or more occurrences.


To replace tabs with spaces:


Type Correction

Say you want to enter the but instead you type teh. To correct the typo:

  • exit edit mode

  • move cursor to the letter e.

  • enter commands xp.