-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
85 lines (65 loc) · 3.02 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
# Make mouse useful in copy mode
set -g mouse on
# Allow xterm titles in terminal window, terminal scrolling with scrollbar, and setting overrides of C-Up, C-Down, C-Left, C-Right
# (commented out because it disables cursor navigation in vim)
#set -g terminal-overrides "xterm*:XT:smcup@:rmcup@:kUP5=\eOA:kDN5=\eOB:kLFT5=\eOD:kRIT5=\eOC"
# Scroll History
set -g history-limit 30000
# Set ability to capture on start and restore on exit window data when running an application
setw -g alternate-screen on
# Lower escape timing from 500ms to 50ms for quicker response to scroll-buffer access.
set -s escape-time 50
# TMUX AND VIM
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
is_fzf="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?fzf$'"
bind -n C-h run "($is_vim && tmux send-keys C-h) || \
tmux select-pane -L"
bind -n C-j run "($is_vim && tmux send-keys C-j) || \
($is_fzf && tmux send-keys C-j) || \
tmux select-pane -D"
bind -n C-k run "($is_vim && tmux send-keys C-k) || \
($is_fzf && tmux send-keys C-k) || \
tmux select-pane -U"
bind -n C-l run "($is_vim && tmux send-keys C-l) || \
tmux select-pane -R"
bind C-l send-keys 'C-l'
bind -n M-z resize-pane -Z
# bind-key -n C-\if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send -X copy-pipe "xclip -i -f -selection primary | xclip -i -selection clipboard" \;\
send -X clear-selection
# use vim-like keys for splits and windows
bind-key v split-window -h
bind-key s split-window -v
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# vi is good
setw -g mode-keys vi
# Windows to panes
bind-key @ command-prompt -p "create pane from:" "join-pane -h -s ':%%'"
bind-key S choose-window "join-pane -v -s '%%'"
bind-key V choose-window "join-pane -h -s '%%'"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'jatap/tmux-base16-statusline'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @base16-statusline 'main'
set -g @base16-statusline-separator-session-name '@'
set -g @base16-statusline-main-separator '|'
set -g status-right "#{prefix_highlight} #[fg=yellow]%H:%M:%S #[fg=white]#{@main_separator} #[fg=green]%d-%b-%y "
set -g @prefix_highlight_bg black
set -g @prefix_highlight_fg red
set -g @prefix_highlight_prefix_prompt '^B'
set -g @prefix_highlight_show_copy_mode 'on'
set -g @prefix_highlight_copy_prompt 'VISUAL'
set -g @prefix_highlight_copy_mode_attr "fg=red,bg=black,bold"
set -g @prefix_highlight_output_prefix ''
set -g @prefix_highlight_output_suffix ''
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'