1
0
mirror of https://github.com/amix/vimrc synced 2025-07-11 21:55:01 +08:00

rename vim_plugins_src to vim_plugin_candinates_src and used as an plugin candinate dir

This commit is contained in:
hustcalm
2012-10-29 18:20:36 +08:00
parent b27590fbb4
commit b64930e3e7
486 changed files with 0 additions and 0 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,436 @@
# voom_mode_asciidoc.py
# Last Modified: 2012-04-02
# VOoM -- Vim two-pane outliner, plugin for Python-enabled Vim version 7.x
# Website: http://www.vim.org/scripts/script.php?script_id=2657
# Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com)
# License: This program is free software. It comes without any warranty,
# to the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want To
# Public License, Version 2, as published by Sam Hocevar.
# See http://sam.zoy.org/wtfpl/COPYING for more details.
"""
VOoM markup mode for AsciiDoc document and section titles.
See |voom_mode_asciidoc|, ../../doc/voom.txt#*voom_mode_asciidoc*
"""
### NOTES
#
# When outline operation changes level, it has to deal with two ambiguities:
# a) Level 1-5 headline can use 2-style (underline) or 1-style (=).
# b) 1-style can have or not have closing ='s.
# To determine current preferences: check first headline at level <6 and check
# first headline with =. This must be done in hook_makeOutline().
# (Save in VO, similar to reST mode.) Cannot be done during outline operation,
# that is in hook_doBodyAfterOop().
# Defaults: use underline, use closing ='s.
try:
import vim
if vim.eval('exists("g:voom_asciidoc_do_blanks")')=='1' and vim.eval("g:voom_asciidoc_do_blanks")=='0':
DO_BLANKS = False
else:
DO_BLANKS = True
except ImportError:
DO_BLANKS = True
import re
# regex for 1-style headline, assumes there is no trailing whitespace
HEAD_MATCH = re.compile(r'^(=+)(\s+\S.*?)(\s+\1)?$').match
# underline chars
ADS_LEVELS = {'=':1, '-':2, '~':3, '^':4, '+':5}
LEVELS_ADS = {1:'=', 2:'-', 3:'~', 4:'^', 5:'+'}
# DelimitedBlock chars, headines are ignored inside such blocks
BLOCK_CHARS = {'/':0, '+':0, '-':0, '.':0, '*':0, '_':0, '=':0}
# Combine all signficant chars. Need one of these at start of line for a
# headline or DelimitedBlock to occur.
CHARS = {}
for k in ADS_LEVELS:
CHARS[k] = 0
for k in BLOCK_CHARS:
CHARS[k] = 0
def hook_makeOutline(VO, blines):
"""Return (tlines, bnodes, levels) for Body lines blines.
blines is either Vim buffer object (Body) or list of buffer lines.
"""
ENC = VO.enc
Z = len(blines)
tlines, bnodes, levels = [], [], []
tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append
# trailing whitespace is always removed with rstrip()
# if headline is precedeed by [AAA] and/or [[AAA]], bnode is set to their lnum
#
# 1-style, overides 2-style
# [[AAA]] L3, blines[i-2]
# [yyy] L2, blines[i-1]
# == head == L1, blines[i] -- current line, closing = are optional
#
# 2-style (underline)
# [[AAA]] L4, blines[i-3]
# [yyy] L3, blines[i-2]
# head L2, blines[i-1] -- title line, many restrictions on the format
# ---- L1, blines[i] -- current line
# Set this the first time a headline with level 1-5 is encountered.
# 0 or 1 -- False, use 2-style (default); 2 -- True, use 1-style
useOne = 0
# Set this the first time headline in 1-style is encountered.
# 0 or 1 -- True, use closing ='s (default); 2 -- False, do not use closing ='s
useOneClose = 0
gotHead = False
inBlock = False # True if inside DelimitedBlock, the value is the char
headI = -2 # idx of the last line that is part of a headline
blockI = -2 # idx of the last line where a DelimitedBlock ended
m = None # match object for 1-style regex
for i in xrange(Z):
L1 = blines[i].rstrip()
if not L1 or not L1[0] in CHARS:
continue
ch = L1[0]
if inBlock:
if inBlock==ch and len(L1)>3 and L1.lstrip(ch)=='':
inBlock = False
blockI = i
continue
# 1-style headline
if ch == '=' and L1.strip('='):
m = HEAD_MATCH(L1)
if m:
gotHead = True
headI_ = headI
headI = i
lev = len(m.group(1))
head = m.group(2).strip()
bnode = i+1
# current line is an underline
# the previous, underlined line (L2) is not a headline if it:
# is not exactly the length of underline +/- 2
# is already part of in the previous headline
# looks like an underline or a delimited block line
# is [[AAA]] or [AAA] (BlockID or Attribute List)
# starts with . (Block Title, they have no level)
# starts with // (comment line)
# starts with tab (don't know why, spaces are ok)
# is only 1 chars (avoids confusion with --, as in Vim syntax, not as in AsciiDoc)
if not gotHead and ch in ADS_LEVELS and L1.lstrip(ch)=='' and i > 0:
L2 = blines[i-1].rstrip()
z2 = len(L2.decode(ENC,'replace'))
z1 = len(L1)
if (L2 and
(-3 < z2 - z1 < 3) and z1 > 1 and z2 > 1 and
headI != i-1 and
not ((L2[0] in CHARS) and L2.lstrip(L2[0])=='') and
not (L2.startswith('[') and L2.endswith(']')) and
not L2.startswith('.') and
not L2.startswith('\t') and
not (L2.startswith('//') and not L2.startswith('///'))
):
gotHead = True
headI_ = headI
headI = i
lev = ADS_LEVELS[ch]
head = L2.strip()
bnode = i # lnum of previous line (L2)
if gotHead and bnode > 1:
# decrement bnode if preceding lines are [[AAA]] or [AAA] lines
# that is set bnode to the topmost [[AAA]] or [AAA] line number
j_ = bnode-2 # idx of line before the title line
L3 = blines[bnode-2].rstrip()
while L3.startswith('[') and L3.endswith(']'):
bnode -= 1
if bnode > 1:
L3 = blines[bnode-2].rstrip()
else:
break
# headline must be preceded by a blank line unless:
# it's line 1 (j == -1)
# headline is preceded by [AAA] or [[AAA]] lines (j != j_)
# previous line is a headline (headI_ == j)
# previous line is the end of a DelimitedBlock (blockI == j)
j = bnode-2
if DO_BLANKS and j==j_ and j > -1:
L3 = blines[j].rstrip()
if L3 and headI_ != j and blockI != j:
# skip over any adjacent comment lines
while L3.startswith('//') and not L3.startswith('///'):
j -= 1
if j > -1:
L3 = blines[j].rstrip()
else:
L3 = ''
if L3 and headI_ != j and blockI != j:
gotHead = False
headI = headI_
# start of DelimitedBlock
if not gotHead and ch in BLOCK_CHARS and len(L1)>3 and L1.lstrip(ch)=='':
inBlock = ch
continue
if gotHead:
gotHead = False
# save style info for first headline and first 1-style headline
if not useOne and lev < 6:
if m:
useOne = 2
else:
useOne = 1
if not useOneClose and m:
if m.group(3):
useOneClose = 1
else:
useOneClose = 2
# make outline
tline = ' %s|%s' %('. '*(lev-1), head)
tlines_add(tline)
bnodes_add(bnode)
levels_add(lev)
# don't clobber these when parsing clipboard during Paste
# which is the only time blines is not Body
if blines is VO.Body:
VO.useOne = useOne == 2
VO.useOneClose = useOneClose < 2
return (tlines, bnodes, levels)
def hook_newHeadline(VO, level, blnum, tlnum):
"""Return (tree_head, bodyLines).
tree_head is new headline string in Tree buffer (text after |).
bodyLines is list of lines to insert in Body buffer.
"""
tree_head = 'NewHeadline'
if level < 6 and not VO.useOne:
bodyLines = [tree_head, LEVELS_ADS[level]*11, '']
else:
lev = '='*level
if VO.useOneClose:
bodyLines = ['%s %s %s' %(lev, tree_head, lev), '']
else:
bodyLines = ['%s %s' %(lev, tree_head), '']
# Add blank line when inserting after non-blank Body line.
if VO.Body[blnum-1].strip():
bodyLines[0:0] = ['']
return (tree_head, bodyLines)
#def hook_changeLevBodyHead(VO, h, levDelta):
# DO NOT CREATE THIS HOOK
def hook_doBodyAfterOop(VO, oop, levDelta, blnum1, tlnum1, blnum2, tlnum2, blnumCut, tlnumCut):
# this is instead of hook_changeLevBodyHead()
# Based on Markdown mode function.
# Inserts blank separator lines if missing.
#print oop, levDelta, blnum1, tlnum1, blnum2, tlnum2, tlnumCut, blnumCut
Body = VO.Body
Z = len(Body)
bnodes, levels = VO.bnodes, VO.levels
ENC = VO.enc
# blnum1 blnum2 is first and last lnums of Body region pasted, inserted
# during up/down, or promoted/demoted.
if blnum1:
assert blnum1 == bnodes[tlnum1-1]
if tlnum2 < len(bnodes):
assert blnum2 == bnodes[tlnum2]-1
else:
assert blnum2 == Z
# blnumCut is Body lnum after which a region was removed during 'cut',
# 'up', 'down'. Need this to check if there is blank line between nodes
# used to be separated by the cut/moved region.
if blnumCut:
if tlnumCut < len(bnodes):
assert blnumCut == bnodes[tlnumCut]-1
else:
assert blnumCut == Z
# Total number of added lines minus number of deleted lines.
b_delta = 0
### After 'cut' or 'up': insert blank line if there is none
# between the nodes used to be separated by the cut/moved region.
if DO_BLANKS and (oop=='cut' or oop=='up') and (0 < blnumCut < Z) and Body[blnumCut-1].strip():
Body[blnumCut:blnumCut] = ['']
update_bnodes(VO, tlnumCut+1 ,1)
b_delta+=1
if oop=='cut':
return
### Make sure there is blank line after the last node in the region:
# insert blank line after blnum2 if blnum2 is not blank, that is insert
# blank line before bnode at tlnum2+1.
if DO_BLANKS and blnum2 < Z and Body[blnum2-1].strip():
Body[blnum2:blnum2] = ['']
update_bnodes(VO, tlnum2+1 ,1)
b_delta+=1
### Change levels and/or formats of headlines in the affected region.
# Always do this after Paste, even if level is unchanged -- format can
# be different when pasting from other outlines.
# Examine each headline, from bottom to top, and change level and/or format.
# To change from 1-style to 2-style:
# strip ='s, strip whitespace;
# insert underline.
# To change from 2-style to 1-style:
# delete underline;
# insert ='s.
# Update bnodes after inserting or deleting a line.
#
# NOTE: bnode can be [[AAA]] or [AAA] line, we check for that and adjust it
# to point to the headline text line
#
# 1-style 2-style
#
# L0 L0 Body[bln-2]
# == head L1 head L1 <--bnode Body[bln-1] (not always the actual bnode)
# L2 ---- L2 Body[bln]
# L3 L3 Body[bln+1]
if levDelta or oop=='paste':
for i in xrange(tlnum2, tlnum1-1, -1):
# required level (VO.levels has been updated)
lev = levels[i-1]
# current level from which to change to lev
lev_ = lev - levDelta
# Body headline (bnode) and the next line
bln = bnodes[i-1]
L1 = Body[bln-1].rstrip()
# bnode can point to the tompost [AAA] or [[AAA]] line
# increment bln until the actual headline (title line) is found
while L1.startswith('[') and L1.endswith(']'):
bln += 1
L1 = Body[bln-1].rstrip()
# the underline line
if bln+1 < len(Body):
L2 = Body[bln].rstrip()
else:
L2 = ''
# get current headline format
hasOne, hasOneClose = False, VO.useOneClose
theHead = L1
if L1.startswith('='):
m = HEAD_MATCH(L1)
if m:
hasOne = True
# headline without ='s but with whitespace around it preserved
theHead = m.group(2)
theclose = m.group(3)
if theclose:
hasOneClose = True
theHead += theclose.rstrip('=')
else:
hasOneClose = False
# get desired headline format
if oop=='paste':
if lev > 5:
useOne = True
else:
useOne = VO.useOne
useOneClose = VO.useOneClose
elif lev < 6 and lev_ < 6:
useOne = hasOne
useOneClose = hasOneClose
elif lev > 5 and lev_ > 5:
useOne = True
useOneClose = hasOneClose
elif lev < 6 and lev_ > 5:
useOne = VO.useOne
useOneClose = VO.useOneClose
elif lev > 5 and lev_ < 6:
useOne = True
useOneClose = hasOneClose
else:
assert False
#print useOne, hasOne, ';', useOneClose, hasOneClose
### change headline level and/or format
# 2-style unchanged, only adjust level of underline
if not useOne and not hasOne:
if not levDelta: continue
Body[bln] = LEVELS_ADS[lev]*len(L2)
# 1-style unchanged, adjust level of ='s and add/remove closing ='s
elif useOne and hasOne:
# no format change, there are closing ='s
if useOneClose and hasOneClose:
if not levDelta: continue
Body[bln-1] = '%s%s%s' %('='*lev, theHead, '='*lev)
# no format change, there are no closing ='s
elif not useOneClose and not hasOneClose:
if not levDelta: continue
Body[bln-1] = '%s%s' %('='*lev, theHead)
# add closing ='s
elif useOneClose and not hasOneClose:
Body[bln-1] = '%s%s %s' %('='*lev, theHead.rstrip(), '='*lev)
# remove closing ='s
elif not useOneClose and hasOneClose:
Body[bln-1] = '%s%s' %('='*lev, theHead.rstrip())
# insert underline, remove ='s
elif not useOne and hasOne:
L1 = theHead.strip()
Body[bln-1] = L1
# insert underline
Body[bln:bln] = [LEVELS_ADS[lev]*len(L1.decode(ENC,'replace'))]
update_bnodes(VO, i+1, 1)
b_delta+=1
# remove underline, insert ='s
elif useOne and not hasOne:
if useOneClose:
Body[bln-1] = '%s %s %s' %('='*lev, theHead.strip(), '='*lev)
else:
Body[bln-1] = '%s %s' %('='*lev, theHead.strip())
# delete underline
Body[bln:bln+1] = []
update_bnodes(VO, i+1, -1)
b_delta-=1
### Make sure first headline is preceded by a blank line.
blnum1 = bnodes[tlnum1-1]
if DO_BLANKS and blnum1 > 1 and Body[blnum1-2].strip():
Body[blnum1-1:blnum1-1] = ['']
update_bnodes(VO, tlnum1 ,1)
b_delta+=1
### After 'down' : insert blank line if there is none
# between the nodes used to be separated by the moved region.
if DO_BLANKS and oop=='down' and (0 < blnumCut < Z) and Body[blnumCut-1].strip():
Body[blnumCut:blnumCut] = ['']
update_bnodes(VO, tlnumCut+1 ,1)
b_delta+=1
assert len(Body) == Z + b_delta
def update_bnodes(VO, tlnum, delta):
"""Update VO.bnodes by adding/substracting delta to each bnode
starting with bnode at tlnum and to the end.
"""
bnodes = VO.bnodes
for i in xrange(tlnum, len(bnodes)+1):
bnodes[i-1] += delta

View File

@ -0,0 +1,72 @@
# voom_mode_cwiki.py
# Last Modified: 2011-10-30
# VOoM -- Vim two-pane outliner, plugin for Python-enabled Vim version 7.x
# Website: http://www.vim.org/scripts/script.php?script_id=2657
# Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com)
# License: This program is free software. It comes without any warranty,
# to the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want To
# Public License, Version 2, as published by Sam Hocevar.
# See http://sam.zoy.org/wtfpl/COPYING for more details.
"""
VOoM markup mode for cwiki Vim plugin. Contributed by Craig B. Allen.
http://www.vim.org/scripts/script.php?script_id=2176
See |voom_mode_various|, ../../doc/voom.txt#*voom_mode_various*
+++ headline level 1
some text
++++ headline level 2
more text
+++++ headline level 3
++++++ headline level 4
etc.
First + must be at start of line. Whitespace after the last + is optional.
"""
import re
headline_match = re.compile(r'^\+\+(\++)').match
def hook_makeOutline(VO, blines):
"""Return (tlines, bnodes, levels) for Body lines blines.
blines is either Vim buffer object (Body) or list of buffer lines.
"""
Z = len(blines)
tlines, bnodes, levels = [], [], []
tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append
for i in xrange(Z):
if not blines[i].startswith('+'):
continue
bline = blines[i]
m = headline_match(bline)
if not m:
continue
lev = len(m.group(1))
head = bline[2+lev:].strip()
tline = ' %s|%s' %('. '*(lev-1), head)
tlines_add(tline)
bnodes_add(i+1)
levels_add(lev)
return (tlines, bnodes, levels)
def hook_newHeadline(VO, level, blnum, tlnum):
"""Return (tree_head, bodyLines).
tree_head is new headline string in Tree buffer (text after |).
bodyLines is list of lines to insert in Body buffer.
"""
tree_head = 'NewHeadline'
bodyLines = ['++%s %s' %('+'*level, tree_head), '']
return (tree_head, bodyLines)
def hook_changeLevBodyHead(VO, h, levDelta):
"""Increase of decrease level number of Body headline by levDelta."""
if levDelta==0: return h
m = headline_match(h)
level = len(m.group(1))
return '++%s%s' %('+'*(level+levDelta), h[m.end(1):])

View File

@ -0,0 +1,18 @@
# voom_mode_fmr1.py
# Last Modified: 2012-02-25
# VOoM -- Vim two-pane outliner, plugin for Python-enabled Vim version 7.x
# Website: http://www.vim.org/scripts/script.php?script_id=2657
# Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com)
# License: This program is free software. It comes without any warranty,
# to the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want To
# Public License, Version 2, as published by Sam Hocevar.
# See http://sam.zoy.org/wtfpl/COPYING for more details.
"""
This mode changes absolutely nothing, it is identical to the default mode.
See |voom_mode_fmr|, ../../doc/voom.txt#*voom_mode_fmr*
"""
# Define this mode as an 'fmr' mode.
MODE_FMR = True

View File

@ -0,0 +1,63 @@
# voom_mode_fmr1.py
# Last Modified: 2012-02-25
# VOoM -- Vim two-pane outliner, plugin for Python-enabled Vim version 7.x
# Website: http://www.vim.org/scripts/script.php?script_id=2657
# Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com)
# License: This program is free software. It comes without any warranty,
# to the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want To
# Public License, Version 2, as published by Sam Hocevar.
# See http://sam.zoy.org/wtfpl/COPYING for more details.
"""
VOoM markup mode for start fold markers with levels.
Similar to the default mode, that is the :Voom command.
See |voom_mode_fmr|, ../../doc/voom.txt#*voom_mode_fmr*
headline level 1 {{{1
some text
headline level 2 {{{2
more text
"""
# Define this mode as an 'fmr' mode.
MODE_FMR = True
# voom.makeoutline() without char stripping
def hook_makeOutline(VO, blines):
"""Return (tlines, bnodes, levels) for Body lines blines.
blines is either Vim buffer object (Body) or list of buffer lines.
"""
marker = VO.marker
marker_re_search = VO.marker_re.search
Z = len(blines)
tlines, bnodes, levels = [], [], []
tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append
#c = VO.rstrip_chars
for i in xrange(Z):
if not marker in blines[i]: continue
bline = blines[i]
m = marker_re_search(bline)
if not m: continue
lev = int(m.group(1))
#head = bline[:m.start()].lstrip().rstrip(c).strip('-=~').strip()
head = bline[:m.start()].strip()
tline = ' %s%s|%s' %(m.group(2) or ' ', '. '*(lev-1), head)
tlines_add(tline)
bnodes_add(i+1)
levels_add(lev)
return (tlines, bnodes, levels)
# same as voom.newHeadline() but without ---
def hook_newHeadline(VO, level, blnum, ln):
"""Return (tree_head, bodyLines).
tree_head is new headline string in Tree buffer (text after |).
bodyLines is list of lines to insert in Body buffer.
"""
tree_head = 'NewHeadline'
#bodyLines = ['---%s--- %s%s' %(tree_head, VO.marker, level), '']
bodyLines = ['%s %s%s' %(tree_head, VO.marker, level), '']
return (tree_head, bodyLines)

View File

@ -0,0 +1,63 @@
# voom_mode_fmr2.py
# Last Modified: 2012-02-04
# VOoM -- Vim two-pane outliner, plugin for Python-enabled Vim version 7.x
# Website: http://www.vim.org/scripts/script.php?script_id=2657
# Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com)
# License: This program is free software. It comes without any warranty,
# to the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want To
# Public License, Version 2, as published by Sam Hocevar.
# See http://sam.zoy.org/wtfpl/COPYING for more details.
"""
VOoM markup mode. Headline text is after the start fold marker with level.
See |voom_mode_fmr|, ../../doc/voom.txt#*voom_mode_fmr*
{{{1 headline level 1
some text
{{{2 headline level 2
more text
"""
# Define this mode as an 'fmr' mode.
MODE_FMR = True
def hook_makeOutline(VO, blines):
"""Return (tlines, bnodes, levels) for Body lines blines.
blines is either Vim buffer object (Body) or list of buffer lines.
"""
marker = VO.marker
marker_re_search = VO.marker_re.search
Z = len(blines)
tlines, bnodes, levels = [], [], []
tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append
#c = VO.rstrip_chars
for i in xrange(Z):
if not marker in blines[i]: continue
bline = blines[i]
m = marker_re_search(bline)
if not m: continue
lev = int(m.group(1))
#head = bline[:m.start()].lstrip().rstrip(c).strip('-=~').strip()
head = bline[m.end():]
# strip special marks o=
if head and head[0]=='o': head = head[1:]
if head and head[0]=='=': head = head[1:]
tline = ' %s%s|%s' %(m.group(2) or ' ', '. '*(lev-1), head.strip())
tlines_add(tline)
bnodes_add(i+1)
levels_add(lev)
return (tlines, bnodes, levels)
def hook_newHeadline(VO, level, blnum, ln):
"""Return (tree_head, bodyLines).
tree_head is new headline string in Tree buffer (text after |).
bodyLines is list of lines to insert in Body buffer.
"""
tree_head = 'NewHeadline'
bodyLines = ['%s%s %s' %(VO.marker, level, tree_head), '']
return (tree_head, bodyLines)

View File

@ -0,0 +1,74 @@
# voom_mode_hashes.py
# Last Modified: 2012-05-06
# VOoM -- Vim two-pane outliner, plugin for Python-enabled Vim version 7.x
# Website: http://www.vim.org/scripts/script.php?script_id=2657
# Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com)
# License: This program is free software. It comes without any warranty,
# to the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want To
# Public License, Version 2, as published by Sam Hocevar.
# See http://sam.zoy.org/wtfpl/COPYING for more details.
"""
VOoM markup mode for headlines marked with #'s (atx-headers, a subset of Markdown format).
See |voom_mode_hashes|, ../../doc/voom.txt#*voom_mode_hashes*
# heading level 1
##heading level 2
### heading level 3
"""
import re
# Marker character can be changed to any ASCII character.
CH = '#'
# Use this if whitespace after marker chars is optional.
headline_match = re.compile(r'^(%s+)' %re.escape(CH)).match
# Use this if a whitespace is required after marker chars (as in org-mode).
#headline_match = re.compile(r'^(%s+)\s' %re.escape(CH)).match
def hook_makeOutline(VO, blines):
"""Return (tlines, bnodes, levels) for Body lines blines.
blines is either Vim buffer object (Body) or list of buffer lines.
"""
Z = len(blines)
tlines, bnodes, levels = [], [], []
tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append
for i in xrange(Z):
if not blines[i].startswith(CH):
continue
bline = blines[i]
m = headline_match(bline)
if not m:
continue
lev = len(m.group(1))
head = bline[lev:].strip()
# Do this instead if optional closing markers need to be stripped.
#head = bline[lev:].strip().rstrip(CH).rstrip()
tline = ' %s|%s' %('. '*(lev-1), head)
tlines_add(tline)
bnodes_add(i+1)
levels_add(lev)
return (tlines, bnodes, levels)
def hook_newHeadline(VO, level, blnum, tlnum):
"""Return (tree_head, bodyLines).
tree_head is new headline string in Tree buffer (text after |).
bodyLines is list of lines to insert in Body buffer.
"""
tree_head = 'NewHeadline'
bodyLines = ['%s %s' %(CH * level, tree_head), '']
return (tree_head, bodyLines)
def hook_changeLevBodyHead(VO, h, levDelta):
"""Increase of decrease level number of Body headline by levDelta."""
if levDelta==0: return h
m = headline_match(h)
level = len(m.group(1))
return '%s%s' %(CH * (level+levDelta), h[m.end(1):])

View File

@ -0,0 +1,73 @@
# voom_mode_html.py
# Last Modified: 2011-05-01
# VOoM -- Vim two-pane outliner, plugin for Python-enabled Vim version 7.x
# Website: http://www.vim.org/scripts/script.php?script_id=2657
# Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com)
# License: This program is free software. It comes without any warranty,
# to the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want To
# Public License, Version 2, as published by Sam Hocevar.
# See http://sam.zoy.org/wtfpl/COPYING for more details.
"""
VOoM markup mode for HTML headings.
See |voom_mode_html|, ../../doc/voom.txt#*voom_mode_html*
<h1>headline level 1</h1>
some text
<h2> headline level 2 </h2>
more text
<H3 ALIGN="CENTER"> headline level 3 </H3>
< h4 > headline level 4 </H4 >
some text <h4> <font color=red> headline 5 </font> </H4> </td></div>
etc.
"""
import re
headline_search = re.compile(r'<\s*h(\d+).*?>(.*?)</h(\1)\s*>', re.IGNORECASE).search
html_tag_sub = re.compile('<.*?>').sub
def hook_makeOutline(VO, blines):
"""Return (tlines, bnodes, levels) for Body lines blines.
blines is either Vim buffer object (Body) or list of buffer lines.
"""
Z = len(blines)
tlines, bnodes, levels = [], [], []
tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append
for i in xrange(Z):
bline = blines[i]
if not ('</h' in bline or '</H' in bline):
continue
m = headline_search(bline)
if not m:
continue
lev = int(m.group(1))
head = m.group(2)
# delete all html tags
head = html_tag_sub('',head)
tline = ' %s|%s' %('. '*(lev-1), head.strip())
tlines_add(tline)
bnodes_add(i+1)
levels_add(lev)
return (tlines, bnodes, levels)
def hook_newHeadline(VO, level, blnum, tlnum):
"""Return (tree_head, bodyLines).
tree_head is new headline string in Tree buffer (text after |).
bodyLines is list of lines to insert in Body buffer.
"""
tree_head = 'NewHeadline'
bodyLines = ['<h%s>%s</h%s>' %(level, tree_head, level), '']
return (tree_head, bodyLines)
def hook_changeLevBodyHead(VO, h, levDelta):
"""Increase of decrease level number of Body headline by levDelta."""
if levDelta==0: return h
m = headline_search(h)
level = int(m.group(1))
lev = level+levDelta
return '%s%s%s%s%s' %(h[:m.start(1)], lev, h[m.end(1):m.start(3)], lev, h[m.end(3):])

View File

@ -0,0 +1,318 @@
# voom_mode_markdown.py
# Last Modified: 2012-04-02
# VOoM -- Vim two-pane outliner, plugin for Python-enabled Vim version 7.x
# Website: http://www.vim.org/scripts/script.php?script_id=2657
# Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com)
# License: This program is free software. It comes without any warranty,
# to the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want To
# Public License, Version 2, as published by Sam Hocevar.
# See http://sam.zoy.org/wtfpl/COPYING for more details.
"""
VOoM markup mode for Markdown headers.
See |voom_mode_markdown|, ../../doc/voom.txt#*voom_mode_markdown*
"""
### NOTES
# When outline operation changes level, it has to deal with two ambiguities:
# a) Level 1 and 2 headline can use underline-style or hashes-style.
# b) Hashes-style can have or not have closing hashes.
# To determine current preferences: check first headline at level <3 and check
# first headline with hashes. This must be done in hook_makeOutline().
# (Save in VO, similar to reST mode.) Cannot be done during outline operation,
# that is in hook_doBodyAfterOop().
# Defaults: use underline, use closing hashes.
levels_ads = {1:'=', 2:'-'}
def hook_makeOutline(VO, blines):
"""Return (tlines, bnodes, levels) for Body lines blines.
blines is either Vim buffer object (Body) or list of buffer lines.
"""
Z = len(blines)
tlines, bnodes, levels = [], [], []
tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append
# trailing whitespace is always removed with rstrip()
#
# hashes-style, overides underline-style
# abcde L2, blines[i-1]
# ## head L1, blines[i] -- current line
#
# underline-style
# head L2, blines[i-1] -- title line, not blank, does not start with #
# ------ L1, blines[i] -- current line, any number of = or - only
L1, L2 = '',''
# Set this once when headline with level 1 or 2 is encountered.
# 0 or 1 -- False, use underline-style (default); 2 -- True, use hashes-style
useHash = 0
# Set this once when headline with hashes is encountered.
# 0 or 1 -- True, use closing hashes (default); 2 -- False, do not use closing hashes
useCloseHash = 0
gotHead = False
for i in xrange(Z):
L2 = L1
L1 = blines[i].rstrip()
if L1.startswith('#'):
gotHead = True
lev = len(L1) - len(L1.lstrip('#'))
bnode = i+1
head = L1.strip('#').strip()
elif L2 and L1.startswith('=') and L1.lstrip('=')=='':
gotHead = True
lev = 1
head = L2.strip()
bnode = i
elif L2 and L1.startswith('-') and L1.lstrip('-')=='':
gotHead = True
lev = 2
head = L2.strip()
bnode = i
else:
continue
if gotHead:
gotHead = False
if not useHash and lev < 3:
if L1.startswith('#'):
useHash = 2
else:
useHash = 1
if not useCloseHash and L1.startswith('#'):
if L1.endswith('#'):
useCloseHash = 1
else:
useCloseHash = 2
L1, L2 = '',''
tline = ' %s|%s' %('. '*(lev-1), head)
tlines_add(tline)
bnodes_add(bnode)
levels_add(lev)
# don't clobber these when parsing clipboard during Paste
# which is the only time blines is not Body
if blines is VO.Body:
VO.useHash = useHash == 2
VO.useCloseHash = useCloseHash < 2
return (tlines, bnodes, levels)
def hook_newHeadline(VO, level, blnum, tlnum):
"""Return (tree_head, bodyLines).
tree_head is new headline string in Tree buffer (text after |).
bodyLines is list of lines to insert in Body buffer.
"""
tree_head = 'NewHeadline'
if level < 3 and not VO.useHash:
bodyLines = [tree_head, levels_ads[level]*11, '']
else:
lev = '#'*level
if VO.useCloseHash:
bodyLines = ['%s %s %s' %(lev, tree_head, lev), '']
else:
bodyLines = ['%s %s' %(lev, tree_head), '']
# Add blank line when inserting after non-blank Body line.
if VO.Body[blnum-1].strip():
bodyLines[0:0] = ['']
return (tree_head, bodyLines)
#def hook_changeLevBodyHead(VO, h, levDelta):
# DO NOT CREATE THIS HOOK
def hook_doBodyAfterOop(VO, oop, levDelta, blnum1, tlnum1, blnum2, tlnum2, blnumCut, tlnumCut):
# this is instead of hook_changeLevBodyHead()
# Based on reST mode function. Insert blank separator lines if missing,
# even though they are not important for Markdown headlines.
#print oop, levDelta, blnum1, tlnum1, blnum2, tlnum2, tlnumCut, blnumCut
Body = VO.Body
Z = len(Body)
bnodes, levels = VO.bnodes, VO.levels
ENC = VO.enc
# blnum1 blnum2 is first and last lnums of Body region pasted, inserted
# during up/down, or promoted/demoted.
if blnum1:
assert blnum1 == bnodes[tlnum1-1]
if tlnum2 < len(bnodes):
assert blnum2 == bnodes[tlnum2]-1
else:
assert blnum2 == Z
# blnumCut is Body lnum after which a region was removed during 'cut',
# 'up', 'down'. Need this to check if there is blank line between nodes
# used to be separated by the cut/moved region.
if blnumCut:
if tlnumCut < len(bnodes):
assert blnumCut == bnodes[tlnumCut]-1
else:
assert blnumCut == Z
# Total number of added lines minus number of deleted lines.
b_delta = 0
### After 'cut' or 'up': insert blank line if there is none
# between the nodes used to be separated by the cut/moved region.
if (oop=='cut' or oop=='up') and (0 < blnumCut < Z) and Body[blnumCut-1].strip():
Body[blnumCut:blnumCut] = ['']
update_bnodes(VO, tlnumCut+1 ,1)
b_delta+=1
if oop=='cut':
return
### Make sure there is blank line after the last node in the region:
# insert blank line after blnum2 if blnum2 is not blank, that is insert
# blank line before bnode at tlnum2+1.
if blnum2 < Z and Body[blnum2-1].strip():
Body[blnum2:blnum2] = ['']
update_bnodes(VO, tlnum2+1 ,1)
b_delta+=1
### Change levels and/or formats of headlines in the affected region.
# Always do this after Paste, even if level is unchanged -- format can
# be different when pasting from other outlines.
# Examine each headline, from bottom to top, and change level and/or format.
# To change from hashes to underline-style:
# strip hashes, strip whitespace;
# insert underline.
# To change from underline to hashes-style:
# delete underline;
# insert hashes.
# Update bnodes after inserting or deleting a line.
# hash-style underline-style
#
# L0 L0 Body[bln-2]
# ## head L1 head L1 <--bnode Body[bln-1]
# L2 ---- L2 Body[bln]
# L3 L3 Body[bln+1]
if levDelta or oop=='paste':
for i in xrange(tlnum2, tlnum1-1, -1):
# required level (VO.levels has been updated)
lev = levels[i-1]
# current level from which to change to lev
lev_ = lev - levDelta
# Body headline (bnode) and next line
bln = bnodes[i-1]
L1 = Body[bln-1].rstrip()
if bln+1 < len(Body):
L2 = Body[bln].rstrip()
else:
L2 = ''
# get current headline format
hasHash, hasCloseHash = False, VO.useCloseHash
if L1.startswith('#'):
hasHash = True
if L1.endswith('#'):
hasCloseHash = True
else:
hasCloseHash = False
# get desired headline format
if oop=='paste':
if lev > 2:
useHash = True
else:
useHash = VO.useHash
useCloseHash = VO.useCloseHash
elif lev < 3 and lev_ < 3:
useHash = hasHash
useCloseHash = hasCloseHash
elif lev > 2 and lev_ > 2:
useHash = True
useCloseHash = hasCloseHash
elif lev < 3 and lev_ > 2:
useHash = VO.useHash
useCloseHash = VO.useCloseHash
elif lev > 2 and lev_ < 3:
useHash = True
useCloseHash = hasCloseHash
else:
assert False
#print useHash, hasHash, ';', useCloseHash, hasCloseHash
# change headline level and/or format
# underline-style unchanged, only adjust level of underline
if not useHash and not hasHash:
if not levDelta: continue
Body[bln] = levels_ads[lev]*len(L2)
# hashes-style unchanged, adjust level of hashes and add/remove closing hashes
elif useHash and hasHash:
# no format change, there are closing hashes
if useCloseHash and hasCloseHash:
if not levDelta: continue
Body[bln-1] = '%s%s%s' %('#'*lev, L1.strip('#'), '#'*lev)
# no format change, there are no closing hashes
elif not useCloseHash and not hasCloseHash:
if not levDelta: continue
Body[bln-1] = '%s%s' %('#'*lev, L1.lstrip('#'))
# add closing hashes
elif useCloseHash and not hasCloseHash:
Body[bln-1] = '%s%s %s' %('#'*lev, L1.strip('#').rstrip(), '#'*lev)
# remove closing hashes
elif not useCloseHash and hasCloseHash:
Body[bln-1] = '%s%s' %('#'*lev, L1.strip('#').rstrip())
# insert underline, remove hashes
elif not useHash and hasHash:
L1 = L1.strip('#').strip()
Body[bln-1] = L1
# insert underline
Body[bln:bln] = [levels_ads[lev]*len(L1.decode(ENC,'replace'))]
update_bnodes(VO, i+1, 1)
b_delta+=1
# remove underline, insert hashes
elif useHash and not hasHash:
if useCloseHash:
Body[bln-1] = '%s %s %s' %('#'*lev, L1.strip('#').strip(), '#'*lev)
else:
Body[bln-1] = '%s %s' %('#'*lev, L1.strip('#').strip())
# delete underline
Body[bln:bln+1] = []
update_bnodes(VO, i+1, -1)
b_delta-=1
### Make sure first headline is preceded by a blank line.
blnum1 = bnodes[tlnum1-1]
if blnum1 > 1 and Body[blnum1-2].strip():
Body[blnum1-1:blnum1-1] = ['']
update_bnodes(VO, tlnum1 ,1)
b_delta+=1
### After 'down' : insert blank line if there is none
# between the nodes used to be separated by the moved region.
if oop=='down' and (0 < blnumCut < Z) and Body[blnumCut-1].strip():
Body[blnumCut:blnumCut] = ['']
update_bnodes(VO, tlnumCut+1 ,1)
b_delta+=1
assert len(Body) == Z + b_delta
def update_bnodes(VO, tlnum, delta):
"""Update VO.bnodes by adding/substracting delta to each bnode
starting with bnode at tlnum and to the end.
"""
bnodes = VO.bnodes
for i in xrange(tlnum, len(bnodes)+1):
bnodes[i-1] += delta

