When I type a space followed by the pipe symbol '|'
on the zsh command line, zsh eats the space, placing the pipe symbol directly up against the prior word. How do I stop it from doing that? I'm not sure about any possible stylistic conventions, but I like a space on both sides of the pipe symbol for readability. I'm using oh-my-zsh pretty much out of the box.
Solution
Based on mpy's answer below, I used the following solution:
By default, ZLE_REMOVE_SUFFIX_CHARS is undefined in zsh/ohmyzsh. When undefined, it acts as though it was:
ZLE_REMOVE_SUFFIX_CHARS=$' \t\n;&|'
I added the following definition to my ~/.zshrc:
ZLE_REMOVE_SUFFIX_CHARS=$' \t\n;&'
(all except pipe) and presto, perfect! problem gone.
Best Answer
I suppose you mean that when you
TAB
complete a command / filename a space is added automatically, but after pressing|
it vanishes again. Otherwise I can't reproduce that effect.However, in that case the solution should be as simple as
The explanation is a litly bit tricky, so I simply quote
man zshparam