-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux.conf
177 lines (144 loc) · 6.79 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# ~/.tmux.conf
# Informations {{{
# File : ~/.tmux.conf
# Purpose: Setup file for the terminal multiplexer called "tmux"
# Author : Reza Jelveh
# Set the command for new windows to "zsh"
set -g default-command zsh
# control cmus <http://cmus.sourceforge.net/>
# bind -n F7 run-shell 'cmus-remote --pause >/dev/null 2>&1'
# bind -n C-F10 run-shell 'cmus-remote -u >/dev/null 2>&1'
# bind -n C-F11 run-shell 'cmus-remote --prev >/dev/null 2>&1'
# bind -n C-F12 run-shell 'cmus-remote --next >/dev/null 2>&1'
bind -n C-F10 run-shell 'mpc toggle >/dev/null 2>&1'
bind -n C-F11 run-shell 'mpc prev >/dev/null 2>&1'
bind -n C-F12 run-shell 'mpc next >/dev/null 2>&1'
# vi mode
setw -g mode-keys vi
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
bind-key -T copy-mode-vi 'y' send-keys -X copy-selection
bind-key -T copy-mode-vi 'C-v' send-keys -X rectangle-toggle
# unbind C-b
# set -g prefix C-a
# bind-key -n C-a send-prefix
# "I' == current window index
# 'H' == Hostname
# 'F' == current window flag
# 'P' == current pane index
# 'S' == Session name
# 'T' == current window title
# 'W' == current window name
# '#' == a literal "#"
# Where appropriate, special character sequences may be prefixed with a
# number to specify the maximum length, in this line "#10W'.
set-window-option -g window-status-format '#I#F #10W '
setw -g window-status-current-format '#I#F #10W'
# toggle last window like screen
bind-key C-a last-window
# confirm before killing a window or the server
bind-key k confirm kill-window
bind-key K confirm kill-server
# ctrl+left/right cycles thru windows
# I rarely use this, and when I do it's by mistake
# bind -n C-left swap-window -t -1
# bind -n C-right swap-window -t +1
bind-key -n C-up next
bind-key -n C-down prev
bind-key r source-file ~/.tmux.conf
bind-key S command-prompt -p ssh: "new-window -n %1 'ssh %1'"
# sometimes needed.. maybe..
setw -g xterm-keys on
# scrollback buffer n lines
set -g history-limit 10000
# listen for activity on all windows
set -g bell-action any
# enable wm window titles
set -g set-titles on
# wm window title string (uses statusbar variables)
set -g set-titles-string '#H: #W'
# default statusbar colors
set -g status-fg cyan
set -g status-bg default
set -g status-attr default
set -g status on
set -g status-interval 4
# set -g status-utf8 on
set -g status-left-length 60
set -g status-right-length 90
set -g status-fg colour231
set -g status-bg colour234
set -g status-left-length 20
# set -g status-left '#[fg=colour16,bg=colour254,bold] #S #[fg=colour254,bg=colour234,nobold]⮀'
set -g status-left '#[fg=colour16,bg=colour254,bold] #S #[fg=colour254,bg=colour234,nobold]'
set -g status-right '#(powerline tmux right)'
set -g status-right-length 150
set -g window-status-format "#[fg=colour244,bg=colour234]#I #[fg=colour244] #[fg=colour249]#W"
# set -g window-status-current-format "#[fg=colour234,bg=colour31]⮀ #[fg=colour231,bold]#W #[fg=colour31,bg=colour234,nobold]⮀"
set -g window-status-current-format "#[fg=colour234,bg=colour31] #[fg=colour231,bold]#W #[fg=colour31,bg=colour234,nobold]"
set-option -g status-right "#(~/.dotfiles/tmux-powerline/powerline.sh right)"
# set-option -g visual-activity on
# set-window-option -g monitor-activity on
set -g bell-action any
# active window title colors
set-window-option -g window-status-current-fg yellow
set-window-option -g window-status-current-bg default
# enable 256 color
set -g default-terminal "screen-256color"
set -g terminal-overrides "xterm*:smcup@:rmcup@:*88col*:colors=88,*256col*:colors=256,xterm*:XT"
new -s Scratchpad zsh
# New session called ``Worksation''
new -s Workstation -nMutt mutt
neww -t 1 -nNews 'newsbeuter -o'
neww -t 2 -nIRC weechat
# run-shell 'tmuxifier load-window gsoc'
# Turn monior-activity for cmus *off*
set-window-option -t:0 monitor-activity off
# Set a space-separated string containing a list of envi†ronment
# variables to be copied into the session environ†ment when a new
# session is created or an existing session is attached
set -g update-environment "DISPLAY WINDOWID SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION GNOME_KEYRING_PID GNOME_KEYRING_SOCKET DBUS_SESSION_BUS_ADDRESS GPG_AGENT_INFO"
# set -g mouse-resize-pane on
# set -g mouse-select-pane on
set -g mouse on
set -g base-index 1
set -g renumber-windows on
# vim fixes
setw -g xterm-keys on
set -sg escape-time 0
set-option -g pane-active-border-fg black
set-option -g pane-border-fg black
set -g renumber-windows on
##CLIPBOARD selection integration
##Requires prefix key before the command key
#Copy tmux paste buffer to CLIPBOARD
# bind C-c run-shell "tmux show-buffer | xclip -i -selection clipboard"
# bind C-c run-shell "tmux show-buffer | pbcopy"
#Copy CLIPBOARD to tmux paste buffer and paste tmux paste buffer
# bind C-v run "tmux set-buffer -- \"$(xclip -o -selection clipboard)\"; tmux paste-buffer"
bind C-c run "tmux save-buffer - | xsel -ib"
bind C-v run "tmux set-buffer \"$(xsel -ob)\"; tmux paste-buffer"
# TODO: support xquartz
# if-shell 'uname | grep -q Darwin' 'set-option -g default-command "reattach-to-user-namespace -l zsh"'
# if-shell 'uname | grep -q Darwin' 'bind C-v run-shell "reattach-to-user-namespace -l zsh -c \"tmux set-buffer -- \'$(pbpaste)\'; tmux paste-buffer\""'
# if-shell 'uname | grep -q Darwin' "bind C-c run-shell \"reattach-to-user-namespace -l zsh -c 'tmux show-buffer | pbcopy'\""
bind C-h select-pane -L
bind C-j select-pane -D
bind C-k select-pane -U
bind C-l select-pane -R
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | egrep -iq '(vim|mc)' && tmux send-keys 'C-\\') || tmux select-pane -l"
# Sometimes we want screen keys
# unbind C-b
# set -g prefix ^A
# bind a send-prefix
# Optional status
# set -g status-left "#[fg=green]host: (#[default]#[fg=yellow]#H#[default]#[fg=green]) | "
# set -g status-left-length 40
# set -g status-right-length 50
# set -g status-left '#[fg=colour16,bg=colour254,bold] #S #[fg=colour254,bg=colour234,nobold]#(powerline tmux left)'
# set -g status-right "#(~/bin/battery Discharging; ~/bin/battery Charging) | %e %B %R | #[fg=red]#(if [[ -a /dev/shm/username/cmus-status ]]; then cat /dev/shm/username/cmus-status | cut -c-70; else echo 'cmus: - stopped -'; fi)"
# set -g status-right "#(~/bin/battery Discharging; ~/bin/battery Charging) | %e %B %R | #[fg=red]#(mpc current | cut -c-70)"
# set-option -g status-left "#(~/.dotfiles/powerline/scripts/powerline tmux left)"
# set-window-option -g window-status-current-format "#[fg=colour234, bg=colour27]#[fg=colour240, bg=colour18] #I #W #[fg=colour27, bg=colour235]"
# set -g window-status-format "#[fg=colour244,bg=colour234]#I #[fg=colour240] #[fg=colour249]#W "
# set -g window-status-current-format "#[fg=colour234,bg=colour31]#[fg=colour117,bg=colour31] #I #[fg=colour231,bold]#W #[fg=colour31,bg=colour234,nobold]"
run-shell ~/.dotfiles/tmux-yank/yank.tmux