tmux start new session
tmux new -s [name] start new session with name
tmux a attach to last session
tmux a -t [name] attach to named session
tmux ls list sessions
tmux kill-session -t [name] kill session with name
ctrl s s list sessions
ctrl s d detach session
ctrl s $ rename session
ctrl s c create new window
ctrl s , rename cur window
ctrl s n/p go to next/prev window
ctrl s w list windows
ctrl s & kill window
ctrl (hjkl) move between panels (VIM keybindings)
ctrl s " open panel (stack vertically)
ctrl s % open panel (stack horizontally)
ctrl s x close panel
ctrl s z toggle panel full screen
ctrl s [ scroll
q quit scroll
ctrl m toggle mouse mode (iterm)
ctrl t (in file manager or normal mode) open new tab
gt move to next tab to right
gT move to next tab to left
ctrl w close tab
ctrl (hjkl) move between splits (VIM keybindings)
<Ctrl-w> s split window horizontally
<Ctrl-w> v split window vertically
<Ctrl-w> q close window
zz, zt, zb put line as center, top, bottom
ctrl ] go to tag
ctrl o go back
ctrl i go forward
m[char] mark cursor location as [char]
'[char] go to marked cursor location
{ or } go to next/prev blank line
* or # go to next/prev word under cursor
f/F [char] go to next/prev [char] in line
t/T [char] go to next/prev [char] in line before [char]
v characterwise visual mode
V linewise visual mode
O add line above
]p paste with correct indentation
. repeat last command
v/c/d ip highlight/change/delete inside _ (paragraph, words, quotes, etc.) pos does not matter
v/c/d ap highlight/change/delete around _ (paragraph, words, quotes, etc.) pos does not matter
v/c/d t/f [char] highlight/change/delete until/forward _ (words, quotes, etc.)
=ap auto indent paragraph
o switch highlight position (visual mode)
K move block of code up
J move block of code down
space d delete line (visual mode)
space dd delete line (normal mode)
space e open diagnostics list on line
space q open all diagnostics
[/] d go to next/prev diagnostic
% makes in file
/g makes global (within a scope)
/c makes confirmation
:s/foo/bar replace first foo with bar in line
:s/foo/bar/g replace all foo with bar in line
:#,#s/foo/bar/g replace all foo with bar in range of (#, #)
:%s/foo/bar/g replace all foo with bar in file
:%s/foo/bar/gc replace all foo with bar in line with confirmation
tab autocomplete for copilot
ctrl j/k move down/up in suggestions
enter select suggestion
ctrl e close suggestions
space m open harpoon menu
space a harpoon file
space h go to file 1
space h go to file 2
space h go to file 3
space h go to file 4
space n/N go to next/prev file
space ft toggle file tree
space gf search files in dir (just git files)
space sf search files in dir (hidden files)
space sg search by grep in dir
space sG search by grep in dir (git dir)
space ut open undo tree
space s/ search in open files
space sd search diagnostics
space space search files in buffer
space / search words in current buffer
space d s search for symbols in document
space w s search for symbols in buffer
space w a add folder in buffer
space w r remove folder from buffer
space w l list folders in buffer
gd/gD go to definition/declaration of thing under cursor
gr go to references of thing under cursor
leader D go to definition of type
K show documentation (shorter) of thing under cursor
ctrl k show documentation (longer) of thing under cursor
ctrl x (in some file manager) split screen horizontally (stack vertically)
ctrl v (in some file manager) split screen vertically (stack horizontally)
- open oil
- (in oil) go back one dir
enter go into dir
_ go back into working dir
ctrl c exit oil
ctrl p preview
` change working dir
g. toggle hidden