Skip to content

Instantly share code, notes, and snippets.

@smarteist
Last active April 11, 2024 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smarteist/bc7c8b0213870c59880051a971d13f09 to your computer and use it in GitHub Desktop.
Save smarteist/bc7c8b0213870c59880051a971d13f09 to your computer and use it in GitHub Desktop.
Starting With VIM & TMUX

VIM

Quit VIM!

:q + ENTER

Force Quit VIM!

:q! + ENTER

Write & Quite VIM

:wq + ENTER

Normal Mode

u undo

CTRL+r redo

h move one character left

j move one row down

k move one row up

l move one character right

zz center the page!

w move to beginning of next word

W move to beginning of next word after a whitespace

b move to previous beginning of word

B move to beginning of previous word before a whitespace

e move to end of word

E move to end of word before a whitespace

0 move to the beginning of the line

$ move to the end of the line

========================

yy yank line ≈ copy line

dd cut the line (yank + delete)

x cut the char (yank + delete)

p paste before

P paste after

Insert mode

Esc Exit from current mode and enter to the Normal mode.

i Enter insert mode.

I for prepend insert to the line.

a Enter append insert mode.

A for append insert to the line.

o Enter ordered new line insert mode.

O Enter ordered new line insert mode above.

Visual Mode

v Enter visual mode, this will also mark a starting selection point

V Enter visual line mode, this will make text selections by line

y To yank selection

d To cut selection


TMUX

Create Numeric Tmux Session : tmux

Create Named Tmux Session : tmux new -s <name>

Activate Tmux Shortcuts : CTRL+B

Divide Horizontally : CTRL+B + %

Divide Vertically : CTRL+B + "

Exit CLI : exit

Create Window : CTRL+B + c

Switch to window number # : CTRL+B + <#>

Rename Current Window : CTRL+B + ,

Find Window : CTRL+B + '

Detach from session: CTRL+B + d

List all bg sessions: tmux ls

Attach to session: tmux attach -t <#>

Rename session: tmux rename-session -t <target> <newname>

Kill session: tmux kill-session -t <target>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment