├── .gitignore ├── README.txt ├── autoload └── voom │ └── voom_vimplugin2657 │ ├── __init__.py │ ├── voom_mode_fmr.py │ ├── voom_mode_org.py │ ├── voom_mode_paragraphNoIndent.py │ ├── voom_mode_fmr1.py │ ├── voom_mode_fmr2.py │ ├── voom_mode_cwiki.py │ ├── voom_mode_vimwiki.py │ ├── voom_mode_fmr3.py │ ├── voom_mode_html.py │ ├── voom_mode_wiki.py │ ├── voom_mode_hashes.py │ ├── voom_mode_paragraphIndent.py │ ├── voom_mode_viki.py │ ├── voom_mode_taskpaper.py │ ├── voom_mode_vimoutliner.py │ ├── voom_mode_thevimoutliner.py │ ├── voom_mode_txt2tags.py │ ├── voom_mode_dokuwiki.py │ ├── voom_mode_paragraphBlank.py │ ├── voom_mode_inverseAtx.py │ ├── voom_mode_python.py │ ├── voom_mode_latex.py │ ├── voom_mode_latexDtx.py │ ├── voom_mode_markdown.py │ ├── voom_mode_pandoc.py │ ├── voom_mode_rest.py │ └── voom_mode_asciidoc.py └── plugin └── voom.vim /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | *.pyc 3 | *.bat 4 | *.vbs 5 | *.lnk 6 | *.sh 7 | 8 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | This is a mirror of http://www.vim.org/scripts/script.php?script_id=2657 2 | -------------------------------------------------------------------------------- /autoload/voom/voom_vimplugin2657/__init__.py: -------------------------------------------------------------------------------- 1 | # Dummy file to make this directory a Python package. 2 | -------------------------------------------------------------------------------- /autoload/voom/voom_vimplugin2657/voom_mode_fmr.py: -------------------------------------------------------------------------------- 1 | # File: voom_mode_fmr.py 2 | # Last Modified: 2017-01-07 3 | # Description: VOoM -- two-pane outliner plugin for Python-enabled Vim 4 | # Website: http://www.vim.org/scripts/script.php?script_id=2657 5 | # Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com) 6 | # License: CC0, see http://creativecommons.org/publicdomain/zero/1.0/ 7 | 8 | """ 9 | VOoM markup mode for start fold markers with levels. 10 | See |voom-mode-fmr|, ../../../doc/voom.txt#*voom-mode-fmr* 11 | This is the default or "fmr" mode. This module changes absolutely nothing. 12 | """ 13 | 14 | # Define this mode as an 'fmr' mode. 15 | MTYPE = 0 16 | 17 | 18 | -------------------------------------------------------------------------------- /plugin/voom.vim: -------------------------------------------------------------------------------- 1 | " File: voom.vim 2 | " Last Modified: 2017-02-20 3 | " Version: 5.3 4 | " Description: VOoM -- two-pane outliner plugin for Python-enabled Vim 5 | " Website: http://www.vim.org/scripts/script.php?script_id=2657 6 | " Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com) 7 | " License: CC0, see http://creativecommons.org/publicdomain/zero/1.0/ 8 | 9 | if exists('g:voom_did_load_plugin') 10 | finish 11 | endif 12 | let g:voom_did_load_plugin = 'v5.3' 13 | 14 | com! -complete=custom,voom#Complete -nargs=? Voom call voom#Init() 15 | com! -complete=custom,voom#Complete -nargs=? VoomToggle call voom#Init(, 1, 1) 16 | com! Voomhelp call voom#Help() 17 | com! Voomlog call voom#LogInit() 18 | com! -nargs=? Voomexec call voom#Exec() 19 | " other commands are defined in ../autoload/voom.vim 20 | 21 | " support for Vim sessions (:mksession) 22 | au BufFilePost __PyLog__ call voom#LogSessionLoad() 23 | au BufFilePost *_VOOM\d\+ call voom#TreeSessionLoad() 24 | 25 | -------------------------------------------------------------------------------- /autoload/voom/voom_vimplugin2657/voom_mode_org.py: -------------------------------------------------------------------------------- 1 | # File: voom_mode_org.py 2 | # Last Modified: 2017-01-07 3 | # Description: VOoM -- two-pane outliner plugin for Python-enabled Vim 4 | # Website: http://www.vim.org/scripts/script.php?script_id=2657 5 | # Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com) 6 | # License: CC0, see http://creativecommons.org/publicdomain/zero/1.0/ 7 | 8 | """ 9 | VOoM markup mode for Emacs Org-mode headline format. 10 | See |voom-mode-org|, ../../../doc/voom.txt#*voom-mode-org* 11 | """ 12 | 13 | import sys 14 | if sys.version_info[0] > 2: 15 | xrange = range 16 | 17 | import re 18 | headline_match = re.compile(r'^(\*+)\s').match 19 | 20 | 21 | def hook_makeOutline(VO, blines): 22 | """Return (tlines, bnodes, levels) for Body lines blines. 23 | blines is either Vim buffer object (Body) or list of buffer lines. 24 | """ 25 | Z = len(blines) 26 | tlines, bnodes, levels = [], [], [] 27 | tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append 28 | for i in xrange(Z): 29 | if not blines[i].startswith('*'): 30 | continue 31 | bline = blines[i] 32 | m = headline_match(bline) 33 | if not m: 34 | continue 35 | lev = len(m.group(1)) 36 | head = bline[lev:].strip() 37 | tline = ' %s|%s' %('. '*(lev-1), head) 38 | tlines_add(tline) 39 | bnodes_add(i+1) 40 | levels_add(lev) 41 | return (tlines, bnodes, levels) 42 | 43 | 44 | def hook_newHeadline(VO, level, blnum, tlnum): 45 | """Return (tree_head, bodyLines). 46 | tree_head is new headline string in Tree buffer (text after |). 47 | bodyLines is list of lines to insert in Body buffer. 48 | """ 49 | tree_head = 'NewHeadline' 50 | bodyLines = ['%s %s' %('*'*level, tree_head), ''] 51 | return (tree_head, bodyLines) 52 | 53 | 54 | def hook_changeLevBodyHead(VO, h, levDelta): 55 | """Increase of decrease level number of Body headline by levDelta.""" 56 | if levDelta==0: return h 57 | m = headline_match(h) 58 | level = len(m.group(1)) 59 | return '%s%s' %('*'*(level+levDelta), h[m.end(1):]) 60 | 61 | 62 | -------------------------------------------------------------------------------- /autoload/voom/voom_vimplugin2657/voom_mode_paragraphNoIndent.py: -------------------------------------------------------------------------------- 1 | # File: voom_mode_paragraphNoIndent.py 2 | # Last Modified: 2017-01-07 3 | # Description: VOoM -- two-pane outliner plugin for Python-enabled Vim 4 | # Website: http://www.vim.org/scripts/script.php?script_id=2657 5 | # Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com) 6 | # License: CC0, see http://creativecommons.org/publicdomain/zero/1.0/ 7 | 8 | """ 9 | VOoM markup mode for paragraphs identified by non-indented lines. 10 | Any line that starts with a character other than space or tab is a headline. 11 | Everything is at level 1. Levels >1 are not possible. 12 | 13 | See |voom-mode-paragraphNoIndent|, ../../../doc/voom.txt#*voom-mode-paragraphNoIndent* 14 | """ 15 | 16 | import sys 17 | if sys.version_info[0] > 2: 18 | xrange = range 19 | 20 | # Disable unsupported outline operations: special node marks, insert new headline as child, move right. 21 | MTYPE = 2 22 | 23 | whitespace = ('\t', ' ') 24 | 25 | def hook_makeOutline(VO, blines): 26 | """Return (tlines, bnodes, levels) for Body lines blines. 27 | blines is either Vim buffer object (Body) or list of buffer lines. 28 | """ 29 | # every line that doesn't start with a space or tab is level 1 headline 30 | Z = len(blines) 31 | tlines, bnodes, levels = [], [], [] 32 | tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append 33 | for i in xrange(Z): 34 | bline = blines[i] 35 | if not bline or bline[0] in whitespace: # THE ONLY DIFFERENCE FROM voom_mode_paragraphIndent.py 36 | continue 37 | bline = bline.strip() 38 | if not bline: 39 | continue 40 | tlines_add(' |%s' %bline) 41 | bnodes_add(i+1) 42 | levels_add(1) 43 | return (tlines, bnodes, levels) 44 | 45 | 46 | def hook_newHeadline(VO, level, blnum, tlnum): 47 | """Return (tree_head, bodyLines). 48 | tree_head is new headline string in Tree buffer (text after |). 49 | bodyLines is list of lines to insert in Body buffer. 50 | """ 51 | return ('NewHeadline', ['NewHeadline']) 52 | 53 | 54 | ### DO NOT DEFINE THIS HOOK -- level never changes, it is always 1 55 | #def hook_changeLevBodyHead(VO, h, levDelta): 56 | # """Increase of decrease level number of Body headline by levDelta.""" 57 | # return h 58 | 59 | 60 | -------------------------------------------------------------------------------- /autoload/voom/voom_vimplugin2657/voom_mode_fmr1.py: -------------------------------------------------------------------------------- 1 | # File: voom_mode_fmr1.py 2 | # Last Modified: 2017-01-07 3 | # Description: VOoM -- two-pane outliner plugin for Python-enabled Vim 4 | # Website: http://www.vim.org/scripts/script.php?script_id=2657 5 | # Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com) 6 | # License: CC0, see http://creativecommons.org/publicdomain/zero/1.0/ 7 | 8 | """ 9 | VOoM markup mode for start fold markers with levels. 10 | See |voom-mode-fmr1|, ../../../doc/voom.txt#*voom-mode-fmr1* 11 | 12 | Headline text is before the start fold marker with level. 13 | Very similar to "fmr" mode. 14 | 15 | headline level 1 {{{1 16 | some text 17 | headline level 2 {{{2 18 | more text 19 | """ 20 | 21 | import sys 22 | if sys.version_info[0] > 2: 23 | xrange = range 24 | 25 | # Define this mode as an 'fmr' mode. 26 | MTYPE = 0 27 | 28 | 29 | # voom_vim.makeoutline() without char stripping 30 | def hook_makeOutline(VO, blines): 31 | """Return (tlines, bnodes, levels) for Body lines blines. 32 | blines is either Vim buffer object (Body) or list of buffer lines. 33 | """ 34 | marker = VO.marker 35 | marker_re_search = VO.marker_re.search 36 | Z = len(blines) 37 | tlines, bnodes, levels = [], [], [] 38 | tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append 39 | #c = VO.rstrip_chars 40 | for i in xrange(Z): 41 | if not marker in blines[i]: continue 42 | bline = blines[i] 43 | m = marker_re_search(bline) 44 | if not m: continue 45 | lev = int(m.group(1)) 46 | #head = bline[:m.start()].lstrip().rstrip(c).strip('-=~').strip() 47 | head = bline[:m.start()].strip() 48 | tline = ' %s%s|%s' %(m.group(2) or ' ', '. '*(lev-1), head) 49 | tlines_add(tline) 50 | bnodes_add(i+1) 51 | levels_add(lev) 52 | return (tlines, bnodes, levels) 53 | 54 | 55 | # same as voom_vim.newHeadline() but without --- 56 | def hook_newHeadline(VO, level, blnum, ln): 57 | """Return (tree_head, bodyLines). 58 | tree_head is new headline string in Tree buffer (text after |). 59 | bodyLines is list of lines to insert in Body buffer. 60 | """ 61 | tree_head = 'NewHeadline' 62 | #bodyLines = ['---%s--- %s%s' %(tree_head, VO.marker, level), ''] 63 | bodyLines = ['%s %s%s' %(tree_head, VO.marker, level), ''] 64 | return (tree_head, bodyLines) 65 | 66 | 67 | -------------------------------------------------------------------------------- /autoload/voom/voom_vimplugin2657/voom_mode_fmr2.py: -------------------------------------------------------------------------------- 1 | # File: voom_mode_fmr2.py 2 | # Last Modified: 2017-01-07 3 | # Description: VOoM -- two-pane outliner plugin for Python-enabled Vim 4 | # Website: http://www.vim.org/scripts/script.php?script_id=2657 5 | # Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com) 6 | # License: CC0, see http://creativecommons.org/publicdomain/zero/1.0/ 7 | 8 | """ 9 | VOoM markup mode for start fold markers with levels. 10 | See |voom-mode-fmr2|, ../../../doc/voom.txt#*voom-mode-fmr2* 11 | 12 | Headline text is after the start fold marker with level. 13 | 14 | {{{1 headline level 1 15 | some text 16 | {{{2 headline level 2 17 | more text 18 | """ 19 | 20 | import sys 21 | if sys.version_info[0] > 2: 22 | xrange = range 23 | 24 | # Define this mode as an 'fmr' mode. 25 | MTYPE = 0 26 | 27 | 28 | def hook_makeOutline(VO, blines): 29 | """Return (tlines, bnodes, levels) for Body lines blines. 30 | blines is either Vim buffer object (Body) or list of buffer lines. 31 | """ 32 | marker = VO.marker 33 | marker_re_search = VO.marker_re.search 34 | Z = len(blines) 35 | tlines, bnodes, levels = [], [], [] 36 | tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append 37 | #c = VO.rstrip_chars 38 | for i in xrange(Z): 39 | if not marker in blines[i]: continue 40 | bline = blines[i] 41 | m = marker_re_search(bline) 42 | if not m: continue 43 | lev = int(m.group(1)) 44 | 45 | head = bline[m.end():] # part after the fold marker 46 | # strip optional special marks from left side: "o", "=", "o=" 47 | #if head and head[0]=='o': head = head[1:] 48 | #if head and head[0]=='=': head = head[1:] 49 | # lstrip all xo= to avoid conflicts with commands that add or remove them 50 | head = head.lstrip('xo=') 51 | 52 | tline = ' %s%s|%s' %(m.group(2) or ' ', '. '*(lev-1), head.strip()) 53 | tlines_add(tline) 54 | bnodes_add(i+1) 55 | levels_add(lev) 56 | return (tlines, bnodes, levels) 57 | 58 | 59 | def hook_newHeadline(VO, level, blnum, ln): 60 | """Return (tree_head, bodyLines). 61 | tree_head is new headline string in Tree buffer (text after |). 62 | bodyLines is list of lines to insert in Body buffer. 63 | """ 64 | tree_head = 'NewHeadline' 65 | bodyLines = ['%s%s %s' %(VO.marker, level, tree_head), ''] 66 | return (tree_head, bodyLines) 67 | 68 | 69 | -------------------------------------------------------------------------------- /autoload/voom/voom_vimplugin2657/voom_mode_cwiki.py: -------------------------------------------------------------------------------- 1 | # File: voom_mode_cwiki.py 2 | # Last Modified: 2017-01-07 3 | # Description: VOoM -- two-pane outliner plugin for Python-enabled Vim 4 | # Website: http://www.vim.org/scripts/script.php?script_id=2657 5 | # Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com) 6 | # License: CC0, see http://creativecommons.org/publicdomain/zero/1.0/ 7 | 8 | """ 9 | VOoM markup mode for cwiki Vim plugin. Contributed by Craig B. Allen. 10 | http://www.vim.org/scripts/script.php?script_id=2176 11 | See |voom-mode-various|, ../../../doc/voom.txt#*voom-mode-various* 12 | 13 | +++ headline level 1 14 | some text 15 | ++++ headline level 2 16 | more text 17 | +++++ headline level 3 18 | ++++++ headline level 4 19 | etc. 20 | 21 | First + must be at start of line. Whitespace after the last + is optional. 22 | """ 23 | 24 | import sys 25 | if sys.version_info[0] > 2: 26 | xrange = range 27 | 28 | import re 29 | headline_match = re.compile(r'^\+\+(\++)').match 30 | 31 | 32 | def hook_makeOutline(VO, blines): 33 | """Return (tlines, bnodes, levels) for Body lines blines. 34 | blines is either Vim buffer object (Body) or list of buffer lines. 35 | """ 36 | Z = len(blines) 37 | tlines, bnodes, levels = [], [], [] 38 | tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append 39 | for i in xrange(Z): 40 | if not blines[i].startswith('+'): 41 | continue 42 | bline = blines[i] 43 | m = headline_match(bline) 44 | if not m: 45 | continue 46 | lev = len(m.group(1)) 47 | head = bline[2+lev:].strip() 48 | tline = ' %s|%s' %('. '*(lev-1), head) 49 | tlines_add(tline) 50 | bnodes_add(i+1) 51 | levels_add(lev) 52 | return (tlines, bnodes, levels) 53 | 54 | 55 | def hook_newHeadline(VO, level, blnum, tlnum): 56 | """Return (tree_head, bodyLines). 57 | tree_head is new headline string in Tree buffer (text after |). 58 | bodyLines is list of lines to insert in Body buffer. 59 | """ 60 | tree_head = 'NewHeadline' 61 | bodyLines = ['++%s %s' %('+'*level, tree_head), ''] 62 | return (tree_head, bodyLines) 63 | 64 | 65 | def hook_changeLevBodyHead(VO, h, levDelta): 66 | """Increase of decrease level number of Body headline by levDelta.""" 67 | if levDelta==0: return h 68 | m = headline_match(h) 69 | level = len(m.group(1)) 70 | return '++%s%s' %('+'*(level+levDelta), h[m.end(1):]) 71 | 72 | 73 | -------------------------------------------------------------------------------- /autoload/voom/voom_vimplugin2657/voom_mode_vimwiki.py: -------------------------------------------------------------------------------- 1 | # File: voom_mode_vimwiki.py 2 | # Last Modified: 2017-01-07 3 | # Description: VOoM -- two-pane outliner plugin for Python-enabled Vim 4 | # Website: http://www.vim.org/scripts/script.php?script_id=2657 5 | # Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com) 6 | # License: CC0, see http://creativecommons.org/publicdomain/zero/1.0/ 7 | 8 | """ 9 | VOoM markup mode for headline markup used by vimwiki plugin: 10 | http://www.vim.org/scripts/script.php?script_id=2226 11 | See |voom-mode-vimwiki|, ../../../doc/voom.txt#*voom-mode-vimwiki* 12 | 13 | = headline level 1 = 14 | body text 15 | == headline level 2 == 16 | body text 17 | === headline level 3 === 18 | 19 | """ 20 | 21 | import sys 22 | if sys.version_info[0] > 2: 23 | xrange = range 24 | 25 | import re 26 | headline_match = re.compile(r'^\s*(=+).+(\1)\s*$').match 27 | 28 | 29 | def hook_makeOutline(VO, blines): 30 | """Return (tlines, bnodes, levels) for Body lines blines. 31 | blines is either Vim buffer object (Body) or list of buffer lines. 32 | """ 33 | Z = len(blines) 34 | tlines, bnodes, levels = [], [], [] 35 | tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append 36 | for i in xrange(Z): 37 | bline = blines[i].strip() 38 | if not bline.startswith('='): 39 | continue 40 | m = headline_match(bline) 41 | if not m: 42 | continue 43 | lev = len(m.group(1)) 44 | bline = bline.strip() 45 | head = bline[lev:-lev].strip() 46 | tline = ' %s|%s' %('. '*(lev-1), head) 47 | tlines_add(tline) 48 | bnodes_add(i+1) 49 | levels_add(lev) 50 | return (tlines, bnodes, levels) 51 | 52 | 53 | def hook_newHeadline(VO, level, blnum, tlnum): 54 | """Return (tree_head, bodyLines). 55 | tree_head is new headline string in Tree buffer (text after |). 56 | bodyLines is list of lines to insert in Body buffer. 57 | """ 58 | tree_head = 'NewHeadline' 59 | bodyLines = ['%s %s %s' %('='*level, tree_head, '='*level), ''] 60 | return (tree_head, bodyLines) 61 | 62 | 63 | def hook_changeLevBodyHead(VO, h, levDelta): 64 | """Increase of decrease level number of Body headline by levDelta.""" 65 | if levDelta==0: return h 66 | m = headline_match(h) 67 | level = len(m.group(1)) 68 | s = '='*(level+levDelta) 69 | return '%s%s%s%s%s' %(h[:m.start(1)], s, h[m.end(1):m.start(2)], s, h[m.end(2):]) 70 | 71 | -------------------------------------------------------------------------------- /autoload/voom/voom_vimplugin2657/voom_mode_fmr3.py: -------------------------------------------------------------------------------- 1 | # File: voom_mode_fmr3.py 2 | # Last Modified: 2017-01-07 3 | # Description: VOoM -- two-pane outliner plugin for Python-enabled Vim 4 | # Website: http://www.vim.org/scripts/script.php?script_id=2657 5 | # Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com) 6 | # License: CC0, see http://creativecommons.org/publicdomain/zero/1.0/ 7 | 8 | """ 9 | VOoM markup mode for start fold markers with levels. 10 | See |voom-mode-fmr3|, ../../../doc/voom.txt#*voom-mode-fmr3* 11 | 12 | Headline text can be before or after the start fold marker with level. 13 | 14 | {{{1 headline level 1 15 | headline level 2 {{{2 16 | """ 17 | 18 | import sys 19 | if sys.version_info[0] > 2: 20 | xrange = range 21 | 22 | # Define this mode as an 'fmr' mode. 23 | MTYPE = 0 24 | 25 | 26 | def hook_makeOutline(VO, blines): 27 | """Return (tlines, bnodes, levels) for Body lines blines. 28 | blines is either Vim buffer object (Body) or list of buffer lines. 29 | """ 30 | marker = VO.marker 31 | marker_re_search = VO.marker_re.search 32 | Z = len(blines) 33 | tlines, bnodes, levels = [], [], [] 34 | tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append 35 | #c = VO.rstrip_chars 36 | for i in xrange(Z): 37 | if not marker in blines[i]: continue 38 | bline = blines[i] 39 | m = marker_re_search(bline) 40 | if not m: continue 41 | lev = int(m.group(1)) 42 | 43 | head = bline[m.end():] # part after the fold marker 44 | # strip optional special marks from left side: "o", "=", "o=" 45 | #if head and head[0]=='o': head = head[1:] 46 | #if head and head[0]=='=': head = head[1:] 47 | # lstrip all xo= to avoid conflicts with commands that add or remove them 48 | head = head.lstrip('xo=') 49 | 50 | # add part before the fold marker 51 | if head: 52 | head = '%s %s' % (bline[:m.start()].rstrip(), head.lstrip()) 53 | else: 54 | head = bline[:m.start()] 55 | 56 | tline = ' %s%s|%s' %(m.group(2) or ' ', '. '*(lev-1), head.strip()) 57 | tlines_add(tline) 58 | bnodes_add(i+1) 59 | levels_add(lev) 60 | return (tlines, bnodes, levels) 61 | 62 | 63 | def hook_newHeadline(VO, level, blnum, ln): 64 | """Return (tree_head, bodyLines). 65 | tree_head is new headline string in Tree buffer (text after |). 66 | bodyLines is list of lines to insert in Body buffer. 67 | """ 68 | tree_head = 'NewHeadline' 69 | bodyLines = ['%s %s%s' %(tree_head, VO.marker, level), ''] 70 | return (tree_head, bodyLines) 71 | 72 | 73 | -------------------------------------------------------------------------------- /autoload/voom/voom_vimplugin2657/voom_mode_html.py: -------------------------------------------------------------------------------- 1 | # File: voom_mode_html.py 2 | # Last Modified: 2017-01-07 3 | # Description: VOoM -- two-pane outliner plugin for Python-enabled Vim 4 | # Website: http://www.vim.org/scripts/script.php?script_id=2657 5 | # Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com) 6 | # License: CC0, see http://creativecommons.org/publicdomain/zero/1.0/ 7 | 8 | """ 9 | VOoM markup mode for HTML headings. 10 | See |voom-mode-html|, ../../../doc/voom.txt#*voom-mode-html* 11 | 12 |

headline level 1

13 | some text 14 |

headline level 2

15 | more text 16 |

headline level 3

17 | < h4 > headline level 4 18 | some text

headline 5

19 | etc. 20 | """ 21 | 22 | import sys 23 | if sys.version_info[0] > 2: 24 | xrange = range 25 | 26 | import re 27 | headline_search = re.compile(r'<\s*h(\d+).*?>(.*?)', re.IGNORECASE).search 28 | html_tag_sub = re.compile('<.*?>').sub 29 | 30 | 31 | def hook_makeOutline(VO, blines): 32 | """Return (tlines, bnodes, levels) for Body lines blines. 33 | blines is either Vim buffer object (Body) or list of buffer lines. 34 | """ 35 | Z = len(blines) 36 | tlines, bnodes, levels = [], [], [] 37 | tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append 38 | for i in xrange(Z): 39 | bline = blines[i] 40 | if not ('%s' %(level, tree_head, level), ''] 63 | return (tree_head, bodyLines) 64 | 65 | 66 | def hook_changeLevBodyHead(VO, h, levDelta): 67 | """Increase of decrease level number of Body headline by levDelta.""" 68 | if levDelta==0: return h 69 | m = headline_search(h) 70 | level = int(m.group(1)) 71 | lev = level+levDelta 72 | return '%s%s%s%s%s' %(h[:m.start(1)], lev, h[m.end(1):m.start(3)], lev, h[m.end(3):]) 73 | 74 | -------------------------------------------------------------------------------- /autoload/voom/voom_vimplugin2657/voom_mode_wiki.py: -------------------------------------------------------------------------------- 1 | # File: voom_mode_wiki.py 2 | # Last Modified: 2017-01-07 3 | # Description: VOoM -- two-pane outliner plugin for Python-enabled Vim 4 | # Website: http://www.vim.org/scripts/script.php?script_id=2657 5 | # Author: Vlad Irnov (vlad DOT irnov AT gmail DOT com) 6 | # License: CC0, see http://creativecommons.org/publicdomain/zero/1.0/ 7 | 8 | """ 9 | VOoM markup mode for MediaWiki headline markup. 10 | See |voom-mode-wiki|, ../../../doc/voom.txt#*voom-mode-wiki* 11 | 12 | = headline level 1 = 13 | some text 14 | == headline level 2 == 15 | more text 16 | === headline level 3 === 17 | ==== headline level 4 ==== 18 | 19 | """ 20 | 21 | import sys 22 | if sys.version_info[0] > 2: 23 | xrange = range 24 | 25 | import re 26 | comment_tag_sub = re.compile('\s*$').sub 27 | headline_match = re.compile(r'^(=+).*(\1)\s*$').match 28 | 29 | 30 | def hook_makeOutline(VO, blines): 31 | """Return (tlines, bnodes, levels) for Body lines blines. 32 | blines is either Vim buffer object (Body) or list of buffer lines. 33 | """ 34 | Z = len(blines) 35 | tlines, bnodes, levels = [], [], [] 36 | tlines_add, bnodes_add, levels_add = tlines.append, bnodes.append, levels.append 37 | for i in xrange(Z): 38 | if not blines[i].startswith('='): 39 | continue 40 | bline = blines[i] 41 | if '