History Search Ctrl+R in my zsh cancels if I enter the dot .
character.
If I hit Ctrl+R the bck-i-search:
prompt appears and the history is searched according to the words I enter. But as soon as I type .
, the search is canceled, the last found result is shown in the prompt and a .
appeared at the cursor position.
foo@bar ~ vi footnote.txt
bck-i-search: foo
And as soon as I enter the . character this is the result:
foo@bar ~ vi .footnote.txt
Is it possible to allow the dot character to be part of the search string?
I am using zsh with "oh-my-zsh".
Edit:
After going line-for-line through my .zshrc I detected the reason for this behaviour:
## Quick ../../..
rationalise-dot() {
if [[ $LBUFFER = *.. ]]; then
LBUFFER+=/..
else
LBUFFER+=.
fi
}
zle -N rationalise-dot
bindkey . rationalise-dot
This function is used to automatically change a series of ...
into ../..
.
I would like to keep this feature but still allowing the .
in search strings.
.zshrc
, until I closed in on the perpetrator. I updated the question detailing the result.