Merge lp:~maphew/leo-editor/stuff into lp:~leo-editor-team/leo-editor/contrib

Proposed by Matt Wilkie
Status: Merged
Merged at revision: 4
Proposed branch: lp:~maphew/leo-editor/stuff
Merge into: lp:~leo-editor-team/leo-editor/contrib
Diff against target: 257 lines (+226/-0)
6 files modified
matt-leo-contribs.leo (+81/-0)
vim-syntax/filetype.vim (+20/-0)
vim-syntax/leo_syntax.vim (+43/-0)
vim-syntax/tests/test.css (+28/-0)
vim-syntax/tests/test.html (+28/-0)
vim-syntax/tests/test.py (+26/-0)
To merge this branch: bzr merge lp:~maphew/leo-editor/stuff
Reviewer Review Type Date Requested Status
Matt Wilkie Approve
Review via email: mp+43463@code.launchpad.net

Description of the change

Adding Leo-awareness to (g)vim syntax highlighting.

To post a comment you must log in.
Revision history for this message
Edward K. Ream (edreamleo) wrote :

On Sun, Dec 12, 2010 at 4:57 AM, Matt Wilkie <email address hidden> wrote:
> Matt Wilkie has proposed merging lp:~maphew/leo-editor/stuff into lp:~leo-editor-team/leo-editor/contrib.

I don't see any changes to Leo's actual source files here, so it
should be safe for merging with the trunk.

Please do so when you are ready.

Edward

Revision history for this message
Matt Wilkie (maphew) wrote :

Thanks Edward!

On Sun, Dec 12, 2010 at 7:37 AM, Edward K. Ream <email address hidden> wrote:
> On Sun, Dec 12, 2010 at 4:57 AM, Matt Wilkie <email address hidden> wrote:
>> Matt Wilkie has proposed merging lp:~maphew/leo-editor/stuff into lp:~leo-editor-team/leo-editor/contrib.
>
> I don't see any changes to Leo's actual source files here, so it
> should be safe for merging with the trunk.
>
> Please do so when you are ready.
>
> Edward
> --
> https://code.launchpad.net/~maphew/leo-editor/stuff/+merge/43463
> You are the owner of lp:~maphew/leo-editor/stuff.
>

--
-matt

