-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
107 lines (88 loc) · 3.2 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
##################################################
#
# Tmux configuration.
#
##################################################
# Set Prefix to Ctrl + s
##################################################
# unbind C-p
# set -g prefix C-p
# New window in current working directory.
##################################################
unbind-key c
bind-key c new-window -ac "#{pane_current_path}"
# Start at 1 instead of 0
##################################################
set -g base-index 1
set -g pane-base-index 1
# Enabling the mouse.
##################################################
set -g mouse on
# # tmux 2
# if-shell "[[ `tmux -V` == *2 ]]" 'set -g mouse on'
# # tmux 1.9
# if-shell "[[ `tmux -V` == *1.9 ]]" 'set -g mode-mouse on'
# if-shell "[[ `tmux -V` == *1.9 ]]" 'set -g mouse-resize-pane on'
# if-shell "[[ `tmux -V` == *1.9 ]]" 'set -g mouse-select-pane on'
# set -g mode-mouse on
# set -g mouse-resize-pane on
# set -g mouse-select-pane on
# Refresh client
##################################################
unbind R
bind-key R refresh-client
# COPY-MODE
##################################################
unbind [
bind Escape copy-mode
# Paste
##################################################
unbind p
bind p paste-buffer
# Vim keys
##################################################
set-window-option -g mode-keys vi
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-selection
unbind r
bind r source-file ~/.tmux.conf \; display "Config reloaded..."
# Move window up or down in list.
##################################################
unbind C-Up
unbind C-Down
bind-key -n C-Up swap-window -t -1
bind-key -n C-Down swap-window -t +1
# Prevent the space bar from changing the layout.
##################################################
# unbind Space
# Plugins
#
# Press "prefix + I" to Install plugins
##################################################
set -g @plugin 'tmux-plugins/tpm' # Tmux Plugin Manager
set -g @plugin 'tmux-plugins/tmux-sensible'
# set -g @plugin 'tmux-plugins/vim-tmux-focus-events'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-urlview'
# set -g @plugin 'christoomey/vim-tmux-navigator'
# Since the plugin christoomey/vim-tmux-navigator is broken and slow we have to
# do it manualy here in the config
is_vim="#{m/ri:(^|\/)g?(view|n?vim?)(diff)?$,#{pane_current_command}}"
bind -n C-h if -F "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if -F "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if -F "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if -F "$is_vim" "send-keys C-l" "select-pane -R"
# Append pane history to file
#
# default file is ~/tmp/tmux.history.txt
##################################################
bind-key P command-prompt -p 'Append history to:' -I '~/tmp/tmux.history.txt' 'capture-pane -S -32768 ; save-buffer %1 ; delete-buffer'
# Fixed backspace producing sapce on Mac
set -g default-terminal "xterm-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
# Initialize TMUX plugin manager
#
# (keep this line at the very bottom of tmux.conf)
##################################################
run -b '~/.tmux/plugins/tpm/tpm'