forked from jgumbley/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
77 lines (66 loc) · 2.6 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
# remap prefix to Control + a
#set -g prefix C-a
#unbind C-b
#bind C-a send-prefix
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
# quick pane cycling
unbind ^A
bind ^A select-pane -t :.+
# keys
bind-key -n C-k send-keys -R \; clear-history\; send-keys "Enter"
bind-key C-w kill-pane
bind-key -n C-t new-window
bind-key -n C-\ previous-window
bind-key -n C-] next-window
bind-key -n C-s split-window -h
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
# make panes
bind-key h split-window -v
bind-key v split-window -h
# verious options
set-window-option -g mode-keys vi
set -g default-terminal "xterm-256color"
set -sg escape-time 0
set-option -g default-shell /bin/zsh
set -g base-index 1
setw -g mode-mouse on
set-option -g mouse-select-pane on
set-option -g mouse-resize-pane on
set-option -g mouse-select-window on
set -g status-left-length 32
set -g status-right-length 150
# main colours
set -g mode-fg white
set -g mode-bg blue
set -g status-fg white
set -g status-bg colour234
set -g window-status-activity-attr bold
set -g pane-border-fg default
set -g pane-active-border-fg default
set -g message-fg white
set -g message-bg blue
set -g message-attr bold
# status colors
set -g status-left '#[fg=colour238,bg=colour234,nobold]⮀'
set -g window-status-format "#[fg=white,bg=colour234] #I #W "
set -g window-status-current-format "#[fg=colour234,bg=colour39]⮀#[fg=colour25,bg=colour39,noreverse,bold] #I #W #[fg=colour39,bg=colour234,nobold]⮀"
set -g status-right '#[fg=colour234,fg=colour238,bold]⮂#[fg=colour245,bg=colour238,bold]'
# try sane scrolling
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# Smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-l) || tmux select-pane -R"
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
#
# # Update default binding of `Enter` to also use copy-pipe
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"