From ef7376d131274b49d9a7c7b347ab45d21d518abb Mon Sep 17 00:00:00 2001 From: Michele Gerarduzzi Date: Tue, 14 Nov 2023 21:17:05 +0100 Subject: [PATCH] Update tmux configuration --- src/shell/config/tmux/tmux.conf | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/shell/config/tmux/tmux.conf b/src/shell/config/tmux/tmux.conf index c3bcd30..3a74403 100644 --- a/src/shell/config/tmux/tmux.conf +++ b/src/shell/config/tmux/tmux.conf @@ -18,6 +18,10 @@ set -g renumber-windows on # Disable mouse set -g mouse off +# Rename windows based on current directory +set -g automatic-rename on +set -g automatic-rename-format '#{b:pane_current_path}' + # ---------------------------------------------------------------------------- # | Key Mappings | @@ -31,18 +35,25 @@ unbind-key C-b # pressing PREFIX key twice bind C-a send-prefix +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# ---------------------------------------------------------------------------- -# | Status bar | -# ---------------------------------------------------------------------------- +# Use vim keybindings in copy mode +setw -g mode-keys vi + +# Workaround for accessing macOS' pasteboard +# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard -# Rename windows with the basename (:b) of current path -set-option -g automatic-rename on -set-option -g automatic-rename-format '#{b:pane_current_path}' +if-shell \ + 'test "$(uname -s)" = Darwin' \ + 'set-option -g default-command "exec reattach-to-user-namespace -l $SHELL"' -# Notify when something happens in one of the other windows -setw -g monitor-activity on -set -g visual-activity on +# Remap the copy & paste keys to work as in vim +unbind [ +bind Escape copy-mode +unbind p +bind p paste-buffer +bind-key -T copy-mode-vi "v" send-keys -X begin-selection +bind-key -T copy-mode-vi "y" send-keys -X copy-selection # ----------------------------------------------------------------------------