Skip to content

Instantly share code, notes, and snippets.

@bfagundez
Created March 21, 2018 03:18
Show Gist options
  • Save bfagundez/5441c520f17fa4f9e1c3625dac0fd1fb to your computer and use it in GitHub Desktop.
Save bfagundez/5441c520f17fa4f9e1c3625dac0fd1fb to your computer and use it in GitHub Desktop.
Tmux conf with powerline
source /Users/<username>/Library/Python/2.7/lib/python/site-packages/powerline/bindings/tmux/powerline.conf
set -g default-terminal "screen-256color"
set -g history-limit 15000
set -sg escape-time 1
setw -g monitor-activity on
set -g visual-activity on
set -g renumber-windows on
set-window-option -g automatic-rename off
set -g base-index 1
set-window-option -g mode-keys vi
bind r source ~/.tmux.conf \; display '~/.tmux.conf sourced'
set -g set-titles-string '#h ❐ #S ● #I #W'
set-option -g status-justify left
set-option -g message-attr none
set-option -g message-bg white
set-option -g message-fg black
set-window-option -g window-status-bell-attr bright
set-window-option -g window-status-activity-bg red
set-window-option -g window-status-activity-attr bright
#set-option -g status-justify
set-option -g status-interval 5
set-option -g status-right-length 80
set-option -g status-left-length 20
#set-option -g status-left '#[fg=magenta] #[fg=white,bold]#T#[default]'
#set-option -g status-right "#[fg=green,bg=default,bright]#(tmux-mem-cpu-load) | #[fg=white,bg=default]%a%l:%M:%S %p#[default] #[fg=white]%Y-%m-%d"
#set-window-option -g window-status-current-bg colour75 #light blue
set-option -g status-interval 1
# resize panes like vim
bind-key -r h resize-pane -L 5
bind-key -r k resize-pane -R 5
bind-key -r u resize-pane -U 2
bind-key -r m resize-pane -D 2
# move around panes like vim
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind v split-window -v
bind b split-window -h
# set a good prefix
unbind C-b
set-option -g prefix `
bind-key ` send-prefix
set-option -g mouse on
# -- copy mode -----------------------------------------------------------------
bind Enter copy-mode # enter copy mode
run -b 'tmux bind -t vi-copy v begin-selection 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi v send -X begin-selection 2> /dev/null || true'
run -b 'tmux bind -t vi-copy C-v rectangle-toggle 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi C-v send -X rectangle-toggle 2> /dev/null || true'
run -b 'tmux bind -t vi-copy y copy-selection 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi y send -X copy-selection-and-cancel 2> /dev/null || true'
run -b 'tmux bind -t vi-copy Escape cancel 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi Escape send -X cancel 2> /dev/null || true'
run -b 'tmux bind -t vi-copy H start-of-line 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi L send -X end-of-line 2> /dev/null || true'
# copy to Mac OSX clipboard
if -b 'command -v reattach-to-user-namespace > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | reattach-to-user-namespace pbcopy"'
# copy to X11 clipboard
if -b 'command -v xsel > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xsel -i -b"'
if -b '! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xclip -i -selection clipboard >/dev/null 2>&1"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment