update tmux config
This commit is contained in:
parent
21b6e80abe
commit
45150ed6c0
1 changed files with 30 additions and 39 deletions
69
.tmux.conf
69
.tmux.conf
|
@ -11,42 +11,44 @@
|
||||||
|
|
||||||
|
|
||||||
# -- general -------------------------------------------------------------------
|
# -- general -------------------------------------------------------------------
|
||||||
|
|
||||||
set -g default-terminal "tmux-256color" # "screen-256color" colors
|
set -g default-terminal "tmux-256color" # "screen-256color" colors
|
||||||
|
|
||||||
bind -n End send-key C-e
|
setw -g xterm-keys on
|
||||||
bind -n Home send-key C-a
|
set -s escape-time 10 # faster command sequences
|
||||||
|
set -sg repeat-time 200 # increase repeat timeout
|
||||||
setw -g xterm-keys on # vim mode switching delay
|
|
||||||
set -s escape-time 0 # faster command sequences
|
|
||||||
set -sg repeat-time 150 # increase repeat timeout
|
|
||||||
set -s focus-events on
|
set -s focus-events on
|
||||||
|
|
||||||
set -g prefix C-e
|
|
||||||
unbind C-b
|
|
||||||
bind C-e send-prefix -2
|
|
||||||
|
|
||||||
set -q -g status-utf8 on # expect UTF-8 (tmux < 2.2)
|
set -q -g status-utf8 on # expect UTF-8 (tmux < 2.2)
|
||||||
setw -q -g utf8 on
|
setw -q -g utf8 on
|
||||||
|
|
||||||
set -g history-limit 3000 # boost history
|
set -g history-limit 3000 # boost history
|
||||||
|
|
||||||
# edit configuration
|
# edit configuration
|
||||||
# bind e new-window -n '~/x/conf/tmux/tmux.conf.local' "sh -c '${EDITOR:-nvim} ~/x/conf/tmux/tmux.conf.local && tmux source ~/.tmux.conf && tmux display \"~/.tmux.conf sourced\"'"
|
bind e new-window -n "#{TMUX_CONF_LOCAL}" -e EDITOR="$EDITOR" sh -c 'case "${EDITOR:-vim}" in *vim*) ${EDITOR:-vim} -c ":set syntax=tmux" "$TMUX_CONF_LOCAL";; *) $EDITOR "$TMUX_CONF_LOCAL";; esac && "$TMUX_PROGRAM" ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} source "$TMUX_CONF" \; display "$TMUX_CONF_LOCAL sourced"'
|
||||||
# bind e new-window -n "#{TMUX_CONF_LOCAL}" -e EDITOR="$EDITOR" sh -c 'case "${EDITOR:-vim}" in *vim*) ${EDITOR:-vim} -c ":set syntax=tmux" "$TMUX_CONF_LOCAL";; *) $EDITOR "$TMUX_CONF_LOCAL";; esac && "$TMUX_PROGRAM" ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} source "$TMUX_CONF" \; display "$TMUX_CONF_LOCAL sourced"'
|
|
||||||
|
|
||||||
# reload configuration
|
# reload configuration
|
||||||
# bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
|
|
||||||
bind r run '"$TMUX_PROGRAM" ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} source "$TMUX_CONF"' \; display "#{TMUX_CONF} sourced"
|
bind r run '"$TMUX_PROGRAM" ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} source "$TMUX_CONF"' \; display "#{TMUX_CONF} sourced"
|
||||||
|
|
||||||
|
bind r run '"$TMUX_PROGRAM" ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} source "$TMUX_CONF"' \; display "#{TMUX_CONF} sourced"
|
||||||
|
|
||||||
|
set -g prefix C-e
|
||||||
|
|
||||||
|
unbind C-b
|
||||||
|
unbind '"'
|
||||||
|
unbind %
|
||||||
|
bind -n End send-key C-e
|
||||||
|
bind -n Home send-key C-a
|
||||||
|
bind C-e send-prefix -2
|
||||||
|
|
||||||
# -- display -------------------------------------------------------------------
|
# -- display -------------------------------------------------------------------
|
||||||
|
|
||||||
set -g base-index 1 # start windows numbering at 1
|
set -g base-index 1 # start windows numbering at 1
|
||||||
setw -g pane-base-index 1 # make pane numbering consistent with windows
|
setw -g pane-base-index 1 # make pane numbering consistent with windows
|
||||||
|
|
||||||
setw -g automatic-rename on # rename window to reflect current program
|
setw -g automatic-rename on # rename window to reflect current program
|
||||||
set -g renumber-windows on # renumber windows when a window is closed
|
set -g renumber-windows on # renumber windows when a window is closed
|
||||||
|
|
||||||
# set -g set-titles on # set terminal title
|
set -g set-titles on # set terminal title
|
||||||
|
|
||||||
set -g display-panes-time 800 # slightly longer pane indicators display time
|
set -g display-panes-time 800 # slightly longer pane indicators display time
|
||||||
set -g display-time 1000 # slightly longer status messages display time
|
set -g display-time 1000 # slightly longer status messages display time
|
||||||
|
@ -54,7 +56,7 @@ set -g display-time 1000 # slightly longer status messages display time
|
||||||
set -g status-interval 30 # redraw status line every 30 seconds
|
set -g status-interval 30 # redraw status line every 30 seconds
|
||||||
|
|
||||||
# clear both screen and history
|
# clear both screen and history
|
||||||
bind -n C-l send-keys C-l \; run 'sleep 0.1' \; clear-history
|
bind -n C-l send-keys C-l \; run 'sleep 0.2' \; clear-history
|
||||||
|
|
||||||
# activity
|
# activity
|
||||||
set -g monitor-activity on
|
set -g monitor-activity on
|
||||||
|
@ -69,12 +71,13 @@ bind C-c new-session
|
||||||
# find session
|
# find session
|
||||||
bind C-f command-prompt -p find-session 'switch-client -t %%'
|
bind C-f command-prompt -p find-session 'switch-client -t %%'
|
||||||
|
|
||||||
unbind '"'
|
# session navigation
|
||||||
unbind %
|
bind BTab switch-client -l # move to last session
|
||||||
|
|
||||||
# split current window horizontally
|
# split current window horizontally
|
||||||
bind '-' split-window -v -c '#{pane_current_path}'
|
bind '-' split-window -v # -c '#{pane_current_path}'
|
||||||
# split current window vertically
|
# split current window vertically
|
||||||
bind '\' split-window -h -c '#{pane_current_path}'
|
bind '\' split-window -h # -c '#{pane_current_path}'
|
||||||
|
|
||||||
# pane navigation
|
# pane navigation
|
||||||
bind -r h select-pane -L # move left
|
bind -r h select-pane -L # move left
|
||||||
|
@ -87,7 +90,7 @@ bind > swap-pane -D # swap current pane with the next one
|
||||||
bind < swap-pane -U # swap current pane with the previous one
|
bind < swap-pane -U # swap current pane with the previous one
|
||||||
|
|
||||||
# maximize current pane
|
# maximize current pane
|
||||||
bind + run "cut -c3- '#{TMUX_CONF}' | sh -s _maximize_pane '#{session_name}' #D"
|
bind + run "cut -c3- '#{TMUX_CONF}' | sh -s _maximize_pane '#{session_name}' '#D'"
|
||||||
|
|
||||||
# pane resizing
|
# pane resizing
|
||||||
bind -r ^k resizep -U 8
|
bind -r ^k resizep -U 8
|
||||||
|
@ -98,22 +101,18 @@ bind -r ^l resizep -R 8
|
||||||
# window navigation
|
# window navigation
|
||||||
unbind n
|
unbind n
|
||||||
unbind p
|
unbind p
|
||||||
bind -r [ previous-window # select previous window
|
bind -r [ previous-window # C-h, select previous window
|
||||||
bind -r ] next-window # select next window
|
bind -r ] next-window # C-l, select next window
|
||||||
bind Tab last-window # move to last active window
|
bind Tab last-window # move to last active window
|
||||||
|
|
||||||
# toggle mouse
|
# toggle mouse
|
||||||
bind m run "cut -c3- '#{TMUX_CONF}' | sh -s _toggle_mouse"
|
bind m run "cut -c3- '#{TMUX_CONF}' | sh -s _toggle_mouse"
|
||||||
|
|
||||||
|
|
||||||
# -- urlview -------------------------------------------------------------------
|
|
||||||
|
|
||||||
# bind U run "cut -c3- '#{TMUX_CONF}' | sh -s _urlview #{pane_id}"
|
|
||||||
|
|
||||||
|
|
||||||
# -- facebook pathpicker -------------------------------------------------------
|
# -- facebook pathpicker -------------------------------------------------------
|
||||||
|
|
||||||
# bind F run "cut -c3- '#{TMUX_CONF}' | sh -s _fpp '#{pane_id}' '#{pane_current_path}'"
|
bind F run "cut -c3- '#{TMUX_CONF}' | sh -s _fpp '#{pane_id}' '#{pane_current_path}'"
|
||||||
|
|
||||||
|
|
||||||
# -- copy mode -----------------------------------------------------------------
|
# -- copy mode -----------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -140,19 +139,11 @@ if -b '[ -c /dev/clipboard ]' 'bind y run -b "\"\$TMUX_PROGRAM\" \${TMUX_SOCKET:
|
||||||
|
|
||||||
# -- buffers -------------------------------------------------------------------
|
# -- buffers -------------------------------------------------------------------
|
||||||
|
|
||||||
# bind b list-buffers # list paste buffers
|
bind b list-buffers # list paste buffers
|
||||||
# bind P paste-buffer # paste from the top paste buffer
|
bind P paste-buffer # paste from the top paste buffer
|
||||||
bind p choose-buffer # choose which buffer to paste from
|
bind p choose-buffer # choose which buffer to paste from
|
||||||
|
|
||||||
|
|
||||||
# -- user defined overrides ----------------------------------------------------
|
|
||||||
|
|
||||||
if '[ -f ~/x/conf/tmux/tmux.conf.local ]' 'source ~/x/conf/tmux/tmux.conf.local'
|
|
||||||
|
|
||||||
# -- user plugs ---------------------------------------------------------------------
|
|
||||||
|
|
||||||
# if '[ -f ~/x/conf/tmux/tmux.conf.plugs ]' 'source ~/x/conf/tmux/tmux.conf.plugs'
|
|
||||||
|
|
||||||
# -- 8< ------------------------------------------------------------------------
|
# -- 8< ------------------------------------------------------------------------
|
||||||
|
|
||||||
%if #{==:#{TMUX_PROGRAM},}
|
%if #{==:#{TMUX_PROGRAM},}
|
||||||
|
|
Loading…
Add table
Reference in a new issue