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

Re: Comments in ZLE



2009/2/14 Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>:
> kba <unixprog@xxxxxxxxxxxxxx>:
>> On Fri, Feb 13, 2009 at 11:01:37PM +0100, Frank Terbeck wrote:
>> > Frank Jeschke <jes@xxxxxxxxx>:
> [...]
>> > > sss@kyag:[~]$ #vim /tmp/foo
>> > > zsh: command not found: #vim
> [...]
>> >
>> > % man zshoptions | less -p INTERACTIVE_COM
>>
>> I shared Frank's confusion until I recently stumbled over the
>> INTERACTIVE_COM option by accident. Is there a specific reason why this
>
> It's actually INTERACTIVE_COMMENTS. I was too lazy to type it out.
> Less's -p option just wants a pattern to search for, so that was
> enough. :-)
>
>> is off by default? To avoid clashes with commands that start with '#'?
>
> Well, I'd guess it's been done to let people use the hash char without
> needing to quote it. After all, who really uses comments in
> interactive mode? (yeah, I know some people do. But they can just use
> said option.)
>
>> Can '#' be used to do history expansion like '!' or something like this?
>
> Not that I would know, why?

# can be used for lots of stuff, (foo/)# for repeating patterns,
${#foo}, ${foo#pattern}, $(( ##a )) etc etc. Note that I only know
what the first one does :).

-- 
Mikael Magnusson



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