From 21a9125689a2583caf2aee4102d27d3dc7598673 Mon Sep 17 00:00:00 2001 From: Alexey Samoshkin Date: Fri, 24 Nov 2017 14:33:34 +0200 Subject: [PATCH] Open new windows and pane while retaining current working directory --- tmux/tmux.conf | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tmux/tmux.conf b/tmux/tmux.conf index 3f7824a..c8752a5 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -65,13 +65,16 @@ bind C-e new-window -n 'tmux.conf' "sh -c '\${EDITOR:-vim} ~/.tmux.conf && tmux # Reload tmux configuration bind C-r source-file ~/.tmux.conf \; display "Config reloaded" +# new window and retain cwd +bind c new-window -c "#{pane_current_path}" + # Rename session and window bind r command-prompt -I "#{window_name}" "rename-window '%%'" bind R command-prompt -I "#{session_name}" "rename-session '%%'" # Split panes -bind | split-window -h -bind _ split-window -v +bind | split-window -h -c "#{pane_current_path}" +bind _ split-window -v -c "#{pane_current_path}" # Select pane and windows bind -r C-[ previous-window @@ -186,12 +189,6 @@ bind -T copy-mode-vi MouseDown1Pane select-pane \;\ # tmux show-options -g -s set-clipboard # set-clipboard on|external -# TODO: open new window/pane and retain pwd -# bind '"' split-window -c "#{pane_current_path}" -# bind % split-window -h -c "#{pane_current_path}" -# bind c new-window -c "#{pane_current_path}" - - # ===================================== # === Theme === # =====================================