From 69a0bedc3604e97dcabd8365f78924fe7ab68fd3 Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Sat, 17 Feb 2024 14:57:52 +0100 Subject: [PATCH] tmux_conf_preserve_stock_bindings, resolves #553 --- .tmux.conf | 6 ++++++ .tmux.conf.local | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/.tmux.conf b/.tmux.conf index 5001d3c..599d4f1 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -858,7 +858,13 @@ run 'cut -c3- "$TMUX_CONF" | sh -s _apply_configuration' # _apply_bindings() { # cfg=$(mktemp) && trap 'rm -f $cfg*' EXIT # +# tmux_conf_preserve_stock_bindings=${tmux_conf_preserve_stock_bindings:-false} # tmux list-keys | grep -vF 'TMUX_CONF_LOCAL' | grep -E 'new-window|split(-|_)window|new-session|copy-selection|copy-pipe' > "$cfg" +# if _is_true "$tmux_conf_preserve_stock_bindings"; then +# probe_socket="$(dirname "$TMUX_SOCKET")/tmux-stock-bindings-$$" +# TMUX_SOCKET="$probe_socket" tmux -f /dev/null list-keys >> "$cfg" +# rm -f "%probe_socket" +# fi # # # tmux 3.0 doesn't include 02254d1e5c881be95fd2fc37b4c4209640b6b266 and the # # output of list-keys can be truncated diff --git a/.tmux.conf.local b/.tmux.conf.local index 87f0efb..81e081a 100644 --- a/.tmux.conf.local +++ b/.tmux.conf.local @@ -5,6 +5,16 @@ # Copyright 2012— Gregory Pakosz (@gpakosz). +# -- bindings ------------------------------------------------------------------ + +# preserve tmux stock bindings, +# while adding bindings that don't conflict with these stock bindings +# /!\ this disables some of Oh my tmux! bindings described in README.md +# - true +# - false (default) +tmux_conf_preserve_stock_bindings=false + + # -- session creation ---------------------------------------------------------- # prompt for session name when creating a new session, possible values are: