-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_tmux.conf
84 lines (66 loc) · 1.99 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
# set prefix key to ctrl-a
unbind C-b
set -g prefix C-a
# toggle last window like screen
# bind-key C-a last-window
# count windows and panes from index 1 rather than 0
set -g base-index 1
setw -g pane-base-index 1
# automatically renumber tmux windows
set -g renumber-windows on
# remove timeout for waiting a command
set -s escape-time 0
# Highlight active window
set-window-option -g window-status-current-bg red
# use vim keys
setw -g mode-keys vi
# act like vim for selecting panes
unbind-key k
unbind-key o
unbind-key l
unbind-key \;
unbind-key ';'
bind k select-pane -L
bind o select-pane -U
bind l select-pane -D
bind \; select-pane -R
bind \059 select-pane -R
bind ';' select-pane -R
# enable mouse support for scrolling and switching panes/windows
setw -g mouse on
set -g mode-mouse on
# set limit to scrolling history
set -g history-limit 20000
# prevent pasting when left clicking when terminal does not support UTF-8
set -g mouse-utf8 off
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
# fix issues for scrolling with Page Up/Down
set -ga terminal-overrides ',xterm*:smcup@:rmcup@'
# Use 256 color terminal
set -g default-terminal "screen-256color"
# enable wm window titles
set -g set-titles on
# copy-paste
bind-key [ copy-mode
bind-key ] paste-buffer -s \015
# Buffers to/from clipboard
bind C-c run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
bind C-v run "tmux set-buffer $(reattach-to-user-namespace pbpaste); tmux paste-buffer"
# new window
bind-key C-c new-window
bind-key c new-window
# title (default key in tmux is ',')
bind-key A command-prompt "rename-window %%"
# split window and fix path for tmux 1.9
unbind-key d
# horizontal split
unbind-key s
bind s split-window -v -c "#{pane_current_path}"
# vertical split
unbind-key v
bind v split-window -h -c "#{pane_current_path}"
# close pane
unbind-key w
bind w kill-pane
# reload config file
bind r source-file ~/.tmux.conf \; display "Config Reloaded!"