diff options
author | Andrew Cady <d@jerkface.net> | 2015-10-04 05:11:36 +0200 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2015-10-04 05:19:40 +0200 |
commit | 0c0e816bd417f98a1d1027dc41ce66a8572555c7 (patch) | |
tree | 6e3a8d763e269649bd14a91347104f48f60a16c7 /dot/tmux.stage2.conf | |
parent | c4ccc221b42a3369c851f9b933bdd0f111c187e8 (diff) |
improved tmux config
Diffstat (limited to 'dot/tmux.stage2.conf')
-rw-r--r-- | dot/tmux.stage2.conf | 157 |
1 files changed, 157 insertions, 0 deletions
diff --git a/dot/tmux.stage2.conf b/dot/tmux.stage2.conf new file mode 100644 index 0000000..915b203 --- /dev/null +++ b/dot/tmux.stage2.conf | |||
@@ -0,0 +1,157 @@ | |||
1 | # use UTF8 | ||
2 | set -g utf8 | ||
3 | set-window-option -g utf8 on | ||
4 | |||
5 | # make tmux display things in 256 colors | ||
6 | #set -g default-terminal "screen-256color" | ||
7 | |||
8 | unbind C-b | ||
9 | set -g prefix C-z | ||
10 | bind z send-prefix | ||
11 | |||
12 | # redundantly bind some frequent commands so that the Control key does not have to be released | ||
13 | bind-key C-n next-window | ||
14 | bind-key C-p previous-window | ||
15 | bind-key C-z last-window | ||
16 | bind-key C-c new-window | ||
17 | |||
18 | # Use vi-like keys to do selection and copying. Ctrl-A Escape starts copy mode, | ||
19 | # 'v' starts text selection and 'y' copies (yanks). | ||
20 | bind-key Escape copy-mode | ||
21 | bind-key [ copy-mode | ||
22 | bind-key C-[ copy-mode | ||
23 | bind-key -t vi-copy v begin-selection | ||
24 | bind-key -t vi-copy y copy-selection | ||
25 | bind-key -t vi-copy Enter copy-selection | ||
26 | #bind-key C-y run "tmux save-buffer - | xclip -i -selection clipboard" | ||
27 | #bind-key C-p run "tmux set-buffer \"$(xclip -o -selection clipboard)\"; tmux paste-buffer" | ||
28 | |||
29 | # TODO: get more from https://github.com/aaronbieber/dotfiles/blob/master/configs/tmux.conf | ||
30 | |||
31 | # shorten command delay | ||
32 | set -sg escape-time 1 | ||
33 | |||
34 | # set window and pane index to 1 (0 by default) | ||
35 | set-option -g base-index 1 | ||
36 | setw -g pane-base-index 1 | ||
37 | |||
38 | # use PREFIX | to split window horizontally and PREFIX - to split vertically | ||
39 | bind | split-window -h | ||
40 | bind - split-window -v | ||
41 | |||
42 | # map Vi movement keys as pane movement keys | ||
43 | bind h select-pane -L | ||
44 | bind j select-pane -D | ||
45 | bind k select-pane -U | ||
46 | bind l select-pane -R | ||
47 | |||
48 | # and use C-h and C-l to cycle thru panes | ||
49 | bind -r C-h select-window -t :- | ||
50 | bind -r C-l select-window -t :+ | ||
51 | |||
52 | # resize panes using PREFIX H, J, K, L | ||
53 | bind H resize-pane -L 5 | ||
54 | bind J resize-pane -D 5 | ||
55 | bind K resize-pane -U 5 | ||
56 | bind L resize-pane -R 5 | ||
57 | |||
58 | # C-i for even-vertical arrangement and C-o to zoom current pane | ||
59 | #bind-key C-i select-layout even-vertical | ||
60 | #bind-key C-v select-layout even-horizontal | ||
61 | #bind-key C-o resize-pane -y 1000 | ||
62 | |||
63 | # Sync panes | ||
64 | #bind C-s set-window-option synchronize-panes | ||
65 | |||
66 | # explicitly disable mouse control | ||
67 | #setw -g mode-mouse off | ||
68 | #set -g mouse-select-pane off | ||
69 | #set -g mouse-resize-pane off | ||
70 | #set -g mouse-select-window off | ||
71 | |||
72 | # --------------------- | ||
73 | # Copy & Paste | ||
74 | # --------------------- | ||
75 | # provide access to the clipboard for pbpaste, pbcopy | ||
76 | #set-option -g default-command "reattach-to-user-namespace -l zsh" | ||
77 | #set-window-option -g automatic-rename on | ||
78 | |||
79 | # use vim keybindings in copy mode | ||
80 | setw -g mode-keys vi | ||
81 | |||
82 | # setup 'v' to begin selection as in Vim | ||
83 | #bind-key -t vi-copy v begin-selection | ||
84 | #bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" | ||
85 | |||
86 | # update default binding of 'Enter' to also use copy-pipe | ||
87 | #unbind -t vi-copy Enter | ||
88 | #bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy" | ||
89 | |||
90 | #bind y run 'tmux save-buffer - | reattach-to-user-namespace pbcopy ' | ||
91 | #bind C-y run 'tmux save-buffer - | reattach-to-user-namespace pbcopy ' | ||
92 | |||
93 | # Save entire tmux history to a file - file will be on machine where tmux is | ||
94 | # running | ||
95 | #bind-key * command-prompt -p 'save history to filename:' -I '~/tmux.history' 'capture-pane -S -32768 ; save-buffer %1 ; delete-buffer' | ||
96 | |||
97 | # ----------------------- | ||
98 | # Multistart panes | ||
99 | # ---------------------- | ||
100 | #bind-key P run-shell 'tmux-multistart as' | ||
101 | #bind-key A run-shell 'tmux-multistart alpha' | ||
102 | #bind-key B run-shell 'tmux-multistart beta' | ||
103 | #bind-key W run-shell 'tmux-multistart web' | ||
104 | #bind-key D run-shell 'tmux-multistart dev' | ||
105 | #bind-key T run-shell 'tmux-multistart txhub' | ||
106 | |||
107 | #bind-key C command-prompt -p "machine(s)/group: " "run-shell 'tmux-multistart %1'" | ||
108 | |||
109 | # ---------------------- | ||
110 | # set some pretty colors | ||
111 | # ---------------------- | ||
112 | # set pane colors - hilight the active pane | ||
113 | #set-option -g pane-border-fg colour235 #base02 | ||
114 | #set-option -g pane-active-border-fg colour33 #blue | ||
115 | #set-option -g pane-active-border-fg colour240 #base01 | ||
116 | |||
117 | # colorize messages in the command line | ||
118 | #set-option -g message-bg black #base02 | ||
119 | #set-option -g message-fg brightred #orange | ||
120 | |||
121 | # ---------------------- | ||
122 | # Status Bar | ||
123 | # ----------------------- | ||
124 | #set-option -g status on # turn the status bar on | ||
125 | #set -g status-utf8 on # set utf-8 for the status bar | ||
126 | #set -g status-interval 5 # set update frequencey (default 15 seconds) | ||
127 | #set -g status-justify centre # center window list for clarity | ||
128 | # set-option -g status-position top # position the status bar at top of screen | ||
129 | |||
130 | # visual notification of activity in other windows | ||
131 | #setw -g monitor-activity on | ||
132 | #set -g visual-activity on | ||
133 | |||
134 | # set color for status bar | ||
135 | #set-option -g status-bg colour235 #base02 | ||
136 | #set-option -g status-fg yellow #yellow | ||
137 | #set-option -g status-attr dim | ||
138 | |||
139 | # set window list colors - red for active and cyan for inactive | ||
140 | #set-window-option -g window-status-fg brightblue #base0 | ||
141 | #set-window-option -g window-status-bg colour236 | ||
142 | #set-window-option -g window-status-attr dim | ||
143 | |||
144 | #set-window-option -g window-status-current-fg brightred #orange | ||
145 | #set-window-option -g window-status-current-bg colour236 | ||
146 | #set-window-option -g window-status-current-attr bright | ||
147 | |||
148 | # show host name and IP address on left side of status bar | ||
149 | #set -g status-left-length 85 | ||
150 | #set -g status-left "#[fg=green]: #h : #[fg=brightblue]#(dig +short myip.opendns.com @resolver1.opendns.com) #[fg=yellow]#(ifconfig en0 | grep 'inet ' | awk '{print \"en0 \" $2}') #(ifconfig en1 | grep 'inet ' | awk '{print \"en1 \" $2}') #(ifconfig en3 | grep 'inet ' | awk '{print \"en3 \" $2}') #[fg=red]#(ifconfig tun0 | grep 'inet ' | awk '{print \"vpn \" $2}') #[fg=green]#(/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | awk -F': ' '/ SSID/{print $2}') " | ||
151 | |||
152 | # show session name, window & pane number, date and time on right side of | ||
153 | # status bar | ||
154 | #set -g status-right-length 60 | ||
155 | #set -g status-right "#[fg=blue]#S #I:#P #[fg=yellow]: %d %b %Y #[fg=green]: %l:%M %p : #(date -u | awk '{print $4}') :" | ||
156 | |||
157 | |||