aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJinwei Zhao <[email protected]>2016-11-14 21:11:00 +0800
committerJinwei Zhao <[email protected]>2016-11-14 21:11:00 +0800
commitd24c59b03dde30af2a302db2672fa034fa27baf5 (patch)
treed30ca72ab5157a52c3fd9da9cca4f1e503115b58
parentdce28d41d5a8b8d907c1fe198df7b7e2838498d1 (diff)
downloadconf.d-d24c59b03dde30af2a302db2672fa034fa27baf5.tar.gz
add .tmux.conf
-rw-r--r--tmux/.tmux.conf117
1 files changed, 117 insertions, 0 deletions
diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf
new file mode 100644
index 0000000..a22586d
--- /dev/null
+++ b/tmux/.tmux.conf
@@ -0,0 +1,117 @@
1# Install tpm
2# git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
3
4# List of plugins
5# Prefix + I to install plugins
6set -g @plugin 'tmux-plugins/tpm'
7set -g @plugin 'tmux-plugins/tmux-sensible'
8
9# Save session to disk
10# Prefix + Ctrl-s to save
11# Prefix + Ctrl-r to restore
12set -g @plugin 'tmux-plugins/tmux-resurrect'
13
14
15# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
16run '~/.tmux/plugins/tpm/tpm'
17
18
19# use C-a, since it's on the home row and easier to hit than C-b
20set-option -g prefix C-a
21unbind-key C-a
22bind-key C-a send-prefix
23set -g base-index 1
24
25# Default Shell
26set -g default-command /bin/zsh
27set-option -g default-terminal screen-256color
28
29# Easy config reloa
30bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
31
32# vi is good
33setw -g mode-keys vi
34
35bind-key : command-prompt
36bind-key r refresh-client
37bind-key L clear-history
38
39bind-key space next-window
40bind-key bspace previous-window
41bind-key enter next-layout
42
43# use vim-like keys for splits and windows
44bind-key v split-window -h -c "#{pane_current_path}"
45bind-key s split-window -v -c "#{pane_current_path}"
46bind-key h select-pane -L
47bind-key j select-pane -D
48bind-key k select-pane -U
49bind-key l select-pane -R
50
51# uncomment below stanza to enable smart pane switching with awareness of vim splits
52# bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-h) || tmux select-pane -L"
53# bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-j) || tmux select-pane -D"
54# bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-k) || tmux select-pane -U"
55# bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-l) || tmux select-pane -R"
56# bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys 'C-\\') || tmux select-pane -l"
57# bind C-l send-keys 'C-l'
58
59bind-key C-o rotate-window
60
61bind-key + select-layout main-horizontal
62bind-key = select-layout main-vertical
63set-window-option -g other-pane-height 25
64set-window-option -g other-pane-width 80
65
66bind-key a last-pane
67bind-key q display-panes
68bind-key c new-window
69bind-key t next-window
70bind-key T previous-window
71
72bind-key [ copy-mode
73bind-key ] paste-buffer
74
75# Setup 'v' to begin selection as in Vim
76bind-key -t vi-copy v begin-selection
77bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
78
79# Update default binding of `Enter` to also use copy-pipe
80unbind -t vi-copy Enter
81bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
82
83set-window-option -g display-panes-time 1500
84
85# Status Bar
86set-option -g status-interval 1
87set-option -g status-left ''
88set-option -g status-right '%l:%M%p'
89set-window-option -g window-status-current-fg magenta
90set-option -g status-fg default
91
92# Status Bar solarized-dark (default)
93set-option -g status-bg black
94set-option -g pane-active-border-fg black
95set-option -g pane-border-fg black
96
97# Status Bar solarized-light
98if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g status-bg white"
99if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g pane-active-border-fg white"
100if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g pane-border-fg white"
101
102# Set window notifications
103setw -g monitor-activity on
104set -g visual-activity on
105
106# Allow the arrow key to be used immediately after changing windows
107set-option -g repeat-time 0
108
109# Fix to allow mousewheel/trackpad scrolling in tmux 2.1
110#bind-key -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
111#bind-key -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
112
113# Disable assume-paste-time, so that iTerm2's "Send Hex Codes" feature works
114# with tmux 2.1. This is backwards-compatible with earlier versions of tmux,
115# AFAICT.
116set-option -g assume-paste-time 0
117
Powered by cgit v1.2.3 (git 2.41.0)