62 lines
2.2 KiB
Bash
62 lines
2.2 KiB
Bash
# Powerline
|
|
run-shell "/usr/bin/powerline-daemon -q"
|
|
source "/usr/share/powerline/bindings/tmux/powerline.conf"
|
|
source "/home/daniel/.config/tmux/{{tmux_theme}}.conf"
|
|
|
|
# Mouse
|
|
set-option -g mouse on
|
|
bind-key -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'"
|
|
|
|
# Vim-like copy/paste mode
|
|
setw -g mode-keys vi
|
|
bind-key [ copy-mode
|
|
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
|
|
bind-key -Tcopy-mode-vi 'y' send -X copy-selection
|
|
bind-key -Tcopy-mode-vi Escape send -X cancel
|
|
bind-key -Tcopy-mode-vi V send -X rectangle-toggle
|
|
bind-key ] paste-buffer
|
|
|
|
# Vi-mode pane switching
|
|
bind-key h "select-pane -L"
|
|
bind-key j "select-pane -D"
|
|
bind-key k "select-pane -U"
|
|
bind-key l "select-pane -R"
|
|
|
|
# Integrate with the system clipboard
|
|
bind-key -n C-S-c run "tmux save-buffer - | xclip -i -sel clipboard"
|
|
bind-key -n C-S-v run "xclip -o -sel clipboard | tmux load-buffer -; tmux paste-buffer"
|
|
unbind -n -Tcopy-mode-vi MouseDragEnd1Pane
|
|
bind-key -Tcopy-mode-vi MouseDragEnd1Pane send -X copy-selection-and-cancel\; run "tmux save-buffer - | xclip -i > /dev/null"
|
|
unbind-key MouseDown2Pane
|
|
bind-key -n MouseDown2Pane run "xclip -o | tmux load-buffer -; tmux paste-buffer"
|
|
|
|
# Set the current working directory based on the current pane's current
|
|
# working directory (if set; if not, use the pane's starting directory)
|
|
# when creating # new windows and splits.
|
|
bind-key c new-window -c '#{pane_current_path}'
|
|
bind-key , rename-window '#{b:pane_current_path}'
|
|
bind-key '"' split-window -c '#{pane_current_path}'
|
|
bind-key % split-window -h -c '#{pane_current_path}'
|
|
bind-key | split-window -h -c '#{pane_current_path}' -p 33
|
|
bind-key _ split-window -v -c '#{pane_current_path}' -p 25
|
|
|
|
# Broadcast input
|
|
bind-key C-x setw synchronize-panes
|
|
|
|
# Reload configuration
|
|
bind-key r source .tmux.conf
|
|
|
|
# Better font term
|
|
set -g default-terminal "tmux-256color"
|
|
set -ga terminal-overrides ",alacritty:Tc"
|
|
|
|
# Neovim said to...
|
|
set-option -sg escape-time 10
|
|
|
|
# Plugins
|
|
set -g @plugin 'samoshkin/tmux-plugin-sysstat'
|
|
set -g @plugin 'tmux-plugins/tmux-net-speed'
|
|
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
|
|
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
|
run '~/.tmux/plugins/tpm/tpm'
|