Revision history for this message
Matt Wilkie (maphew) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'matt-leo-contribs.leo'
--- matt-leo-contribs.leo 1970-01-01 00:00:00 +0000
+++ matt-leo-contribs.leo 2010-12-12 09:56:55 +0000
@@ -0,0 +1,81 @@
1<?xml version="1.0" encoding="utf-8"?>
2<?xml-stylesheet ekr_test?>
3<leo_file>
4<leo_header file_format="2" tnodes="0" max_tnode_index="0" clone_windows="0"/>
5<globals body_outline_ratio="0.5" body_secondary_ratio="0.5">
6 <global_window_position top="50" left="50" height="500" width="700"/>
7 <global_log_window_position top="0" left="0" height="0" width="0"/>
8</globals>
9<preferences/>
10<find_panel_settings/>
11<vnodes>
12<v t="maphew.20101201124731.3113" a="E"><vh>Leo Contribs (mine)</vh>
13<v t="matt.20101204175038.1325"><vh>@file ~/code/o4w/apt/apt.py</vh></v>
14<v t="matt.20101212004153.1367" a="E"><vh>Vim-Syntax</vh>
15<v t="matt.20101212004153.1446" a="E"
16expanded="matt.20101212004153.1442,"><vh>@file filetype.vim</vh></v>
17<v t="maphew.20101201124731.3123" a="E"><vh>@file leo_syntax.vim</vh></v>
18<v t="matt.20101212004153.1440"
19expanded="matt.20101212004153.1442,"><vh>@file ~/.vim/after/filetype.vim</vh></v>
20<v t="matt.20101204175038.1322" a="E"><vh>@file ~/.vim/after/leo_syntax.vim</vh></v>
21<v t="matt.20101204140731.1281"><vh>tests</vh>
22<v t="matt.20101204175038.1325"></v>
23<v t="maphew.20101201124731.3120"><vh>@@file test.py</vh>
24<v t="matt.20101128004159.1266"><vh>Level One</vh>
25<v t="matt.20101128232629.1271"><vh>Level Two</vh></v>
26</v>
27</v>
28<v t="maphew.20101201124731.3114"><vh>@@file test.html</vh>
29<v t="matt.20101128004159.1266"></v>
30</v>
31<v t="maphew.20101201124731.3117"><vh>@@file test.css</vh>
32<v t="matt.20101128004159.1266"></v>
33</v>
34</v>
35<v t="matt.20101204175038.1323"><vh>@url appending syntax</vh></v>
36<v t="matt.20101204175038.1324"><vh>@url new filetype</vh></v>
37</v>
38</v>
39</vnodes>
40<tnodes>
41<t tx="maphew.20101201124731.3113">
42
43
44</t>
45<t tx="maphew.20101201124731.3114">@language html
46@others
47</t>
48<t tx="maphew.20101201124731.3117">@language css
49@others
50</t>
51<t tx="maphew.20101201124731.3120">@language python
52@others
53</t>
54<t tx="matt.20101128004159.1266">Some text in body of level one
55@ followed by
56/*
57/*
58/*
59/*
60/*
61/*
62multiline
63comment
64*/
65*/
66*/
67*/
68*/
69*/
70</t>
71<t tx="matt.20101128232629.1271">this is body
72of level 2
73</t>
74<t tx="matt.20101204140731.1281">@path tests</t>
75<t tx="matt.20101204175038.1323">http://vimdoc.sourceforge.net/htmldoc/syntax.html#mysyntaxfile-add</t>
76<t tx="matt.20101204175038.1324">http://vimdoc.sourceforge.net/htmldoc/filetype.html#new-filetype</t>
77<t tx="matt.20101212004153.1367">@path vim-syntax
78Towards Leo-aware syntax highlighting in vim.
79@url https://code.launchpad.net/~maphew/leo-editor/stuff</t>
80</tnodes>
81</leo_file>
082
=== added directory 'vim-syntax'
=== added file 'vim-syntax/filetype.vim'
--- vim-syntax/filetype.vim 1970-01-01 00:00:00 +0000
+++ vim-syntax/filetype.vim 2010-12-12 09:56:55 +0000
@@ -0,0 +1,20 @@
1"@+leo-ver=5-thin
2"@+node:matt.20101212004153.1446: * @file filetype.vim
3"@@language vim
4"@+others
5"@+node:matt.20101212004153.1442: ** main
6" Leo editor additions
7" to activate save this file as ~/.vim/after/filetype.vim
8
9if !exists("after_autocmds_loaded")
10 let after_autocmds_loaded = 1
11 au BufNewFile,BufRead * source ~/.vim/after/leo_syntax.vim
12endif
13"@+node:matt.20101212004153.1441: *3* notes
14"@+at
15" The name 'filetype.vim' seems to be sourced BEFORE the syntax files, even when
16" in 'after' dir, so it gets overwritten by the default syntax file. Therefore we
17" resort to this.
18" @url http://stackoverflow.com/questions/4301716/extend-modify-vim-highlighting-for-all-filetypes-at-once/4301809#4301809
19"@-others
20"@-leo
021
=== added file 'vim-syntax/leo_syntax.vim'
--- vim-syntax/leo_syntax.vim 1970-01-01 00:00:00 +0000
+++ vim-syntax/leo_syntax.vim 2010-12-12 09:56:55 +0000
@@ -0,0 +1,43 @@
1"@+leo-ver=5-thin
2"@+node:maphew.20101201124731.3123: * @file leo_syntax.vim
3"@@language vim
4"@+others
5"@+node:matt.20101204175038.1321: ** main
6" Leo editor additions
7" to activate change save this file as ~/.vim/after/leo_syntax.vim
8
9" --- Leo directive ---
10" We assume anything with one of @@, @+, @- near line start is a leo headline/directive.
11" Examples:
12" #@+leo-ver=5-thin
13" #@+node:johndoe.20100928224755.1557: * @file foobar.py
14" #@@first
15" #@+<<docstring> >
16"
17" Search pattern break down:
18"
19" ^ beginning of line
20" . any single character
21" \{,4} 0 to 4 of preceeding pattern (any single character in this case)
22" \zs Set start of match here (http://vimhelp.appspot.com/pattern.txt.html#%2F\zs)
23" @[@\-+] match any of: @@, @+, @-
24" .* include everything after, to end of line
25"
26" (better but too hard(?): match only if preceding character is a known comment delimeter)
27
28syn match leoSentinel "^.\{,4}\zs@[@\-+].*" containedin=ALL
29 " why did this stop this working with html files?
30
31" Resume normal emphasis within leoHeadline after last asterisk (*)
32" Idea is to keep the node's name (headline contents) prominent
33syn match Comment "\* .*$"hs=s+1 containedin=leoSentinel
34
35highlight leoSentinel guifg=grey ctermfg=darkgrey
36
37
38" Wishlist:
39" - background highlight entire node line. Idea is to still communicate or delineate the Leo node boundaries, but hide the noisy stuff. As is now the headline text kind of floats in the middle of nowhere.
40" - would rather the headline colour say 'x% lighter than comment colour, in same hue'. This would be more adaptable to different colour schemes.
41"
42"@-others
43"@-leo
044
=== added directory 'vim-syntax/tests'
=== added file 'vim-syntax/tests/test.css'
--- vim-syntax/tests/test.css 1970-01-01 00:00:00 +0000
+++ vim-syntax/tests/test.css 2010-12-12 09:56:55 +0000
@@ -0,0 +1,28 @@
1/*@+leo-ver=5-thin*/
2/*@+node:maphew.20101201124731.3117: * @file test.css*/
3/*@@language css*/
4/*@+others*/
5/*@+node:matt.20101128004159.1266: ** Level One*/
6Some text in body of level one
7/*@+at followed by*/
8/*
9/*
10/*
11/*
12/*
13/*
14/*
15multiline
16comment
17*/
18*/
19*/
20*/
21*/
22*/
23*/
24/*@+node:matt.20101128232629.1271: *3* Level Two*/
25this is body
26of level 2
27/*@-others*/
28/*@-leo*/
029
=== added file 'vim-syntax/tests/test.html'
--- vim-syntax/tests/test.html 1970-01-01 00:00:00 +0000
+++ vim-syntax/tests/test.html 2010-12-12 09:56:55 +0000
@@ -0,0 +1,28 @@
1<!--@+leo-ver=5-thin-->
2<!--@+node:maphew.20101201124731.3114: * @file test.html-->
3<!--@@language html-->
4<!--@+others-->
5<!--@+node:matt.20101128004159.1266: ** Level One-->
6Some text in body of level one
7<!--@+at followed by-->
8<!--
9/*
10/*
11/*
12/*
13/*
14/*
15multiline
16comment
17*/
18*/
19*/
20*/
21*/
22*/
23-->
24<!--@+node:matt.20101128232629.1271: *3* Level Two-->
25this is body
26of level 2
27<!--@-others-->
28<!--@-leo-->
029
=== added file 'vim-syntax/tests/test.py'
--- vim-syntax/tests/test.py 1970-01-01 00:00:00 +0000
+++ vim-syntax/tests/test.py 2010-12-12 09:56:55 +0000
@@ -0,0 +1,26 @@
1#@+leo-ver=5-thin
2#@+node:maphew.20101201124731.3120: * @file test.py
3#@@language python
4#@+others
5#@+node:matt.20101128004159.1266: ** Level One
6Some text in body of level one
7#@+at followed by
8# /*
9# /*
10# /*
11# /*
12# /*
13# /*
14# multiline
15# comment
16# */
17# */
18# */
19# */
20# */
21# */
22#@+node:matt.20101128232629.1271: *3* Level Two
23this is body
24of level 2
25#@-others
26#@-leo

Subscribers

People subscribed via source and target branches