View File

@ -0,0 +1,61 @@
# voom_mode_org.py
# Last Modified: 2011-10-28
# VOoM -- Vim two-pane outliner, plugin for Python-enabled Vim version 7.x
# Website: http://www.vim.org/scripts/script.php?script_id=2657
# Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com)
# License: This program is free software. It comes without any warranty,
# to the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want To
# Public License, Version 2, as published by Sam Hocevar.
# See http://sam.zoy.org/wtfpl/COPYING for more details.
"""
VOoM markup mode for Emacs Org-mode headline format.
See |voom_mode_org|, ../../doc/voom.txt#*voom_mode_org*
"""
import re
headline_match = re.compile(r'^(\*+)\s').match
def hook_makeOutline(VO, blines):
"""Return (tlines, bnodes, levels) for Body lines blines.
blines is either Vim buffer object (Body) or list of buffer lines.
"""
Z = len(blines)
tlines, bnodes, levels = [], [], []
tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append
for i in xrange(Z):
if not blines[i].startswith('*'):
continue
bline = blines[i]
m = headline_match(bline)
if not m:
continue
lev = len(m.group(1))
head = bline[lev:].strip()
tline = ' %s|%s' %('. '*(lev-1), head)
tlines_add(tline)
bnodes_add(i+1)
levels_add(lev)
return (tlines, bnodes, levels)
def hook_newHeadline(VO, level, blnum, tlnum):
"""Return (tree_head, bodyLines).
tree_head is new headline string in Tree buffer (text after |).
bodyLines is list of lines to insert in Body buffer.
"""
tree_head = 'NewHeadline'
bodyLines = ['%s %s' %('*'*level, tree_head), '']
return (tree_head, bodyLines)
def hook_changeLevBodyHead(VO, h, levDelta):
"""Increase of decrease level number of Body headline by levDelta."""
if levDelta==0: return h
m = headline_match(h)
level = len(m.group(1))
return '%s%s' %('*'*(level+levDelta), h[m.end(1):])

View File

@ -0,0 +1,214 @@
# voom_mode_python.py
# Last Modified: 2011-05-01
# VOoM -- Vim two-pane outliner, plugin for Python-enabled Vim version 7.x
# Website: http://www.vim.org/scripts/script.php?script_id=2657
# Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com)
# License: This program is free software. It comes without any warranty,
# to the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want To
# Public License, Version 2, as published by Sam Hocevar.
# See http://sam.zoy.org/wtfpl/COPYING for more details.
"""
VOoM markup mode for Python code.
See |voom_mode_python|, ../../doc/voom.txt#*voom_mode_python*
"""
import token, tokenize
import traceback
import vim
def hook_makeOutline(VO, blines):
"""Return (tlines, bnodes, levels) for Body lines blines.
blines is either Vim buffer object (Body) or list of buffer lines.
"""
Z = len(blines)
tlines, bnodes, levels = [], [], []
tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append
#ignore_lnums, func_lnums = get_lnums_from_tokenize(blines)
try:
ignore_lnums, func_lnums = get_lnums_from_tokenize(blines)
except (IndentationError, tokenize.TokenError):
vim.command("call Voom_ErrorMsg('VOoM: EXCEPTION WHILE PARSING PYTHON OUTLINE')")
# DO NOT print to sys.stderr -- triggers Vim error when default stderr (no PyLog)
#traceback.print_exc() --this goes to sys.stderr
#print traceback.format_exc() --ok but no highlighting
lines = traceback.format_exc().replace("'","''").split('\n')
for l in lines:
vim.command("call Voom_ErrorMsg('%s')" %l)
return (['= |!!!ERROR: OUTLINE IS INVALID'], [1], [1])
gotHead = False # True if current line is a headline
indents = [0,] # indents of previous levels
funcLevels = [] # levels of previous def or class
indent_error = '' # inconsistent indent
for i in xrange(Z):
if i+1 in ignore_lnums: continue
bline = blines[i]
bline_s = bline.strip()
if not bline_s: continue
bline_ls = bline.lstrip()
# compute indent and level
indent = len(bline) - len(bline_ls)
if indent > indents[-1]:
indents.append(indent)
elif indent < indents[-1]:
while indents and (indents[-1] > indent):
indents.pop()
if indents[-1]==indent:
indent_error = ''
else:
indent_error = '!!! '
lev = len(indents)
# first line after the end of a class or def block
if funcLevels and lev <= funcLevels[-1]:
gotHead = True
while funcLevels and funcLevels[-1] >= lev:
funcLevels.pop()
# first line of a class or def block
if i+1 in func_lnums:
gotHead = True
if not funcLevels or (lev > funcLevels[-1]):
funcLevels.append(lev)
# special comment line (unconditional headline) or line with @decorator
elif bline_s.startswith('@') or bline_s.startswith('### ') or bline_s.startswith('#---'):
gotHead = True
if gotHead:
gotHead = False
tline = ' %s|%s%s' %('. '*(lev-1), indent_error, bline_s)
tlines_add(tline)
bnodes_add(i+1)
levels_add(lev)
return (tlines, bnodes, levels)
class BLines:
"""Wrapper around Vim buffer object or list of Body lines to provide
readline() method for use with tokenize.generate_tokens().
"""
def __init__(self, blines):
self.blines = blines
self.size = len(blines)
self.idx = -1
def readline(self):
self.idx += 1
if self.idx == self.size:
return ''
return "%s\n" %self.blines[self.idx]
### toktypes of tokens
STRING = token.STRING
NAME = token.NAME
NEWLINE = token.NEWLINE
def get_lnums_from_tokenize(blines):
"""Return dicts. Keys are Body lnums.
The main purpose is to get list of lnums to ignore: multi-line strings and
expressions.
"""
# lnums to ignore: multi-line strings and expressions other than the first line
ignore_lnums = {}
# lnums of 'class' and 'def' tokens
func_lnums = {}
inName = False
for tok in tokenize.generate_tokens(BLines(blines).readline):
toktype, toktext, (srow, scol), (erow, ecol), line = tok
#print token.tok_name[toktype], tok
if toktype == NAME:
if not inName:
inName = True
srow_name = srow
if toktext in ('def','class'):
func_lnums[srow] = toktext
elif toktype == NEWLINE and inName:
inName = False
if srow_name != erow:
for i in xrange(srow_name+1, erow+1):
ignore_lnums[i] = 0
elif toktype == STRING:
if srow != erow:
for i in xrange(srow+1, erow+1):
ignore_lnums[i] = 0
return (ignore_lnums, func_lnums)
def get_body_indent(body):
"""Return string used for indenting Body lines."""
et = int(vim.eval("getbufvar(%s,'&et')" %body))
if et:
ts = int(vim.eval("getbufvar(%s,'&ts')" %body))
return ' '*ts
else:
return '\t'
def hook_newHeadline(VO, level, blnum, tlnum):
"""Return (tree_head, bodyLines).
tree_head is new headline string in Tree buffer (text after |).
bodyLines is list of lines to insert in Body buffer.
"""
tree_head = '### NewHeadline'
indent = get_body_indent(VO.body)
body_head = '%s%s' %(indent*(level-1), tree_head)
return (tree_head, [body_head])
#def hook_changeLevBodyHead(VO, h, levDelta):
#"""Increase of decrease level number of Body headline by levDelta."""
#if levDelta==0: return h
def hook_doBodyAfterOop(VO, oop, levDelta, blnum1, tlnum1, blnum2, tlnum2, blnumCut, tlnumCut):
# this is instead of hook_changeLevBodyHead()
#print oop, levDelta, blnum1, tlnum1, blnum2, tlnum2, tlnumCut, blnumCut
Body = VO.Body
Z = len(Body)
ind = get_body_indent(VO.body)
# levDelta is wrong when pasting because hook_makeOutline() looks at relative indent
# determine level of pasted region from indent of its first line
if oop=='paste':
bline1 = Body[blnum1-1]
lev = (len(bline1) - len(bline1.lstrip())) / len(ind) + 1
levDelta = VO.levels[tlnum1-1] - lev
if not levDelta: return
indent = abs(levDelta) * ind
#--- copied from voom_mode_thevimoutliner.py -----------------------------
if blnum1:
assert blnum1 == VO.bnodes[tlnum1-1]
if tlnum2 < len(VO.bnodes):
assert blnum2 == VO.bnodes[tlnum2]-1
else:
assert blnum2 == Z
# dedent (if possible) or indent every non-blank line in Body region blnum1,blnum2
blines = []
for i in xrange(blnum1-1,blnum2):
line = Body[i]
if not line.strip():
blines.append(line)
continue
if levDelta > 0:
line = '%s%s' %(indent,line)
elif levDelta < 0 and line.startswith(indent):
line = line[len(indent):]
blines.append(line)
# replace Body region
Body[blnum1-1:blnum2] = blines
assert len(Body)==Z

View File

@ -0,0 +1,369 @@
# voom_mode_rest.py
# Last Modified: 2012-04-02
# VOoM -- Vim two-pane outliner, plugin for Python-enabled Vim version 7.x
# Website: http://www.vim.org/scripts/script.php?script_id=2657
# Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com)
# License: This program is free software. It comes without any warranty,
# to the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want To
# Public License, Version 2, as published by Sam Hocevar.
# See http://sam.zoy.org/wtfpl/COPYING for more details.
"""
VOoM markup mode for reStructuredText.
See |voom_mode_rest|, ../../doc/voom.txt#*voom_mode_rest*
http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#sections
The following are all valid section title adornment characters:
! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
Some characters are more suitable than others. The following are recommended:
= - ` : . ' " ~ ^ _ * + #
http://docs.python.org/documenting/rest.html#sections
Python recommended styles: ## ** = - ^ "
"""
# All valid section title adornment characters.
AD_CHARS = """ ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ """
AD_CHARS = AD_CHARS.split()
# List of adornment styles, in order of preference.
# Adornment style (ad) is a char or double char: '=', '==', '-', '--', '*', etc.
# Char is adornment char, double if there is overline.
AD_STYLES = """ == -- = - * " ' ` ~ : ^ + # . _ """
AD_STYLES = AD_STYLES.split()
# add all other possible styles to AD_STYLES
d = {}.fromkeys(AD_STYLES)
for c in AD_CHARS:
if not c*2 in d:
AD_STYLES.append(c*2)
if not c in d:
AD_STYLES.append(c)
assert len(AD_STYLES)==64
# convert AD_CHARS to dict for faster lookups
AD_CHARS = {}.fromkeys(AD_CHARS)
def hook_makeOutline(VO, blines):
"""Return (tlines, bnodes, levels) for Body lines blines.
blines is either Vim buffer object (Body) or list of buffer lines.
"""
Z = len(blines)
tlines, bnodes, levels = [], [], []
tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append
ENC = VO.enc
# {adornment style: level, ...}
# Level indicates when the first instance of this style was found.
ads_levels = {}
# diagram of Body lines when a headline is detected
# trailing whitespace always removed with rstrip()
# a b c
# ------ L3, blines[i-2] -- an overline or blank line
# head L2, blines[i-1] -- title line, not blank, <= than underline, can be inset only if overline
# ------ L1, blines[i] -- current line, always underline
# x y z
L1, L2, L3 = '','',''
gotHead = False
for i in xrange(Z):
L2, L3 = L1, L2
L1 = blines[i].rstrip()
# current line must be underline and title line cannot be blank
if not (L1 and L2 and (L1[0] in AD_CHARS) and L1.lstrip(L1[0])==''):
continue
# underline must be as long as headline text
if len(L1) < len(L2.decode(ENC,'replace')):
continue
# there is no overline; L3 must be blank line; L2 must be not inset
if not L3 and len(L2)==len(L2.lstrip()):
#if len(L1) < len(L2.decode(ENC,'replace')): continue
gotHead = True
ad = L1[0]
head = L2.strip()
bnode = i
# there is overline -- bnode is lnum of overline!
elif L3==L1:
#if len(L1) < len(L2.decode(ENC,'replace')): continue
gotHead = True
ad = L1[0]*2
head = L2.strip()
bnode = i-1
if gotHead:
if not ad in ads_levels:
ads_levels[ad] = len(ads_levels)+1
lev = ads_levels[ad]
gotHead = False
L1, L2, L3 = '','',''
tline = ' %s|%s' %('. '*(lev-1), head)
tlines_add(tline)
bnodes_add(bnode)
levels_add(lev)
# save ads_levels for outline operations
# don't clobber VO.ads_levels when parsing clipboard during Paste
# which is the only time blines is not Body
if blines is VO.Body:
VO.ads_levels = ads_levels
return (tlines, bnodes, levels)
def hook_newHeadline(VO, level, blnum, tlnum):
"""Return (tree_head, bodyLines).
tree_head is new headline string in Tree buffer (text after |).
bodyLines is list of lines to insert in Body buffer.
"""
tree_head = 'NewHeadline'
ads_levels = VO.ads_levels
levels_ads = dict([[v,k] for k,v in ads_levels.items()])
if level in levels_ads:
ad = levels_ads[level]
else:
ad = get_new_ad(levels_ads, ads_levels, level)
if len(ad)==1:
bodyLines = [tree_head, ad*11, '']
elif len(ad)==2:
ad = ad[0]
bodyLines = [ad*11, tree_head, ad*11, '']
# Add blank line when inserting after non-blank Body line.
if VO.Body[blnum-1].strip():
bodyLines[0:0] = ['']
return (tree_head, bodyLines)
#def hook_changeLevBodyHead(VO, h, levDelta):
# DO NOT CREATE THIS HOOK
def hook_doBodyAfterOop(VO, oop, levDelta, blnum1, tlnum1, blnum2, tlnum2, blnumCut, tlnumCut):
# this is instead of hook_changeLevBodyHead()
#print oop, levDelta, blnum1, tlnum1, blnum2, tlnum2, tlnumCut, blnumCut
Body = VO.Body
Z = len(Body)
bnodes, levels = VO.bnodes, VO.levels
ENC = VO.enc
# blnum1 blnum2 is first and last lnums of Body region pasted, inserted
# during up/down, or promoted/demoted.
if blnum1:
assert blnum1 == bnodes[tlnum1-1]
if tlnum2 < len(bnodes):
assert blnum2 == bnodes[tlnum2]-1
else:
assert blnum2 == Z
# blnumCut is Body lnum after which a region was removed during 'cut',
# 'up', 'down'. We need to check if there is blank line between nodes
# used to be separated by the cut/moved region to prevent headline loss.
if blnumCut:
if tlnumCut < len(bnodes):
assert blnumCut == bnodes[tlnumCut]-1
else:
assert blnumCut == Z
# Total number of added lines minus number of deleted lines.
b_delta = 0
### After 'cut' or 'up': insert blank line if there is none
# between the nodes used to be separated by the cut/moved region.
if (oop=='cut' or oop=='up') and (0 < blnumCut < Z) and Body[blnumCut-1].strip():
Body[blnumCut:blnumCut] = ['']
update_bnodes(VO, tlnumCut+1 ,1)
b_delta+=1
if oop=='cut':
return
### Prevent loss of headline after last node in the region:
# insert blank line after blnum2 if blnum2 is not blank, that is insert
# blank line before bnode at tlnum2+1.
if blnum2 < Z and Body[blnum2-1].strip():
Body[blnum2:blnum2] = ['']
update_bnodes(VO, tlnum2+1 ,1)
b_delta+=1
### Change levels and/or styles of headlines in the affected region.
# Always do this after Paste, even if level is unchanged -- adornments can
# be different when pasting from other outlines.
# Examine each headline, from bottom to top, and change adornment style.
# To change from underline to overline style:
# insert overline.
# To change from overline to underline style:
# delete overline if there is blank before it;
# otherwise change overline to blank line;
# remove inset from headline text.
# Update bnodes after inserting or deleting a line.
if levDelta or oop=='paste':
ads_levels = VO.ads_levels
levels_ads = dict([[v,k] for k,v in ads_levels.items()])
# Add adornment styles for new levels. Can't do this in the main loop
# because it goes backwards and thus will add styles in reverse order.
for i in xrange(tlnum1, tlnum2+1):
lev = levels[i-1]
if not lev in levels_ads:
ad = get_new_ad(levels_ads, ads_levels, lev)
levels_ads[lev] = ad
ads_levels[ad] = lev
for i in xrange(tlnum2, tlnum1-1, -1):
# required level (VO.levels has been updated)
lev = levels[i-1]
# required adornment style
ad = levels_ads[lev]
# deduce current adornment style
bln = bnodes[i-1]
L1 = Body[bln-1].rstrip()
L2 = Body[bln].rstrip()
if bln+1 < len(Body):
L3 = Body[bln+1].rstrip()
else:
L3 = ''
ad_ = deduce_ad_style(L1,L2,L3,ENC)
# change adornment style
# see deduce_ad_style() for diagram
if ad_==ad:
continue
elif len(ad_)==1 and len(ad)==1:
Body[bln] = ad*len(L2)
elif len(ad_)==2 and len(ad)==2:
Body[bln-1] = ad[0]*len(L1)
Body[bln+1] = ad[0]*len(L3)
elif len(ad_)==1 and len(ad)==2:
# change underline if different
if not ad_ == ad[0]:
Body[bln] = ad[0]*len(L2)
# insert overline; current bnode doesn't change
Body[bln-1:bln-1] = [ad[0]*len(L2)]
update_bnodes(VO, i+1, 1)
b_delta+=1
elif len(ad_)==2 and len(ad)==1:
# change underline if different
if not ad_[0] == ad:
Body[bln+1] = ad*len(L3)
# remove headline inset if any
if not len(L2) == len(L2.lstrip()):
Body[bln] = L2.lstrip()
# check if line before overline is blank
if bln >1:
L0 = Body[bln-2].rstrip()
else:
L0 = ''
# there is blank before overline
# delete overline; current bnode doesn't change
if not L0:
Body[bln-1:bln] = []
update_bnodes(VO, i+1, -1)
b_delta-=1
# there is no blank before overline
# change overline to blank; only current bnode needs updating
else:
Body[bln-1] = ''
bnodes[i-1]+=1
### Prevent loss of first headline: make sure it is preceded by a blank line
blnum1 = bnodes[tlnum1-1]
if blnum1 > 1 and Body[blnum1-2].strip():
Body[blnum1-1:blnum1-1] = ['']
update_bnodes(VO, tlnum1 ,1)
b_delta+=1
### After 'down' : insert blank line if there is none
# between the nodes used to be separated by the moved region.
if oop=='down' and (0 < blnumCut < Z) and Body[blnumCut-1].strip():
Body[blnumCut:blnumCut] = ['']
update_bnodes(VO, tlnumCut+1 ,1)
b_delta+=1
assert len(Body) == Z + b_delta
def update_bnodes(VO, tlnum, delta):
"""Update VO.bnodes by adding/substracting delta to each bnode
starting with bnode at tlnum and to the end.
"""
bnodes = VO.bnodes
for i in xrange(tlnum, len(bnodes)+1):
bnodes[i-1] += delta
def get_new_ad(levels_ads, ads_levels, level):
"""Return adornment style for new level, that is level missing from
levels_ads and ads_levels.
"""
for ad in AD_STYLES:
if not ad in ads_levels:
return ad
# all 64 adornment styles are in use, return style for level 64
assert len(levels_ads)==64
return levels_ads[64]
def deduce_ad_style(L1,L2,L3,ENC):
"""Deduce adornment style given first 3 lines of Body node.
1st line is bnode line. Lines must be rstripped.
"""
# '--' style '-' style
#
# L0 L0 Body[bln-2]
# ---- L1 head L1 <--bnode Body[bln-1]
# head L2 ---- L2 Body[bln]
# ---- L3 text L3 Body[bln+1]
# bnode is overline
if L1==L3 and (L1[0] in AD_CHARS) and L1.lstrip(L1[0])=='' and (len(L1) >= len(L2.decode(ENC,'replace'))):
ad = 2*L1[0]
# bnode is headline text
elif (L2[0] in AD_CHARS) and L2.lstrip(L2[0])=='' and (len(L2) >= len(L1.decode(ENC,'replace'))):
ad = L2[0]
else:
print L1
print L2
print L3
print ENC
assert None
return ad
# wrong if perverse headline like this (correct ad style is '-')
#
# ^^^^^
# -----
# ^^^^^
# text
def deduce_ad_style_test(VO):
""" Test to verify deduce_ad_style(). Execute from Vim
:py voom.VOOMS[1].mModule.deduce_ad_style_test(voom.VOOMS[1])
"""
bnodes, levels, Body = VO.bnodes, VO.levels, VO.Body
ads_levels = VO.ads_levels
levels_ads = dict([[v,k] for k,v in ads_levels.items()])
ENC = VO.enc
for i in xrange(2, len(bnodes)+1):
bln = bnodes[i-1]
L1 = Body[bln-1].rstrip()
L2 = Body[bln].rstrip()
if bln+1 < len(Body):
L3 = Body[bln+1].rstrip()
else:
L3 = ''
ad = deduce_ad_style(L1,L2,L3,ENC)
lev = levels[i-1]
print i, ad, levels_ads[lev]
assert ad == levels_ads[lev]

