-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
93 lines (67 loc) · 2.68 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
# Set the shell to fish
#set-option -g default-shell "/bin/fish"
# Custom terminal titles
set-option -g set-titles on
set-option -g set-titles-string '[#S:#I #H] #W'
set-window-option -g xterm-keys
# Fix clipboard on Macs
#set-option -g default-command "reattach-to-user-namespace -l zsh"
# Set the base index for windows to 1 instead of 0
set -g base-index 1
# Set the base index for panes to 1 instead of 1
setw -g pane-base-index 1
# Enable 256 color terminal
set -g default-terminal "screen-256color"
# Enable mouse support (works in iTerm)
setw -g mode-mouse on
set -g mouse-select-pane off
set -g mouse-resize-pane off
set -g mouse-select-window off
# scrollback buffer size increase
set -g history-limit 500000
# Allows for faster key repetition
set -s escape-time 1
# Vim like {{{
# Act like Vim
setw -g mode-keys vi
# Vim cursor
set-option -g terminal-overrides '*88col*:colors=88,*256col*:colors=256,xterm*:XT:Ms=\E]52;%p1%s;%p2%s\007:Cc=\E]12;%p1%s\007:Cr=\E]112\007:Cs=\E]50;CursorShape=%?%p1%{3}%<%t%{0}%e%p1%{2}%-%;%d\007'
# }}}
# Keybindings {{{
# Use prefix v to paste the tmux buffer
bind v paste-buffer
# Set the prefix keybinding
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# Use easy to remember keybindings to split windows
unbind %
bind | split-window -h
bind - split-window -v
# Reload the file with Prefix r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Smart pane switching with awareness of vim splits
# https://github.com/christoomey/vim-tmux-navigator#tmux-configuration
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys 'C-\\') || tmux select-pane -l""')"
# }}}
# Statusline {{{
if-shell "test -f ~/.tmux/tmuxline.sh" "source ~/.tmux/tmuxline.sh"
# }}}
# Colors {{{
# Color status bar
set -g status-bg colour234
set -g status-fg white
# Highlight current window
set-window-option -g window-status-current-fg black
set-window-option -g window-status-current-bg green
# Set color of active pane
set -g pane-border-fg colour235
set -g pane-border-bg black
set -g pane-active-border-fg green
set -g pane-active-border-bg black
# }}}
# vim:tw=79:et:fmr={{{,}}}