Yang wrote:
On 9/2/06, A.J.Mechelynck antoine.mechelynck-at-skynet.be |vim|
<...> wrote:
Yang wrote:
> There seems to be an 'undocumented feature' when editing Lisp files
> with the 'lisp' option set. I can no longer % between matching
> s-expressions []{}() if they are in comments and on newlines, e.g. in:
>
> ;; myfold {{{
> (blah blah)
> ;; }}}
>
> ;; (blah
> ;; blah)
>
> I can't jump between the {} or the second (). Is this a bug?
>
Are you using matchit or "plain" % jumping? By default, matching ignores
matches inside comments, see ":help b:match_skip"
Best regards,
Tony.
I'm not using matchit, I'm using plain %.
I didn't know about matchit; do I need to use this instead of vim's
built-in %, then? I just installed matchit, but when I tried letting
b:match_skip = 's:string', nothing seemed to change.
(In any case, this still doesn't explain the plain % behavior.)
You don't "need" to do anything; it's your choice. I use matchit because
I prefer its more extensive choice of matched words depending on the
underlying syntax. I don't have Lisp sources, but in HTML pages I see %
jumping from ( to ) inside a comment or from < to > or <a to </a>
outside comments but not between something in a comment and something
that isn't. I'm not sure about jumping from one comment to another, but
I see jumping happening from text to text, skipping a comment. I believe
that this is the "normal" behaviour.
If you don't see the equivalent in Lisp with the _default_ settings,
then maybe your Lisp plugins are not matchit-aware?
Mine (distributed with Vim 7) are:
ftplugin/lisp.vim
by Sergey Khorev (after Dorai Sitaram), Nov 8, 2004
syntax/lisp.vim (version 17a)
by Charles E. Campbell, Jr., Oct 12, 2005
The former sets no matchit variables; the latter -- I'm not sure. Let's
wait and see if these two people have something to say on this matter.
Best regards,
Tony.