Skip to content

Instantly share code, notes, and snippets.

@Aneurysm9
Created June 28, 2017 21:22
Show Gist options
  • Save Aneurysm9/a3e9794cd3cd02187c45d360431c24bc to your computer and use it in GitHub Desktop.
Save Aneurysm9/a3e9794cd3cd02187c45d360431c24bc to your computer and use it in GitHub Desktop.
Basic screen-like tmux config with vim-like movements
# Set the prefix to ^A.
unbind C-b
set -g prefix ^A
bind a send-prefix
# Bind appropriate commands similar to screen.
# lockscreen ^X x
unbind ^X
bind ^X lock-server
unbind x
bind x lock-server
#set -g lock-command vlock
#set -g lock-after-time 1800
#set -g lock-server on
# screen ^C c
unbind ^C
bind ^C new-window
unbind c
bind c new-window
# detach ^D d
unbind ^D
bind ^D detach
# displays *
unbind *
bind * list-clients
# next ^@ ^N sp n
unbind ^@
bind ^@ next-window
unbind ^N
bind ^N next-window
unbind " "
bind " " next-window
unbind n
bind n next-window
# title A
unbind A
bind A command-prompt "rename-window %%"
# other ^A
unbind ^A
bind ^A last-window
# prev ^H ^P p ^?
unbind ^H
bind ^H previous-window
unbind ^P
bind ^P previous-window
unbind p
bind p previous-window
unbind BSpace
bind BSpace previous-window
# windows ^W w
unbind ^W
bind ^W list-windows
unbind w
bind w list-windows
# quit \
unbind \
bind \ confirm-before "kill-server"
# kill K k
unbind K
bind K confirm-before "kill-window"
# redisplay ^L l
unbind ^L
bind ^L refresh-client
# More straight forward key bindings for splitting
unbind %
bind | split-window -h
bind v split-window -h
unbind '"'
bind - split-window -v
bind / command-prompt "split-window 'exec %%'"
bind S command-prompt "new-window -n %1 'ssh %1'"
# History
set -g history-limit 4096
# Terminal emulator window title
set -g set-titles on
set -g set-titles-string '#S:#I.#P #W'
# Status Bar
set -g status-bg black
set -g status-fg white
set -g status-interval 1
set -g status-left '#[fg=green,bold]#H#[default]'
set -g status-right '#[fg=yellow]#(cut -d " " -f 1-4 /proc/loadavg)#[default] #[fg=cyan,bold]%Y-%m-%d %H:%M:%S#[default]'
# Notifying if other windows has activities
setw -g monitor-activity on
set -g visual-activity off
# Highlighting the active window in status bar
setw -g window-status-current-bg blue
# Clock
setw -g clock-mode-colour green
setw -g clock-mode-style 24
set-option -g mouse on
# " windowlist -b
unbind '"'
bind '"' choose-window
# act like vim
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
setw -g display-panes-time 2000
bind ^s display-panes \; command-prompt "swap-pane -s %1"
set -g detach-on-destroy off
setw -g alternate-screen off
bind M-l next-layout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment