CheatSheet

Tmux

Start

$ tmux //start new session
$ tmux ls //list sessions
$ tmux a //attach
$ tmux a -t sessionName //attach to a target

Sessions

  • C-b :new [enter] new session
  • C-b s list sessions
  • C-b $ rename session
  • C-b d detach

Windows

  • C-b C-n new window
  • C-b w list windows
  • C-b , rename window

Panes

  • C-b % horizontal split
  • C-b " vertical split
  • C-b o swap panes
  • C-b q show pane numbers
  • C-b x kill pane
  • C-b [space] toggle between layouts
  • C-b hold[option] [arrow key] resize panes

Misc.

  • C-b [ enter copy mode (scrolling history)
  • Increase history buffer size
# ~/.tmux.conf
set -g history-limit 8000
set -g default-terminal "xterm-256color"

Screen

  • Frequently Used


Vim

Substitution

  • In visual mode
    1. Mark the range
    2. Type :s/foo/bar/g
  • Whole document
    :%s/foo/bar/g