From 04ef69c02183280706836d577a548ae4aa767260 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Mon, 2 Jun 2025 11:07:04 +0200 Subject: [PATCH] zsh:rationalize-dots: Self-insert when replacing --- .config/zsh/zshrc.d/60-keys.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.config/zsh/zshrc.d/60-keys.zsh b/.config/zsh/zshrc.d/60-keys.zsh index 2ceb074..64b6d6d 100644 --- a/.config/zsh/zshrc.d/60-keys.zsh +++ b/.config/zsh/zshrc.d/60-keys.zsh @@ -152,6 +152,12 @@ bindkey -M vicmd " f" edit-fuzzy-file # Modified version (end with a trailing slash) of: # https://github.com/majutsushi/etc/blob/1d8a5aa28/zsh/zsh/func/rationalize-dots function rationalize_dots { + if [[ $ZLE_STATE == *overwrite* ]]; then + # Don't do anything in overwrite-mode (i.e. vim's Replace-mode) + zle self-insert + return + fi + # Rationalize dots at BOL or after a space or slash. if [[ "$LBUFFER" =~ "(^|[ /])\.\./$" ]]; then # ../ + . -> ../../