From 75e00e4cf49edcda75d80e1003845d32a1e5585e Mon Sep 17 00:00:00 2001 From: earnest ma Date: Wed, 28 Jul 2021 12:03:23 -0400 Subject: [PATCH] Add tmux config --- .config/tmux/tmux.conf | 64 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .config/tmux/tmux.conf diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf new file mode 100644 index 0000000..8e56b70 --- /dev/null +++ b/.config/tmux/tmux.conf @@ -0,0 +1,64 @@ +# If you're running an older version of tmux, use: +# ln -s $XDG_CONFIG_HOME/tmux/tmux.conf ~/.tmux.conf + +# Thanks: +# https://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/ +# https://git.sr.ht/~seirdy/dotfiles/tree/HEAD/item/.config/tmux/tmux.conf + +set -g default-terminal "tmux-256color" + +# No delay between hitting +set-option -s escape-time 0 + +# Mouse support +set-option -g mouse on + +# Start with 1 instead of 0 +set -g base-index 1 +set -g pane-base-index 1 + +# Panes +bind | split-window -h -c "#{pane_current_path}" +bind - split-window -v -c "#{pane_current_path}" +unbind '"' +unbind % + +bind -n M-Left select-pane -L +bind -n M-Right select-pane -R +bind -n M-Up select-pane -U +bind -n M-Down select-pane -D + +# Windows +bind c new-window -c "#{pane_current_path}" + +bind -n M-S-Right select-window -n +bind -n M-S-Left select-window -p + +# set-option -g allow-rename off # Don't autorename windows +set -g renumber-windows on + +# Show menu of URLs to open from the visible pane - needs `urlview' +bind u capture-pane \;\ + save-buffer /tmp/tmux-buffer \;\ + split-window -l 10 "urlscan /tmp/tmux-buffer" + +# Allow programs with their own scrollback to scroll properly +bind-key -n WheelUpPane \ + if-shell -Ft= "#{?pane_active,0,1}" "select-pane -t=" \; \ + if-shell -Ft= "#{pane_in_mode}" \ + "send-keys -M ; send-keys -M ; send-keys -M" \ + "if-shell -Ft= \"#{mouse_any_flag}\" \ + \"send-keys -M\" \ + \"if-shell -Ft= '#{alternate_on}' \ + 'send-keys Up Up Up' \ + 'copy-mode -e'\"" + +bind-key -n WheelDownPane \ + if-shell -Ft= "#{?pane_active,0,1}" "select-pane -t=" \; \ + if-shell -Ft= "#{pane_in_mode}" \ + "send-keys -M ; send-keys -M ; send-keys -M" \ + "if-shell -Ft= \"#{mouse_any_flag}\" \ + \"send-keys -M\" \ + \"if-shell -Ft= '#{alternate_on}' \ + 'send-keys Down Down Down'\"" +