-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
98 lines (76 loc) · 2.97 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
# Do I even use tmux any more?
# use C-f as prefix
unbind C-b
set -g prefix C-f
bind C-f send-prefix
# move between panes
# bind h select-pane -L
# bind j select-pane -D
# bind k select-pane -U
# bind l select-pane -R
# source tmux conf
bind R source-file ~/.tmux.conf
# Pane resizing
bind -r C-k resize-pane -L 3
bind -r C-j resize-pane -D 3
bind -r C-h resize-pane -U 3
bind -r C-l resize-pane -R 3
set-option -g mouse on
#set -g status off
set -g pane-border-bg black
set -g pane-border-fg white
set -g pane-active-border-bg black
set -g pane-active-border-fg white
set -g status-bg black
set -g status-fg white
set -g default-terminal "screen"
# no escape time (important for vim)
set-option -sg escape-time 0
# hide date and time
set -g status-right ''
# turn off confirm
bind-key & kill-window
bind-key x kill-pane
# Allow cmus remote over all of tmux
set -g @plugin 'Mpdreamz/tmux-cmus'
# status line
set -g status-left '[#S] '
set -g status-left-length 25
set -g status-right-length 100
#set -g status-right '#($HOME/scripts/tmux-cmus-status.sh) | %H:%M '
#set -g status-right '#{cmus_status} | %H:%M '
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
# ============================================================================
# COPY/PASTE
# ============================================================================
# fix issue with os x clip board
set-option -g default-command "reattach-to-user-namespace -l /bin/bash"
# bind-key -Tcopy-mode-vi 'v' send -X begin-selection
# bind-key -Tcopy-mode-vi 'y' send -X copy-pipe "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
# bind-key -Tcopy-mode-vi Enter send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# Bind ']' to use pbpaste
# bind ] run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
bind-key -T copy-mode-vi C-h select-pane -L
bind-key -T copy-mode-vi C-j select-pane -D
bind-key -T copy-mode-vi C-k select-pane -U
bind-key -T copy-mode-vi C-l select-pane -R
bind-key -T copy-mode-vi C-\ select-pane -l
# 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"
#