Files
tmuxconfig/tmux.conf.symlink
2017-10-27 14:08:38 +01:00

213 lines
6.3 KiB
Plaintext

# ==================================
# Solarized color settings
# ==================================
#### COLOUR (Solarized dark)
#
# default statusbar colors
# set-option -g status-bg black #base02
# set-option -g status-fg yellow #yellow
# set-option -g status-attr default
# default window title colors
# set-window-option -g window-status-fg brightblue #base0
# set-window-option -g window-status-bg default
#set-window-option -g window-status-attr dim
# active window title colors
# set-window-option -g window-status-current-fg brightred #orange
# set-window-option -g window-status-current-bg default
#set-window-option -g window-status-current-attr bright
# pane border
# set-option -g pane-border-fg black #base02
# set-option -g pane-active-border-fg brightgreen #base01
# message text
# set-option -g message-bg black #base02
# set-option -g message-fg brightred #orange
# pane number display
# set-option -g display-panes-active-colour blue #blue
# set-option -g display-panes-colour brightred #orange
# clock
# set-window-option -g clock-mode-colour green #green
# bell
# set-window-option -g window-status-bell-style fg=black,bg=red #base02, red
#### COLOUR (Solarized light)
# # default statusbar colors
# set-option -g status-bg white #base2
# set-option -g status-fg yellow #yellow
# set-option -g status-attr default
#
# # default window title colors
# set-window-option -g window-status-fg brightyellow #base00
# set-window-option -g window-status-bg default
# #set-window-option -g window-status-attr dim
#
# # active window title colors
# set-window-option -g window-status-current-fg brightred #orange
# set-window-option -g window-status-current-bg default
# #set-window-option -g window-status-current-attr bright
#
# # pane border
# set-option -g pane-border-fg white #base2
# set-option -g pane-active-border-fg brightcyan #base1
#
# # message text
# set-option -g message-bg white #base2
# set-option -g message-fg brightred #orange
#
# # pane number display
# set-option -g display-panes-active-colour blue #blue
# set-option -g display-panes-colour brightred #orange
#
# # clock
# set-window-option -g clock-mode-colour green #green
#
# # bell
# set-window-option -g window-status-bell-style fg=white,bg=red #base2, red
#
set -g default-terminal "xterm-new"
setw -g xterm-keys on
#
# set window list
setw -g window-status-fg green
setw -g window-status-bg default
setw -g window-status-attr dim
# Set status bar
set -g status-bg colour21
set -g status-fg colour06
set -g status-left '#[fg=green]#H: #[fg=colour08]#S #[fg=green]|'
set -g status-left-length 300
# set right status bar content
set -g status-right '#[fg=green] | #[fg=colour08]#(date +"%A %F %R")'
# Activity Monitoring
setw -g monitor-activity off
set -g visual-activity off
# ==================================
# General settings
# ==================================
# Only resize window if smaller screen is viewing it
setw -g aggressive-resize on
# Number windows starting at 1, not 0.
set -g base-index 1
# clock
# set-window-option -g clock-mode-colour colour64 #green
# Fix escape time problem
set -sg escape-time 0
# Set the default shell
set-option -g default-shell "/usr/local/bin/zsh"
# ==================================
# vim-navigation pluging settings
# ==================================
# Smart pane switching with awareness of vim splits
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(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"
# ==================================
# redfining tmux commands
# ==================================
# Set tmux prefix to <control-space>
unbind C-b
set -g prefix C-Space
bind-key C-Space send-prefix
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection
# Set window switching
bind -n C-b previous-window
bind -n C-n next-window
set -g default-shell $SHELL
set -g default-command "reattach-to-user-namespace -l ${SHELL}"
# Copy to system clipboard
bind-key -T copy-mode-vi 'y' send -X copy-pipe "reattach-to-user-namespace pbcopy"
# Split windows vertically with <control-space> j
bind j split-window -v
bind C-j split-window -v -c "#{pane_current_path}"
# Split windows horizontaly with <control-space> l
bind l split-window -h
bind C-l split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
bind C-c new-window -c "#{pane_current_path}"
# Clear terminal
#bind u send-keys clear
bind -n C-a send-keys C-l \; run-shell "sleep .3s" \; clear-history
# Bind Alt + hjkl keys to resize window
unbind-key M-j ; bind-key -n M-j resize-pane -D 1
unbind-key M-k ; bind-key -n M-k resize-pane -U 1
unbind-key M-h ; bind-key -n M-h resize-pane -L 1
unbind-key M-l ; bind-key -n M-l resize-pane -R 1
# Set custom save and restore tmux bindings
set -g @resurrect-save 'S'
set -g @resurrect-restore 'R'
# Kill pane without a warning
bind-key x kill-pane
set-option -g mouse on
# Start copy mode when scrolling up
bind -n WheelUpPane copy-mode
# Enable our custom option to exit copy mode when scrolling past bottom
# set-window-option -g exit-copy-paste-bottom on
# ==================================
# Resurrection settings
# ==================================
# Enable Vim ressurection
set -g @resurrect-strategy-vim 'session'
# Save session every 5 minutes
set -g @continuum-save-interval '5'
# Restore saved session on loading tmux
set -g @continuum-restore 'on'
# ==================================
# Tmux start settings
# ==================================
bind D command-prompt -p "Make/attach session:" "new-window 'tmuxstart \'%%\''"
# ==================================
# List of plugins
# ==================================
set -g @tpm_plugins ' \
tmux-plugins/tpm \
tmux-plugins/tmux-sensible \
tmux-plugins/tmux-resurrect \
nhdaly/tmux-scroll-copy-mode \
seebi/tmux-colors-solarized \
'
# ==================================
# Initializes TMUX plugin manager.
# Keep this line at the very bottom of tmux.conf.
run-shell '~/.tmux/plugins/tpm/tpm'