Shortcuts Cheat Sheet — Vim, fzf, tmux & CLI Tools
Shortcuts Cheat Sheet — This Machine
Reflects what is actually installed and configured on this Mac (verified from ~/.vimrc, ~/.zshrc, ~/.tmux.conf, and Homebrew). Not a generic list.
-
Vim: 9.2 (Homebrew,
+clipboard) at/opt/homebrew/bin/vim -
Vim plugins (vim-plug, in
~/.vim/plugged):nerdtree,fzf,fzf.vim -
CLI tools:
fzf,rg(ripgrep),fd,bat,zoxide,eza,lazygit,starship -
Shell: zsh + Oh My Zsh (theme via Starship), plugins line
plugins=(git)
⚠️ fzf shell key-bindings are NOT enabled on this machine.Ctrl-R/Ctrl-T/Alt-Cin the terminal will not use fzf until you run the installer (see [Enable fzf shell integration](#enable-fzf-shell-integration-not-yet-done)). The Vim fzf commands below do work.
Vim — general (from your ~/.vimrc)
Your ~/.vimrc sets: number, relativenumber (hybrid line numbers), and clipboard=unnamed (yanks go to the macOS system clipboard).
Key / Action
-
y/yy— Yank (copies to macOS clipboard viaclipboard=unnamed) -
p/P— Paste after / before -
"+y"+p— Explicit system-clipboard yank / paste -
ddccx— Delete line / change line / delete char -
vVCtrl-v— Visual / visual-line / visual-block select -
/patternnN— Search, next, previous -
:%s/a/b/g— Replace allawithbin file -
ggG— Top / bottom of file -
:w:q:wq:q!— Write / quit / write-quit / force-quit -
uCtrl-r— Undo / redo -
:source ~/.vimrc— Reload vimrc from inside Vim (neversourceit in zsh)
Clipboard check: in Vim press yy, quit, run pbpaste in the shell — the line prints.
NERDTree (file explorer)
No custom mapping is set in your ~/.vimrc, so use the commands directly:
Command / Key / Action
-
:NERDTree— Open the file tree -
:NERDTreeToggle— Toggle the tree open/closed -
:NERDTreeFind— Reveal current file in the tree -
o/Enter— Open file / expand dir (inside tree) -
t— Open in new tab -
s/i— Open in vertical / horizontal split -
pP— Jump to parent / root -
R— Refresh the tree -
m— Menu (create/delete/move file) -
q— Close the tree
Tip: to open the tree with a single key, add to~/.vimrc:nnoremap <C-n> :NERDTreeToggle<CR>
NERDTree — open modes & moving between tree and file
How you open a file from the tree changes what "previous file" means:
Key (in tree) / Opens in / Notes
-
o/Enter— Same window · Replaces current buffer (Ctrl-^flips back to it) -
t— New tab · Switches to it (usegt/gTto move between tabs) -
T— New tab · Opens silently — keeps focus on the tree -
i/s— Horizontal / vertical split · Both files visible;Ctrl-wto move between -
go— Preview · Opens file but cursor stays in the tree
Move between the tree window and your file:
Key / Command / Action
-
Ctrl-w w— Cycle to next window (quick tree ↔ file) -
Ctrl-w h/Ctrl-w l— Move to window left / right -
Ctrl-w p— Jump to previous window -
Ctrl-o/Ctrl-^— Back to previous location / alternate file -
:NERDTreeFind— Reveal the current file's location in the tree
Vim — tabs (gt / gT)
Built-in Vim tabs (not NERDTree-specific). Pairs with NERDTree t/T which open files in new tabs.
Key / Command / Action
-
gt/gT— Next / previous tab -
{count}gt— Go to tab number (e.g.2gt→ tab 2) -
:tabnew— New empty tab -
:tabclose/:tabonly— Close current tab / close all other tabs -
:tabs— List open tabs -
:tabmove N— Move current tab to position N
Vim tabs are window layouts, not per-file like browser tabs. Many users switch files via buffers (:Buffers,:bn/:bp,Ctrl-^) and use tabs only to group layouts.
Vim — split view (windows)
Split the view to see two+ files at once. From NERDTree, s (vertical) / i (horizontal) open a file straight into a split; fzf.vim uses Ctrl-v / Ctrl-x.
Create:
Key / Command / Action
-
Ctrl-w s/:split— Split horizontally (stacked) -
Ctrl-w v/:vsplit— Split vertically (side by side) -
:sp file/:vs file— Split and open a specific file
Move / resize:
Key / Action
-
Ctrl-w h/j/k/l— Move to split left/down/up/right -
Ctrl-w w/Ctrl-w p— Next split / previous split -
Ctrl-w =— Equalize all splits -
Ctrl-w +/Ctrl-w -— Taller / shorter -
Ctrl-w >/Ctrl-w <— Wider / narrower -
Ctrl-w _/Ctrl-w |— Maximize height / width
Close / rearrange:
Key / Action
-
Ctrl-w q/:q— Close current split -
Ctrl-w o— Close all other splits (keep only current) -
Ctrl-w r— Rotate splits -
Ctrl-w H/J/K/L— Move the split to far left/bottom/top/right
fzf inside Vim (fzf.vim)
These commands are provided by the installed fzf.vim (verified from the plugin). They open a fuzzy-finder window; type to filter, Enter to open.
Command / What it fuzzy-finds
-
:Files [dir]— Files under dir (with preview) -
:GFiles— Git-tracked files -
:GFiles?— Git status (changed files) -
:Buffers— Open buffers -
:Rg [pattern]— ripgrep content search (with preview) -
:RG [pattern]— ripgrep, re-runs on every keystroke -
:Ag [pattern]— silver-searcher content search -
:Lines/:BLines— Lines in all buffers / current buffer -
:Tags/:BTags— ctags in project / current buffer -
:Marks/:Jumps/:Changes— Marks / jump list / change list -
:History— Recently opened files (:oldfiles) -
:Commits/:BCommits— Git commits (repo / current buffer) -
:Commands— Vim commands -
:Maps— Normal-mode mappings -
:Windows— Open windows -
:Colors— Color schemes -
:Helptags— Help tags
Inside any fzf window:
Key / Action
-
Ctrl-j/Ctrl-k(or arrows) — Move selection down / up -
Enter— Open in current window -
Ctrl-t— Open in new tab -
Ctrl-x— Open in horizontal split -
Ctrl-v— Open in vertical split -
Tab/Shift-Tab— Multi-select (where supported) -
Esc/Ctrl-c— Cancel
:Rg/:RGusergand:FilesprefersfdifFZF_DEFAULT_COMMANDis set — both are installed.FZF_DEFAULT_COMMANDis currently unset, so:Filesfalls back to the systemfind. To make it usefd, see the env-var tip below.
Vim — jump & buffer navigation (get back after :Rg)
After :Rg/:Files opens a file, use these to return to where you were:
Key / Command / Action
-
Ctrl-o— Jump back to previous location (undo the jump:Rgmade) -
Ctrl-i/Tab— Jump forward again -
Ctrl-^(Ctrl-6) — Toggle between current and alternate (last) file -
:b#— Switch to the alternate buffer (same asCtrl-^) -
:bp/:bn— Previous / next buffer in the list -
:Buffers— fzf: fuzzy-pick any open buffer -
:History— fzf: fuzzy-pick a recently opened file (:oldfiles)
For "just flip back to the file I was in before:Rg",Ctrl-^is the most reliable.Ctrl-owalks the whole jumplist, so it may step through cursor positions first.
fzf in the terminal (shell)
⚠️ Not active yet on this machine — see the enable section below. Once enabled:
Key / Action
-
Ctrl-r— Fuzzy-search command history -
Ctrl-t— Fuzzy-pick file/dir, insert path at cursor -
Alt-c— Fuzzycdinto a subdirectory -
**<Tab>— Fuzzy completion (e.g.vimthenthen Tab;cdthen Tab)
ripgrep (rg) & fd — standalone
Command / Action
-
rg pattern— Recursive content search (respects.gitignore) -
rg -i pattern— Case-insensitive -
rg -t rb pattern— Only Ruby files (-t js,-t py, …) -
rg -l pattern— Only list matching file names -
rg -A 3 -B 3 pattern— Show 3 lines after/before match -
fd name— Find files/dirs by name (respects.gitignore) -
fd -e rb— Find by extension -
fd -H name— Include hidden files
bat, eza, zoxide, lazygit
Command / Action
-
bat file—catwith syntax highlighting + line numbers -
bat -p file— Plain (no decorations) -
ls/ll/lt— eza aliases (from~/.zshrc): icons / long+git / tree -
z foo— zoxide: jump to a "frecent" dir matchingfoo -
zi— zoxide interactive pick (fzf-style) -
lazygit— Git TUI (stage/commit/branch/rebase visually)
lazygit essentials (inside the TUI): Space stage, c commit, P push, p pull, b branches, Tab switch panels, ? help, q quit.
tmux (from your ~/.tmux.conf)
Prefix is Ctrl-b. Copy-mode is vi-style; yanks pipe to pbcopy.
Key / Action
-
prefix + o— tmux-sessionx fuzzy session switcher -
prefix + H/J/K/L— Resize pane left/down/up/right by 5 (repeatable) -
prefix + z— Zoom pane fullscreen / restore -
prefix + [— Enter copy-mode (thenvselect,ycopy to clipboard) -
prefix + Ctrl-s/Ctrl-r— tmux-resurrect save / restore -
prefix + I— Install TPM plugins
Note:Ctrl/Alt-arrowresize does not work here — Ghostty strips the modifier. UseH/J/K/L(seemacbook-setup.mdfor the full explanation).
Enable fzf shell integration (not yet done)
To turn on Ctrl-R / Ctrl-T / Alt-C in the terminal:
$(brew --prefix)/opt/fzf/install
Answer "y" to the key-bindings prompt. It appends a source ...fzf.zsh line to ~/.zshrc. Reload with source ~/.zshrc (or open a new shell).
Optional: make fzf/:Files use fd + nicer defaults
Add to ~/.zshrc:
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND='fd --type d --hidden --follow --exclude .git'
export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --border'