summaryrefslogtreecommitdiff
path: root/.tmux.conf
blob: 9ca16e3467843ef2c746792cd45b70f3a96e3324 (plain)
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
setw -g clock-mode-style 12

#start window numbering at 1
set -g base-index 1
set -g pane-base-index 1
set-option -g renumber-windows on


# Copy mode
setw -g mode-keys vi
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection

# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix

# remap window split commands to something easier to remember
unbind % 
bind | split-window -h
bind - split-window -v

# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf

# make tmux panes like Vim
#bind h select-pane -L
#bind j select-pane -D
#bind k select-pane -U
#bind l select-pane -R
unbind C-l
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+



# quick pane cycling
unbind ^A
bind ^A select-pane -t :.+


# smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"

#alternative for ctrl-l
bind l send-keys 'C-l'
# setup a decent environment
bind m source-file ~/.tmux/thesetup
bind C-f source-file ~/.tmux/write-fict
bind C-x source-file ~/.tmux/write-lux
bind C-w source-file ~/.tmux/write-wire
bind C-d source-file ~/.tmux/dev
bind C-l source-file ~/.tmux/dev-lbh
bind C-c source-file ~/.tmux/dev-ccg


set -g status-left-length 52
set -g status-right-length 451
set -g status-fg white
set -g status-bg colour234
#set -g window-status-activity-attr bold
set-option -g pane-border-style fg=colour245
set-option -g pane-active-border-style fg=colour39
set-option -g message-style fg=colour16,bg=colour221,bold
set -g status-left '#[fg=colour235,bg=colour252,bold] #S #[fg=colour252,bg=colour238,nobold]#[fg=colour245,bg=colour238,bold] #(whoami) #[fg=colour238,bg=colour234,nobold]'
set -g window-status-format "#[fg=white,bg=colour234] #I #W "

set -g default-terminal "screen-256color"
set-window-option -g automatic-rename off
set-option -g allow-rename off
bind -n C-w run "set status"

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'