-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
77 lines (55 loc) · 2.5 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
set -g default-command /opt/homebrew/bin/fish
set -g default-terminal screen-256color
# crucial for viu to work in nnn. truecolor.
set -ga terminal-overrides ',xterm-256color:Tc'
setw -g aggressive-resize on
setw -g monitor-activity on
set -g visual-activity off
setw -g set-titles on
set -g remain-on-exit off
set -g mode-keys vi
set -s escape-time 50
set -g mouse on
set -g prefix C-b
set-option -g display-time 4000
set -g history-limit 10000
# set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
bind t run-shell 'wemux display_users'
bind y run-shell "tmux show-buffer | xclip -sel clip -i" \; display-message "Copied tmux buffer to system clipboard"
bind-key k send-keys -R \; send-keys C-l \; clear-history
bind K kill-session
# #select url
## urlscan and urlview fails as they rely on save-buffer, which breaks up lines
# bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; new-window -n "urlscan" 'zsh -c "urlscan -c -d -r \"firefox {}\" < /tmp/tmux-buffer"'
bind u run '~/.tmux/plugins/tmux-url-select/tmux-url-select.pl'
#joining and sending panes
bind-key @ choose-window 'join-pane -h -s "%%"'
#dump pane
bind-key P command-prompt -p 'save history to filename:' -I '~/tmux.history' 'capture-pane -S - ; save-buffer %1 ; delete-buffer'
# reload configs
bind C-r source-file ~/.tmux.conf \; \
display-message "conf reloaded"
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
what="ps -o state= -o comm= -t '#{pane_tty}'"
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 -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
# change tmux current dir
bind C-c command-prompt -I "'#{pane_current_path}'" -p "New session dir:" "attach -c%1"
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'mortang2410/tmux-url-select'
set -g @plugin 'wfxr/tmux-power'
set -g @tmux_power_theme 'gold'
run '~/.tmux/plugins/tpm/tpm'
## get tmuxline config, I no longer use vim ....
# if-shell "test -f ~/.tmux-status.conf" "source ~/.tmux-status.conf"
# vim: ft=tmux: