diff --git a/themes/brethil.zsh-theme b/themes/brethil.zsh-theme index c92f4bb..4d9b74f 100644 --- a/themes/brethil.zsh-theme +++ b/themes/brethil.zsh-theme @@ -81,13 +81,18 @@ function __prompt_too_long(){ # prints a newline if less than $COLUMNS/2 characters remain to the right margin, see end of `man zshmisc` echo "%-$((COLUMNS/2))(l..\n)" } +function __print_prompt_marker(){ + # prints the escape sequence that tmux interprets as prompt start (see next-prompt/previous-prompt in `man tmux`) + printf '\033]133;A\033\\' +} ## oh-my-zsh vi-mode plugins indicators: export MODE_INDICATOR="[%B%K{red}nav%k%b]" # red background export INSERT_MODE_INDICATOR="[%B%K{28}ins%k%b]" # green background -# put it all together -PROMPT='$(__virtualenv_info)'"${user_prompt}${path_prompt}${git_prompt}${job_prompt}${shlvl_prompt}$(__prompt_too_long)${prompt_with_previous_return_status}" - -# Right prompt is just return code and time +## put it all together +# Note: wrapping __print_prompt_marker in extra %{...%} works around an issue with zsh autosuggestions with escape sequences +# see https://github.com/zsh-users/zsh-autosuggestions/issues/570 for more information +PROMPT='$(__virtualenv_info)'"${user_prompt}${path_prompt}${git_prompt}${job_prompt}${shlvl_prompt}$(__prompt_too_long)${prompt_with_previous_return_status}%{$(__print_prompt_marker)%} " +# right prompt indicator: return code, vi mode prompt info and current time RPS1="${return_code_RPS1}"'$(vi_mode_prompt_info)[%*]' diff --git a/tmux.conf b/tmux.conf index f7a8f43..99452f8 100644 --- a/tmux.conf +++ b/tmux.conf @@ -103,3 +103,6 @@ bind-key W choose-window 'swap-window -t "%%"' bind A command-prompt "rename-window \"%%\"" bind C customize-mode + +bind-key -T copy-mode-vi n send-keys -X next-prompt +bind-key -T copy-mode-vi p send-keys -X previous-prompt