~hokiegeek/dotfiles

ref: bb95ccbbd653fccb856a24b2e0ac62fb1a9e6c86 dotfiles/tmux.conf -rw-r--r-- 3.1 KiB
bb95ccbbHokieGeek This thing.... 2 years ago
                                                                                
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
## Misc {{{
# Shorten command delay
set -sg escape-time 1

set-option -g history-limit 100000

# This passes xterm-style keysequences down to the programs
set-window-option -g xterm-keys on

# Titlebar title
set -g set-titles on
set -g set-titles-string '#S | #W'

# The bells and whistles
# set-option -g bell-action any
# set-option -g visual-bell on
set-option -g visual-silence on
set-option -g visual-activity on
# set-option -g visual-content on

# Zero-based indexing is dumb
set -g base-index 1

# hmm...
set-window-option -g aggressive-resize on
# }}}

#### Keybindings {{{
### Change prefix {{{
unbind C-b
set-option -g prefix C-a
bind-key a send-prefix
# }}}

### Use vi-like keybindings {{{
set-window-option -g mode-keys vi
set-option -g status-keys vi

unbind-key [
bind-key Escape copy-mode

bind-key -r j select-pane -D
bind-key -r k select-pane -U
bind-key -r h select-pane -L
bind-key -r l select-pane -R
bind-key -r J resize-pane -D 5
bind-key -r K resize-pane -U 5
bind-key -r H resize-pane -L 5
bind-key -r L resize-pane -R 5
# }}}

### Custom {{{
bind-key R source-file ~/.tmux.conf \; display-message 'Loaded config...'

bind-key @ command-prompt -p "join pane from:" "join-pane -s '%%'"
bind-key - command-prompt -p "link pane from:" "link-window -s '%%'"

bind-key S command-prompt -p "Target session:" "attach-session -t '%%'"

bind-key C-a last-window

## Fixing the silly change in the new version where new windows are not created from the current location
bind-key c new-window -c '#{pane_current_path}'
bind-key '%' split-window -h -c '#{pane_current_path}'
bind-key '"' split-window -v -c '#{pane_current_path}'
# }}}

## Clipboard helpers {{{
bind-key Y run-shell "tmux show-buffer | xclip -i -sel clipboard" \; display-message "Copied to clipboard"
bind-key P run-shell "tmux set-buffer -b 'xclip' \"$(xclip -o -sel clipboard)\"" \; paste-buffer
# }}}

## Monitoring {{{
bind-key M set-window-option monitor-silence 30 \; display-message "Monitoring for 30s of silence (C-S to disable)"
bind-key C-M set-window-option monitor-silence 0 \; display-message "Disabled silence monitoring"
bind-key A set-window-option monitor-activity \; display-message "Toggled monitoring for activity"
# }}}

# TODO: how about a zoom/unzoom set of bindings
# Maybe cheat by just putting the current pane in it s own window
# }}}

## Status bar {{{
# Left
set-option -g status-left '#S:#I.#P '

# Right
set-option -g status-right ''
# }}}

## Colors {{{
# Turn on coloring
set-option -g default-terminal "screen-256color"

# Status color
set-option -g status-style bg=default,fg=colour240

# window status
set-window-option -g window-status-format "#[bg=colour237]#[fg=colour233] #I #[bg=colour233]#[fg=colour240] #W#F "
set-window-option -g window-status-current-format "#[bg=colour130]#[fg=black] #I #[bg=colour234]#[fg=colour243] #W "

# borders
set-option -g pane-border-style fg=colour235
set-option -g pane-active-border-style fg=colour130

# message/command
set-option -g mode-style bg=colour245
set-option -g message-style fg=white,bg=colour130
# }}}

# vim: set foldmethod=marker number relativenumber formatoptions-=tc: