-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
129 lines (98 loc) · 4.45 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# use C-a, since it's on the home row and easier to hit than C-b
set-option -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
set -g base-index 1
# vi is good
setw -g mode-keys vi
set-option -g default-terminal screen-256color
bind-key : command-prompt
bind-key r respawn-pane -k
bind-key L clear-history
bind-key space next-window
bind-key bspace previous-window
bind-key enter next-layout
# use vim-like keys for splits and windows
bind-key v split-window -h
bind-key s split-window -v
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
#choose from a predefine layouts
#TODO: create someway to have predefined sessions
# smart pane switching with awareness of vim splits
#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"
#bind C-l send-keys 'C-l'
bind-key C-o rotate-window
bind-key + select-layout main-horizontal
bind-key = select-layout main-vertical
#set-window-option -g other-pane-height 25
#set-window-option -g other-pane-width 80
bind-key a last-pane
bind-key q display-panes
bind-key c new-window
bind-key t next-window
bind-key T previous-window
bind-key [ copy-mode
bind-key ] paste-buffer
# Setup 'v' to begin selection as in Vim
# init mode: [
# past buffer: ]
bind-key -T copy-mode-vi v send-keys -X begin-selection
#bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
set-option -s set-clipboard on
set-window-option -g display-panes-time 1500
# Status Bar
set-option -g status-interval 1
set-option -g status-left ''
set-option -g status-right '%l:%M%p'
#if-shell "uname | grep -q Linux" "set-window-option -g window-status-current-fg magenta"
set-option -g status-fg default
# Status Bar solarized-dark (default)
set-option -g status-bg black
#if-shell "uname | grep -q Linux" "set-window-option -g window-status-current-fg magenta"
#if-shell "uname | grep -q Linux" "set-option -g pane-border-fg cyan"
# Status Bar solarized-light
if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g status-bg white"
if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g pane-active-border-fg white"
if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g pane-border-fg white"
# Set window notifications
setw -g monitor-activity on
set -g visual-activity on
# Allow the arrow key to be used immediately after changing windows
set-option -g repeat-time 0
#add in default zsh shell
set-option -g default-shell /bin/zsh
#buffer limit
set-option -g history-limit 10000
#copy and past
#bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -i -sel clip > /dev/null"
bind-key p run "xclip -o -sel clip | tmux load-buffer - ; tmux paste-buffer"
#enable xtermkeys
if-shell "uname | grep -q Linux" "set-window-option -g xterm-keys on"
#enable/disable pane sync
bind-key A set-window-option synchronize-panes\; display-message "synchronize-panes is now #{?pane_synchronized,on,off}"
# ssh setup: https://gist.github.com/martijnvermaat/8070533#gistcomment-1778689
#TODO: optional for server
#set -g update-environment -r
#setenv -g SSH_AUTH_SOCK $HOME/.ssh/ssh_auth_sock
#vim setting:
set -sg escape-time 10
set -g focus-events on
#enable tmux restore/save
#directory: .tmux/resurrect
run-shell $HOME/.dotfiles/tmux_plugs/tmux-resurrect/resurrect.tmux
## unbind the current defaults C-s and C-r
unbind-key -T prefix C-s
unbind-key -T prefix C-r
## rebind keys:
bind-key -T prefix S confirm-before -p 'Save this tmux session? (y/n)' 'run-shell ~/.dotfiles/tmux_plugs/tmux-resurrect/scripts/save.sh'
bind-key -T prefix R confirm-before -p 'Resurrect last tmux session? (y/n)' 'run-shell ~/.dotfiles/tmux_plugs/tmux-resurrect/scripts/restore.sh'
# config reload during testing
#bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."