View File

@ -0,0 +1,97 @@
# voom_mode_thevimoutliner.py
# Last Modified: 2011-05-01
# VOoM -- Vim two-pane outliner, plugin for Python-enabled Vim version 7.x
# Website: http://www.vim.org/scripts/script.php?script_id=2657
# Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com)
# License: This program is free software. It comes without any warranty,
# to the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want To
# Public License, Version 2, as published by Sam Hocevar.
# See http://sam.zoy.org/wtfpl/COPYING for more details.
"""
VOoM markup mode for The Vim Outliner format.
See |voom_mode_thevimoutliner|, ../../doc/voom.txt#*voom_mode_thevimoutliner*
Headlines and body lines are indented with Tabs. Number of tabs indicates
level. 0 Tabs means level 1.
Headlines are lines with >=0 Tabs followed by any character except '|'.
Blank lines are not headlines.
"""
# Body lines start with these chars
BODY_CHARS = {'|':0,}
# ------ the rest is identical to voom_mode_vimoutliner.py -------------------
def hook_makeOutline(VO, blines):
"""Return (tlines, bnodes, levels) for Body lines blines.
blines is either Vim buffer object (Body) or list of buffer lines.
"""
Z = len(blines)
tlines, bnodes, levels = [], [], []
tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append
for i in xrange(Z):
bline = blines[i].rstrip()
if not bline:
continue
head = bline.lstrip('\t')
if head[0] in BODY_CHARS:
continue
lev = len(bline) - len(head) + 1
tline = ' %s|%s' %('. '*(lev-1), head)
tlines_add(tline)
bnodes_add(i+1)
levels_add(lev)
return (tlines, bnodes, levels)
def hook_newHeadline(VO, level, blnum, tlnum):
"""Return (tree_head, bodyLines).
tree_head is new headline string in Tree buffer (text after |).
bodyLines is list of lines to insert in Body buffer.
"""
tree_head = 'NewHeadline'
bodyLines = ['%s%s' %('\t'*(level-1), tree_head),]
return (tree_head, bodyLines)
#def hook_changeLevBodyHead(VO, h, levDelta):
#"""Increase of decrease level number of Body headline by levDelta."""
#if levDelta==0: return h
def hook_doBodyAfterOop(VO, oop, levDelta, blnum1, tlnum1, blnum2, tlnum2, blnumCut, tlnumCut):
# this is instead of hook_changeLevBodyHead()
if not levDelta: return
indent = abs(levDelta) * '\t'
Body = VO.Body
Z = len(Body)
# ---- identical to voom_mode_python.py code ----------------------------
if blnum1:
assert blnum1 == VO.bnodes[tlnum1-1]
if tlnum2 < len(VO.bnodes):
assert blnum2 == VO.bnodes[tlnum2]-1
else:
assert blnum2 == Z
# dedent (if possible) or indent every non-blank line in Body region blnum1,blnum2
blines = []
for i in xrange(blnum1-1,blnum2):
line = Body[i]
if not line.strip():
blines.append(line)
continue
if levDelta > 0:
line = '%s%s' %(indent,line)
elif levDelta < 0 and line.startswith(indent):
line = line[len(indent):]
blines.append(line)
# replace Body region
Body[blnum1-1:blnum2] = blines
assert len(Body)==Z

View File

@ -0,0 +1,105 @@
# voom_mode_txt2tags.py
# Last Modified: 2011-05-01
# VOoM -- Vim two-pane outliner, plugin for Python-enabled Vim version 7.x
# Website: http://www.vim.org/scripts/script.php?script_id=2657
# Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com)
# License: This program is free software. It comes without any warranty,
# to the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want To
# Public License, Version 2, as published by Sam Hocevar.
# See http://sam.zoy.org/wtfpl/COPYING for more details.
"""
VOoM markup mode for txt2tags titles.
See |voom_mode_txt2tags|, ../../doc/voom.txt#*voom_mode_txt2tags*
"""
import re
# from txt2tags.py
# titskel = r'^ *(?P<id>%s)(?P<txt>%s)\1(\[(?P<label>[\w-]*)\])?\s*$'
# bank[ 'title'] = re.compile(titskel%('[=]{1,5}','[^=](|.*[^=])'))
# bank['numtitle'] = re.compile(titskel%('[+]{1,5}','[^+](|.*[^+])'))
# === headline ===
headline1_match = re.compile(r'^ *(=+)([^=].*[^=]|[^=])(\1)(\[[\w-]*\])?\s*$').match
# +++ headline +++
headline2_match = re.compile(r'^ *(\++)([^+].*[^+]|[^+])(\1)(\[[\w-]*\])?\s*$').match
def hook_makeOutline(VO, blines):
"""Return (tlines, bnodes, levels) for Body lines blines.
blines is either Vim buffer object (Body) or list of buffer lines.
"""
Z = len(blines)
tlines, bnodes, levels = [], [], []
tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append
areaVerb,areaRaw,areaTagged = False,False,False
for i in xrange(Z):
bline = blines[i]
# ignore Verbatim/Raw/Tagged Areas
bline_rs = bline.rstrip()
if bline_rs=='```' and not (areaRaw or areaTagged):
areaVerb = not areaVerb; continue
elif bline_rs=='"""' and not (areaVerb or areaTagged):
areaRaw = not areaRaw; continue
elif bline_rs=="'''" and not (areaVerb or areaRaw):
areaTagged = not areaTagged; continue
if areaVerb or areaRaw or areaTagged: continue
# there can be leading spaces but not tabs
bline = bline.lstrip(' ')
if bline.startswith('='):
m = headline1_match(bline)
if not m: continue
plus = ''
elif bline.startswith('+'):
m = headline2_match(bline)
if not m: continue
plus = '+ '
else:
continue
lev = len(m.group(1))
head = '%s%s' %(plus, m.group(2).strip())
tline = ' %s|%s' %('. '*(lev-1), head)
tlines_add(tline)
bnodes_add(i+1)
levels_add(lev)
return (tlines, bnodes, levels)
def hook_newHeadline(VO, level, blnum, tlnum):
"""Return (tree_head, bodyLines).
tree_head is new headline string in Tree buffer (text after |).
bodyLines is list of lines to insert in Body buffer.
"""
tree_head = 'NewHeadline'
# choose = or + headline type -- same as previous headline
if tlnum > 1:
prev_head = VO.Body[VO.bnodes[tlnum-1] - 1]
if prev_head.lstrip()[0] == '=':
lev = '='*level
else:
lev = '+'*level
tree_head = '+ NewHeadline'
else:
lev = '='*level
bodyLines = ['%s NewHeadline %s' %(lev, lev), '']
return (tree_head, bodyLines)
def hook_changeLevBodyHead(VO, h, levDelta):
"""Increase of decrease level number of Body headline by levDelta."""
if levDelta==0: return h
hLS = h.lstrip()
if hLS[0] == '=':
m = headline1_match(h)
level = len(m.group(1))
s = '='*(level+levDelta)
elif hLS[0] == '+':
m = headline2_match(h)
level = len(m.group(1))
s = '+'*(level+levDelta)
else: assert False
return '%s%s%s%s%s' %(h[:m.start(1)], s, h[m.end(1):m.start(3)], s, h[m.end(3):])

View File

@ -0,0 +1,91 @@
# voom_mode_viki.py
# Last Modified: 2011-10-28
# VOoM -- Vim two-pane outliner, plugin for Python-enabled Vim version 7.x
# Website: http://www.vim.org/scripts/script.php?script_id=2657
# Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com)
# License: This program is free software. It comes without any warranty,
# to the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want To
# Public License, Version 2, as published by Sam Hocevar.
# See http://sam.zoy.org/wtfpl/COPYING for more details.
"""
VOoM markup mode for headline markup used by Vim Viki/Deplate plugin.
See |voom_mode_viki|, ../../doc/voom.txt#*voom_mode_viki*
"""
import re
headline_match = re.compile(r'^(\*+)\s').match
# Ignore Regions other than #Region
#
# #Type [OPTIONS] <<EndOfRegion
# .......
# EndOfRegion
#
# syntax/viki.vim:
# syn region vikiRegion matchgroup=vikiMacroDelim
# \ start=/^[[:blank:]]*#\([A-Z]\([a-z][A-Za-z]*\)\?\>\|!!!\)\(\\\n\|.\)\{-}<<\z(.*\)$/
# \ end=/^[[:blank:]]*\z1[[:blank:]]*$/
# \ contains=@vikiText,vikiRegionNames
#
# EndOfRegion can be empty string, leading/trailing white space matters
# Don't know what !!! is for.
#
region_match = re.compile(r'^\s*#([A-Z]([a-z][A-Za-z]*)?)\b.*?<<(.*)').match
def hook_makeOutline(VO, blines):
"""Return (tlines, bnodes, levels) for Body lines blines.
blines is either Vim buffer object (Body) or list of buffer lines.
"""
Z = len(blines)
tlines, bnodes, levels = [], [], []
tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append
inRegion = False # EndOfRegion match object when inside a region
for i in xrange(Z):
bline = blines[i]
if inRegion:
if re.match(inRegion, bline):
inRegion = False
continue
if bline.lstrip().startswith('#') and '<<' in bline:
r_m = region_match(bline)
if r_m and r_m.group(1) != 'Region':
inRegion = '^\s*%s\s*$' %re.escape(r_m.group(3) or '')
continue
elif not bline.startswith('*'):
continue
m = headline_match(bline)
if not m:
continue
lev = len(m.group(1))
head = bline[lev:].strip()
tline = ' %s|%s' %('. '*(lev-1), head)
tlines_add(tline)
bnodes_add(i+1)
levels_add(lev)
return (tlines, bnodes, levels)
def hook_newHeadline(VO, level, blnum, tlnum):
"""Return (tree_head, bodyLines).
tree_head is new headline string in Tree buffer (text after |).
bodyLines is list of lines to insert in Body buffer.
"""
tree_head = 'NewHeadline'
bodyLines = ['%s %s' %('*'*level, tree_head), '']
return (tree_head, bodyLines)
def hook_changeLevBodyHead(VO, h, levDelta):
"""Increase of decrease level number of Body headline by levDelta."""
if levDelta==0: return h
m = headline_match(h)
level = len(m.group(1))
return '%s%s' %('*'*(level+levDelta), h[m.end(1):])

View File

@ -0,0 +1,96 @@
# voom_mode_vimoutliner.py
# Last Modified: 2011-05-01
# VOoM -- Vim two-pane outliner, plugin for Python-enabled Vim version 7.x
# Website: http://www.vim.org/scripts/script.php?script_id=2657
# Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com)
# License: This program is free software. It comes without any warranty,
# to the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want To
# Public License, Version 2, as published by Sam Hocevar.
# See http://sam.zoy.org/wtfpl/COPYING for more details.
"""
VOoM markup mode for VimOutliner format.
See |voom_mode_vimoutliner|, ../../doc/voom.txt#*voom_mode_vimoutliner*
Headlines are lines with >=0 Tabs followed by any character except:
: ; | > <
Otherwise this mode is identical to the "thevimoutliner" mode.
"""
# Body lines start with these chars
BODY_CHARS = {':':0, ';':0, '|':0, '<':0, '>':0,}
#-------------copy/pasted from voom_mode_thevimoutliner.py -------------------
def hook_makeOutline(VO, blines):
"""Return (tlines, bnodes, levels) for Body lines blines.
blines is either Vim buffer object (Body) or list of buffer lines.
"""
Z = len(blines)
tlines, bnodes, levels = [], [], []
tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append
for i in xrange(Z):
bline = blines[i].rstrip()
if not bline:
continue
head = bline.lstrip('\t')
if head[0] in BODY_CHARS:
continue
lev = len(bline) - len(head) + 1
tline = ' %s|%s' %('. '*(lev-1), head)
tlines_add(tline)
bnodes_add(i+1)
levels_add(lev)
return (tlines, bnodes, levels)
def hook_newHeadline(VO, level, blnum, tlnum):
"""Return (tree_head, bodyLines).
tree_head is new headline string in Tree buffer (text after |).
bodyLines is list of lines to insert in Body buffer.
column is cursor position in new headline in Body buffer.
"""
tree_head = 'NewHeadline'
bodyLines = ['%s%s' %('\t'*(level-1), tree_head),]
return (tree_head, bodyLines)
#def hook_changeLevBodyHead(VO, h, levDelta):
#"""Increase of decrease level number of Body headline by levDelta."""
#if levDelta==0: return h
def hook_doBodyAfterOop(VO, oop, levDelta, blnum1, tlnum1, blnum2, tlnum2, blnumCut, tlnumCut):
# this is instead of hook_changeLevBodyHead()
if not levDelta: return
indent = abs(levDelta) * '\t'
Body = VO.Body
Z = len(Body)
# ---- identical to Python mode ----
if blnum1:
assert blnum1 == VO.bnodes[tlnum1-1]
if tlnum2 < len(VO.bnodes):
assert blnum2 == VO.bnodes[tlnum2]-1
else:
assert blnum2 == Z
# dedent (if possible) or indent every non-blank line in Body region blnum1,blnum2
blines = []
for i in xrange(blnum1-1,blnum2):
line = Body[i]
if not line.strip():
blines.append(line)
continue
if levDelta > 0:
line = '%s%s' %(indent,line)
elif levDelta < 0 and line.startswith(indent):
line = line[len(indent):]
blines.append(line)
# replace Body region
Body[blnum1-1:blnum2] = blines
assert len(Body)==Z

View File

