My vim cheatcheet


date: 2020-11-27 09:28:34 +0300


Main

About

Contacts


I google some vim commands on regular basis, but don't remember them. So, it's time to create my own vim cheatsheet.


Ex


- ``-`` - jump to parent directory

- ``%`` - create file in current directory

- ``d`` - create new directory

- ``D`` - delete file/directory under cursor

- ``R`` - Rename file under cursor


Work with windows


- ``Ctrl-w v`` - split window vertically

- ``Ctrl-w s`` - split window hotizontally

- ``Ctrl-w k`` - move to upper window

- ``Ctrl-w l`` - move to right window

- ``Ctrl-w h`` - move to left window

- ``Ctrl-w o`` - close all windows except current


Tips


Delete all trailing spaces when save buffer(save it to .vimrc):


autocmd BufWritePre * %s/\s\+$//e

Seee also:


Everyday vim commands



/posts/