Skip to content

Instantly share code, notes, and snippets.

@dpo
Last active April 20, 2020 20:51
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 dpo/cdfe307b46cb318d6382936a4e55ad4e to your computer and use it in GitHub Desktop.
Save dpo/cdfe307b46cb318d6382936a4e55ad4e to your computer and use it in GitHub Desktop.
set -g prefix Home
unbind C-b
bind-key Home send-prefix # Caps-Lock is remapped to Home
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# tmux-resurrect and tmux-continuum to save the state across system restarts
# prefix-Ctrl-s to save the state
# prefix-Ctrl-r to restore the state
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# tmux-yank: Copy to the system clipboard in tmux
# begin copying with Leader + ] V, end with ENTER
set -g @plugin 'tmux-plugins/tmux-yank'
# tmux-cpu: Enables displaying CPU and GPU information in Tmux status-right and status-left
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g status-right '#{cpu_bg_color} CPU: #{cpu_icon} #{cpu_percentage} | %a %h-%d %H:%M '
# local customizations
set -g mouse off
set -g base-index 1 # number windows starting from 1 instead of 0
setw -g pane-base-index 1 # number panes starting from 1 instead of 0
bind-key M split-window -h "vim ~/.tmux.conf"
bind r source-file ~/.tmux.conf \; display "Reloaded!" # reload this config file with prefix-r
bind | split-window -h # more intuitive characters to split a window into panes
bind - split-window -v
setw -g mode-keys vi
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
unbind n
bind < previous-window # use prefix-< and prefix-> to cycle through windows
bind > next-window
# enable true colors so tmux and terminal colors match
# https://github.com/tmux/tmux/issues/1246#issuecomment-493454336
set -g default-terminal "xterm-256color"
set -ga terminal-overrides ",*256col*:Tc"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
run -b '~/.tmux/plugins/tpm/tpm'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment