blob: a6c0317df0d5097176798ad7433c91b35eee689c (
plain) (
tree)
|
|
# unbind some default keybindings
unbind C-b
# command sequence for nested tmux sessions
bind-key a send-prefix
# set prefix key to ctrl-a
set -g prefix C-a
# lower command delay
set -sg escape-time 1
# force tmux to use xterm
#set -g default-terminal "xterm-256color"
#set -g default-terminal "tmux-256color"
set -g default-terminal "screen-256color"
# set from advice in neovim :checkhealth
set-option -sa terminal-overrides ',screen-256color:RGB'
# start first window and pane at 1, not zero
set -g base-index 1
set -g pane-base-index 1
# bind r to reloading the config file
bind r source-file ~/.tmux.conf \; display "Reloaded tmux config file."
# pass through a ctrl-a if you press it twice
bind C-a send-prefix
# better mnemonics for splitting panes!
bind | split-window -h
bind - split-window -v
# vim / xmonad style bindings for pane movement
bind -r h select-pane -L
bind -r j select-pane -D
bind -r k select-pane -U
bind -r l select-pane -R
# vim / xmonad style bindings for window movement
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
# shift-movement keys will resize panes
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# disable mouse support (at least while we're learning)
# setw -g mode-mouse off
# set -g mouse-select-pane off
# set -g mouse-resize-pane off
# set -g mouse-select-window off
#
# copy and paste
unbind p
bind p paste-buffer
#bind -t vi-copy 'v' begin-selection
#bind -t vi-copy 'y' copy-selection
# fiddle with colors of status bar
#set -g status-position bottom
#set -g status-style "bg=colour1"
#set -g status-style "fg=colour137"
##set -g status-fg colour137
##set -g status-attr dim
##set -g status-left ''
#set -g status-left-length 30
#set -g status-right '#[fg=colour233,bg=colour241,bold] %d/%m #[fg=colour233,bg=colour245,bold] %H:%M:%S '
##set -g status-right-length 5
##set -g status-left-length 20
##
##setw -g window-status-current-style "fg=colour81"
##setw -g window-status-current-bg colour238
##setw -g window-status-current-style bold
#setw -g window-status-current-format ' #[bg=colour237]#I#[fg=colour250]:#[fg=colour255]#[bg=colour237]#W#[fg=colour50]#F '
##
#setw -g window-status-style "fg=colour61"
#setw -g window-status-style "bg=colour235"
#setw -g window-status-attr none
#setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '
#
#setw -g window-status-bell-attr bold
#setw -g window-status-bell-fg colour255
#setw -g window-status-bell-bg colour1
##
## fuck with border colours
#set -g pane-border-fg yellow
#set -g pane-active-border-fg red
#
#
## fiddle with colors of inactive windows
#setw -g window-status-fg cyan
# vim mode keys
setw -g mode-keys vi
#
## 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-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
#bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
#bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
#bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
#tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
#if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
# "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
#if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
# "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
#
#bind-key -T copy-mode-vi 'C-h' select-pane -L
#bind-key -T copy-mode-vi 'C-j' select-pane -D
#bind-key -T copy-mode-vi 'C-k' select-pane -U
#bind-key -T copy-mode-vi 'C-l' select-pane -R
#bind-key -T copy-mode-vi 'C-\' select-pane -l
#
#
# try different, vimlike copy-mode
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
#bind-key -t vi-copy 'v' begin-selection
#bind-key -t vi-copy 'y' copy-selection
# this is supposed to grab powerline for tmux but it disnae work
#run-shell "powerline-daemon -q"
#source "/usr/local/lib/python2.7/dist-packages/powerline/bindings/tmux/powerline.conf"
#List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-yank'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'
set -g @resurrect-save 'Q'
set -g @resurrect-restore 'R'
# gcalcli config
#
set-option -g status-interval 60
run-shell ~/.tmux-resurrect/resurrect.tmux
#set-option -g status-left "#[fg=blue,bright]#(gcalcli agenda | head -2 | tail -1)#[default]"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
|