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 {
|
function rationalize_dots {
|
||||||
# Rationalize dots at BOL or after a space or slash.
|
# Rationalize dots at BOL or after a space or slash.
|
||||||
if [[ "$LBUFFER" =~ "(^|[ /])\.\./$" ]]; then
|
if [[ "$LBUFFER" =~ "(^|[ /])\.\./$" ]]; then
|
||||||
|
# ../ + . -> ../../
|
||||||
LBUFFER+=../
|
LBUFFER+=../
|
||||||
elif [[ "$LBUFFER" =~ "(^|[ /])\.\.$" ]]; then
|
elif [[ "$LBUFFER" =~ "(^|[ /])\.\.$" ]]; then
|
||||||
|
# .. + . -> ../../
|
||||||
# NOTE: This scenario occurs only if backspace or `default_dot` was
|
# NOTE: This scenario occurs only if backspace or `default_dot` was
|
||||||
# used.
|
# used.
|
||||||
LBUFFER+=/../
|
LBUFFER+=/../
|
||||||
elif [[ "$LBUFFER" =~ "(^|[ /])\.$" ]]; then
|
elif [[ "$LBUFFER" =~ "(^|[ /])\.$" ]]; then
|
||||||
|
# . + . -> ../
|
||||||
LBUFFER+=./
|
LBUFFER+=./
|
||||||
else
|
else
|
||||||
LBUFFER+=.
|
LBUFFER+=.
|
||||||
|
|||||||
Reference in New Issue
Block a user