From b9943589e308aeffecd92d6f5166a9721de87685 Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Fri, 23 Oct 2015 22:15:43 +0200 Subject: [PATCH] optionally prompt for session name when creating a new session --- .tmux.conf | 12 ++++++++---- .tmux.conf.local | 4 ++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 998046e..355da89 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -57,9 +57,6 @@ set -g visual-activity off # -- navigation ---------------------------------------------------------------- -# create new session -bind C-c new-session - # find session bind C-f command-prompt -p find-session 'switch-client -t %%' @@ -150,7 +147,7 @@ if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local' # -- 8< ------------------------------------------------------------------------ run 'cut -c3- ~/.tmux.conf | sh -s apply_theme' -run 'cut -c3- ~/.tmux.conf | sh -s apply_configurable_bindings $tmux_conf_new_windows_retain_current_path $tmux_conf_new_panes_retain_current_path' +run 'cut -c3- ~/.tmux.conf | sh -s apply_configurable_bindings' run 'for name in $(printenv | grep -Eo ^tmux_conf_[^=]+); do tmux setenv -gu $name; done;' @@ -475,6 +472,13 @@ run 'for name in $(printenv | grep -Eo ^tmux_conf_[^=]+); do tmux setenv -gu $na # bind - split-window -v \;\ # bind _ split-window -h # fi +# +# tmux_conf_new_session_prompt=${tmux_conf_new_session_prompt:-false} +# if [ x"$tmux_conf_new_session_prompt" = x"true" ] || [ x"$tmux_conf_new_session_prompt" = x"1" ] ; then +# tmux bind C-c command-prompt -p new-session 'new-session -s %%' +# else +# tmux bind C-c new-session +# fi # } # # urlview() { diff --git a/.tmux.conf.local b/.tmux.conf.local index 69d97a3..509744e 100644 --- a/.tmux.conf.local +++ b/.tmux.conf.local @@ -76,6 +76,10 @@ tmux_conf_new_windows_retain_current_path=false tmux_conf_new_panes_retain_current_path=true #tmux_conf_new_panes_retain_current_path=false +# prompt for session name when creating a new session +tmux_conf_new_session_prompt=false +#tmux_conf_new_session_prompt=true + # if you're running tmux within iTerm2 # - and tmux is 1.9 or 1.9a # - and iTerm2 is configured to let option key act as +Esc