dotfiles/roles/tmux/files/tmux.conf

66 lines
1.7 KiB
Plaintext

# https://robots.thoughtbot.com/a-tmux-crash-course
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
# quick pane cycling
unbind ^A
bind ^A select-pane -t :.+
# remap pane splitting to \ and /
bind \\ split-window -h
bind / split-window
#allow Ctrl-Left and Ctrl-Right
set-window-option -g xterm-keys on
#enable mouse scrolling
#https://github.com/NHDaly/tmux-better-mouse-mode
set -g mouse on
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
#set -g @scroll-speed-num-lines-per-scroll "3"
set -g @emulate-scroll-for-no-mouse-alternate-buffer "on"
#set -g terminal-overrides 'xterm*:smcup@:rmcup@'
set -g default-shell /bin/zsh
#set -g mouse on
# sane scrolling:
#bind -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'"
# Allow xterm titles in terminal window, terminal scrolling with scrollbar, and setting overrides of C-Up, C-Down, C-Left, C-Right
#set -g terminal-overrides "xterm*:XT:smcup@:rmcup@:kUP5=\eOA:kDN5=\eOB:kLFT5=\eOD:kRIT5=\eOC"
#https://tangledhelix.com/blog/2012/07/16/tmux-and-mouse-mode/
# Toggle mouse on with ^B m
#bind m \
# set -g mouse on \;\
# display 'Mouse: ON'
# Toggle mouse off with ^B M
#bind M \
# set -g mouse off \;\
# display 'Mouse: OFF'
unbind +
bind + \
set -g mouse off \;\
new-window -d -n tmux-zoom 'clear && echo TMUX ZOOM && read' \;\
swap-pane -s tmux-zoom.0 \;\
select-window -t tmux-zoom \;\
display 'Mouse: OFF'
unbind -
bind - \
set -g mouse on \;\
last-window \;\
swap-pane -s tmux-zoom.0 \;\
kill-window -t tmux-zoom \;\
display 'Mouse: ON'