-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
124 lines (101 loc) · 4.91 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
set-option -g prefix C-b
bind r source-file ~/.tmux.conf \; display "Reloaded!"
set -g default-terminal "xterm-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
set-window-option -g xterm-keys on
# dinamic tmux windows name
set -g status-left '#(ps -o comm= -p #{pane_pid} | sed "s/reattach-to-user-namespace //")'
set -g status-right '#(basename "#{pane_current_command}")'
set -g set-clipboard on
# setw -g aggressive-resize on
setw -g automatic-rename on
set -g renumber-windows on
setw -g monitor-activity off
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
set -g base-index 1
setw -g pane-base-index 1
set -g history-limit 9999999
set -g history-file ~/.tmux_history
set -g focus-events on
set -g escape-time 0
set-option escape-time 40
set -g set-titles on
set -g set-titles-string '#W'
set-option -g wrap-search on
set -g status-interval 1
set -g update-environment "SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION"
set -g mouse on
bind-key -n S-Left swap-window -t -1
bind-key -n S-Right swap-window -t +1
bind-key h select-pane -L
bind-key l select-pane -R
bind-key k select-pane -U
bind-key j select-pane -D
bind-key -r J resize-pane -D 3
bind-key -r K resize-pane -U 3
bind-key -r H resize-pane -L 3
bind-key -r L resize-pane -R 3
bind-key | split-window -h -c "#{pane_current_path}"
bind-key - split-window -v -c "#{pane_current_path}"
unbind '"'
unbind '%'
bind c new-window -c "#{pane_current_path}"
bind-key & kill-window
bind-key x kill-pane
########################## selection & copy ##############################################################################################################
# wrap default shell in reattach-to-user-namespace if available
# there is some hack with `exec & reattach`, credits to "https://github.com/gpakosz/.tmux"
# don't really understand how it works, but at least window are not renamed to "reattach-to-user-namespace"
set-option -g default-command "tmux rename-window zsh; reattach-to-user-namespace -l zsh"
setw -g mode-keys vi
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-no-clear "reattach-to-user-namespace pbcopy" \; display-message "copied to clipboard"
# bind-key -T copy-mode-vi Enter send-keys -X copy-selection
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "command -v pbcopy >/dev/null && pbcopy"
bind -T copy-mode-vi Escape send-keys -X cancel
# reverse search
bind-key ? copy-mode \; send-keys ? \; display-message "Search backward (use n for next, N for previous)"
# normal search
bind-key / copy-mode \; send-keys / \; display-message "Search forward (use n for next, N for previous)"
# improve double and triple click and trackpad selection
bind-key -T copy-mode-vi DoubleClick1Pane send-keys -X select-word-no-clear \; send-keys -X copy-pipe-no-clear "reattach-to-user-namespace pbcopy"
bind-key -T copy-mode-vi TripleClick1Pane send-keys -X select-line \; send-keys -X copy-pipe-no-clear "reattach-to-user-namespace pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-no-clear "reattach-to-user-namespace pbcopy"
# Double clicking selects the word also when not in copy-mode.
bind-key -T root DoubleClick1Pane select-pane \; copy-mode \; send-keys -X select-word
bind -T copy-mode-vi n send-keys -X search-again
bind -T copy-mode-vi N send-keys -X search-reverse
####################################################################################################################################################
# Custom binds
bind-key a command-prompt -p 'Save history to filename:' -I '~/tmux.history' 'capture-pane -S -32768 ; save-buffer %1 ; delete-buffer'
####################################################################################################################################################
# Plugins
set -g @prefix_highlight_show_copy_mode 'on' # Exibe quando está no modo de cópia
set -g @prefix_highlight_output_prefix '#[fg=yellow]' # Cor opcional
set -g @yank_selection 'clipboard'
set -g @yank_action 'copy-pipe'
set -g @shell_mode 'vi'
set -g @fzf-url-bind 'o'
set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-strategy-nvim 'session'
set -g @continuum-boot 'on'
set -g @continuum-boot-options 'fullscreen'
set -g @continuum-boot-options 'alacritty,fullscreen'
# 3 minutes to autosave
set -g @continuum-save-interval '3'
# set -g @continuum-boot-options 'kitty,fullscreen'
# set -g @continuum-boot-options 'iterm,fullscreen'
bind-key S command-prompt -p 'SSH to:' 'new-window "ssh %1"'
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# set -g @plugin 'nhdaly/tmux-better-mouse-mode'
set -g @plugin 'wfxr/tmux-fzf-url'
set -g @plugin 'arl/tmux-ssh'
source ~/.themes/tmux/tmux.gruvbox-powerline.conf
run '~/.tmux/plugins/tpm/tpm'