Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: making `cd` work unquoted




On 05.08.2009, at 16:40, spiralofhope wrote:
I agree that this ought to be a separate command. I was hoping to make
something that could be a drop-in replacement for cd, but that doesn't
look possible.

You would also have to deal with the special case cd with two arguments:

Consider you are in /home/userA/tmp

  cd userA userB

would lead you to /home/userB/tmp

Probably the best route for me to go is to create a function bound to a
hotkey which will either quote my current commandline

It's there already: quote-line and quote-region. Especially the latter is useful together with set-mark-command, which I have bound to ESC-v, just like in vim. In newer zsh version you even get different color for characters that are "marked" like this, e. g.:

  zle_highlight=(region:bg=red special:underline)

This helps if you have to correctly quote things like \""'\''\\\'''" :)


Sebastian



Messages sorted by: Reverse Date, Date, Thread, Author