-
Notifications
You must be signed in to change notification settings - Fork 5
/
tmux.conf
executable file
·115 lines (89 loc) · 4.08 KB
/
tmux.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
###############################################################################
# basic config
# use control-a prefix like screen
unbind-key C-b
bind-key C-a send-prefix
set -g prefix C-a
# ensure 256 color compatibility
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
# ensure utf-8 compatibility - uncomment on older tmux if issues
# set -g status-utf8 on
# set -g utf8 on
# DONT SLOW DOWN ESCAPE KEY GOD DAMN IT
set -sg escape-time 0
###############################################################################
# extended vim keybindings
# original Daniel Thau. Pblic domain.
# Requires tmux 1.3
# split windows like vim
# vim's definition of a horizontal/vertical split is reversed from tmux's
bind s split-window -v -c '#{pane_current_path}'
bind v split-window -h -c '#{pane_current_path}'
bind c new-window -c '#{pane_current_path}'
# move around panes with hjkl, as one would in vim after pressing ctrl-w
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# resize panes like vim
# feel free to change the "1" to however many lines you want to resize by, only
# one at a time can be slow
bind < resize-pane -L 1
bind > resize-pane -R 1
bind - resize-pane -D 1
bind = resize-pane -U 1
# bind : to command-prompt like vim
# this is the default in tmux already
bind : command-prompt
# vi-style controls for copy mode
setw -g mode-keys vi
set -g status-keys vi
# in order to use `pbcopy` and `pbpaste` on OS X, we need to run reattach-to-user-namespeace
# but on other systems the bare shell is fine
set -g default-command "if which reattach-to-user-namespace >/dev/null 2>&1; then reattach-to-user-namespace -l $SHELL; else $SHELL; fi"
set -g xterm-keys on
# Alt + h,l to switch to prev/next windows
bind-key -n M-h previous-window
bind-key -n M-l next-window
# Alt-Sift + h,l to move windows left/right
bind-key -n M-H swap-window -t -1
bind-key -n M-L swap-window -t +1
# save history
bind-key P command-prompt -p 'save history to filename:' -I '~/tmux.history' 'capture-pane -S -32768 ; save-buffer %1 ; delete-buffer'
###############################################################################
# vim-tmux-navigator integration.
# Smart pane switching with awareness of vim splits. Hella tight.
# https://github.com/christoomey/vim-tmux-navigator
run ~/.dotfiles/config/nvim/plug/vim-tmux-navigator/vim-tmux-navigator.tmux
#is_vim_or_emacs='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$|emacs.*$"'
#bind -n C-h if-shell "$is_vim_or_emacs" "send-keys C-h" "select-pane -L"
#bind -n C-j if-shell "$is_vim_or_emacs" "send-keys C-j" select-pane -D"
#bind -n C-k if-shell "$is_vim_or_emacs" "send-keys C-k" "select-pane -U"
#bind -n C-l if-shell "$is_vim_or_emacs" "send-keys C-l" "select-pane -R"
#bind -n C-\ if-shell "$is_vim_or_emacs" "send-keys C-\\" "select-pane -l"
##############################################################################
# Theme
#source-file ~/.dotfiles/tmux/themes/basic.conf
#source-file ~/.dotfiles/tmux/themes/dothebarbwa.conf
# Status bar
set -g status-style bg=colour19
set -g status-left ''
set -g status-right '#[fg=colour18,bg=colour21,bold] %Y-%m-%d %l:%M %p '
# Active window tab
setw -g window-status-current-style bg=colour4,fg=colour18,bold
setw -g window-status-current-format ' #T #W '
# Inactive window tab
setw -g window-status-style bg=colour21,fg=colour18,bold
setw -g window-status-format ' #T #W '
# Pane borders
set -g pane-border-style bg=colour18,fg=colour19,
set -g pane-active-border-style bg=colour19,fg=colour19
# Use a lighter background color for inactive panes.
if-shell "tmux -V | grep -qiE '2\.[1-9]\d*|[3-9]\d*\.\d+'" 'set -g window-style fg=colour21,bg=colour18'
if-shell "tmux -V | grep -qiE '2\.[1-9]\d*|[3-9]\d*\.\d+'" 'set -g window-active-style fg=colour7,bg=colour0'
# Pane titles
if-shell "tmux -V | grep -qiE '2\.[1-9]\d*|[3-9]\d*\.\d+'" 'set -g pane-border-format "#[fg=colour18,bg=colour21] #{pane_title} #{pane_current_command} "'
if-shell "tmux -V | grep -qiE '2\.[1-9]\d*|[3-9]\d*\.\d+'" 'set -g pane-border-status top'
# set -g mouse-utf8 on
set -g mouse on