Ctrl+W -> Enter window mode Ctrl+W, HJKL -> Browse splits Ctrl+W, R -> Rotate up/left Ctrl+W, r -> Rotate down/right
Ctrl+ww -> browse throught windows ( nerdtree, splits ... )
:# -> Go to line # #G -> Go to line # #| -> Go to column #
gt -> to next tab gT -> go to previous tab {i}gt -> go to tab in position i
f{char} -> Move to next occurence of char F{char} -> Move to next occurence of char backwards
'' -> Move to last position ( it's double single quote )
H -> Move to top of screen M -> Move to middle of screen L -> Move to bottom of screen
Ctrl+U -> Browse half screen up Ctrl+D -> Browse half screen down
Ctrl+B -> Page up Ctrl+F -> Page down
#z -> Make top of screen start at line #
Between lines :#,#s/old/new/gc
:%s -> All lines of the file
Ctrl+r,"-> Paste current register to command
:term
Ctrl+w -> Switch terminal to VIM mode ---> N -> Enter normal mode and can browse through output of terminal for instance ---> i -> Go back to terminal mode
:! % -> Execute a shell command :silent ! -> Execute a shell commmand without the need to press enter at the end :r ! -> Put the output of the command into the current buffer
:res 60 -> 60 rows :res +5 :vertical resize 50 -> 50 columns
:sp -> Split horizontally :vsp -> Split vertically
Ctrl+W, R -> Swap splits
Ctrl+W, HJKL -> Browse between splits VIM like Remapped to just Ctrl + HJKL
=> 'Window browsing'
Ctrl + O -> backward Ctrl + I -> forward
:reg -> List all of them
"#p -> Paste content of the # register kyy -> Copy current line in register k Kyw -> Append current word to register k
:WipeReg -> Custom command
to delete all registers
. Last inserted text : Last command " Last register
@: -> Repeat last command @@ -> Repeat again last command
:marks -> List all marks
ma -> Put a marker named "a" at that position 'a -> Jump to mark "a" d'a -> Delete from current to line to line on mark "a" d{backtick}a -> Delete from current position to position on mark "a"
:delmarks! -> Delete all lowercase marks for the current buffer :delmarks a -> Delete mark 'a' :delmarks a-d -> Delete mark 'a, b, c, d'
:changes -> List current changes :e! -> Discard all changes
Ctrl + R -> Redo the previous undo through u
~ -> Makes selected caracter switch case 3~ -> Makes 3 next caracters switch case 3w -> Makes 3 next words switch case
:e -> Reloads current file :e Open file in current window :tabedit -> Open file in new tab :tabonly -> Close every tabs except the current one
:x -> Save and quit
qa -> Starts recording in the register a q -> Stop recording @a -> Play register a
git config --global diff.tool vimdiff git config --global difftool.prompt false git config --global alias.d difftool
do → Get the content of the opposite line where the cursor is dp → Push the content where the cursor is on the oposite line ]c → Next diff [c → Previous diff zo → Open fold zf → Close fold
:TabulousRename
Ctrl+n to toggle
t -> Open in new Tab T -> Opens silently i -> Open in split view horizontal s -> Open in split view vertical R -> Reloads root directory r -> Reloads current directory O -> Expand recursively P -> Jump to root p -> Jump to parent J -> Go to last child
GoTo, etc. -> Go to include/declaration/definition GetDoc -> View documentation comments for identifiers GetType -> Type information for identifiers FixIt -> Automatically fix certain errors GoToReferences -> Reference finding RefactorRename -> Renaming symbols Format -> Code formatting
$ git mergetool -> Open vim as a mergetool to handle conflict between a merge in two branchs
- LOCAL -> The file in the current branch
- BASE -> The file as it was before it was modified in both branches hence the conflict
- REMOTE -> The file as it is in the branch I'm merging into the current one
In the final merged file ( the view on the bottom ) go to a conflict and execute those commands to select what to keep :diffg RE -> Get from REMOTE :diffg BA -> Get from BASE :diffg LO -> Get from LOCAL
:GitGutterLineHighlightsToggle -> Change background of new/changed lines => Remapped to :Githl
:GitGutterNextHunk -> Go to next hunk => Remapped to :Gitnext
:GitGutterPrevHunk -> Go to previous hunk => Remapped to :Gitprev
:GitGutterStageHunk -> Stage a hunk => Remapped to :Gitstage
:GitGutterUndoHunk -> Undo a staged hunk => Remapped to :Gitunstage
:GitGutterPreviewHunk -> See what has changed for that hunk
:Gdiffsplit -> Make a split with hunks highlighted => Remapped to :Gitsplit
:noh -> Clear highlighted stuff :tabclose -> Close current tab :messages -> Show vim messages :map -> See how keys are mapped :map key -> See what are the bindings with key