-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.tmux.conf
156 lines (141 loc) · 5.75 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# _ __ _
# | |_ _ __ ___ _ ___ __ ___ ___ _ __ / _(_) __ _
# | __| '_ ` _ \| | | \ \/ / / __/ _ \| '_ \| |_| |/ _` |
# | |_| | | | | | |_| |> < | (_| (_) | | | | _| | (_| |
# \__|_| |_| |_|\__,_/_/\_\ \___\___/|_| |_|_| |_|\__, |
# |___/
# List of plugins
#set -g @plugin 'Morantron/tmux-fingers'
#set -g @plugin 'dequis/tmux-url-select'
#set -g @plugin 'tmux-plugins/tmux-copycat'
#set -g @plugin 'tmux-plugins/tmux-open'
#set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
# set -g @plugin 'tmux-plugins/tmux-sessionist'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'wfxr/tmux-fzf-url'
# plugin conf
set -g @fzf-url-bind 'u'
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
set -g @yank_selection 'primary'
set -g @yank_selection_mouse 'clipboard'
# set zsh as your default Tmux shell
set-option -g default-shell /bin/zsh
# 256 color support
set-option -ga terminal-overrides ",screen-256color:Tc"
set -g default-terminal "screen-256color"
# prefix is Ctrl-a
set -g prefix C-a
# command delay
set -s escape-time 0
# Mouse works as expected
set -g mouse on
set -g visual-activity off
set -g mode-keys vi
set -g history-limit 10000
setw -g monitor-activity on
setw -g mode-keys vi
set-option -s set-clipboard off
bind C-a send-prefix
bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe "xclip -se c -i"
bind G command-prompt -p "Enter Prompt:" "run-shell '~/scripts/gpt.sh \"%1\"'"
set -g display-panes-time 4000
bind-key C-0 select-pane -t 0
set -g default-command "${SHELL}"
# prevent unwanted exit
set-environment -g 'IGNOREEOF' 2
# y and p as in vim
bind Escape copy-mode
unbind p
bind p paste-buffer
bind -T copy-mode-vi 'v' send -X begin-selection
bind -T copy-mode-vi 'y' send -X copy-selection
bind -T copy-mode-vi 'Space' send -X halfpage-down
bind -T copy-mode-vi 'Bspace' send -X halfpage-up
bind -T copy-mode-vi 'C-j' send -X halfpage-down
bind -T copy-mode-vi 'C-k' send -X halfpage-up
bind-key -Tcopy-mode-vi Escape send -X cancel
bind-key -Tcopy-mode-vi V send -X rectangle-toggle
unbind '"'
unbind %
# this should also work in copy mode
bind-key -T copy-mode-vi M-k select-pane -U
bind-key -T copy-mode-vi M-j select-pane -D
bind-key -T copy-mode-vi M-h select-pane -L
bind-key -T copy-mode-vi M-l select-pane -R
# this should also work in vim itself
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
# move arround vim = tmux
bind -n M-h if-shell "$is_vim" "send-keys M-h" "select-pane -L"
bind -n M-j if-shell "$is_vim" "send-keys M-j" "select-pane -D"
bind -n M-k if-shell "$is_vim" "send-keys M-k" "select-pane -U"
bind -n M-l if-shell "$is_vim" "send-keys M-l" "select-pane -R"
# resize vim = tmux
bind -n M-H if-shell "$is_vim" "send-keys M-H" "resize-pane -L 5"
bind -n M-J if-shell "$is_vim" "send-keys M-J" "resize-pane -D 5"
bind -n M-K if-shell "$is_vim" "send-keys M-K" "resize-pane -U 5"
bind -n M-L if-shell "$is_vim" "send-keys M-L" "resize-pane -R 5"
bind -n C-M-H resize-pane -L 5
bind -n C-M-J resize-pane -D 5
bind -n C-M-K resize-pane -U 5
bind -n C-M-L resize-pane -R 5
bind -n M-y display-panes
bind -n M-c new-window
bind -n M-f resize-pane -Z # toogle fullscreen
bind -n M-x kill-pane
bind -n M-0 select-window -t :0
bind -n M-1 select-window -t :1
bind -n M-2 select-window -t :2
bind -n M-3 select-window -t :3
bind -n M-4 select-window -t :4
bind -n M-5 select-window -t :5
bind -n M-6 select-window -t :6
bind -n M-7 select-window -t :7
bind -n M-8 select-window -t :8
bind -n M-9 select-window -t :9
bind -n M-. split-window -h -c '#{pane_current_path}' # Split panes horizontal
bind -n M-- split-window -v -c '#{pane_current_path}' # Split panes vertically
bind -n M-s choose-tree -s
# Alt-h: prev window
# bind -n M-p send -t default.1 "command tmux previous-window" ENTER \; prev
bind -n M-p prev
# Alt-h: next window
bind -n M-n next
bind -n M-Space next-layout
# PageUp (and down included)
bind -n Pageup copy-mode -u
bind -n M-m copy-mode
# moving between windows with vim movement keys
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
bind r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf"
bind-key x kill-pane
bind U run "cut -c3- ~/.tmux.conf | sh -s _urlview #{pane_id}"
#########
# Theme
#########
set -g status-interval 10 # redraw status line every 10 seconds
set-option -g status-position top
set -g default-terminal "screen-256color"
set -g status-justify "left"
set -g status "on"
set -g status-left-style "none"
set -g message-command-style "fg=colour237,bg=colour109"
set -g status-right-style "none"
set -g pane-active-border-style "fg=colour109"
set -g status-style "none,bg=colour237"
set -g message-style "fg=colour237,bg=colour109"
set -g pane-border-style "fg=colour236"
set -g status-right-length "100"
set -g status-left-length "100"
setw -g window-status-activity-style "none"
setw -g window-status-separator ""
setw -g window-status-style "none,fg=colour109,bg=colour237"
set -g status-left "#[fg=colour237,bg=colour109] #S #[fg=colour109,bg=colour237,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=colour236,bg=colour237,nobold,nounderscore,noitalics]#[fg=colour109,bg=colour236] %Y-%m-%d %H:%M #[fg=colour109,bg=colour236,nobold,nounderscore,noitalics]#[fg=colour237,bg=colour109] #h "
setw -g window-status-format "#[fg=colour109,bg=colour237] #I #[fg=colour109,bg=colour237] #W "
setw -g window-status-current-format "#[fg=colour153,bg=colour237,bold] #I #[fg=colour153,bg=colour237] #W "
set-window-option -g xterm-keys on
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'