2025-04-18 08:49:54 +02:00
|
|
|
set-environment -g PATH "$HOME/dotfiles/scripts:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
|
2020-10-14 11:06:07 +02:00
|
|
|
set -g default-terminal "xterm-256color"
|
2017-04-12 10:07:35 +02:00
|
|
|
|
2022-09-05 10:52:43 +02:00
|
|
|
set -g history-limit 20000
|
2017-04-12 10:07:35 +02:00
|
|
|
|
|
|
|
|
# Remap prefix
|
2023-07-17 11:07:35 +02:00
|
|
|
set-option -g prefix C-a
|
2023-07-17 12:44:07 +02:00
|
|
|
set-option -g prefix2 C-b
|
2017-04-12 10:07:35 +02:00
|
|
|
|
|
|
|
|
setw -g mode-keys vi
|
|
|
|
|
set-option -g status-keys vi
|
|
|
|
|
|
|
|
|
|
bind | split-window -h -c '#{pane_current_path}'
|
|
|
|
|
bind - split-window -v -c '#{pane_current_path}'
|
|
|
|
|
|
|
|
|
|
# Switch windows
|
|
|
|
|
bind-key -n M-Left select-window -t -1
|
|
|
|
|
bind-key -n M-Right select-window -t +1
|
|
|
|
|
|
|
|
|
|
unbind '"'
|
|
|
|
|
unbind '%'
|
|
|
|
|
#bind-key -n M-left select-pane -L
|
|
|
|
|
#bind-key -n M-right select-pane -R
|
|
|
|
|
#bind-key -n M-up select-pane -U
|
|
|
|
|
#bind-key -n M-down select-pane -D
|
|
|
|
|
bind-key -n C-x resize-pane -Z
|
2021-01-06 12:59:56 +01:00
|
|
|
bind-key C-x send-keys C-x
|
2017-04-12 10:07:35 +02:00
|
|
|
|
2022-02-14 15:00:04 +01:00
|
|
|
bind k clear-history\; display "History cleared"
|
2017-04-12 10:07:35 +02:00
|
|
|
|
|
|
|
|
bind-key a set-window-option synchronize-panes
|
|
|
|
|
|
|
|
|
|
bind r source-file ~/.tmux.conf\; display "Conf reloaded!"
|
|
|
|
|
|
|
|
|
|
set -g mouse on
|
|
|
|
|
|
2022-07-06 11:41:04 +02:00
|
|
|
#bind-key -Tcopy-mode-vi 'v' send -X begin-selection
|
|
|
|
|
#bind-key -Tcopy-mode-vi 'y' send -X copy-selection
|
|
|
|
|
#bind -Tcopy-mode-vi y send -X copy-pipe "xclip -i -sel p -f | xclip -i -sel c" \; display-message "copied to system clipboard"
|
2017-04-12 10:07:35 +02:00
|
|
|
|
|
|
|
|
# Smart pane switching with awareness of vim splits
|
|
|
|
|
# See: https://github.com/christoomey/vim-tmux-navigator
|
|
|
|
|
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"'
|
|
|
|
|
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
|
|
|
|
|
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
|
|
|
|
|
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
|
|
|
|
|
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
|
|
|
|
|
|
2020-10-14 11:06:07 +02:00
|
|
|
# Nano
|
|
|
|
|
bind-key C-x send-keys C-x
|
|
|
|
|
bind-key C-o send-keys C-o
|
|
|
|
|
|
2022-07-06 11:41:04 +02:00
|
|
|
# Copying - Most of this is done in tmux-yank!
|
2017-04-12 10:07:35 +02:00
|
|
|
# move x clipboard into tmux paste buffer
|
2022-07-06 11:41:04 +02:00
|
|
|
#bind C-p run "tmux set-buffer \"$(xclip -o)\"; tmux paste-buffer"
|
2017-04-12 10:07:35 +02:00
|
|
|
# move tmux copy buffer into x clipboard
|
2022-07-06 12:06:58 +02:00
|
|
|
# Vi copypaste mode
|
|
|
|
|
set-window-option -g mode-keys vi
|
2021-10-26 11:46:05 +02:00
|
|
|
set-option -s set-clipboard on
|
2022-07-06 12:06:58 +02:00
|
|
|
set -g @yank_with_mouse off
|
|
|
|
|
set -g @yank_action 'copy-pipe'
|
2025-04-18 08:49:54 +02:00
|
|
|
bind-key -Tcopy-mode-vi 'C-right' send -X next-word
|
|
|
|
|
bind-key -Tcopy-mode-vi 'C-left' send -X previous-word
|
|
|
|
|
unbind-key -T copy-mode-vi MouseDragEnd1Pane
|
|
|
|
|
# Allow copy across SSH
|
|
|
|
|
set -g @override_copy_command 'yank > #{pane_tty}'
|
2017-04-12 10:07:35 +02:00
|
|
|
|
2018-07-29 16:26:51 +02:00
|
|
|
if '[ `uname` == Darwin ]' \
|
|
|
|
|
'source-file ~/.tmux/.mac_config'
|
2017-04-12 10:07:35 +02:00
|
|
|
|
2022-07-06 11:41:04 +02:00
|
|
|
set-option -g set-titles on
|
|
|
|
|
|
2018-07-29 16:26:51 +02:00
|
|
|
|
|
|
|
|
# Escape timeout for nvim
|
|
|
|
|
set -sg escape-time 10
|
|
|
|
|
|
|
|
|
|
|
2017-04-12 10:07:35 +02:00
|
|
|
# List of plugins
|
|
|
|
|
set -g @plugin 'tmux-plugins/tpm'
|
2022-10-07 08:32:37 +02:00
|
|
|
# Does not work on servers without GUI
|
|
|
|
|
#set -g @plugin 'tmux-plugins/tmux-open'
|
2017-04-12 10:07:35 +02:00
|
|
|
set -g @plugin 'tmux-plugins/tmux-yank'
|
2018-07-29 16:26:51 +02:00
|
|
|
set -g @plugin 'jimeh/tmux-themepack'
|
2025-04-18 08:48:22 +02:00
|
|
|
set -g @themepack 'powerline/double/red'
|
2017-04-12 10:07:35 +02:00
|
|
|
|
2022-10-06 16:36:01 +02:00
|
|
|
setenv -g TMUX_PLUGIN_MANAGER_PATH "$HOME/.tmux/plugins/"
|
|
|
|
|
|
|
|
|
|
if "test ! -d ~/.tmux/plugins/tpm" \
|
|
|
|
|
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && \
|
|
|
|
|
~/.tmux/plugins/tpm/bin/install_plugins'"
|
2017-04-12 10:07:35 +02:00
|
|
|
|
|
|
|
|
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
2022-10-06 16:36:01 +02:00
|
|
|
run -b '~/.tmux/plugins/tpm/tpm || true'
|