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
1=== added file 'matt-leo-contribs.leo'
2--- matt-leo-contribs.leo 1970-01-01 00:00:00 +0000
3+++ matt-leo-contribs.leo 2010-12-12 09:56:55 +0000
4@@ -0,0 +1,81 @@
5+<?xml version="1.0" encoding="utf-8"?>
6+<?xml-stylesheet ekr_test?>
7+<leo_file>
8+<leo_header file_format="2" tnodes="0" max_tnode_index="0" clone_windows="0"/>
9+<globals body_outline_ratio="0.5" body_secondary_ratio="0.5">
10+ <global_window_position top="50" left="50" height="500" width="700"/>
11+ <global_log_window_position top="0" left="0" height="0" width="0"/>
12+</globals>
13+<preferences/>
14+<find_panel_settings/>
15+<vnodes>
16+<v t="maphew.20101201124731.3113" a="E"><vh>Leo Contribs (mine)</vh>
17+<v t="matt.20101204175038.1325"><vh>@file ~/code/o4w/apt/apt.py</vh></v>
18+<v t="matt.20101212004153.1367" a="E"><vh>Vim-Syntax</vh>
19+<v t="matt.20101212004153.1446" a="E"
20+expanded="matt.20101212004153.1442,"><vh>@file filetype.vim</vh></v>
21+<v t="maphew.20101201124731.3123" a="E"><vh>@file leo_syntax.vim</vh></v>
22+<v t="matt.20101212004153.1440"
23+expanded="matt.20101212004153.1442,"><vh>@file ~/.vim/after/filetype.vim</vh></v>
24+<v t="matt.20101204175038.1322" a="E"><vh>@file ~/.vim/after/leo_syntax.vim</vh></v>
25+<v t="matt.20101204140731.1281"><vh>tests</vh>
26+<v t="matt.20101204175038.1325"></v>
27+<v t="maphew.20101201124731.3120"><vh>@@file test.py</vh>
28+<v t="matt.20101128004159.1266"><vh>Level One</vh>
29+<v t="matt.20101128232629.1271"><vh>Level Two</vh></v>
30+</v>
31+</v>
32+<v t="maphew.20101201124731.3114"><vh>@@file test.html</vh>
33+<v t="matt.20101128004159.1266"></v>
34+</v>
35+<v t="maphew.20101201124731.3117"><vh>@@file test.css</vh>
36+<v t="matt.20101128004159.1266"></v>
37+</v>
38+</v>
39+<v t="matt.20101204175038.1323"><vh>@url appending syntax</vh></v>
40+<v t="matt.20101204175038.1324"><vh>@url new filetype</vh></v>
41+</v>
42+</v>
43+</vnodes>
44+<tnodes>
45+<t tx="maphew.20101201124731.3113">
46+
47+
48+</t>
49+<t tx="maphew.20101201124731.3114">@language html
50+@others
51+</t>
52+<t tx="maphew.20101201124731.3117">@language css
53+@others
54+</t>
55+<t tx="maphew.20101201124731.3120">@language python
56+@others
57+</t>
58+<t tx="matt.20101128004159.1266">Some text in body of level one
59+@ followed by
60+/*
61+/*
62+/*
63+/*
64+/*
65+/*
66+multiline
67+comment
68+*/
69+*/
70+*/
71+*/
72+*/
73+*/
74+</t>
75+<t tx="matt.20101128232629.1271">this is body
76+of level 2
77+</t>
78+<t tx="matt.20101204140731.1281">@path tests</t>
79+<t tx="matt.20101204175038.1323">http://vimdoc.sourceforge.net/htmldoc/syntax.html#mysyntaxfile-add</t>
80+<t tx="matt.20101204175038.1324">http://vimdoc.sourceforge.net/htmldoc/filetype.html#new-filetype</t>
81+<t tx="matt.20101212004153.1367">@path vim-syntax
82+Towards Leo-aware syntax highlighting in vim.
83+@url https://code.launchpad.net/~maphew/leo-editor/stuff</t>
84+</tnodes>
85+</leo_file>
86
87=== added directory 'vim-syntax'
88=== added file 'vim-syntax/filetype.vim'
89--- vim-syntax/filetype.vim 1970-01-01 00:00:00 +0000
90+++ vim-syntax/filetype.vim 2010-12-12 09:56:55 +0000
91@@ -0,0 +1,20 @@
92+"@+leo-ver=5-thin
93+"@+node:matt.20101212004153.1446: * @file filetype.vim
94+"@@language vim
95+"@+others
96+"@+node:matt.20101212004153.1442: ** main
97+" Leo editor additions
98+" to activate save this file as ~/.vim/after/filetype.vim
99+
100+if !exists("after_autocmds_loaded")
101+ let after_autocmds_loaded = 1
102+ au BufNewFile,BufRead * source ~/.vim/after/leo_syntax.vim
103+endif
104+"@+node:matt.20101212004153.1441: *3* notes
105+"@+at
106+" The name 'filetype.vim' seems to be sourced BEFORE the syntax files, even when
107+" in 'after' dir, so it gets overwritten by the default syntax file. Therefore we
108+" resort to this.
109+" @url http://stackoverflow.com/questions/4301716/extend-modify-vim-highlighting-for-all-filetypes-at-once/4301809#4301809
110+"@-others
111+"@-leo
112
113=== added file 'vim-syntax/leo_syntax.vim'
114--- vim-syntax/leo_syntax.vim 1970-01-01 00:00:00 +0000
115+++ vim-syntax/leo_syntax.vim 2010-12-12 09:56:55 +0000
116@@ -0,0 +1,43 @@
117+"@+leo-ver=5-thin
118+"@+node:maphew.20101201124731.3123: * @file leo_syntax.vim
119+"@@language vim
120+"@+others
121+"@+node:matt.20101204175038.1321: ** main
122+" Leo editor additions
123+" to activate change save this file as ~/.vim/after/leo_syntax.vim
124+
125+" --- Leo directive ---
126+" We assume anything with one of @@, @+, @- near line start is a leo headline/directive.
127+" Examples:
128+" #@+leo-ver=5-thin
129+" #@+node:johndoe.20100928224755.1557: * @file foobar.py
130+" #@@first
131+" #@+<<docstring> >
132+"
133+" Search pattern break down:
134+"
135+" ^ beginning of line
136+" . any single character
137+" \{,4} 0 to 4 of preceeding pattern (any single character in this case)
138+" \zs Set start of match here (http://vimhelp.appspot.com/pattern.txt.html#%2F\zs)
139+" @[@\-+] match any of: @@, @+, @-
140+" .* include everything after, to end of line
141+"
142+" (better but too hard(?): match only if preceding character is a known comment delimeter)
143+
144+syn match leoSentinel "^.\{,4}\zs@[@\-+].*" containedin=ALL
145+ " why did this stop this working with html files?
146+
147+" Resume normal emphasis within leoHeadline after last asterisk (*)
148+" Idea is to keep the node's name (headline contents) prominent
149+syn match Comment "\* .*$"hs=s+1 containedin=leoSentinel
150+
151+highlight leoSentinel guifg=grey ctermfg=darkgrey
152+
153+
154+" Wishlist:
155+" - 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.
156+" - would rather the headline colour say 'x% lighter than comment colour, in same hue'. This would be more adaptable to different colour schemes.
157+"
158+"@-others
159+"@-leo
160
161=== added directory 'vim-syntax/tests'
162=== added file 'vim-syntax/tests/test.css'
163--- vim-syntax/tests/test.css 1970-01-01 00:00:00 +0000
164+++ vim-syntax/tests/test.css 2010-12-12 09:56:55 +0000
165@@ -0,0 +1,28 @@
166+/*@+leo-ver=5-thin*/
167+/*@+node:maphew.20101201124731.3117: * @file test.css*/
168+/*@@language css*/
169+/*@+others*/
170+/*@+node:matt.20101128004159.1266: ** Level One*/
171+Some text in body of level one
172+/*@+at followed by*/
173+/*
174+/*
175+/*
176+/*
177+/*
178+/*
179+/*
180+multiline
181+comment
182+*/
183+*/
184+*/
185+*/
186+*/
187+*/
188+*/
189+/*@+node:matt.20101128232629.1271: *3* Level Two*/
190+this is body
191+of level 2
192+/*@-others*/
193+/*@-leo*/
194
195=== added file 'vim-syntax/tests/test.html'
196--- vim-syntax/tests/test.html 1970-01-01 00:00:00 +0000
197+++ vim-syntax/tests/test.html 2010-12-12 09:56:55 +0000
198@@ -0,0 +1,28 @@
199+<!--@+leo-ver=5-thin-->
200+<!--@+node:maphew.20101201124731.3114: * @file test.html-->
201+<!--@@language html-->
202+<!--@+others-->
203+<!--@+node:matt.20101128004159.1266: ** Level One-->
204+Some text in body of level one
205+<!--@+at followed by-->
206+<!--
207+/*
208+/*
209+/*
210+/*
211+/*
212+/*
213+multiline
214+comment
215+*/
216+*/
217+*/
218+*/
219+*/
220+*/
221+-->
222+<!--@+node:matt.20101128232629.1271: *3* Level Two-->
223+this is body
224+of level 2
225+<!--@-others-->
226+<!--@-leo-->
227
228=== added file 'vim-syntax/tests/test.py'
229--- vim-syntax/tests/test.py 1970-01-01 00:00:00 +0000
230+++ vim-syntax/tests/test.py 2010-12-12 09:56:55 +0000
231@@ -0,0 +1,26 @@
232+#@+leo-ver=5-thin
233+#@+node:maphew.20101201124731.3120: * @file test.py
234+#@@language python
235+#@+others
236+#@+node:matt.20101128004159.1266: ** Level One
237+Some text in body of level one
238+#@+at followed by
239+# /*
240+# /*
241+# /*
242+# /*
243+# /*
244+# /*
245+# multiline
246+# comment
247+# */
248+# */
249+# */
250+# */
251+# */
252+# */
253+#@+node:matt.20101128232629.1271: *3* Level Two
254+this is body
255+of level 2
256+#@-others
257+#@-leo

Subscribers

People subscribed via source and target branches