Skip to content

Instantly share code, notes, and snippets.

@penghou620
Last active December 19, 2015 17:18
Show Gist options
  • Save penghou620/5989710 to your computer and use it in GitHub Desktop.
Save penghou620/5989710 to your computer and use it in GitHub Desktop.
set-window-option -g mode-keys vi
# set prefix key fro C-b to C-a
set-option -g prefix C-n
#####################################
# Key Binding
# bind-key [-cnr] [-t key-table] key command [arguments]
# -n: ignore prefix key
#####################################
## split
# key \ will split a window vertically
bind-key \ split-window -h
# key - will split a window horizontally
bind-key - split-window
## panes
# key Ctrl-h will select the right pane
bind-key -n C-l select-pane -R
# key Ctrl-l will select the left pane
bind-key -n C-h select-pane -L
# key Ctrl-h will select the down pane
bind-key -n C-j select-pane -D
# key Ctrl-h will select the up pane
bind-key -n C-k select-pane -U
## Windows
# key Ctrl-h will select the last Window
bind-key ` select-window -l
# key Ctrl-h will select the right Window
bind-key l select-window -n
# key Ctrl-l will select the left Window
bind-key h select-window -p
## close a pane
# key k will kill the current pane
bind-key k kill-pane
# key k will kill other pane except the current one
bind-key K kill-pane -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment