Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 183 lines (143 sloc) 5.2 KB
######################
### KEY BINDING ###
######################
# nvim compatibility - fix the cursor problem
set -g -a terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q'
# set prefix to Ctrl-Space
unbind C-b
set -g prefix C-Space
set -g default-terminal "rxvt-256color";
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf"
# set window split
unbind v
unbind h
unbind %
unbind '"'
bind v split-window -h -c "#{pane_current_path}"
bind h split-window -c "#{pane_current_path}"
# bind Space send-prefix
# bind Space last-window
# vim pane selection
bind -n C-h select-pane -L
bind -n C-j select-pane -D
bind -n C-k select-pane -U
bind -n C-l select-pane -R
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n C-\\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# pane movement to window
bind j command-prompt -p "join pane from:" "join-pane -s '%%'"
bind s command-prompt -p "send pane to:" "join-pane -t '%%'"
# mouse mode
set -g mouse on
bind m \
set -g mouse on \; \
display 'Mouse: ON'
bind M \
set -g mouse off \; \
display 'Mouse: OFF'
# Alt vim key to switch windows
bind -n M-j previous-window
bind -n M-k next-window
# Make a smaller delay so we can perform commands after switching windows
set -sg escape-time 0
set -sg repeat-time 600
# Window title begins by 1 and not 0
set -g base-index 1
setw -g pane-base-index 1
# window management
unbind n
unbind w
bind w new-window -c "#{pane_current_path}"
bind n command-prompt "rename-window '%%'"
# panes
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
# Scrollback lines
set -g history-limit 100000
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on
#vim key mode
set-window-option -g mode-keys vi
bind -Tcopy-mode-vi 'v' send -X begin-selection
# copy selected selection with y - if using the mouse `y` need to be used before releasing the mouse button
bind -Tcopy-mode-vi 'y' send -X copy-selection
# Copy tmux copy to clipboard (need xsel - possible to use xclip as well)
unbind -T copy-mode-vi Space; #Default for begin-selection
unbind -T copy-mode-vi Enter; #Default for copy-selection
unbind ]
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xsel --clipboard"
##############
### DESIGN ###
##############
# panes
set -g pane-border-style fg=black
set -g pane-active-border-style fg=red
## Status bar design
# status line
set -g status-justify left
#set -g status-bg default
set -g status-style fg=blue
set -g status-interval 2
# messaging
set -g message-command-style fg=blue,bg=black
# window mode
setw -g mode-style bg=green,fg=black
# window status
setw -g window-status-format " #F#I:#W#F "
setw -g window-status-current-format " #F#I:#W#F "
setw -g window-status-format "#[fg=magenta]#[bg=black] #I #[bg=cyan]#[fg=white] #W "
setw -g window-status-current-format "#[bg=brightmagenta]#[fg=white] #I #[fg=white]#[bg=cyan] #W "
setw -g window-status-current-style bg=black,fg=yellow,dim
setw -g window-status-style bg=green,fg=black,reverse
# loud or quiet?
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
set-window-option -g monitor-activity off
set -g bell-action none
# The modes
set-window-option -g clock-mode-colour red
set-window-option -g mode-style fg=red,bg=white,bold
# The panes
set -g pane-border-style bg=black,fg=black
set -g pane-active-border-style fg=blue,bg=black
# The statusbar
set -g status-position bottom
set -g status-style bg=black,fg=yellow,dim
set -g status-left ''
set -g status-right '#{?client_prefix,#[fg=red]prefix pressed ..,#[fg=brightwhite]#H}'
set -g status-right-length 50
set -g status-left-length 20
# The window
set-window-option -g window-status-current-style fg=red,bg=white,bold
set-window-option -g window-status-current-format ' #I#[fg=brightwhite]:#[fg=brightwhite]#W#[fg=blue]#F '
set-window-option -g window-status-style fg=magenta,bg=black,none
set-window-option -g window-status-format ' #I#[fg=colour251]:#[fg=colour251]#W#[fg=black]#F '
set-window-option -g window-status-bell-style fg=white,bg=red,bold
# The messages
set -g message-style fg=white,bg=red,bold
###############
### PLUGINS ###
###############
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'laktak/extrakto'
# set -g @plugin 'wfxr/tmux-fzf-url'
# set -g @plugin 'tmux-plugins/tmux-yank'
# unbind u
# set -g @fzf-url-bind 'u'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'
You can’t perform that action at this time.