On Thu, Jan 25, 2007 at 04:39:15PM +0200, Ilya Bobir wrote:
> Gregory Seidman wrote:
> >I'm finding that smartindent is routinely wrong about how I want things to
> >be indented in JS, but I haven't been able to find an indent script. I'd be
> >interested in working on it myself, but I don't know the first thing about
> >how the function referred to when setting indentexpr is expected to behave.
> >
> >Is anyone already working on an indentation file for JavaScript? If so, I'd
> >be interested in helping. If not, would anyone be interested in
> >collaborating on it?
> >
> >--Greg
> >  
> Hi,
> 
> I have a pretty working JS indentation script - javascript.vim, but it
> handles only most common cases.  It uses the build in C indentation rules
> and does a bit of correction.  Really much more corrections is required
> in order to indent JavaScript correctly for all the cases.  Maybe C
> indent is a bad starting point for a complete JavaScript indentation
> solution.  I've also tried using syntax in order to calculate indentation
> but this attempt lead me to even worth results - javascript.vim.bad.
> Maybe you can fix the syntax based version, as it is more promising. IIRC
> some changes were required in the syntax script in order to get better
> indentation results...
> 
> Currently I'm not programming in JavaScript, so I doubt I can devote much
> time to fixing its indentation script.  But probably I will be, so I am
> interested in having a complete JavaScript indentation solution in Vim.

Much appreciated. This was exactly the starting point I was looking for.
Don't expect immediate results, but I'll get to work on it in my minimal
free time. I'll post the results here and in the vim scripts archive, and
we'll share credit.

--Greg

Reply via email to