Created
September 20, 2025 03:43
-
-
Save ormaaj/516bf42870fda8b56cce896528283a6c to your computer and use it in GitHub Desktop.
tmux.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ~/.tmux.conf | |
| if-shell \ | |
| 'tput -T tmux-256color longname' \ | |
| 'set -s default-terminal tmux-256color' \ | |
| 'set -s default-terminal screen-256color' | |
| %hidden trace='strace -DDYYyqqqf' | |
| %hidden el=/usr/bin/execlineb | |
| %hidden bash=/usr/bin/bash | |
| %hidden ksh=/usr/bin/ksh | |
| %hidden bashargs='-sipo vi +o posix +o histexpand -O lastpipe -O extglob -O expand_aliases +O assoc_expand_once +O sourcepath' | |
| %hidden kshargs='-sipo vi -o posix' | |
| %hidden shexec="import os, os.path, sys, pwd, locale, signal\n\ | |
| def main():\n\ | |
| for s in [signal.SIGPIPE, signal.SIGXFSZ]: signal.signal(s, signal.SIG_DFL)\n\ | |
| os.sched_setscheduler(0, os.SCHED_OTHER, os.sched_param(0))\n\ | |
| os.nice(-os.getpriority(os.PRIO_PROCESS, 0))\n\ | |
| os.environ.setdefault('TMPDIR', '/tmp')\n\ | |
| os.environ.setdefault('BASH_COMPAT', '51')\n\ | |
| p = {k: str(v) for k, v in zip(('USER', None, 'UID', 'GID', None, 'HOME', 'SHELL'), pwd.getpwuid(os.geteuid())) if k}\n\ | |
| os.execve(p['SHELL'], (lambda sh: [sh, *(sh == 'bash' and sys.argv[1:] or [])])(os.path.basename(os.path.realpath(p['SHELL']))), {**os.environ, **p})\n\ | |
| \n\ | |
| main()" | |
| set -g default-shell $bash | |
| set -g default-command $bash | |
| run-shell -C "bind -T prefix c new-window -- python -X utf8=0 -c \$shexec $bashargs" | |
| run-shell -C "bind -T prefix '\"' split-window -v -- python -X utf8=0 -c \$shexec $bashargs" | |
| run-shell -C "bind -T prefix % split-window -h -- python -X utf8=0 -c \$shexec $bashargs" | |
| set -s default-terminal tmux-direct | |
| set -s terminal-features "xterm*:clipboard:ccolour:cstyle:extkeys:focus:mouse:overline:rectfill:RGB:strikethrough:sync:title:usstyle" | |
| #set -s terminal-features "xterm*:clipboard:ccolour:cstyle:extkeys:focus:margins:mouse:overline:rectfill:RGB:strikethrough:sync:title:usstyle" | |
| #set -g terminal-overrides "xterm*:XT:Ms=\E]52;%p1%s;%p2%s\007:Cs=\E]12;%p1%s\007:Cr=\E]112\007:Ss=\E[%p1%d:q:Se=\E[2:q:Tc,screen*:XT;Tc" | |
| set -s extended-keys always | |
| set -s focus-events on | |
| set -s set-clipboard on | |
| set -s history-file ~/.tmux_history | |
| set -s exit-empty 1 | |
| set -g status-interval 1 | |
| set -g status-right-length 80 | |
| set -g display-time 2000 | |
| set -g history-limit 20000 | |
| set -g repeat-time 1000 | |
| set -g set-titles on | |
| set -g mouse on | |
| set -g mode-keys vi | |
| set -g status-keys vi | |
| set -g escape-time 0 | |
| set -g lock-command /usr/bin/vlock | |
| set -g status-position top | |
| set -g status-style 'bg=colour234,fg=colour7' | |
| set -g message-style 'bg=colour234,fg=colour7' | |
| set -g message-command-style 'bg=colour234,fg=colour7' | |
| set -g pane-active-border-style 'fg=colour27' | |
| set -wg aggressive-resize on | |
| set -wg monitor-bell off | |
| set -wg monitor-activity off | |
| set -wg pane-border-indicators off | |
| set -wg window-status-format "#{?window_flags,#{window_flags}, }#{window_index}.#{pane_index}-#{pane_current_command}" | |
| set -wg window-status-current-format "#{?window_flags,#{window_flags}, }#{window_index}.#{pane_index}-#{pane_current_command}" | |
| set -wg cursor-style bar | |
| set -wg allow-passthrough on | |
| set -wg allow-rename on | |
| set -wg alternate-screen on | |
| set -wg remain-on-exit off | |
| set -g update-environment "COLORFGBG,COLORTERM,COPYQ_SESSION_NAME,COPYQ_SETTINGS_PATH,KMSCON_PID,DBUS_SESSION_BUS_ADDRESS,DBUS_SESSION_BUS_PID,DBUS_SYSTEM_BUS_ADDRESS,DBUS_SYSTEM_BUS_PID,DE,DISPLAY,GPG_TTY,KDED_STARTED_BY_KDEINIT,KDE_FULL_SESSION,KDE_SESSION_UID,KDE_SESSION_VERSION,KONSOLE_DBUS_SERVICE,KONSOLE_DBUS_SESSION,KONSOLE_DBUS_WINDOW,KONSOLE_PROFILE_NAME,PATH,PROFILEHOME,SESSION_MANAGER,SHELL_SESSION_ID,SSH_ASKPASS,SSH_AUTH_SOCK,SSH_AGENT_PID,SSH_CLIENT,SSH_CONNECTION,SSH_TTY,WINDOWID,XAUTHORITY,XDG_CONFIG_DIRS,XDG_DATA_DIRS,XDG_CURRENT_DESKTOP,XDG_RUNTIME_DIR,XDG_SESSION_CLASS,XDG_SESSION_ID,XDG_SESSION_TYPE,XDG_SESSION_COOKIE,XDG_SEAT" | |
| set -g status-left "[#{session_name}] " | |
| set -g status-right "#{pane_title} #{pane_pid} #{pane_tty} %H:%M %Y-%m-%d" | |
| # 'source -- /dotfiles/common/home/shell/functions; setupUniversalOptions; [[ ${| n=${ \ps -wwnp "$BASHPID" -o nice:1=; }; REPLY=$n; } == +([[:digit:]]) || n=0 -ne o ]]; \exec -- nice -n "$((-n))" -- schedtool -Ne "${ type -P bash; }" "${bob[@]}" -sip' | |
| if-shell \ | |
| '[[ ${OSTYPE:-$(uname -o)} == *[Aa]ndroid* && -L ${HOME}/.termux/shell ]]' \ | |
| 'set -g default-command ~/.termux/shell \; set -g default-command ~/.termux/shell' | |
| bind -T prefix y if-shell -b \ | |
| 'set +m -o pipefail && for x in DISPLAY XAUTHORITY; do eval -- "$(tmux showenv -st #{session_id} -- "$x")"; done && tmux saveb - | xsel -d "${DISPLAY:-:0}" -i' \ | |
| 'display "Sent tmux buffer to primary X selection."' \ | |
| 'display "Failed setting selection."' | |
| bind -T prefix C-p if-shell -b \ | |
| 'set +m -o pipefail && for x in DISPLAY XAUTHORITY; do eval -- "$(tmux showenv -st #{session_id} -- "$x")"; done && xsel -d "${DISPLAY:-:0}" -o | tmux loadb -' \ | |
| 'display "Sent tmux buffer to primary X selection."' \ | |
| 'display "Failed loading selection."' | |
| bind -T prefix n next-window | |
| bind -T prefix p previous-window | |
| bind -T prefix o select-pane -t :.+ | |
| bind -T prefix C-o select-pane -t :.- | |
| bind -T prefix ( switch-client -Ep | |
| bind -T prefix ) switch-client -En | |
| bind -T prefix K confirm-before kill-pane | |
| bind ! breakp -d | |
| bind s command-prompt "swapp -s :. -t %%" | |
| bind S command-prompt "swapw -s : -t %%" | |
| bind j choose-window "joinp -s %% -t :." | |
| bind L unlinkw -t :. | |
| #bind m set -w monitor-activity \; display "enabled monitoring on window #{window_index}" | |
| bind r source ~/.tmux.conf \; display "Sourced ~/.tmux.conf" | |
| bind e run-shell -b '{ source /dotfiles/common/home/shell/functions-tmux; tmuxUpdateGlobalEnv; } 2>&1' | |
| bind x lockc | |
| bind O rotate-window | |
| bind -T copy-mode-vi y send-keys -X copy-selection-and-cancel | |
| bind -T copy-mode-vi v send-keys -X begin-selection | |
| bind -T copy-mode-vi C-v send-keys -X rectangle-toggle | |
| bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-selection | |
| #if-shell 'type -P tmux-mem-cpu-load >/dev/null 2>&1' \ | |
| # 'set -g status-right "#(tmux-mem-cpu-load) "' | |
| #if-shell \ | |
| # '[[ ${OSTYPE:-$(uname -o)} == [Cc]ygwin || #{host} == @(ormaaj-laptop|earth|livecd) ]]' \ | |
| # 'set -g prefix C-a; unbind C-b; bind C-a send-prefix' | |
| #if-shell '[[ ${OSTYPE:-$(uname -o)} == *[Aa]ndroid* && -L ${HOME}/.termux/shell ]]' \ | |
| # 'set -g default-shell #(readlink -f "${HOME}/.termux/shell"); set -g default-command #(readlink -f "${HOME}/.termux/shell")' | |
| #set-hook -g client-attached \ | |
| # 'run-shell -b "{ source /dotfiles/common/home/shell/functions-tmux; tmuxUpdateGlobalEnv; } 2>&1"' | |
| # bind -T copy-mode-vi y send -X copy-pipe-and-cancel if-shell -b | |
| #bind-key -T root MouseDown1Pane select-pane -t = ; send-keys -M | |
| #bind-key -T root MouseDown1Status select-window -t = | |
| #bind-key -T root MouseDown3Pane if-shell -F -t = "#{mouse_any_flag}" "select-pane -t=; send-keys -M" "select-pane -mt=" | |
| #bind-key -T root MouseDrag1Pane if-shell -F -t = "#{mouse_any_flag}" "if -Ft= \"#{pane_in_mode}\" \"copy-mode -M\" \"send-keys -M\"" "copy-mode -M" | |
| #bind-key -T root MouseDrag1Border resize-pane -M | |
| #bind-key -T root WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= \"#{pane_in_mode}\" \"send-keys -M\" \"copy-mode -et=\"" | |
| #bind-key -T root WheelUpStatus previous-window | |
| # vim: set ft=tmux fenc=utf-8 ff=unix ts=4 noet : |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment