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

Re: Vim syntax file for zsh

On Sat, 4 Dec 2004 17:42:17 +0100, Nikolai Weibull
<mailing-lists.zsh-users@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> I'm actually thinking that none of them should be highlighted, not even
> those that are "special".  Any input?
> Three choices:
> 1.  Highlight all variable references alike.
> 2.  Highlight only "special" variables, such as $$, $#, and $n.
> 3.  Highlight no variable references at all.

I would prefer 1&2 together, and then 1 in that order.

> If you look at the C syntax definition, no variable references are
> highlighted, and this isn't only due to the fact that it is infinitely
> much harder to determine what a variable in C (no marking $) is but also
> to keep things simple and clean.  Variables are everywhere, so
> highlighting all of them makes the display cluttered.

I appreciate your point about the cluttering. 

Though I like the perl syntax coloring. It deals with all the
little context regions special to perl like different types of quotes,
search regex, replace strings, heredocs, etc. I think zsh is closer to
perl than C in that it has a lot of little special contexts with their own
rules. (Not sure what you call this language property.)  Having the
coloring expose those special areas can make code more readable.

My interest is looking at existing code and trying to understand it. 
I'm typically looking at the completion and zle widget code that comes
with zsh, and that code contains a lot of these nested parameter
expressions.  And with no highlighting or with a single color
highlighting, the coloring doesn't help as much as it seems like it


> Also things like the first line #compdef or #autoload lines are not
> > marked or highlighted in any way, other than as a comment.
> Hm, that's an interesting suggestion.  The #! /bin/shell stuff should
> perhaps also be highlighted.  It's simple enough to add.
> Could you perhaps point me to where I find the exact information that
> may appear in a beginning comment line?  I always seem to lose that
> page in the info pages.
This looks like this contains the information you would need:


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