VI

From Alessandro's Wiki
Jump to: navigation, search
  • insert mode:
i

o


  • salvare e uscire
:x
    • forzato (x i file sola lettura)
:x!
  • Sostituzione caratteri e frasi:

First occurrence on current line:

:s/OLD/NEW

Globally (all) on current line:

:s/OLD/NEW/g

Between two lines #,#:

:#,#s/OLD/NEW/g

Every occurrence in file:

:%s/OLD/NEW/g

Ridimensionare tutti i files/dirs to Title case, capitalize, first character-letter upper case (maiuscole)

:%s/\(.\)\(.*\)/\u\1\2/
  • remove empty lines:
:g/^$/d