@ -0,0 +1,70 @@
# voom_mode_vimwiki.py
# Last Modified: 2011-05-01
# VOoM -- Vim two-pane outliner, plugin for Python-enabled Vim version 7.x
# Website: http://www.vim.org/scripts/script.php?script_id=2657
# Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com)
# License: This program is free software. It comes without any warranty,
# to the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want To
# Public License, Version 2, as published by Sam Hocevar.
# See http://sam.zoy.org/wtfpl/COPYING for more details.
"""
VOoM markup mode for headline markup used by vimwiki plugin:
http://www.vim.org/scripts/script.php?script_id=2226
See |voom_mode_vimwiki|, ../../doc/voom.txt#*voom_mode_vimwiki*
= headline level 1 =
body text
== headline level 2 ==
body text
=== headline level 3 ===
"""
import re
headline_match = re.compile(r'^\s*(=+).+(\1)\s*$').match
def hook_makeOutline(VO, blines):
"""Return (tlines, bnodes, levels) for Body lines blines.
blines is either Vim buffer object (Body) or list of buffer lines.
"""
Z = len(blines)
tlines, bnodes, levels = [], [], []
tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append
for i in xrange(Z):
bline = blines[i].strip()
if not bline.startswith('='):
continue
m = headline_match(bline)
if not m:
continue
lev = len(m.group(1))
bline = bline.strip()
head = bline[lev:-lev].strip()
tline = ' %s|%s' %('. '*(lev-1), head)
tlines_add(tline)
bnodes_add(i+1)
levels_add(lev)
return (tlines, bnodes, levels)
def hook_newHeadline(VO, level, blnum, tlnum):
"""Return (tree_head, bodyLines).
tree_head is new headline string in Tree buffer (text after |).
bodyLines is list of lines to insert in Body buffer.
"""
tree_head = 'NewHeadline'
bodyLines = ['%s %s %s' %('='*level, tree_head, '='*level), '']
return (tree_head, bodyLines)
def hook_changeLevBodyHead(VO, h, levDelta):
"""Increase of decrease level number of Body headline by levDelta."""
if levDelta==0: return h
m = headline_match(h)
level = len(m.group(1))
s = '='*(level+levDelta)
return '%s%s%s%s%s' %(h[:m.start(1)], s, h[m.end(1):m.start(2)], s, h[m.end(2):])

View File

@ -0,0 +1,82 @@
# voom_mode_wiki.py
# Last Modified: 2011-05-01
# VOoM -- Vim two-pane outliner, plugin for Python-enabled Vim version 7.x
# Website: http://www.vim.org/scripts/script.php?script_id=2657
# Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com)
# License: This program is free software. It comes without any warranty,
# to the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want To
# Public License, Version 2, as published by Sam Hocevar.
# See http://sam.zoy.org/wtfpl/COPYING for more details.
"""
VOoM markup mode for MediaWiki headline markup.
See |voom_mode_wiki|, ../../doc/voom.txt#*voom_mode_wiki*
= headline level 1 =
some text
== headline level 2 ==
more text
=== headline level 3 === <!--comment-->
==== headline level 4 ====<!--comment-->
"""
# can access main module voom.py, including global outline data
#import sys
#if 'voom' in sys.modules:
#voom = sys.modules['voom']
#VOOMS = voom.VOOMS
import re
comment_tag_sub = re.compile('<!--.*?-->\s*$').sub
headline_match = re.compile(r'^(=+).*(\1)\s*$').match
def hook_makeOutline(VO, blines):
"""Return (tlines, bnodes, levels) for Body lines blines.
blines is either Vim buffer object (Body) or list of buffer lines.
"""
Z = len(blines)
tlines, bnodes, levels = [], [], []
tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append
for i in xrange(Z):
if not blines[i].startswith('='):
continue
bline = blines[i]
if '<!--' in bline:
bline = comment_tag_sub('',bline)
bline = bline.strip()
m = headline_match(bline)
if not m:
continue
lev = len(m.group(1))
head = bline[lev:-lev].strip()
tline = ' %s|%s' %('. '*(lev-1), head)
tlines_add(tline)
bnodes_add(i+1)
levels_add(lev)
return (tlines, bnodes, levels)
def hook_newHeadline(VO, level, blnum, tlnum):
"""Return (tree_head, bodyLines).
tree_head is new headline string in Tree buffer (text after |).
bodyLines is list of lines to insert in Body buffer.
"""
tree_head = 'NewHeadline'
bodyLines = ['%s %s %s' %('='*level, tree_head, '='*level), '']
return (tree_head, bodyLines)
def hook_changeLevBodyHead(VO, h, levDelta):
"""Increase of decrease level number of Body headline by levDelta."""
if levDelta==0: return h
hs = h # need to strip trailing comment tags first
if '<!--' in h:
hs = comment_tag_sub('',hs)
m = headline_match(hs)
level = len(m.group(1))
s = '='*(level+levDelta)
return '%s%s%s%s' %(s, h[m.end(1):m.start(2)], s, h[m.end(2):])

View File

