.vimrc

Location of my .vimrc in github.

Searching

Delete all lines containing “matchingstring”:

:%g/matchingstring/d

Delete all lines NOT containing “matchingstring”:

:%g!/matchingstring/d

or

:v/matchingstring/d

Search by hex code:

\%x1b

Spelling

To enable spell checking:

:set spell spelllang=en_us

To disable spell checkiung:

:set nospell

To move to a misspelled word, use ]s and [s.

Suggest a list of alternatives : z=.

Encoding

Set file to UTF8:

:set fileencoding=utf8
:w myfilename

Change the line endings when saving a file:

:w ++ff=dos
:w ++ff=mac
:w ++ff=unix

Equalize width and height of all windows

Ctrl+W =

Sources:

  • https://stackoverflow.com/questions/9310274/how-can-i-use-vim-to-convert-my-file-to-utf8
  • https://stackoverflow.com/questions/82726/convert-dos-line-endings-to-linux-line-endings-in-vim
  • https://vi.stackexchange.com/questions/514/how-do-i-change-the-current-splits-width-and-height

The VIM alphabet: https://www.youtube.com/watch?v=aAsz359xTd4&list=PLnc_NxpmOxaNqdGvUg8RBi8ZTaZGPdqBD&index=5