Leader Key is Space
:h keyword- Bring up help for keywordsav file- save the current file as another filenameclo- Close the current paneter- Open a terminal windowESC- Return to Normal mode:w- save:q- quit:q!- quit don't save:wqa- Save and quit cloing all tabs
h(left) j (down) k(up) l(right)- Move around the screengg- Move to top of bufferG- Move to bottom of fileH- Top of screenM- Middle of screenL- Bottom of the screenw- jump forward to start of worde- jump forward to end of wordb- jump backwards to start of word%- Jump forward to matching paren or brace.0- Start of line$- End of line^- First non blank charecter of linef(char)- Move to the next occurrence of charecterF(char)- Move ot the previous occurrence of charecter;- Repeat last f or F,- Repeat last f or F backwards{ }- Move around paragraph blocks (works in code too)ctrl + e- Move screen down one line without moving cursor.ctrl + y- Move screen up one line without moving cursor.ctrl + b- Move back one full screenctrl + f- Move forward one full screenctrl + d- Move forward 1/2 screenctrl + u- Move back one full screen
i- Enter insert mode before cursor.I- Enter insert mode at the start of the line.a- Enter insert mode after cursor.A- Enter insert mode at the end of the line.o- Append a line below current lineO- Append a line above current lineea- Enter insert mode at the end of the wordctrl + rx- Insert the contents of register x
r- Replace single charecterJ- Join line below to current onegwip- Reflow paragraphg~- switch case up to motiongu- Lower case up to motiongU- Upper case up to motion.cc- Replace entire lineCorc$- Replace to end of line.ciw- Change entire wordcw- Replace to end of wordu- UndoU- Redo.- Repeat last command
v- Visual modeV- Start linewise visual mode (select lines)o- Move to other end of marked area.Ctrl + v- Visual Block modeCtrl + O- Other corner of blockaw- Mark a wordab- Mark block with ()aB- Mark block with {}ib- Mark inner block with ()iB- mark inner block with {}at- Mark tags with <>
>- Shift text right<- Shift text lefty- Yank marked textd- Delete marked text~- Switch caseu- Change case to lowercaseU- Change case to uppercase
:reg- Show register content"xy- Yank into register x"xp- Paste contents of register x"+y- Yank into system clipboard"+p- Paste from system clipboard
:marks- Lists all marksma- Set position of mark a- `a - Jump back to a
- `. - Go to position when last editing the file
- `` - Go to position before last jump
:ju- List of jumpsctrl + i- Newer position in jump listctrl + o- Older position in jump list:changes- List changesg,- Go to newer changeg;- Go to older change
qa- Record macro aq- stop recording macro@a- Run macro a@@- rerun last macro
yy- yank lineyw- yank wordy$- yank to end of linep- Paste clipboard after cursorP- Paste clipboard before cursordd- delete linedw- Delete word (from current cursor to next start of word)d$- Delete till end of linex- delete character
<<- Move line left>>- Move line right>%- Indent block (when on brace or paren)=%- Re-indent block
/pattern- Search for pattern?pattern- Search backwards for patternn- Repeat search in same directionN- Repeat search in opposite direction:%s/old/new/g- Replace all old with new throughout the file.:%s/old/new/gc- Replace all old with new throughout the file with confirmations.noh- Remove highlighting of search matches:vimgrep /pattern/ **/*- Search for pattern in all files.:cn- next match:cp- prev match:cope- List of all matches found:ccl- Close list of all matches
:tabnew [file]- Open file in new tabCtrl + wT- Move current split window into its own tabgt- Go to next tabgT- Go to prev tab#gt- Go to tab number:tabc- Close current tab:tabo- Close other tabs but this one.
:e file- Edit file in a new buffer:bn- Next buffer:bp- Prev buffer:bd- Close buffer:ls- List open buffers
:sp file- Open file in new buffer and split:vs file- Open file in new buffer and split (verticle):tab ba- Open all buffers as tabsctrl + ws- split windowctrl + wv- split window verticlectrl + ww- switch windowctrl + wq- Quit windowctrl + wx- Exchange window with next onectrl + w=- Make all windows equal height and widthctrl + wh- Move to left windowctrl + wl- Move to right windowctrl + wj- Move to below windowctrl + wk- Move to above window
leader + n- Toggle file treea- Add new file (or folder if you leave a / at end)r- Rename filed- Delete file or foldery- Copy file name to system clipboardY- Copy relative path to system clipboardgy- Copy absolute path to system clipboard.x- cut filep- paste file from clipboardctrl + v- open in vert splitctrl + x- open in horizontal splittab- Open file but stay in tree (preview)R- Refresh treeI- toggle hidden folders visabilityH- toggle dot files visability
leader + ff- Find fileleader + fg- Live grepleader + fb- Buffersleader + fh- Help tags
F2- RenameLeader + R- RenameLeader + r- ReferencesLeader + D- Go to definitionLeader + I- Go to implimentationLeader + e- Show document diagLeader + E- Show workspace diagLeader + f- Format bufferLeader + k- Signature helpLeader + K- Hover textLeader + a- Do code action
F5- RunF10- Step overF11- Step intoF12- Step out<leader> + b- Set break pointF9- Open debug repl<leader> + d- All dap commands<leader> + B- List break points<leader> + dv- List variables<leader> + df- List frames
<leader> + t- Run whole test suite<leader> + tn
<leader>~- Open new floating terminal<leader>~j- next floating terminal<leader>~k- prev floating terminal<escape>- Close terminal
<leader>g- Open magit fullscreenenter- Expand hunksR- Refresh magit bufferq- Quit magit buffers- Stage or unstag hunkF- Stage or unstag the whole fileDDD- Discard changes to hunkL- Stage the line under cursorE- Edit file that is selectedCA- Set commit mode to ammendCU- Go back to stage modeI- Add file under cursorCC- Commit changes or move to commit mode.
? How to do snippets