mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 13:46:41 +00:00
Update tmux config
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
# Ensure that tmux windows are by default named after the shell, rather than
|
||||
# full path to the shell binary.
|
||||
shell=$(basename "$SHELL")
|
||||
|
||||
# If reattach-to-user-namespace is not available, just run the command.
|
||||
if [ -n "$(command -v reattach-to-user-namespace)" ]; then
|
||||
reattach-to-user-namespace -l "$shell"
|
||||
else
|
||||
exec "$shell"
|
||||
fi
|
||||
@@ -1,8 +0,0 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
# If reattach-to-user-namespace is not available, just run the command.
|
||||
if [ -n "$(command -v reattach-to-user-namespace)" ]; then
|
||||
reattach-to-user-namespace $@
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
31
tmux.conf
31
tmux.conf
@@ -8,20 +8,29 @@ set -g default-terminal "screen-256color"
|
||||
set -g detach-on-destroy on
|
||||
set -g history-limit 50000
|
||||
|
||||
# Mouse support
|
||||
set -g mouse on # Tmux 2.1 and later
|
||||
set -g mode-mouse on
|
||||
set -g mouse-select-pane on
|
||||
set -g mouse-resize-pane on
|
||||
set -g mouse-select-window on
|
||||
# Mouse support (pre Tmux 2.1)
|
||||
if-shell -b '[ "$(echo "$(tmux -V | cut -c 6-) < 2.1" | bc)" = 1 ]' \
|
||||
" \
|
||||
set -g mode-mouse on; \
|
||||
set -g mouse-resize-pane on; \
|
||||
set -g mouse-select-pane on; \
|
||||
set -g mouse-select-window on; \
|
||||
"
|
||||
|
||||
# Pre Tmux 2.1 mouse scrolling behavior
|
||||
# - from: https://github.com/tmux/tmux/issues/145#issuecomment-151123624
|
||||
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
|
||||
bind -n WheelDownPane select-pane -t= \; send-keys -M
|
||||
# Mouse support (Tmux 2.1 and later)
|
||||
# - scrolling behavior from: https://github.com/tmux/tmux/issues/145#issuecomment-151123624
|
||||
if-shell -b '[ "$(echo "$(tmux -V | cut -c 6-) >= 2.1" | bc)" = 1 ]' \
|
||||
" \
|
||||
set -g mouse on; \
|
||||
bind -n WheelUpPane if-shell -F -t = \"#{mouse_any_flag}\" \"send-keys -M\" \"if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'\"; \
|
||||
bind -n WheelDownPane select-pane -t= \\; send-keys -M; \
|
||||
"
|
||||
|
||||
# Mac OS X fix for pbcopy, pbpaste, and launchctl
|
||||
set-option -g default-command "login-shell"
|
||||
if-shell -b '[ -n "$(command -v reattach-to-user-namespace)" ]' \
|
||||
" \
|
||||
set-option -g default-command 'reattach-to-user-namespace -l $SHELL'; \
|
||||
"
|
||||
|
||||
# Set window notifications
|
||||
setw -g monitor-activity on
|
||||
|
||||
Reference in New Issue
Block a user