Vim - fairulazmin/note GitHub Wiki

Commands / Shortcuts

NORMAL MODE -> INSERT MODE

cc             -   Delete current line and enter insert mode (unlike dd which leaves you in normal mode)
C              -   Delete (change) from cursor to end of line, and enter insert mode

DELETION

D              -   Delete until end of line

VISUAL MODE

~              -   Swap case under selection

BUFFERS

:ls            -   list / show available buffers
:e filename    -   Edit a file in a new buffer
:bn            -   go to next buffer
:bp            -   go to previous buffer
:bd            -   unload a buffer (close a file)
:bw            -   unload a buffer and deletes it

TAB

:tabe filename -   opens the file in newtab
:tabe          -   open an empty tab
gt             -   go to next tab
gT             -   go to previous tab
CTRL+W T       -   Break out current window into a new tabview
CTRL+W o       -   Close every window in the current tabview but the current one
CTRL+W n       -   create a new window in the current tabview
CTRL+W c       -   Close current window in the current tabview

WINDOW

CTRL+w s       -   Split current window horizontally
CTRL+w v       -   Split current window vertically
CTRL+w c       -   Close current window
CTRL+W r       -   Swap bottom/top if split horizontally
CTRL+W R       -   Swap top/bottom if split horizontally
CTRL+w CTRL+w  -   switch between windows
CTRL+w UP      -   Move to the top window from current window
CTRL+w DOWN    -   Move to the bottom window from current window
CTRL+w LEFT    -   Move to the left window from current window
CTRL+w RIGHT   -   Move to the right window from current window
CTRL+w >       -   Incrementally increase the window to the right.
CTRL+w <       -   Incrementally increase the window to the left.
CTRL+w -       -   Incrementally decrease the window's height.
CTRL+w +       -   Incrementally increase the window's height.
<space>e       -   open explorer
<space>f       -   open explorer (floating window)
s              -   open:split
E              -   open:vsplit
t              -   open:tab
.              -   toggleHidden
gf             -   gotoSource:file
gb             -   gotoSource:buffer

you surround inner word, ysiw'

img

delete surround, ds'

img

you surround inner Word, ysiW"

img

VISUAL - surround, veeeS{

img

change surround, cs"[

img

you surround line word with spaces, yss{

img

you surround line word without spaces, yss}

img

you surround two around words, ys2aW<h1>

img

delete surround tag, dst

img

change inside (, ci(

img

change inside tag, cit

img

⚠️ **GitHub.com Fallback** ⚠️