@ -0,0 +1,76 @@
" This VOoM add-on shows how to customize Tree headline text for individual
" Body filetypes. It works only when outlining start fold markers with levels,
" doesn't do anything when using a markup mode.
"
" IMPORTANT: This file must be sourced after entire voom.vim has been sourced.
" Use option g:voom_user_command as explained in |voom_addons|.
" EXAMPLE: Move this file to $HOME/.vim/voom_add-ons/ and add the following
" line to .vimrc:
" let g:voom_user_command = "runtime! voom_add-ons/*.vim"
"
" NOTE: DO NOT place this file in Vim plugin folder or its subfolder.
"
" Do not load this script if voom.vim has not been sourced completely.
if !exists('*Voom_Exec')
finish
endif
" g:voom_rstrip_chars_{filetype} can be defined here instead of vimrc.
" Note that Space and Tab must be included.
if 0
let g:voom_rstrip_chars_autohotkey = "; \t"
endif
python << EOF
# Replace default headline construction procedure with a custom function:
# 1. Define a make_head Python function.
# - It returns a string: Tree headline text.
# - It requires two arguments: bline and match.
# - bline is Body line from which we make Tree headline.
# - match is MatchObject produced by re.search() for bline and fold
# marker regex
# - bline[:match.start()] gives part of Body line before the
# matching fold marker. This is what we usually start from.
# 2. Register function in dictionary voom.MAKE_HEAD for filetypes with which
# it should be used.
import re
if 1:
# HTML headline: like default plus delete all html tags
html_tag_sub = re.compile('<.*?>').sub
def voom_make_head_html(bline,match):
s = bline[:match.start()].strip().strip('-=~').strip()
s = html_tag_sub('',s)
if s.endswith('<!'):
return s[:-2].strip()
else:
return s
voom.MAKE_HEAD['html'] = voom_make_head_html
if 0:
# Python headline: like default plus remove "def "
def voom_make_head_python(bline,match):
s = bline[:match.start()].lstrip().rstrip('# \t').strip('-=~').strip()
if s.startswith('def ') or s.startswith('def\t'):
return s[3:].lstrip()
else:
return s
voom.MAKE_HEAD['python'] = voom_make_head_python
#voom.MAKE_HEAD['ruby'] = voom_make_head_python
if 0:
# Vim headline: like default plus remove leading "fu ", "fun ", ..., "function ".
vim_func_sub = re.compile(r"^fu(n|nc|nct|ncti|nctio|nction)?!?\s+").sub
def voom_make_head_vim(bline,match):
s = bline[:match.start()].lstrip().rstrip('" \t').strip('-=~').strip()
s = vim_func_sub('',s)
return s
voom.MAKE_HEAD['vim'] = voom_make_head_vim
EOF

View File

@ -0,0 +1,76 @@
" This is a sample VOoM add-on.
" It creates global command :VoomInfo which prints various outline information
" about the current buffer if it's a VOoM buffer (Tree or Body)
" This file can be sourced at any time like a regular Vim script. E.g., it can
" be dropped in folder ~/.vim/plugin/ . Of course, VOoM has to be installed for
" the command :VoomInfo to work.
" This works because the name of command function starts with 'Voom_'
com! VoomInfo call Voom_Info()
func! Voom_Info()
""""""" standard code for every VOoM add-on command
" Determine if the current buffer is a VOoM Tree buffer, Body buffer, or neither.
let [bufType,body,tree] = Voom_GetBufInfo()
" Error, outline is not available (Body is unloaded, outline update failed).
if body==-1 | return | endif
""" Do different things depending on the type of the current buffer.
" Current buffer is not a VOoM buffer (neither Tree nor Body).
" The error message is printed automatically. It can be suppressed by
" providing an optional argument: Voom_GetBufInfo(1)
if bufType==#'None'
"call Voom_ErrorMsg("VOoM: current buffer is not a VOoM buffer")
return
" Current buffer is a VOoM Body. Outline is updated automatically if needed.
elseif bufType==#'Body'
call Voom_WarningMsg("in VOoM Body buffer")
" Current buffer is a VOoM Tree.
elseif bufType==#'Tree'
call Voom_WarningMsg("in VOoM Tree buffer")
endif
" Get Vim-side outline data. NOTE: Do not modify these dictionaries!
let [voom_bodies, voom_trees] = Voom_GetData()
""""""" script-specific code
" Get Python-side data. This creates Vim local variables.
py voom_Info()
echo 'VOoM version:' Voom_GetVar('s:voom_did_quickload')
echo '__PyLog__ buffer number:' Voom_GetVar('s:voom_logbnr')
" print outline information
echo 'VOoM outline for:' getbufline(tree,1)[0][1:]
echo 'Current buffer is:' bufType
echo 'Body buffer number:' body
echo 'Tree buffer number:' tree
echo 'number of nodes:' l:nodesNumber
echo 'nodes with/without children:' l:nodesWithChildren '/' l:nodesWithoutChildren
echo 'max level:' l:maxLevel
echo 'selected node number:' voom_bodies[body].snLn
echo 'selected node headline text:' l:selectedHeadline
echo 'selected node level:' l:selectedNodeLevel
endfunc
python << EOF
def voom_Info():
body, tree = int(vim.eval('l:body')), int(vim.eval('l:tree'))
VO = voom.VOOMS[body]
bnodes, levels = VO.bnodes, VO.levels
vim.command("let l:maxLevel=%s" %(max(levels)))
vim.command("let l:nodesNumber=%s" %(len(bnodes)))
nodesWithChildren = len([i for i in xrange(1,len(bnodes)+1) if voom.nodeHasChildren(VO,i)])
vim.command("let l:nodesWithChildren=%s" %nodesWithChildren)
nodesWithoutChildren = len([i for i in xrange(1,len(bnodes)+1) if not voom.nodeHasChildren(VO,i)])
vim.command("let l:nodesWithoutChildren=%s" %nodesWithoutChildren)
snLn = VO.snLn
treeline = VO.Tree[snLn-1]
if snLn>1:
selectedHeadline = treeline[treeline.find('|')+1:]
else:
selectedHeadline = "top-of-buffer"
vim.command("let [l:selectedNode,l:selectedHeadline]=[%s,'%s']" %(snLn, selectedHeadline.replace("'","''")))
vim.command("let l:selectedNodeLevel=%s" %levels[snLn-1])
EOF

View File

@ -0,0 +1,127 @@
vim:fdm=marker
vim:foldtext=getline(v\:foldstart).'\ \ \ /'.v\:foldlevel.'...'.(v\:foldend-v\:foldstart)
foldtext=getline(v\:foldstart).'...'.(v\:foldend-v\:foldstart)
Vim folding seems to be limited to 20 levels.
--- 1 ---{{{1
1
--- 2 ---{{{2
2
--- 3 ---{{{3
3
--- 4 ---{{{4
4
--- 5 ---{{{5
5
--- 6 ---{{{6
6
--- 7 ---{{{7
7
--- 8 ---{{{8
8
--- 9 ---{{{9
9
--- 10 ---{{{10
10
--- 11 ---{{{11
11
--- 12 ---{{{12
12
--- 13 ---{{{13
13
--- 14 ---{{{14
14
--- 15 ---{{{15
15
--- 16 ---{{{16
16
--- 17 ---{{{17
17
--- 18 ---{{{18
18
--- 19 ---{{{19
19
--- 20 ---{{{20
20
--- 21 ---{{{21
21
--- 22 ---{{{22
22
--- 23 ---{{{23
23
--- 24 ---{{{24
24
--- 25 ---{{{25
25
--- 26 ---{{{26
26
--- 27 ---{{{27
27
--- 28 ---{{{28
28
--- 29 ---{{{29
29
--- 30 ---{{{30
30
--- 31 ---{{{31
31
--- 32 ---{{{32
32
--- 33 ---{{{33
33
--- 34 ---{{{34
34
--- 35 ---{{{35
35
--- 36 ---{{{36
36
--- 37 ---{{{37
37
--- 38 ---{{{38
38
--- 39 ---{{{39
39
--- 40 ---{{{40
40
~~~ ~~~ THE END ~~~ ~~~{{{1

View File

@ -0,0 +1,355 @@
// :Voom asciidoc
// Tests for VOoM asciidoc mode. This file is in utf-8 encoding.
// vim: ft=asciidoc list fdm=manual
// Two-line style, levels 1 to 5 only
Level 1
=======
Level 2
-------
Level 3
~~~~~~~
Level 4
^^^^^^^
Level 5
+++++++
// One-line style
= Level 1 =
== Level 2 ==
=== Level 3 ===
==== Level 4 ====
===== Level 5 =====
====== Level 6 ======
======= Level 7 =======
// Closing ='s are optional
= Level 1
== Level 2
=== Level 3
==== Level 4
===== Level 5
====== Level 6
======= Level 7
There must be a whitespace between headline text and ='s. The number of closing
='s must match the number of opening ='s.
//One-line style overrides two-line style:
===== Level 5
-------------
listing
-------------
UNDERLINE SIZE
==============
The underline must be of the same size as the title line +/- 2 chars.
Both the underline and the title line must be at least 2 chars long.
Trailing whitespace is always ignored and is not counted.
not headlines
-------------
headline
~~~~~
headline
~~~~~~~~~~~
заголовок
~~~~~~
заголовок
~~~~~~~~~~~~
A
---
headlines, 5 of each
--------------------
headline
~~~~~~
headline
~~~~~~~
headline
~~~~~~~~
headline
~~~~~~~~~
headline
~~~~~~~~~~
заголовок
~~~~~~~
заголовок
~~~~~~~~
заголовок
~~~~~~~~~
заголовок
~~~~~~~~~~
заголовок
~~~~~~~~~~~
BLOCKID, ATTRIBUTELIST
======================
[[AAA]]
== headline 1 ==
[AAA]
== headline 2 ==
[[AAA]]
[AAA]
== headline 3 ==
[AAA]
[[AAA]]
== headline 4 ==
[AAA]
[[AAA]]
[AAA]
== headline 5 ==
text
[AAA]
== headline 6 ==
DELIMITED BLOCKS
================
////
== not headline ==
not headline
------------
////
++++
== not headline ==
not headline
------------
++++
----
== not headline ==
not headline
------------
....
== not headline ==
not headline
------------
....
****
== not headline ==
not headline
------------
****
____
== not headline ==
not headline
------------
____
====
== not headline ==
not headline
------------
====
// ambiguious cases
headline
--------
--------
listing, not headline
---------------------
DISALLOWED UNDERLINED HEADLINES
===============================
No headlines here. The underline starts Delimited Block.
//BlockID
[[AAA]]
-------
== not headline
-------
//Attribute List
[AAA]
-----
== not headline
-----
//Comment line (exactly two // at start)
//AAA
-----
== not headline
-----
//Block Title, one dot is enough
.AAA
----
== not headline
-----
//Tab at start of title line is also not allowed, don't know why
not headline
------------
== not headline
-----
//An underlined headline cannot be just one character. They can in AsciiDoc.
A
--
B
---
//An underlined title cannot look like an underline or a Delimited Block line,
//that is a line of only =,-,+, etc.
===
---
===
+++
===
^^^
+++
++
==
^^
~~
BLANK LINES
===========
A blank separator line is required in front of most headlines.
But preceding [[]] and/or [] lines are treated as part of the headline.
// Wrong:
== headline ==
text
== not headline ==
[[X1]]
[blah]
== not headline ==
// Correct:
== headline 1 ==
text
== headline 2 ==
[[X1]]
[blah]
== headline 3 ==
// The second underline starts Delimited Block
headline
--------
text
not headline
------------
not headline
------------
// Comment lines before the headline are ignored
== headline 1 ==
text
// comment
== not headline ==
// comment
== headline 2 ==
text
// comment
// comment
[blah]
== headline 3 ==
// Blank line is NOT required between adjacent headlines
== headline 1 ==
== headline 2 ==
// comment
== headline 3 ==
headline 4
----------
[blah]
headline 5
----------
// after the end of a Delimited Block
== headline 1 ==
----------------------------
listing
----------------------------
== headline 2 ==
GOTCHAS
=======
There must be a blank line between a macro, an :atrrbute:, etc. and the
following headline.
The underline can be mistaken for a DelimitedBlock, which will kill subsequent
headlines.
== headline
:numbered:
== not headline
ifdef::something[]
not headline
------------
== not headline
---------------
== headline

View File

@ -0,0 +1,433 @@
:Voom asciidoc
This is VOoM markup mode test file. Converted from **test_outline.txt**.
findme findme2
h 1
===
1 body
NEXT LINE IS FOR TESTS -- DO NOT MOVE OR EDIT
VO.levels=[1, 1, 2, 2, 1, 1, 2, 2, 3, 4, 3, 4, 5, 6, 7, 2, 1, 2, 1, 2, 2, 3, 3, 4, 5, 5, 3, 2, 3, 2, 3, 2, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 3, 4, 4, 4, 4, 5, 5, 4, 4, 5, 5, 3, 3, 3, 4, 4, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 3, 2, 3, 3]
[[X2]]
h 1.1
-----
1.1 body
[[X2]]
h 1.2
-----
1.2 body
h 2
===
2 body
h 3
===
3 body
[[X2]]
h 3.1
-----
3.1 body
[[X2]]
h 3.2
-----
3.2 body
[[X3]]
[ATTR]
h 3.2.1
~~~~~~~
3.2.1 body
h 3.2.1.1
^^^^^^^^^
3.2.1.1 body
xxxx findme findme
[[X3]]
[ATTR]
h 3.2.2
~~~~~~~
3.2.2 body
h 3.2.2.1
^^^^^^^^^
3.2.2.1 body
h 3.2.2.1.1
+++++++++++
3.2.2.1.1 body
====== h 3.2.2.1.2.1 ======
3.2.2.1.2.1 body
======= h 3.2.2.1.2.1.1 =======
3.2.2.1.2.1.1 body
[[X2]]
h 3.3
-----
3.3 body
h 4
===
4 body
[[X2]]
h 4.1
-----
4.1 body findme
h 5
===
5 body
[[X2]]
h 5.1
-----
5.1 body
[[X2]]
h 5.2
-----
5.2 body
[[X3]]
[ATTR]
h 5.2.1
~~~~~~~
5.2.1 body
[[X3]]
[ATTR]
h 5.2.2
~~~~~~~
5.2.2 body
h 5.2.2.1
^^^^^^^^^
5.2.2.1 body
h 5.2.2.1.1
+++++++++++
5.2.2.1.1 body
h 5.2.2.1.2
+++++++++++
5.2.2.1.2 body
[[X3]]
[ATTR]
h 5.2.3
~~~~~~~
5.2.3 body
[[X2]]
h AA
----
a a a a
[[X3]]
[ATTR]
h AA.1
~~~~~~
a1 a1 a1 a1
[[X2]]
h BB
----
b b b b
[[X3]]
[ATTR]
h BB.1
~~~~~~
b1 b1 b1 b1 b1
[[X2]]
h 5.3
-----
5.3 body
findme
h tests
=======
[[X2]]
h syntax tests
--------------
Since v2.1 comment chars before foldmarker are stripped according to filetype.
Some Body filetypes have their own Tree syntax hi.
[[X3]]
[ATTR]
h //---TODO comment--- //
~~~~~~~~~~~~~~~~~~~~~~~~~
[[X3]]
[ATTR]
h "---comment--- "
~~~~~~~~~~~~~~~~~~
echo 'vim ok'
[[X3]]
[ATTR]
h #---comment--- #
~~~~~~~~~~~~~~~~~~
print 'py ok'
[[X3]]
[ATTR]
h %---comment--- %
~~~~~~~~~~~~~~~~~~
[[X3]]
[ATTR]
h /*---comment--- /*
~~~~~~~~~~~~~~~~~~~~
[[X3]]
[ATTR]
h <!-- Comment
~~~~~~~~~~~~~~
ft=html,xml
[[X3]]
[ATTR]
h html head <!
~~~~~~~~~~~~~~
[[X3]]
[ATTR]
h /organizer node/
~~~~~~~~~~~~~~~~~~
[[X3]]
[ATTR]
h !warning mark
~~~~~~~~~~~~~~~
[[X2]]
h Voomgrep tests
----------------
:Voomg Spam and ham not bacon
:Voomg Spam and\ ham not\ bacon
:Voomg Spam and\\ ham not\\ bacon
\Spam// ' "
[[X3]]
[ATTR]
h n44 breakfast
~~~~~~~~~~~~~~~
eggs
bacon
[[X3]]
[ATTR]
h n45 lunch
~~~~~~~~~~~
Spam Spam Spam Spam Spam Spam Spam Spam Spam
Spam Spam Spam Spam Spam Spam Spam Spam Spam
Spam Spam Spam Spam Spam Spam Spam Spam Spam
ham
[[X3]]
[ATTR]
h n46 dinner
~~~~~~~~~~~~
eggs
Spam
ham
[[X3]]
[ATTR]
h n47 snack
~~~~~~~~~~~
bacon
spam
HAM
beef
[[X2]]
h sort tests
------------
[[X3]]
[ATTR]
h node 2
~~~~~~~~
h dddd
^^^^^^
d1
h eeee
^^^^^^
h dddd
^^^^^^
d2
h bbbb
^^^^^^
b
h b_yyy
+++++++
h b_xxx
+++++++
h cccc
^^^^^^
c
h aaaa
^^^^^^
a
h a_nnn
+++++++
h a_mmm
+++++++
[[X3]]
[ATTR]
h node 22
~~~~~~~~~
[[X3]]
[ATTR]
h ñ
~~~
[[X3]]
[ATTR]
h Ñ
~~~
unicode tests
h э
^^^
1
h Я
^^^
2
h ю
^^^
3
h Э
^^^
4
h я
^^^
5
h Ю
^^^
6
[[X3]]
[ATTR]
h node 1
~~~~~~~~
h bbbb
^^^^^^
b
h dddd
^^^^^^
d1
h DDDD
^^^^^^
ingorecase test
h aaaa
^^^^^^
a
h dddd
^^^^^^
d2
h cccc
^^^^^^
c
[[X3]]
[ATTR]
h z
~~~
[[X2]]
h special chars tests
---------------------
[[X3]]
[ATTR]
h '" /\\/
~~~~~~~~~
" "" """
' '' """
\ \\ \\\
/ // ///
\//\
[[X3]]
[ATTR]
h Брожу ли я
~~~~~~~~~~~~
Брожу. Чего ж не побродить.
Чебурашка CHeburashka
u'\u0427\u0435\u0431\u0443\u0440\u0430\u0448\u043a\u0430'
utf-8
'\xd0\xa7\xd0\xb5\xd0\xb1\xd1\x83\xd1\x80\xd0\xb0\xd1\x88\xd0\xba\xd0\xb0'

View File

@ -0,0 +1,249 @@
:Voom hashes
This is VOoM markup mode test file. Converted from **test_outline.txt**.
findme findme2
# 1
1 body
NEXT LINE IS FOR TESTS -- DO NOT MOVE OR EDIT
VO.levels=[1, 1, 2, 2, 1, 1, 2, 2, 3, 4, 3, 4, 5, 6, 7, 2, 1, 2, 1, 2, 2, 3, 3, 4, 5, 5, 3, 2, 3, 2, 3, 2, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 3, 4, 4, 4, 4, 5, 5, 4, 4, 5, 5, 3, 3, 3, 4, 4, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 3, 2, 3, 3]
## 1.1
1.1 body
## 1.2
1.2 body
# 2
2 body
# 3
3 body
## 3.1
3.1 body
## 3.2
3.2 body
### 3.2.1
3.2.1 body
#### 3.2.1.1
3.2.1.1 body
xxxx findme findme
### 3.2.2
3.2.2 body
#### 3.2.2.1
3.2.2.1 body
##### 3.2.2.1.1
3.2.2.1.1 body
###### 3.2.2.1.2.1
3.2.2.1.2.1 body
####### 3.2.2.1.2.1.1
3.2.2.1.2.1.1 body
## 3.3
3.3 body
# 4
4 body
## 4.1
4.1 body findme
# 5
5 body
## 5.1
5.1 body
## 5.2
5.2 body
### 5.2.1
5.2.1 body
### 5.2.2
5.2.2 body
#### 5.2.2.1
5.2.2.1 body
##### 5.2.2.1.1
5.2.2.1.1 body
##### 5.2.2.1.2
5.2.2.1.2 body
### 5.2.3
5.2.3 body
## AA
a a a a
### AA.1
a1 a1 a1 a1
## BB
b b b b
### BB.1
b1 b1 b1 b1 b1
## 5.3
5.3 body
findme
# tests
## syntax tests
Since v2.1 comment chars before foldmarker are stripped according to filetype.
Some Body filetypes have their own Tree syntax hi.
### //---TODO comment--- //
### "---comment--- "
echo 'vim ok'
### #---comment--- #
print 'py ok'
### %---comment--- %
### /*---comment--- /*
### <!-- Comment
ft=html,xml
### html head <!
### /organizer node/
### !warning mark
## Voomgrep tests
:Voomg Spam and ham not bacon
:Voomg Spam and\ ham not\ bacon
:Voomg Spam and\\ ham not\\ bacon
\Spam// ' "
### n44 breakfast
eggs
bacon
### n45 lunch
Spam Spam Spam Spam Spam Spam Spam Spam Spam
Spam Spam Spam Spam Spam Spam Spam Spam Spam
Spam Spam Spam Spam Spam Spam Spam Spam Spam
ham
### n46 dinner
eggs
Spam
ham
### n47 snack
bacon
spam
HAM
beef
## sort tests
### node 2
#### dddd
d1
#### eeee
#### dddd
d2
#### bbbb
b
##### b_yyy
##### b_xxx
#### cccc
c
#### aaaa
a
##### a_nnn
##### a_mmm
### node 22
### ñ
### Ñ
unicode tests
#### э
1
#### Я
2
#### ю
3
#### Э
4
#### я
5
#### Ю
6
### node 1
#### bbbb
b
#### dddd
d1
#### DDDD
ingorecase test
#### aaaa
a
#### dddd
d2
#### cccc
c
### z
## special chars tests
### '" /\\/
" "" """
' '' """
\ \\ \\\
/ // ///
\//\
### Брожу ли я
Брожу. Чего ж не побродить.
Чебурашка CHeburashka
u'\u0427\u0435\u0431\u0443\u0440\u0430\u0448\u043a\u0430'
utf-8
'\xd0\xa7\xd0\xb5\xd0\xb1\xd1\x83\xd1\x80\xd0\xb0\xd1\x88\xd0\xba\xd0\xb0'

View File

@ -0,0 +1,249 @@
:Voom html
This is VOoM markup mode test file. Converted from **test_outline.txt**.
findme findme2
<h1>1</h1> <!--{{{1-->
1 body
NEXT LINE IS FOR TESTS -- DO NOT MOVE OR EDIT
VO.levels=[1, 1, 2, 2, 1, 1, 2, 2, 3, 4, 3, 4, 5, 6, 7, 2, 1, 2, 1, 2, 2, 3, 3, 4, 5, 5, 3, 2, 3, 2, 3, 2, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 3, 4, 4, 4, 4, 5, 5, 4, 4, 5, 5, 3, 3, 3, 4, 4, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 3, 2, 3, 3]
<h2>1.1</h2> <!--{{{2-->
1.1 body
<h2>1.2</h2> <!--{{{2-->
1.2 body
<h1>2</h1> <!--{{{1-->
2 body
<h1>3</h1> <!--{{{1o=-->
3 body
<h2>3.1</h2> <!--{{{2x-->
3.1 body
<h2>3.2</h2> <!--{{{2x-->
3.2 body
<h3>3.2.1</h3> <!--{{{3-->
3.2.1 body
<h4>3.2.1.1</h4> <!--{{{4-->
3.2.1.1 body
xxxx findme findme
<h3>3.2.2</h3> <!--{{{3-->
3.2.2 body
<h4>3.2.2.1</h4> <!--{{{4x-->
3.2.2.1 body
<h5>3.2.2.1.1</h5> <!--{{{5x-->
3.2.2.1.1 body
<h6>3.2.2.1.2.1</h6> <!--{{{6-->
3.2.2.1.2.1 body
<h7>3.2.2.1.2.1.1</h7> <!--{{{7x-->
3.2.2.1.2.1.1 body
<h2>3.3</h2> <!--{{{2-->
3.3 body
<h1>4</h1> <!--{{{1-->
4 body
<h2>4.1</h2> <!--{{{2-->
4.1 body findme
<h1>5</h1> <!--{{{1o-->
5 body
<h2>5.1</h2> <!--{{{2-->
5.1 body
<h2>5.2</h2> <!--{{{2o-->
5.2 body
<h3>5.2.1</h3> <!--{{{3-->
5.2.1 body
<h3>5.2.2</h3> <!--{{{3-->
5.2.2 body
<h4>5.2.2.1</h4> <!--{{{4o-->
5.2.2.1 body
<h5>5.2.2.1.1</h5> <!--{{{5-->
5.2.2.1.1 body
<h5>5.2.2.1.2</h5> <!--{{{5-->
5.2.2.1.2 body
<h3>5.2.3</h3> <!--{{{3-->
5.2.3 body
<h2>AA</h2> <!--{{{2-->
a a a a
<h3>AA.1</h3> <!--{{{3-->
a1 a1 a1 a1
<h2>BB</h2> <!--{{{2-->
b b b b
<h3>BB.1</h3> <!--{{{3-->
b1 b1 b1 b1 b1
<h2>5.3</h2> <!--{{{2-->
5.3 body
findme
<h1>tests</h1> <!--{{{1o-->
<h2>syntax tests</h2> <!--{{{2-->
Since v2.1 comment chars before foldmarker are stripped according to filetype.
Some Body filetypes have their own Tree syntax hi.
<h3>//---TODO comment--- //</h3> <!--{{{3-->
<h3>"---comment--- "</h3> <!--{{{3-->
echo 'vim ok'
<h3>#---comment--- #</h3> <!--{{{3-->
print 'py ok'
<h3>%---comment--- %</h3> <!--{{{3-->
<h3>/*---comment--- /*</h3> <!--{{{3*/-->
<h3>&lt;!-- Comment</h3> <!--{{{3 --&gt;-->
ft=html,xml
<h3>html head &lt;!</h3> <!--{{{3--&gt;-->
<h3>/organizer node/</h3> <!--{{{3-->
<h3>!warning mark</h3> <!--{{{3-->
<h2>Voomgrep tests</h2> <!--{{{2-->
:Voomg Spam and ham not bacon
:Voomg Spam and\ ham not\ bacon
:Voomg Spam and\\ ham not\\ bacon
\Spam// ' "
<h3>n44 breakfast</h3> <!--{{{3-->
eggs
bacon
<h3>n45 lunch</h3> <!--{{{3-->
Spam Spam Spam Spam Spam Spam Spam Spam Spam
Spam Spam Spam Spam Spam Spam Spam Spam Spam
Spam Spam Spam Spam Spam Spam Spam Spam Spam
ham
<h3>n46 dinner</h3> <!--{{{3-->
eggs
Spam
ham
<h3>n47 snack</h3> <!--{{{3-->
bacon
spam
HAM
beef
<h2>sort tests</h2> <!--{{{2-->
<h3>node 2</h3> <!--{{{3-->
<h4>dddd</h4> <!--{{{4x-->
d1
<h4>eeee</h4> <!--{{{4-->
<h4>dddd</h4> <!--{{{4-->
d2
<h4>bbbb</h4> <!--{{{4o-->
b
<h5>b_yyy</h5> <!--{{{5-->
<h5>b_xxx</h5> <!--{{{5-->
<h4>cccc</h4> <!--{{{4-->
c
<h4>aaaa</h4> <!--{{{4-->
a
<h5>a_nnn</h5> <!--{{{5-->
<h5>a_mmm</h5> <!--{{{5-->
<h3>node 22</h3> <!--{{{3-->
<h3>ñ</h3> <!--{{{3-->
<h3>Ñ</h3> <!--{{{3-->
unicode tests
<h4>э</h4> <!--{{{4-->
1
<h4>Я</h4> <!--{{{4-->
2
<h4>ю</h4> <!--{{{4-->
3
<h4>Э</h4> <!--{{{4-->
4
<h4>я</h4> <!--{{{4-->
5
<h4>Ю</h4> <!--{{{4-->
6
<h3>node 1</h3> <!--{{{3-->
<h4>bbbb</h4> <!--{{{4-->
b
<h4>dddd</h4> <!--{{{4-->
d1
<h4>DDDD</h4> <!--{{{4-->
ingorecase test
<h4>aaaa</h4> <!--{{{4-->
a
<h4>dddd</h4> <!--{{{4-->
d2
<h4>cccc</h4> <!--{{{4-->
c
<h3>z</h3> <!--{{{3-->
<h2>special chars tests</h2> <!--{{{2-->
<h3>'" /\\/</h3> <!--{{{3 '" /\\/-->
" "" """
' '' """
\ \\ \\\
/ // ///
\//\
<h3>Брожу ли я</h3> <!--{{{3 вдоль улиц шумных? (utf-8)-->
Брожу. Чего ж не побродить.
Чебурашка CHeburashka
u'\u0427\u0435\u0431\u0443\u0440\u0430\u0448\u043a\u0430'
utf-8
'\xd0\xa7\xd0\xb5\xd0\xb1\xd1\x83\xd1\x80\xd0\xb0\xd1\x88\xd0\xba\xd0\xb0'

View File

@ -0,0 +1,270 @@
:Voom markdown
This is VOoM markup mode test file. Converted from **test_outline.txt**.
findme findme2
h1
==
1 body
NEXT LINE IS FOR TESTS -- DO NOT MOVE OR EDIT
VO.levels=[1, 1, 2, 2, 1, 1, 2, 2, 3, 4, 3, 4, 5, 6, 7, 2, 1, 2, 1, 2, 2, 3, 3, 4, 5, 5, 3, 2, 3, 2, 3, 2, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 3, 4, 4, 4, 4, 5, 5, 4, 4, 5, 5, 3, 3, 3, 4, 4, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 3, 2, 3, 3]
h1.1
----
1.1 body
h1.2
----
1.2 body
h2
==
2 body
h3
==
3 body
h3.1
----
3.1 body
h3.2
----
3.2 body
### h3.2.1 ###
3.2.1 body
#### h3.2.1.1 ####
3.2.1.1 body
xxxx findme findme
### h3.2.2 ###
3.2.2 body
#### h3.2.2.1 ####
3.2.2.1 body
##### h3.2.2.1.1 #####
3.2.2.1.1 body
###### h3.2.2.1.2.1 ######
3.2.2.1.2.1 body
####### h3.2.2.1.2.1.1 #######
3.2.2.1.2.1.1 body
h3.3
----
3.3 body
h4
==
4 body
h4.1
----
4.1 body findme
h5
==
5 body
h5.1
----
5.1 body
h5.2
----
5.2 body
### h5.2.1 ###
5.2.1 body
### h5.2.2 ###
5.2.2 body
#### h5.2.2.1 ####
5.2.2.1 body
##### h5.2.2.1.1 #####
5.2.2.1.1 body
##### h5.2.2.1.2 #####
5.2.2.1.2 body
### h5.2.3 ###
5.2.3 body
hAA
---
a a a a
### hAA.1 ###
a1 a1 a1 a1
hBB
---
b b b b
### hBB.1 ###
b1 b1 b1 b1 b1
h5.3
----
5.3 body
findme
htests
======
hsyntax tests
-------------
Since v2.1 comment chars before foldmarker are stripped according to filetype.
Some Body filetypes have their own Tree syntax hi.
### h//---TODO comment--- // ###
### h"---comment--- " ###
echo 'vim ok'
### h#---comment--- # ###
print 'py ok'
### h%---comment--- % ###
### h/*---comment--- /* ###
### h&lt;!-- Comment ###
ft=html,xml
### hhtml head &lt;! ###
### h/organizer node/ ###
### h!warning mark ###
hVoomgrep tests
---------------
:Voomg Spam and ham not bacon
:Voomg Spam and\ ham not\ bacon
:Voomg Spam and\\ ham not\\ bacon
\Spam// ' "
### hn44 breakfast ###
eggs
bacon
### hn45 lunch ###
Spam Spam Spam Spam Spam Spam Spam Spam Spam
Spam Spam Spam Spam Spam Spam Spam Spam Spam
Spam Spam Spam Spam Spam Spam Spam Spam Spam
ham
### hn46 dinner ###
eggs
Spam
ham
### hn47 snack ###
bacon
spam
HAM
beef
hsort tests
-----------
### hnode 2 ###
#### hdddd ####
d1
#### heeee ####
#### hdddd ####
d2
#### hbbbb ####
b
##### hb_yyy #####
##### hb_xxx #####
#### hcccc ####
c
#### haaaa ####
a
##### ha_nnn #####
##### ha_mmm #####
### hnode 22 ###
### hñ ###
### hÑ ###
unicode tests
#### hэ ####
1
#### hЯ ####
2
#### hю ####
3
#### hЭ ####
4
#### hя ####
5
#### hЮ ####
6
### hnode 1 ###
#### hbbbb ####
b
#### hdddd ####
d1
#### hDDDD ####
ingorecase test
#### haaaa ####
a
#### hdddd ####
d2
#### hcccc ####
c
### hz ###
hspecial chars tests
--------------------
### h'" /\\/ ###
" "" """
' '' """
\ \\ \\\
/ // ///
\//\
### hБрожу ли я ###
Брожу. Чего ж не побродить.
Чебурашка CHeburashka
u'\u0427\u0435\u0431\u0443\u0440\u0430\u0448\u043a\u0430'
utf-8
'\xd0\xa7\xd0\xb5\xd0\xb1\xd1\x83\xd1\x80\xd0\xb0\xd1\x88\xd0\xba\xd0\xb0'

View File

@ -0,0 +1,249 @@
:Voom org
This is VOoM markup mode test file. Converted from **test_outline.txt**.
findme findme2
* 1
1 body
NEXT LINE IS FOR TESTS -- DO NOT MOVE OR EDIT
VO.levels=[1, 1, 2, 2, 1, 1, 2, 2, 3, 4, 3, 4, 5, 6, 7, 2, 1, 2, 1, 2, 2, 3, 3, 4, 5, 5, 3, 2, 3, 2, 3, 2, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 3, 4, 4, 4, 4, 5, 5, 4, 4, 5, 5, 3, 3, 3, 4, 4, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 3, 2, 3, 3]
** 1.1
1.1 body
** 1.2
1.2 body
* 2
2 body
* 3
3 body
** 3.1
3.1 body
** 3.2
3.2 body
*** 3.2.1
3.2.1 body
**** 3.2.1.1
3.2.1.1 body
xxxx findme findme
*** 3.2.2
3.2.2 body
**** 3.2.2.1
3.2.2.1 body
***** 3.2.2.1.1
3.2.2.1.1 body
****** 3.2.2.1.2.1
3.2.2.1.2.1 body
******* 3.2.2.1.2.1.1
3.2.2.1.2.1.1 body
** 3.3
3.3 body
* 4
4 body
** 4.1
4.1 body findme
* 5
5 body
** 5.1
5.1 body
** 5.2
5.2 body
*** 5.2.1
5.2.1 body
*** 5.2.2
5.2.2 body
**** 5.2.2.1
5.2.2.1 body
***** 5.2.2.1.1
5.2.2.1.1 body
***** 5.2.2.1.2
5.2.2.1.2 body
*** 5.2.3
5.2.3 body
** AA
a a a a
*** AA.1
a1 a1 a1 a1
** BB
b b b b
*** BB.1
b1 b1 b1 b1 b1
** 5.3
5.3 body
findme
* tests
** syntax tests
Since v2.1 comment chars before foldmarker are stripped according to filetype.
Some Body filetypes have their own Tree syntax hi.
*** //---TODO comment--- //
*** "---comment--- "
echo 'vim ok'
*** #---comment--- #
print 'py ok'
*** %---comment--- %
*** /*---comment--- /*
*** <!-- Comment
ft=html,xml
*** html head <!
*** /organizer node/
*** !warning mark
** Voomgrep tests
:Voomg Spam and ham not bacon
:Voomg Spam and\ ham not\ bacon
:Voomg Spam and\\ ham not\\ bacon
\Spam// ' "
*** n44 breakfast
eggs
bacon
*** n45 lunch
Spam Spam Spam Spam Spam Spam Spam Spam Spam
Spam Spam Spam Spam Spam Spam Spam Spam Spam
Spam Spam Spam Spam Spam Spam Spam Spam Spam
ham
*** n46 dinner
eggs
Spam
ham
*** n47 snack
bacon
spam
HAM
beef
** sort tests
*** node 2
**** dddd
d1
**** eeee
**** dddd
d2
**** bbbb
b
***** b_yyy
***** b_xxx
**** cccc
c
**** aaaa
a
***** a_nnn
***** a_mmm
*** node 22
*** ñ
*** Ñ
unicode tests
**** э
1
**** Я
2
**** ю
3
**** Э
4
**** я
5
**** Ю
6
*** node 1
**** bbbb
b
**** dddd
d1
**** DDDD
ingorecase test
**** aaaa
a
**** dddd
d2
**** cccc
c
*** z
** special chars tests
*** '" /\\/
" "" """
' '' """
\ \\ \\\
/ // ///
\//\
*** Брожу ли я
Брожу. Чего ж не побродить.
Чебурашка CHeburashka
u'\u0427\u0435\u0431\u0443\u0440\u0430\u0448\u043a\u0430'
utf-8
'\xd0\xa7\xd0\xb5\xd0\xb1\xd1\x83\xd1\x80\xd0\xb0\xd1\x88\xd0\xba\xd0\xb0'

View File

@ -0,0 +1,249 @@
| :Voom thevimoutliner
| This is VOoM markup mode test file. Converted from **test_outline.txt**.
| findme findme2
1
| 1 body
| NEXT LINE IS FOR TESTS -- DO NOT MOVE OR EDIT
| VO.levels=[1, 1, 2, 2, 1, 1, 2, 2, 3, 4, 3, 4, 5, 6, 7, 2, 1, 2, 1, 2, 2, 3, 3, 4, 5, 5, 3, 2, 3, 2, 3, 2, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 3, 4, 4, 4, 4, 5, 5, 4, 4, 5, 5, 3, 3, 3, 4, 4, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 3, 2, 3, 3]
1.1
| 1.1 body
1.2
| 1.2 body
2
| 2 body
3
| 3 body
3.1
| 3.1 body
3.2
| 3.2 body
3.2.1
| 3.2.1 body
3.2.1.1
| 3.2.1.1 body
| xxxx findme findme
3.2.2
| 3.2.2 body
3.2.2.1
| 3.2.2.1 body
3.2.2.1.1
| 3.2.2.1.1 body
3.2.2.1.2.1
| 3.2.2.1.2.1 body
3.2.2.1.2.1.1
| 3.2.2.1.2.1.1 body
3.3
| 3.3 body
4
| 4 body
4.1
| 4.1 body findme
5
| 5 body
5.1
| 5.1 body
5.2
| 5.2 body
5.2.1
| 5.2.1 body
5.2.2
| 5.2.2 body
5.2.2.1
| 5.2.2.1 body
5.2.2.1.1
| 5.2.2.1.1 body
5.2.2.1.2
| 5.2.2.1.2 body
5.2.3
| 5.2.3 body
AA
| a a a a
AA.1
| a1 a1 a1 a1
BB
| b b b b
BB.1
| b1 b1 b1 b1 b1
5.3
| 5.3 body
| findme
tests
syntax tests
| Since v2.1 comment chars before foldmarker are stripped according to filetype.
| Some Body filetypes have their own Tree syntax hi.
//---TODO comment--- //
"---comment--- "
| echo 'vim ok'
#---comment--- #
| print 'py ok'
%---comment--- %
/*---comment--- /*
\<!-- Comment
| ft=html,xml
html head \<!
/organizer node/
!warning mark
Voomgrep tests
| :Voomg Spam and ham not bacon
| :Voomg Spam and\ ham not\ bacon
| :Voomg Spam and\\ ham not\\ bacon
| \Spam// ' "
n44 breakfast
| eggs
| bacon
n45 lunch
| Spam Spam Spam Spam Spam Spam Spam Spam Spam
| Spam Spam Spam Spam Spam Spam Spam Spam Spam
| Spam Spam Spam Spam Spam Spam Spam Spam Spam
| ham
n46 dinner
| eggs
| Spam
| ham
n47 snack
| bacon
| spam
| HAM
| beef
sort tests
node 2
dddd
| d1
eeee
dddd
| d2
bbbb
| b
b_yyy
b_xxx
cccc
| c
aaaa
| a
a_nnn
a_mmm
node 22
ñ
Ñ
| unicode tests
э
| 1
Я
| 2
ю
| 3
Э
| 4
я
| 5
Ю
| 6
node 1
bbbb
| b
dddd
| d1
DDDD
| ingorecase test
aaaa
| a
dddd
| d2
cccc
| c
z
special chars tests
'" /\\/
| " "" """
| ' '' """
| \ \\ \\\
| / // ///
| \//\
Брожу ли я
| Брожу. Чего ж не побродить.
| Чебурашка CHeburashka
| u'\u0427\u0435\u0431\u0443\u0440\u0430\u0448\u043a\u0430'
| utf-8
| '\xd0\xa7\xd0\xb5\xd0\xb1\xd1\x83\xd1\x80\xd0\xb0\xd1\x88\xd0\xba\xd0\xb0'

View File

@ -0,0 +1,97 @@
# :Voom python
# VOoM test file for Python outlining mode
# no gotchas--oultine operations do not kill or create headlines
# vim: et ts=4 sw=4 sts=4 fdm=manual
"""
docstring
def func_in_docstring():
pass
# not COMMENT
after func_in_docstring
"""
a = [1, # COMMENT, headline
# COMMENT, not headline
2]
# line continuation
s = "oosp\
class Fake\
pass \
"
s2 = """
xx
yy
closing " " " must not be mistaken for start of docstring
"""
### if 1
# NEXT LINE IS FOR TEST SUITE -- DO NOT MOVE OR EDIT
# VO.levels=[1, 1, 2, 3, 3, 1, 1, 1, 2, 3, 3, 3, 2, 2, 1, 1, 1, 2, 3, 3, 1, 1, 1, 1, 1]
if 1:
### if 1
if 1:
def func1(a,
b,
c):
"""
docstring
"""
pass
#--- headline 1
def func_with_string(a, b, c=False, d="NoName",
e=None, f=0, g='Oopsy'):
"""
text text text text
"""
#---- headline before Class1
class Class1:
b = []
def func2():
### headline 2
a = 'a'
def func3():
pass
#----- headline 3
#----headline 4
def func4(): pass
#----- headline 5
# not headline
def func4(f):
'''
badly indented docstring
'''
pass
class Class2:
u" perversely formatted docstring \
perversely formatted docstring"
b = []
def func5():
pass
def func6():
pass
#--- headline 6
#---- headline 7
# not a headline
def func7(func):
a = \
"perverted continuation"
pass
@func7
def func8(): # <-- headline
a = 1
b = [1,
2, # <-- false headline
3]
c = 4
### if __name__=='__main__':
if __name__=='__main__':
print Class2.__doc__

View File

@ -0,0 +1,408 @@
:Voom rest
This is VOoM markup mode test file. Converted from **test_outline.txt**.
NOTE: no gotchas, suitable for test suite
findme findme2
=
1
=
1 body
NEXT LINE IS FOR TESTS -- DO NOT MOVE OR EDIT
VO.levels=[1, 1, 2, 2, 1, 1, 2, 2, 3, 4, 3, 4, 5, 6, 7, 2, 1, 2, 1, 2, 2, 3, 3, 4, 5, 5, 3, 2, 3, 2, 3, 2, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 3, 4, 4, 4, 4, 5, 5, 4, 4, 5, 5, 3, 3, 3, 4, 4, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 3, 2, 3, 3]
---
1.1
---
1.1 body
---
1.2
---
1.2 body
=
2
=
2 body
=
3
=
3 body
---
3.1
---
3.1 body
---
3.2
---
3.2 body
3.2.1
=====
3.2.1 body
3.2.1.1
-------
3.2.1.1 body
xxxx findme findme
3.2.2
=====
3.2.2 body
3.2.2.1
-------
3.2.2.1 body
3.2.2.1.1
*********
3.2.2.1.1 body
3.2.2.1.2.1
"""""""""""
3.2.2.1.2.1 body
3.2.2.1.2.1.1
'''''''''''''
3.2.2.1.2.1.1 body
---
3.3
---
3.3 body
=
4
=
4 body
---
4.1
---
4.1 body findme
=
5
=
5 body
---
5.1
---
5.1 body
---
5.2
---
5.2 body
5.2.1
=====
5.2.1 body
5.2.2
=====
5.2.2 body
5.2.2.1
-------
5.2.2.1 body
5.2.2.1.1
*********
5.2.2.1.1 body
5.2.2.1.2
*********
5.2.2.1.2 body
5.2.3
=====
5.2.3 body
--
AA
--
a a a a
AA.1
====
a1 a1 a1 a1
--
BB
--
b b b b
BB.1
====
b1 b1 b1 b1 b1
---
5.3
---
5.3 body
findme
=====
tests
=====
------------
syntax tests
------------
Since v2.1 comment chars before foldmarker are stripped according to filetype.
Some Body filetypes have their own Tree syntax hi.
//---TODO comment--- //
=======================
"---comment--- "
================
echo 'vim ok'
#---comment--- #
================
print 'py ok'
%---comment--- %
================
/*---comment--- /*
==================
<!-- Comment
============
ft=html,xml
html head <!
============
/organizer node/
================
!warning mark
=============
--------------
Voomgrep tests
--------------
:Voomg Spam and ham not bacon
:Voomg Spam and\ ham not\ bacon
:Voomg Spam and\\ ham not\\ bacon
\Spam// ' "
n44 breakfast
=============
eggs
bacon
n45 lunch
=========
Spam Spam Spam Spam Spam Spam Spam Spam Spam
Spam Spam Spam Spam Spam Spam Spam Spam Spam
Spam Spam Spam Spam Spam Spam Spam Spam Spam
ham
n46 dinner
==========
eggs
Spam
ham
n47 snack
=========
bacon
spam
HAM
beef
----------
sort tests
----------
node 2
======
dddd
----
d1
eeee
----
dddd
----
d2
bbbb
----
b
b_yyy
*****
b_xxx
*****
cccc
----
c
aaaa
----
a
a_nnn
*****
a_mmm
*****
node 22
=======
ñ
=
Ñ
=
unicode tests
э
-
1
Я
-
2
ю
-
3
Э
-
4
я
-
5
Ю
-
6
node 1
======
bbbb
----
b
dddd
----
d1
DDDD
----
ingorecase test
aaaa
----
a
dddd
----
d2
cccc
----
c
z
=
-------------------
special chars tests
-------------------
'" /\\/
=======
" "" """
' '' """
\ \\ \\\
/ // ///
\//\
Брожу ли я
==========
Брожу. Чего ж не побродить.
Чебурашка CHeburashka
u'\u0427\u0435\u0431\u0443\u0440\u0430\u0448\u043a\u0430'
utf-8
'\xd0\xa7\xd0\xb5\xd0\xb1\xd1\x83\xd1\x80\xd0\xb0\xd1\x88\xd0\xba\xd0\xb0'

View File

@ -0,0 +1,249 @@
:Voom txt2tags
This is VOoM markup mode test file. Converted from **test_outline.txt**.
findme findme2
= 1 =[ref]
1 body
NEXT LINE IS FOR TESTS -- DO NOT MOVE OR EDIT
VO.levels=[1, 1, 2, 2, 1, 1, 2, 2, 3, 4, 3, 4, 5, 6, 7, 2, 1, 2, 1, 2, 2, 3, 3, 4, 5, 5, 3, 2, 3, 2, 3, 2, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 3, 4, 4, 4, 4, 5, 5, 4, 4, 5, 5, 3, 3, 3, 4, 4, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 3, 2, 3, 3]
== 1.1 ==[ref]
1.1 body
== 1.2 ==[ref]
1.2 body
= 2 =[ref]
2 body
= 3 =[ref]
3 body
== 3.1 ==[ref]
3.1 body
== 3.2 ==[ref]
3.2 body
+++ 3.2.1 +++[ref]
3.2.1 body
++++ 3.2.1.1 ++++[ref]
3.2.1.1 body
xxxx findme findme
+++ 3.2.2 +++[ref]
3.2.2 body
++++ 3.2.2.1 ++++[ref]
3.2.2.1 body
+++++ 3.2.2.1.1 +++++[ref]
3.2.2.1.1 body
++++++ 3.2.2.1.2.1 ++++++[ref]
3.2.2.1.2.1 body
+++++++ 3.2.2.1.2.1.1 +++++++[ref]
3.2.2.1.2.1.1 body
== 3.3 ==[ref]
3.3 body
= 4 =[ref]
4 body
== 4.1 ==[ref]
4.1 body findme
= 5 =[ref]
5 body
== 5.1 ==[ref]
5.1 body
== 5.2 ==[ref]
5.2 body
+++ 5.2.1 +++[ref]
5.2.1 body
+++ 5.2.2 +++[ref]
5.2.2 body
++++ 5.2.2.1 ++++[ref]
5.2.2.1 body
+++++ 5.2.2.1.1 +++++[ref]
5.2.2.1.1 body
+++++ 5.2.2.1.2 +++++[ref]
5.2.2.1.2 body
+++ 5.2.3 +++[ref]
5.2.3 body
== AA ==[ref]
a a a a
+++ AA.1 +++[ref]
a1 a1 a1 a1
== BB ==[ref]
b b b b
+++ BB.1 +++[ref]
b1 b1 b1 b1 b1
== 5.3 ==[ref]
5.3 body
findme
= tests =[ref]
== syntax tests ==[ref]
Since v2.1 comment chars before foldmarker are stripped according to filetype.
Some Body filetypes have their own Tree syntax hi.
+++ //---TODO comment--- // +++[ref]
+++ "---comment--- " +++[ref]
echo 'vim ok'
+++ #---comment--- # +++[ref]
print 'py ok'
+++ %---comment--- % +++[ref]
+++ /*---comment--- /* +++[ref]
+++ <!-- Comment +++[ref]
ft=html,xml
+++ html head <! +++[ref]
+++ /organizer node/ +++[ref]
+++ !warning mark +++[ref]
== Voomgrep tests ==[ref]
:Voomg Spam and ham not bacon
:Voomg Spam and\ ham not\ bacon
:Voomg Spam and\\ ham not\\ bacon
\Spam// ' "
+++ n44 breakfast +++[ref]
eggs
bacon
+++ n45 lunch +++[ref]
Spam Spam Spam Spam Spam Spam Spam Spam Spam
Spam Spam Spam Spam Spam Spam Spam Spam Spam
Spam Spam Spam Spam Spam Spam Spam Spam Spam
ham
+++ n46 dinner +++[ref]
eggs
Spam
ham
+++ n47 snack +++[ref]
bacon
spam
HAM
beef
== sort tests ==[ref]
+++ node 2 +++[ref]
++++ dddd ++++[ref]
d1
++++ eeee ++++[ref]
++++ dddd ++++[ref]
d2
++++ bbbb ++++[ref]
b
+++++ b_yyy +++++[ref]
+++++ b_xxx +++++[ref]
++++ cccc ++++[ref]
c
++++ aaaa ++++[ref]
a
+++++ a_nnn +++++[ref]
+++++ a_mmm +++++[ref]
+++ node 22 +++[ref]
+++ ñ +++[ref]
+++ Ñ +++[ref]
unicode tests
++++ э ++++[ref]
1
++++ Я ++++[ref]
2
++++ ю ++++[ref]
3
++++ Э ++++[ref]
4
++++ я ++++[ref]
5
++++ Ю ++++[ref]
6
+++ node 1 +++[ref]
++++ bbbb ++++[ref]
b
++++ dddd ++++[ref]
d1
++++ DDDD ++++[ref]
ingorecase test
++++ aaaa ++++[ref]
a
++++ dddd ++++[ref]
d2
++++ cccc ++++[ref]
c
+++ z +++[ref]
== special chars tests ==[ref]
+++ '" /\\/ +++[ref]
" "" """
' '' """
\ \\ \\\
/ // ///
\//\
+++ Брожу ли я +++[ref]
Брожу. Чего ж не побродить.
Чебурашка CHeburashka
u'\u0427\u0435\u0431\u0443\u0440\u0430\u0448\u043a\u0430'
utf-8
'\xd0\xa7\xd0\xb5\xd0\xb1\xd1\x83\xd1\x80\xd0\xb0\xd1\x88\xd0\xba\xd0\xb0'

View File

@ -0,0 +1,249 @@
vim:fdm=marker:
vim:foldtext=getline(v\:foldstart).'...'.(v\:foldend-v\:foldstart):
findme findme2
---1--- {{{1
1 body
NEXT LINE IS FOR TESTS -- DO NOT MOVE OR EDIT
VO.levels=[1, 1, 2, 2, 1, 1, 2, 2, 3, 4, 3, 4, 5, 6, 7, 2, 1, 2, 1, 2, 2, 3, 3, 4, 5, 5, 3, 2, 3, 2, 3, 2, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 3, 4, 4, 4, 4, 5, 5, 4, 4, 5, 5, 3, 3, 3, 4, 4, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 3, 2, 3, 3]
---1.1--- {{{2
1.1 body
---1.2--- {{{2
1.2 body
---2--- {{{1
2 body
---3--- {{{1o=
3 body
---3.1--- {{{2x
3.1 body
---3.2--- {{{2x
3.2 body
---3.2.1--- {{{3
3.2.1 body
---3.2.1.1--- {{{4
3.2.1.1 body
xxxx findme findme
---3.2.2--- {{{3
3.2.2 body
---3.2.2.1--- {{{4x
3.2.2.1 body
---3.2.2.1.1--- {{{5x
3.2.2.1.1 body
---3.2.2.1.2.1--- {{{6
3.2.2.1.2.1 body
---3.2.2.1.2.1.1--- {{{7x
3.2.2.1.2.1.1 body
---3.3--- {{{2
3.3 body
---4--- {{{1
4 body
---4.1--- {{{2
4.1 body findme
---5--- {{{1o
5 body
---5.1--- {{{2
5.1 body
---5.2--- {{{2o
5.2 body
---5.2.1--- {{{3
5.2.1 body
---5.2.2--- {{{3
5.2.2 body
---5.2.2.1--- {{{4o
5.2.2.1 body
---5.2.2.1.1--- {{{5
5.2.2.1.1 body
---5.2.2.1.2--- {{{5
5.2.2.1.2 body
---5.2.3--- {{{3
5.2.3 body
--- AA --- {{{2
a a a a
--- AA.1 --- {{{3
a1 a1 a1 a1
--- BB --- {{{2
b b b b
--- BB.1 --- {{{3
b1 b1 b1 b1 b1
---5.3--- {{{2
5.3 body
findme
---tests--- {{{1o
--- syntax tests --- {{{2
Since v2.1 comment chars before foldmarker are stripped according to filetype.
Some Body filetypes have their own Tree syntax hi.
//---TODO comment--- //{{{3
"---comment--- "{{{3
echo 'vim ok'
#---comment--- #{{{3
print 'py ok'
%---comment--- %{{{3
/*---comment--- /*{{{3*/
<!-- Comment {{{3 -->
ft=html,xml
html head <!--{{{3-->
--- /organizer node/ --- {{{3
--- !warning mark --- {{{3
--- Voomgrep tests--- {{{2
:Voomg Spam and ham not bacon
:Voomg Spam and\ ham not\ bacon
:Voomg Spam and\\ ham not\\ bacon
\Spam// ' "
--- n44 breakfast --- {{{3
eggs
bacon
--- n45 lunch --- {{{3
Spam Spam Spam Spam Spam Spam Spam Spam Spam
Spam Spam Spam Spam Spam Spam Spam Spam Spam
Spam Spam Spam Spam Spam Spam Spam Spam Spam
ham
--- n46 dinner --- {{{3
eggs
Spam
ham
--- n47 snack --- {{{3
bacon
spam
HAM
beef
--- sort tests --- {{{2
--- node 2 --- {{{3
--- dddd --- {{{4x
d1
--- eeee --- {{{4
--- dddd --- {{{4
d2
--- bbbb --- {{{4o
b
--- b_yyy --- {{{5
--- b_xxx --- {{{5
--- cccc --- {{{4
c
--- aaaa --- {{{4
a
--- a_nnn --- {{{5
--- a_mmm --- {{{5
--- node 22 --- {{{3
--- ñ --- {{{3
--- Ñ --- {{{3
unicode tests
--- э --- {{{4
1
--- Я --- {{{4
2
--- ю --- {{{4
3
--- Э --- {{{4
4
--- я --- {{{4
5
--- Ю --- {{{4
6
--- node 1 --- {{{3
--- bbbb --- {{{4
b
--- dddd --- {{{4
d1
--- DDDD --- {{{4
ingorecase test
--- aaaa --- {{{4
a
--- dddd --- {{{4
d2
--- cccc --- {{{4
c
--- z --- {{{3
--- special chars tests --- {{{2
--- '" /\\/ --- {{{3 '" /\\/
" "" """
' '' """
\ \\ \\\
/ // ///
\//\
--- Брожу ли я {{{3 вдоль улиц шумных? (utf-8)
Брожу. Чего ж не побродить.
Чебурашка CHeburashka
u'\u0427\u0435\u0431\u0443\u0440\u0430\u0448\u043a\u0430'
utf-8
'\xd0\xa7\xd0\xb5\xd0\xb1\xd1\x83\xd1\x80\xd0\xb0\xd1\x88\xd0\xba\xd0\xb0'

View File

@ -0,0 +1,249 @@
:Voom vimwiki
This is VOoM markup mode test file. Converted from **test_outline.txt**.
findme findme2
= 1 =
1 body
NEXT LINE IS FOR TESTS -- DO NOT MOVE OR EDIT
VO.levels=[1, 1, 2, 2, 1, 1, 2, 2, 3, 4, 3, 4, 5, 6, 7, 2, 1, 2, 1, 2, 2, 3, 3, 4, 5, 5, 3, 2, 3, 2, 3, 2, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 3, 4, 4, 4, 4, 5, 5, 4, 4, 5, 5, 3, 3, 3, 4, 4, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 3, 2, 3, 3]
== 1.1 ==
1.1 body
== 1.2 ==
1.2 body
= 2 =
2 body
= 3 =
3 body
== 3.1 ==
3.1 body
== 3.2 ==
3.2 body
=== 3.2.1 ===
3.2.1 body
==== 3.2.1.1 ====
3.2.1.1 body
xxxx findme findme
=== 3.2.2 ===
3.2.2 body
==== 3.2.2.1 ====
3.2.2.1 body
===== 3.2.2.1.1 =====
3.2.2.1.1 body
====== 3.2.2.1.2.1 ======
3.2.2.1.2.1 body
======= 3.2.2.1.2.1.1 =======
3.2.2.1.2.1.1 body
== 3.3 ==
3.3 body
= 4 =
4 body
== 4.1 ==
4.1 body findme
= 5 =
5 body
== 5.1 ==
5.1 body
== 5.2 ==
5.2 body
=== 5.2.1 ===
5.2.1 body
=== 5.2.2 ===
5.2.2 body
==== 5.2.2.1 ====
5.2.2.1 body
===== 5.2.2.1.1 =====
5.2.2.1.1 body
===== 5.2.2.1.2 =====
5.2.2.1.2 body
=== 5.2.3 ===
5.2.3 body
== AA ==
a a a a
=== AA.1 ===
a1 a1 a1 a1
== BB ==
b b b b
=== BB.1 ===
b1 b1 b1 b1 b1
== 5.3 ==
5.3 body
findme
= tests =
== syntax tests ==
Since v2.1 comment chars before foldmarker are stripped according to filetype.
Some Body filetypes have their own Tree syntax hi.
=== //---TODO comment--- // ===
=== "---comment--- " ===
echo 'vim ok'
=== #---comment--- # ===
print 'py ok'
=== %---comment--- % ===
=== /*---comment--- /* ===
=== <!-- Comment ===
ft=html,xml
=== html head <! ===
=== /organizer node/ ===
=== !warning mark ===
== Voomgrep tests ==
:Voomg Spam and ham not bacon
:Voomg Spam and\ ham not\ bacon
:Voomg Spam and\\ ham not\\ bacon
\Spam// ' "
=== n44 breakfast ===
eggs
bacon
=== n45 lunch ===
Spam Spam Spam Spam Spam Spam Spam Spam Spam
Spam Spam Spam Spam Spam Spam Spam Spam Spam
Spam Spam Spam Spam Spam Spam Spam Spam Spam
ham
=== n46 dinner ===
eggs
Spam
ham
=== n47 snack ===
bacon
spam
HAM
beef
== sort tests ==
=== node 2 ===
==== dddd ====
d1
==== eeee ====
==== dddd ====
d2
==== bbbb ====
b
===== b_yyy =====
===== b_xxx =====
==== cccc ====
c
==== aaaa ====
a
===== a_nnn =====
===== a_mmm =====
=== node 22 ===
=== ñ ===
=== Ñ ===
unicode tests
==== э ====
1
==== Я ====
2
==== ю ====
3
==== Э ====
4
==== я ====
5
==== Ю ====
6
=== node 1 ===
==== bbbb ====
b
==== dddd ====
d1
==== DDDD ====
ingorecase test
==== aaaa ====
a
==== dddd ====
d2
==== cccc ====
c
=== z ===
== special chars tests ==
=== '" /\\/ ===
" "" """
' '' """
\ \\ \\\
/ // ///
\//\
=== Брожу ли я ===
Брожу. Чего ж не побродить.
Чебурашка CHeburashka
u'\u0427\u0435\u0431\u0443\u0440\u0430\u0448\u043a\u0430'
utf-8
'\xd0\xa7\xd0\xb5\xd0\xb1\xd1\x83\xd1\x80\xd0\xb0\xd1\x88\xd0\xba\xd0\xb0'

View File

@ -0,0 +1,250 @@
:Voom wiki
This is VOoM markup mode test file. Converted from **test_outline.txt**.
NOTE: MediaWiki format, with fold markers
findme findme2
= 1 = <!--{{{1-->
1 body
NEXT LINE IS FOR TESTS -- DO NOT MOVE OR EDIT
VO.levels=[1, 1, 2, 2, 1, 1, 2, 2, 3, 4, 3, 4, 5, 6, 7, 2, 1, 2, 1, 2, 2, 3, 3, 4, 5, 5, 3, 2, 3, 2, 3, 2, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 3, 4, 4, 4, 4, 5, 5, 4, 4, 5, 5, 3, 3, 3, 4, 4, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 3, 2, 3, 3]
== 1.1 == <!--{{{2-->
1.1 body
== 1.2 == <!--{{{2-->
1.2 body
= 2 = <!--{{{1-->
2 body
= 3 = <!--{{{1o=-->
3 body
== 3.1 == <!--{{{2x-->
3.1 body
== 3.2 == <!--{{{2x-->
3.2 body
=== 3.2.1 === <!--{{{3-->
3.2.1 body
==== 3.2.1.1 ==== <!--{{{4-->
3.2.1.1 body
xxxx findme findme
=== 3.2.2 === <!--{{{3-->
3.2.2 body
==== 3.2.2.1 ==== <!--{{{4x-->
3.2.2.1 body
===== 3.2.2.1.1 ===== <!--{{{5x-->
3.2.2.1.1 body
====== 3.2.2.1.2.1 ====== <!--{{{6-->
3.2.2.1.2.1 body
======= 3.2.2.1.2.1.1 ======= <!--{{{7x-->
3.2.2.1.2.1.1 body
== 3.3 == <!--{{{2-->
3.3 body
= 4 = <!--{{{1-->
4 body
== 4.1 == <!--{{{2-->
4.1 body findme
= 5 = <!--{{{1o-->
5 body
== 5.1 == <!--{{{2-->
5.1 body
== 5.2 == <!--{{{2o-->
5.2 body
=== 5.2.1 === <!--{{{3-->
5.2.1 body
=== 5.2.2 === <!--{{{3-->
5.2.2 body
==== 5.2.2.1 ==== <!--{{{4o-->
5.2.2.1 body
===== 5.2.2.1.1 ===== <!--{{{5-->
5.2.2.1.1 body
===== 5.2.2.1.2 ===== <!--{{{5-->
5.2.2.1.2 body
=== 5.2.3 === <!--{{{3-->
5.2.3 body
== AA == <!--{{{2-->
a a a a
=== AA.1 === <!--{{{3-->
a1 a1 a1 a1
== BB == <!--{{{2-->
b b b b
=== BB.1 === <!--{{{3-->
b1 b1 b1 b1 b1
== 5.3 == <!--{{{2-->
5.3 body
findme
= tests = <!--{{{1o-->
== syntax tests == <!--{{{2-->
Since v2.1 comment chars before foldmarker are stripped according to filetype.
Some Body filetypes have their own Tree syntax hi.
=== //---TODO comment--- // === <!--{{{3-->
=== "---comment--- " === <!--{{{3-->
echo 'vim ok'
=== #---comment--- # === <!--{{{3-->
print 'py ok'
=== %---comment--- % === <!--{{{3-->
=== /*---comment--- /* === <!--{{{3*/-->
=== &lt;!-- Comment === <!--{{{3 --&gt;-->
ft=html,xml
=== html head &lt;! === <!--{{{3--&gt;-->
=== /organizer node/ === <!--{{{3-->
=== !warning mark === <!--{{{3-->
== Voomgrep tests == <!--{{{2-->
:Voomg Spam and ham not bacon
:Voomg Spam and\ ham not\ bacon
:Voomg Spam and\\ ham not\\ bacon
\Spam// ' "
=== n44 breakfast === <!--{{{3-->
eggs
bacon
=== n45 lunch === <!--{{{3-->
Spam Spam Spam Spam Spam Spam Spam Spam Spam
Spam Spam Spam Spam Spam Spam Spam Spam Spam
Spam Spam Spam Spam Spam Spam Spam Spam Spam
ham
=== n46 dinner === <!--{{{3-->
eggs
Spam
ham
=== n47 snack === <!--{{{3-->
bacon
spam
HAM
beef
== sort tests == <!--{{{2-->
=== node 2 === <!--{{{3-->
==== dddd ==== <!--{{{4x-->
d1
==== eeee ==== <!--{{{4-->
==== dddd ==== <!--{{{4-->
d2
==== bbbb ==== <!--{{{4o-->
b
===== b_yyy ===== <!--{{{5-->
===== b_xxx ===== <!--{{{5-->
==== cccc ==== <!--{{{4-->
c
==== aaaa ==== <!--{{{4-->
a
===== a_nnn ===== <!--{{{5-->
===== a_mmm ===== <!--{{{5-->
=== node 22 === <!--{{{3-->
=== ñ === <!--{{{3-->
=== Ñ === <!--{{{3-->
unicode tests
==== э ==== <!--{{{4-->
1
==== Я ==== <!--{{{4-->
2
==== ю ==== <!--{{{4-->
3
==== Э ==== <!--{{{4-->
4
==== я ==== <!--{{{4-->
5
==== Ю ==== <!--{{{4-->
6
=== node 1 === <!--{{{3-->
==== bbbb ==== <!--{{{4-->
b
==== dddd ==== <!--{{{4-->
d1
==== DDDD ==== <!--{{{4-->
ingorecase test
==== aaaa ==== <!--{{{4-->
a
==== dddd ==== <!--{{{4-->
d2
==== cccc ==== <!--{{{4-->
c
=== z === <!--{{{3-->
== special chars tests == <!--{{{2-->
=== '" /\\/ === <!--{{{3 '" /\\/-->
" "" """
' '' """
\ \\ \\\
/ // ///
\//\
=== Брожу ли я === <!--{{{3 вдоль улиц шумных? (utf-8)-->
Брожу. Чего ж не побродить.
Чебурашка CHeburashka
u'\u0427\u0435\u0431\u0443\u0440\u0430\u0448\u043a\u0430'
utf-8
'\xd0\xa7\xd0\xb5\xd0\xb1\xd1\x83\xd1\x80\xd0\xb0\xd1\x88\xd0\xba\xd0\xb0'