I've taken a crack at creating a syntax file for vim which demphasizes
Leo's metadata chatter without detracting (much) from the information
contained in the headline comments. It's crude but effective. I could
use help with tuning the pattern match expressions (for example html
files aren't working, though they were a few hours ago), see comments.
Save the attached filetype.vim in ~/.vim/after/ (linux) or
%userprofile%\_vim\after\ (windows, going from memory). It's not
necessary to restart vim, thought you do need to switch to another
file (buffer) and back again to force a refresh.
cheers,
--
-matt
Many thanks for this work. I have long dreamed of something like
this. I had thought that it would be good to have emacs or vim simply
not show sentinels, but now I'm not so sure. Your way is brilliantly
simple, and in some ways is superior to hiding sentinels completely.
This is great work. Thanks for doing it.
Edward
After more hours troubleshooting than I care to think about, I've
finally managed to get branch pushed to Launchpad for this:
http://bazaar.launchpad.net/~maphew/leo-editor/stuff/files
cheers,
-matt
> --
> You received this message because you are subscribed to the Google Groups "leo-editor" group.
> To post to this group, send email to leo-e...@googlegroups.com.
> To unsubscribe from this group, send email to leo-editor+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
>
>
--
-matt
> After more hours troubleshooting than I care to think about, I've
> finally managed to get branch pushed to Launchpad for this:
> http://bazaar.launchpad.net/~maphew/leo-editor/stuff/files
Why not put it to the "contrib" branch?
--
Ville M. Vainio @@ Forum Nokia
because "You cannot upload to this branch. Members of The Leo editor
team can upload to this branch." :)
-matt
El 02/12/10 05:25, Matt Wilkie escribi�:
I'm just curious about this deemphasizing. How you see the normal
comments in python versus the comments of Leo metadata inside this
Python file. For example if we have:
# This is a test file of python that has some commented code
#@<leo-metadata>
This two lines should be seen different in vim using your syntax file?
Cheers,
Offray
Yes that's right, the two lines are treated differently. Basically the
syntax file scans for any occurrence of "@@" or "@+" or "@-" within
the first 5 characters of a Comment line. If found the line is called
a "leoSentinel" and changed to lightgrey. Each leoSentinel line is
further scanned for the right most asterisk "*", and the contents to
the right of that revert back to the normal Comment colour.
That's the theory anyway. For some reason it doesn't work with html
files, though it did at an earlier point in my experiments. A new
update is forthcoming which should make it a little more reliable.
cheers,
-matt
A new version (r7) has been uploaded to
https://code.launchpad.net/~maphew/leo-editor/stuff. Changes:
- two files are now needed, both in ~/.vim/after. Previously the
highlighting was working ing Cream+gvim but not stock (g)vim. Now it
works for (g)vim (and is broken in Cream, *sigh*, but much as I like
Cream, it's not the primary target).
- Leo sentinel regex now looks in all defined syntax names not just
comments to identify a sentinel line. This will make the addon easier
to maintain. Previously one would have to add "xxxComment" every time
a new language syntax was added.
It's possible this change will have a performance impact on very large
files or slow machines. My test workstation is fairly old though and I
noticed no difference.
--
-matt
Now merged with lp:~leo-editor-team/leo-editor/contrib. This is the
first time I've merged branches, so may have not done it correctly,
please vet.
cheers,
--
-matt
The .leo file loads correctly, so all looks good. It would be cleaner
if the .leo file were in the vim-syntax folder...
Edward
done.
I also found and fixed a serious mistake that caused data loss: I was
using clones and @file nodes to mirror the vim syntax files from the
project working directory to the vim profile directory. This appeared
to work just fine... until I started using the same setup on multiple
computers.
My workflow is (supposed to be) pull changes from bzr or dropbox to
the working dir, open the .leo file, do stuff, then save, which
mirrors changes from working to $home/vim/after/. However it turns out
what *actually* happens is that the most recently read @file wins,
updating the clones in the other @file nodes. So each time I switched
computers the older vim profile syntax files, which are later in the
outline tree, were overwriting the new work. (It's good to know I
wasn't just imagining making the same changes over and over!)
The fix is to use @file nodes for the code files and @auto nodes for
the one-way mirror files, now committed in r6.
I'd have cottoned on to the real problem sooner if I hadn't ignored
the recovered nodes tree Leo created. I thought I was just seeing this
bug[1] again so didn't pay attention, once again proving the adage
that assumptions make an ass of u and me, though mostly just me ;-)
[1] https://bugs.launchpad.net/leo-editor/+bug/683867
cheers,
--
-matt