zsh:keys:rationalize_dots: Add comments
This commit is contained in:
@@ -85,12 +85,15 @@ bindkey -M vicmd " f" edit-fuzzy-file
|
||||
function rationalize_dots {
|
||||
# Rationalize dots at BOL or after a space or slash.
|
||||
if [[ "$LBUFFER" =~ "(^|[ /])\.\./$" ]]; then
|
||||
# ../ + . -> ../../
|
||||
LBUFFER+=../
|
||||
elif [[ "$LBUFFER" =~ "(^|[ /])\.\.$" ]]; then
|
||||
# .. + . -> ../../
|
||||
# NOTE: This scenario occurs only if backspace or `default_dot` was
|
||||
# used.
|
||||
LBUFFER+=/../
|
||||
elif [[ "$LBUFFER" =~ "(^|[ /])\.$" ]]; then
|
||||
# . + . -> ../
|
||||
LBUFFER+=./
|
||||
else
|
||||
LBUFFER+=.
|
||||
|
||||
Reference in New Issue
Block a user