Version 0.5

* DONE: vimwiki default markup to HTML conversion improved.
  * DONE: Added basic `GoogleWiki` and `MediaWiki` markup languages.
  * DONE: Chinese `[[complex wiki words]]`.
This commit is contained in:
Maxim Kim 2008-09-15 00:00:00 +00:00 committed by Able Scraper
parent 03a25a7975
commit cac8365402
4 changed files with 644 additions and 461 deletions

View File

@ -1,86 +0,0 @@
" Vim filetype plugin file
" Language: Wiki
" Author: Maxim Kim (habamax at gmail dot com)
" Home: http://code.google.com/p/vimwiki/
" Filenames: *.wiki
" Last Change: (02.06.2008 12:58)
" Version: 0.4
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1 " Don't load another plugin for this buffer
"" Defaults
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Reset the following options to undo this plugin.
let b:undo_ftplugin = "setl tw< wrap< lbr< fenc< ff< sua< isf< awa< com< fo<"
setlocal textwidth=0
setlocal wrap
setlocal linebreak
setlocal fileencoding=utf-8
setlocal fileformat=unix
setlocal autowriteall
" for gf
execute 'setlocal suffixesadd='.g:vimwiki_ext
setlocal isfname-=[,]
if g:vimwiki_smartCR>=2
setlocal comments=b:*,b:#
setlocal formatoptions=ctnqro
endif
"" keybindings {{{
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
nmap <buffer> <Up> gk
nmap <buffer> k gk
vmap <buffer> <Up> gk
vmap <buffer> k gk
nmap <buffer> <Down> gj
nmap <buffer> j gj
vmap <buffer> <Down> gj
vmap <buffer> j gj
imap <buffer> <Down> <C-o>gj
imap <buffer> <Up> <C-o>gk
nmap <silent><buffer> <CR> :call vimwiki#WikiFollowWord('nosplit')<CR>
nmap <silent><buffer> <S-CR> :call vimwiki#WikiFollowWord('split')<CR>
nmap <silent><buffer> <C-CR> :call vimwiki#WikiFollowWord('vsplit')<CR>
nmap <buffer> <S-LeftMouse> <NOP>
nmap <buffer> <C-LeftMouse> <NOP>
noremap <silent><buffer> <2-LeftMouse> :call vimwiki#WikiFollowWord('nosplit')<CR>
noremap <silent><buffer> <S-2-LeftMouse> <LeftMouse>:call vimwiki#WikiFollowWord('split')<CR>
noremap <silent><buffer> <C-2-LeftMouse> <LeftMouse>:call vimwiki#WikiFollowWord('vsplit')<CR>
nmap <silent><buffer> <BS> :call vimwiki#WikiGoBackWord()<CR>
"<BS> mapping doesn't work in vim console
nmap <silent><buffer> <C-h> :call vimwiki#WikiGoBackWord()<CR>
nmap <silent><buffer> <RightMouse><LeftMouse> :call vimwiki#WikiGoBackWord()<CR>
nmap <silent><buffer> <TAB> :call vimwiki#WikiNextWord()<CR>
nmap <silent><buffer> <S-TAB> :call vimwiki#WikiPrevWord()<CR>
nmap <silent><buffer> <Leader>wd :call vimwiki#WikiDeleteWord()<CR>
nmap <silent><buffer> <Leader>wr :call vimwiki#WikiRenameWord()<CR>
if g:vimwiki_smartCR==1
inoremap <silent><buffer><CR> <CR><Space><C-O>:call vimwiki#WikiNewLine('checkup')<CR>
noremap <silent><buffer>o o<Space><C-O>:call vimwiki#WikiNewLine('checkup')<CR>
noremap <silent><buffer>O O<Space><C-O>:call vimwiki#WikiNewLine('checkdown')<CR>
endif
" keybindings }}}
"" commands {{{2
" command! -nargs=1 Wiki2HTML call WikiExportHTML(expand(<f-args>))
command! Wiki2HTML call vimwiki#Wiki2HTML(g:vimwiki_home_html, expand('%'))
command! WikiAll2HTML call vimwiki#WikiAll2HTML(g:vimwiki_home_html)
"" commands 2}}}

View File

@ -1,59 +0,0 @@
" VimWiki plugin file
" Language: Wiki
" Author: Maxim Kim (habamax at gmail dot com)
" Home: http://code.google.com/p/vimwiki/
" Filenames: *.wiki
" Last Change: (02.06.2008 12:57)
" Version: 0.4
if exists("loaded_vimwiki") || &cp
finish
endif
let loaded_vimwiki = 1
let s:save_cpo = &cpo
set cpo&vim
function! s:default(varname,value)
if !exists('g:vimwiki_'.a:varname)
let g:vimwiki_{a:varname} = a:value
endif
endfunction
"" Could be redefined by users
call s:default('home',"")
call s:default('index',"index")
call s:default('ext','.wiki')
call s:default('upper','A-ZА-Я')
call s:default('lower','a-zа-я')
call s:default('maxhi','1')
call s:default('other','0-9_')
call s:default('smartCR',1)
call s:default('stripsym','_')
call s:default('home_html',g:vimwiki_home."html/")
" call s:default('addheading','1')
call s:default('history',[])
let upp = g:vimwiki_upper
let low = g:vimwiki_lower
let oth = g:vimwiki_other
let nup = low.oth
let nlo = upp.oth
let any = upp.nup
let g:vimwiki_word1 = '\C\<['.upp.']['.nlo.']*['.low.']['.nup.']*['.upp.']['.any.']*\>'
let g:vimwiki_word2 = '\[\[['.upp.low.oth.'[:punct:][:space:]]\{-}\]\]'
"" TODO: common regexps for syntax hiliting
"" regexps
call s:default('rxWeblink', '\("[^"(]\+\((\([^)]\+\))\)\?":\)\?\(https\?\|ftp\|gopher\|telnet\|file\|notes\|ms-help\):\(\(\(//\)\|\(\\\\\)\)\+[A-Za-z0-9:#@%/;$~_?+-=.&\-\\\\]*\)')
call s:default('rxWikiWord', g:vimwiki_word1.'\|'.g:vimwiki_word2)
call s:default('rxCode', '`.\{-}`')
execute 'autocmd! BufNewFile,BufReadPost,BufEnter *'.g:vimwiki_ext.' set ft=vimwiki'
nmap <silent><unique> <Leader>ww :call vimwiki#WikiGoHome()<CR>
nmap <silent><unique> <Leader>wh :execute "edit ".g:vimwiki_home."."<CR>

View File

@ -1,121 +0,0 @@
" Vim syntax file
" Language: Wiki
" Author: Maxim Kim (habamax at gmail dot com)
" Home: http://code.google.com/p/vimwiki/
" Filenames: *.wiki
" Last Change: (02.06.2008 12:58)
" Version: 0.4
" Quit if syntax file is already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
"" use max highlighting - could be quite slow if there are too many wikifiles
if g:vimwiki_maxhi
" Every WikiWord is nonexistent
execute 'syntax match wikiNoExistsWord /'.g:vimwiki_word1.'/'
execute 'syntax match wikiNoExistsWord /'.g:vimwiki_word2.'/'
" till we find them in g:vimwiki_home
call vimwiki#WikiHighlightWords()
else
" A WikiWord (unqualifiedWikiName)
execute 'syntax match wikiWord /'.g:vimwiki_word1.'/'
" A [[bracketed wiki word]]
execute 'syntax match wikiWord /'.g:vimwiki_word2.'/'
endif
" text: "this is a link (optional tooltip)":http://www.microsoft.com
" TODO: check URL syntax against RFC
syntax match wikiLink `\("[^"(]\+\((\([^)]\+\))\)\?":\)\?\(https\?\|ftp\|gopher\|telnet\|file\|notes\|ms-help\):\(\(\(//\)\|\(\\\\\)\)\+[A-Za-z0-9:#@%/;$~_?+-=.&\-\\\\]*\)`
" text: *strong*
" syntax match wikiBold /\(^\|\W\)\zs\*\([^ ].\{-}\)\*/
" syntax match wikiBold /\(^\|\W\)\zs\*.\{-}\*/
syntax match wikiBold /\*.\{-}\*/
" text: _emphasis_
syntax match wikiItalic /_.\{-}_/
" text: `code`
syntax match wikiCode /`.\{-}`/
" text: ~~deleted text~~
syntax match wikiDelText /\~\{2}.\{-}\~\{2}/
" text: ^superscript^
syntax match wikiSuperScript /\^.\{-}\^/
" text: ,,subscript,,
syntax match wikiSubScript /,,.\{-},,/
" Emoticons: must come after the Textilisms, as later rules take precedence
" over earlier ones. This match is an approximation for the ~70 distinct
" patterns that FlexWiki knows.
syntax match wikiEmoticons /\((.)\|:[()|$@]\|:-[DOPS()\]|$@]\|;)\|:'(\)/
" Aggregate all the regular text highlighting into wikiText
syntax cluster wikiText contains=wikiItalic,wikiBold,wikiCode,wikiDelText,wikiSuperScript,wikiSubScript,wikiLink,wikiWord,wikiEmoticons
" Header levels, 1-6
syntax match wikiH1 /\(^!\{1}.*$\|^\s*=\{1}.*=\{1}\s*$\)/
syntax match wikiH2 /\(^!\{2}.*$\|^\s*=\{2}.*=\{2}\s*$\)/
syntax match wikiH3 /\(^!\{3}.*$\|^\s*=\{3}.*=\{3}\s*$\)/
syntax match wikiH4 /\(^!\{4}.*$\|^\s*=\{4}.*=\{4}\s*$\)/
syntax match wikiH5 /\(^!\{5}.*$\|^\s*=\{5}.*=\{5}\s*$\)/
syntax match wikiH6 /\(^!\{6}.*$\|^\s*=\{6}.*=\{6}\s*$\)/
" <hr>, horizontal rule
syntax match wikiHR /^----.*$/
" Tables. Each line starts and ends with '||'; each cell is separated by '||'
syntax match wikiTable /||/
" Bulleted list items start with whitespace(s), then '*'
" syntax match wikiList /^\s\+\(\*\|[1-9]\+0*\.\).*$/ contains=@wikiText
" highlight only bullets and digits.
syntax match wikiList /^\s\+\(\*\|[1-9]\+0*\.\|#\)/
syntax match wikiTodo /\(TODO:\|DONE:\|FIXME:\|FIXED:\)/
" Treat all other lines that start with spaces as PRE-formatted text.
syntax match wikiPre /^\s\+[^[:blank:]*#].*$/
syntax region wikiPre start=/^{{{\s*$/ end=/^}}}\s*$/
syntax sync match wikiPreSync grouphere wikiPre /^{{{\s*$/
" Link FlexWiki syntax items to colors
hi def link wikiH1 Title
hi def link wikiH2 wikiH1
hi def link wikiH3 wikiH2
hi def link wikiH4 wikiH3
hi def link wikiH5 wikiH4
hi def link wikiH6 wikiH5
hi def link wikiHR wikiH6
hi def wikiBold term=bold cterm=bold gui=bold
hi def wikiItalic term=italic cterm=italic gui=italic
hi def link wikiCode PreProc
hi def link wikiWord Underlined
hi def link wikiNoExistsWord Error
hi def link wikiEscape Todo
hi def link wikiPre PreProc
hi def link wikiLink Underlined
hi def link wikiList Type
hi def link wikiTable Type
hi def link wikiEmoticons Constant
hi def link wikiDelText Comment
hi def link wikiInsText Constant
hi def link wikiSuperScript Constant
hi def link wikiSubScript Constant
hi def link wikiCitation Constant
hi def link wikiTodo Todo
let b:current_syntax="vimwiki"
" vim:tw=0:

View File

@ -1,10 +1,200 @@
" Vimball Archiver by Charles E. Campbell, Jr., Ph.D.
UseVimball
finish
plugin\vimwiki.vim [[[1
55
" VimWiki plugin file " VimWiki plugin file
" Language: Wiki " Language: Wiki
" Author: Maxim Kim (habamax at gmail dot com) " Author: Maxim Kim (habamax at gmail dot com)
" Home: http://code.google.com/p/vimwiki/ " Home: http://code.google.com/p/vimwiki/
" Filenames: *.wiki " Filenames: *.wiki
" Last Change: (02.06.2008 12:57) " Last Change: [15.09.2008 - 12:07]
" Version: 0.4 " Version: 0.5
if exists("loaded_vimwiki") || &cp
finish
endif
let loaded_vimwiki = 1
let s:save_cpo = &cpo
set cpo&vim
function! s:default(varname,value)
if !exists('g:vimwiki_'.a:varname)
let g:vimwiki_{a:varname} = a:value
endif
endfunction
"" Could be redefined by users
call s:default('home',"")
call s:default('index',"index")
call s:default('ext','.wiki')
call s:default('upper','A-ZА-Я')
call s:default('lower','a-zа-я')
call s:default('maxhi','1')
call s:default('other','0-9_')
call s:default('smartCR',1)
call s:default('stripsym','_')
call s:default('home_html',g:vimwiki_home."html/")
call s:default('syntax','default')
call s:default('history',[])
let upp = g:vimwiki_upper
let low = g:vimwiki_lower
let oth = g:vimwiki_other
let nup = low.oth
let nlo = upp.oth
let any = upp.nup
let g:vimwiki_word1 = '\C\<['.upp.']['.nlo.']*['.low.']['.nup.']*['.upp.']['.any.']*\>'
" let g:vimwiki_word2 = '\[\[['.upp.low.oth.'[:punct:][:space:]]\{-}\]\]'
let g:vimwiki_word2 = '\[\[[^\]]\+\]\]'
let g:vimwiki_rxWikiWord = g:vimwiki_word1.'\|'.g:vimwiki_word2
execute 'autocmd! BufNewFile,BufReadPost,BufEnter *'.g:vimwiki_ext.' set ft=vimwiki'
nmap <silent><unique> <Leader>ww :call vimwiki#WikiGoHome()<CR>
nmap <silent><unique> <Leader>wh :execute "edit ".g:vimwiki_home<CR>
ftplugin\vimwiki.vim [[[1
126
" Vim filetype plugin file
" Language: Wiki
" Author: Maxim Kim (habamax at gmail dot com)
" Home: http://code.google.com/p/vimwiki/
" Filenames: *.wiki
" Last Change: [15.09.2008 - 12:09]
" Version: 0.5
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1 " Don't load another plugin for this buffer
"" Defaults
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Reset the following options to undo this plugin.
let b:undo_ftplugin = "setl tw< wrap< lbr< fenc< ff< sua< isf< awa< com< fo< fdt< fdm< fde<"
setlocal textwidth=0
setlocal wrap
setlocal linebreak
setlocal fileencoding=utf-8
setlocal fileformat=unix
setlocal autowriteall
" for gf
execute 'setlocal suffixesadd='.g:vimwiki_ext
setlocal isfname-=[,]
if g:vimwiki_smartCR>=2
setlocal comments=b:*,b:#
setlocal formatoptions=ctnqro
endif
"" TODO: folding for Headers using syntax fold method.
" setlocal foldmethod=expr
" setlocal foldexpr=VimWikiFoldLevel(v:lnum)
" function! s:wikiHeaderLevel(header)
" let c = 0
" while a:header[c]=='!'
" let c += 1
" endwhile
" return c
" endfunction
" function! VimWikiFoldLevel(lnum)
" let str = getline(a:lnum)
" let strnext = getline(a:lnum+1)
" if str =~ '^!'
" if strnext =~ '^!'
" return '<1'
" else
" return '1'
" endif
" elseif strnext =~ '^!'
" return '<1'
" else
" return '1'
" endif
" endfunction
" setlocal foldtext=VimWikiFoldText()
" function! VimWikiFoldText()
" let line = getline(v:foldstart)
" let sub = substitute(line, '!', '', '')
" let sub = substitute(sub, '!', v:folddashes.v:folddashes, 'g')
" let lines_nr = v:foldend-v:foldstart
" return '+'.v:folddashes.v:folddashes.sub.' ('.lines_nr.')'
" endfunction
"" keybindings {{{
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
nmap <buffer> <Up> gk
nmap <buffer> k gk
vmap <buffer> <Up> gk
vmap <buffer> k gk
nmap <buffer> <Down> gj
nmap <buffer> j gj
vmap <buffer> <Down> gj
vmap <buffer> j gj
imap <buffer> <Down> <C-o>gj
imap <buffer> <Up> <C-o>gk
nmap <silent><buffer> <CR> :call vimwiki#WikiFollowWord('nosplit')<CR>
nmap <silent><buffer> <S-CR> :call vimwiki#WikiFollowWord('split')<CR>
nmap <silent><buffer> <C-CR> :call vimwiki#WikiFollowWord('vsplit')<CR>
nmap <buffer> <S-LeftMouse> <NOP>
nmap <buffer> <C-LeftMouse> <NOP>
noremap <silent><buffer> <2-LeftMouse> :call vimwiki#WikiFollowWord('nosplit')<CR>
noremap <silent><buffer> <S-2-LeftMouse> <LeftMouse>:call vimwiki#WikiFollowWord('split')<CR>
noremap <silent><buffer> <C-2-LeftMouse> <LeftMouse>:call vimwiki#WikiFollowWord('vsplit')<CR>
nmap <silent><buffer> <BS> :call vimwiki#WikiGoBackWord()<CR>
"<BS> mapping doesn't work in vim console
nmap <silent><buffer> <C-h> :call vimwiki#WikiGoBackWord()<CR>
nmap <silent><buffer> <RightMouse><LeftMouse> :call vimwiki#WikiGoBackWord()<CR>
nmap <silent><buffer> <TAB> :call vimwiki#WikiNextWord()<CR>
nmap <silent><buffer> <S-TAB> :call vimwiki#WikiPrevWord()<CR>
nmap <silent><buffer> <Leader>wd :call vimwiki#WikiDeleteWord()<CR>
nmap <silent><buffer> <Leader>wr :call vimwiki#WikiRenameWord()<CR>
if g:vimwiki_smartCR==1
inoremap <silent><buffer><CR> <CR><Space><C-O>:call vimwiki#WikiNewLine('checkup')<CR>
noremap <silent><buffer>o o<Space><C-O>:call vimwiki#WikiNewLine('checkup')<CR>
noremap <silent><buffer>O O<Space><C-O>:call vimwiki#WikiNewLine('checkdown')<CR>
endif
" keybindings }}}
"" commands {{{2
" command! -nargs=1 Wiki2HTML call WikiExportHTML(expand(<f-args>))
command! Wiki2HTML call vimwiki#Wiki2HTML(g:vimwiki_home_html, expand('%'))
command! WikiAll2HTML call vimwiki#WikiAll2HTML(g:vimwiki_home_html)
"" commands 2}}}
autoload\vimwiki.vim [[[1
901
" VimWiki plugin file
" Language: Wiki
" Author: Maxim Kim (habamax at gmail dot com)
" Home: http://code.google.com/p/vimwiki/
" Filenames: *.wiki
" Last Change: [15.09.2008 - 12:23]
" Version: 0.5
if exists("g:loaded_vimwiki_auto") || &cp if exists("g:loaded_vimwiki_auto") || &cp
finish finish
@ -97,7 +287,7 @@ endfunction "}}}
"" WikiWord history helper functions {{{ "" WikiWord history helper functions {{{
" history is [['WikiWord.wiki', 11], ['AnotherWikiWord', 3] ... etc] " history is [['WikiWord.wiki', 11], ['AnotherWikiWord', 3] ... etc]
" where numbers are column positions we should return when coming back. " where numbers are column positions we should return to when coming back.
function! s:GetHistoryWord(historyItem) function! s:GetHistoryWord(historyItem)
return get(a:historyItem, 0) return get(a:historyItem, 0)
endfunction endfunction
@ -336,14 +526,17 @@ endfunction "}}}
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! s:WikiCreateDefaultCSS(path) " {{{ function! s:WikiCreateDefaultCSS(path) " {{{
if glob(a:path.'style.css') == "" if glob(a:path.'style.css') == ""
let lines = ['body { margin: 1em 5em 1em 5em; font-size: 100%; }'] let lines = ['body { margin: 1em 5em 1em 5em; font-size: 100%;}']
call add(lines, 'p, ul {line-height: 1.5;}')
call add(lines, '.todo {font-weight: bold; text-decoration: underline; color: #FF0000; }')
call add(lines, '.strike {text-decoration: line-through; }')
call add(lines, 'h1 {font-size: 2.0em;}') call add(lines, 'h1 {font-size: 2.0em;}')
call add(lines, 'h2 {font-size: 1.4em;}') call add(lines, 'h2 {font-size: 1.4em;}')
call add(lines, 'h3 {font-size: 1.0em;}') call add(lines, 'h3 {font-size: 1.0em;}')
call add(lines, 'h4 {font-size: 0.8em;}') call add(lines, 'h4 {font-size: 0.8em;}')
call add(lines, 'h5 {font-size: 0.7em;}') call add(lines, 'h5 {font-size: 0.7em;}')
call add(lines, 'h6 {font-size: 0.6em;}') call add(lines, 'h6 {font-size: 0.6em;}')
call add(lines, 'h1 { border-bottom: 1px solid #3366cc; text-align: right; padding: 0.3em 1em 0.3em 1em; }') call add(lines, 'h1 { border-bottom: 1px solid #3366cc; text-align: left; padding: 0em 1em 0.3em 0em; }')
call add(lines, 'h3 { background: #e5ecf9; border-top: 1px solid #3366cc; padding: 0.1em 0.3em 0.1em 0.5em; }') call add(lines, 'h3 { background: #e5ecf9; border-top: 1px solid #3366cc; padding: 0.1em 0.3em 0.1em 0.5em; }')
call add(lines, 'ul { margin-left: 2em; padding-left: 0.5em; }') call add(lines, 'ul { margin-left: 2em; padding-left: 0.5em; }')
call add(lines, 'pre { border-left: 0.2em solid #ccc; margin-left: 2em; padding-left: 0.5em; }') call add(lines, 'pre { border-left: 0.2em solid #ccc; margin-left: 2em; padding-left: 0.5em; }')
@ -351,18 +544,27 @@ function! s:WikiCreateDefaultCSS(path) " {{{
call add(lines, 'hr { border: none; border-top: 1px solid #ccc; }') call add(lines, 'hr { border: none; border-top: 1px solid #ccc; }')
call writefile(lines, a:path.'style.css') call writefile(lines, a:path.'style.css')
echomsg "Default style.css created." echomsg "Default style.css is created."
endif endif
endfunction "}}} endfunction "}}}
function! s:syntax_supported()
return g:vimwiki_syntax == "default"
endfunction
function! vimwiki#WikiAll2HTML(path) "{{{ function! vimwiki#WikiAll2HTML(path) "{{{
if !s:syntax_supported()
call s:msg('Wiki2Html: Only vimwiki_default syntax supported!!!')
return
endif
if !isdirectory(a:path) if !isdirectory(a:path)
call s:msg('Please create '.a:path.' directory first!') call s:msg('Please create '.a:path.' directory first!')
return return
endif endif
let wikifiles = split(glob(g:vimwiki_home.'*'.g:vimwiki_ext), '\n') let wikifiles = split(glob(g:vimwiki_home.'*'.g:vimwiki_ext), '\n')
for wikifile in wikifiles for wikifile in wikifiles
echo 'Processing '.wikifile echomsg 'Processing '.wikifile
call vimwiki#Wiki2HTML(a:path, wikifile) call vimwiki#Wiki2HTML(a:path, wikifile)
endfor endfor
call s:WikiCreateDefaultCSS(g:vimwiki_home_html) call s:WikiCreateDefaultCSS(g:vimwiki_home_html)
@ -370,13 +572,24 @@ function! vimwiki#WikiAll2HTML(path) "{{{
endfunction "}}} endfunction "}}}
function! vimwiki#Wiki2HTML(path, wikifile) "{{{ function! vimwiki#Wiki2HTML(path, wikifile) "{{{
if !s:syntax_supported()
call s:msg('Wiki2Html: Only vimwiki_default syntax supported!!!')
return
endif
if !isdirectory(a:path) if !isdirectory(a:path)
call s:msg('Please create '.a:path.' directory first!') call s:msg('Please create '.a:path.' directory first!')
return return
endif endif
"" helper funcs "" helper funcs
function! s:isLinkToPic(lnk) "{{{ function! s:isWebLink(lnk) "{{{
if a:lnk =~ '^\(http://\|www.\|ftp://\)'
return 1
endif
return 0
endfunction "}}}
function! s:isImgLink(lnk) "{{{
if a:lnk =~ '.\(png\|jpg\|gif\|jpeg\)$' if a:lnk =~ '.\(png\|jpg\|gif\|jpeg\)$'
return 1 return 1
endif endif
@ -529,72 +742,25 @@ function! vimwiki#Wiki2HTML(path, wikifile) "{{{
function! s:processHeading(line) "{{{ function! s:processHeading(line) "{{{
let line = a:line let line = a:line
let processed = 0 let processed = 0
if a:line =~ '^!!!!!!.*$' if a:line =~ g:vimwiki_rxH6
let line = '<h6>'.strpart(a:line, 6).'</h6>' let line = '<h6>'.strpart(a:line, 6).'</h6>'
let processed = 1 let processed = 1
elseif a:line =~ '^!!!!!.*$' elseif a:line =~ g:vimwiki_rxH5
let line = '<h5>'.strpart(a:line, 5).'</h5>' let line = '<h5>'.strpart(a:line, 5).'</h5>'
let processed = 1 let processed = 1
elseif a:line =~ '^!!!!.*$' elseif a:line =~ g:vimwiki_rxH4
let line = '<h4>'.strpart(a:line, 4).'</h4>' let line = '<h4>'.strpart(a:line, 4).'</h4>'
let processed = 1 let processed = 1
elseif a:line =~ '^!!!.*$' elseif a:line =~ g:vimwiki_rxH3
let line = '<h3>'.strpart(a:line, 3).'</h3>' let line = '<h3>'.strpart(a:line, 3).'</h3>'
let processed = 1 let processed = 1
elseif a:line =~ '^!!.*$' elseif a:line =~ g:vimwiki_rxH2
let line = '<h2>'.strpart(a:line, 2).'</h2>' let line = '<h2>'.strpart(a:line, 2).'</h2>'
let processed = 1 let processed = 1
elseif a:line =~ '^!.*$' elseif a:line =~ g:vimwiki_rxH1
let line = '<h1>'.strpart(a:line, 1).'</h1>' let line = '<h1>'.strpart(a:line, 1).'</h1>'
let processed = 1 let processed = 1
endif endif
if processed
return [processed, line]
endif
"" dumb test if Tagit has made changes to line
let lenbefore = len(line)
let line = s:Tagit(a:line, '^=\{6}.*=\{6}\s*$', '<h6>', '</h6>', 6)
if len(line)!=lenbefore
let processed = 1
endif
if !processed
let lenbefore = len(line)
let line = s:Tagit(a:line, '^=\{5}.*=\{5}\s*$', '<h5>', '</h5>', 5)
if len(line)!=lenbefore
let processed = 1
endif
endif
if !processed
let lenbefore = len(line)
let line = s:Tagit(a:line, '^=\{4}.*=\{4}\s*$', '<h4>', '</h4>', 4)
if len(line)!=lenbefore
let processed = 1
endif
endif
if !processed
let lenbefore = len(line)
let line = s:Tagit(a:line, '^=\{3}.*=\{3}\s*$', '<h3>', '</h3>', 3)
if len(line)!=lenbefore
let processed = 1
endif
endif
if !processed
let lenbefore = len(line)
let line = s:Tagit(a:line, '^=\{2}.*=\{2}\s*$', '<h2>', '</h2>', 2)
if len(line)!=lenbefore
let processed = 1
endif
endif
if !processed
let lenbefore = len(line)
let line = s:Tagit(a:line, '^=\{1}.*=\{1}\s*$', '<h1>', '</h1>', 1)
if len(line)!=lenbefore
let processed = 1
endif
endif
return [processed, line] return [processed, line]
endfunction "}}} endfunction "}}}
@ -644,83 +810,6 @@ function! vimwiki#Wiki2HTML(path, wikifile) "{{{
return [processed, lines, table] return [processed, lines, table]
endfunction "}}} endfunction "}}}
"" yes I know it is dumb to name variables like that ;)
function! s:Linkit(line, regexp, regexp2) "{{{
let line = a:line
let done = 0
let posend = -1
let posbeg = 0
let posbeg2 = 0
while !done
let posbeg = match(a:line, a:regexp, posend+1)
let posbeg2 = match(a:line, a:regexp2, posend+1)
if (posbeg < posbeg2 && posbeg!=-1) || (posbeg2==-1 && posbeg!=-1)
let str = matchstr(a:line, a:regexp, posbeg)
if str != ''
let word = s:WikiStripWord(str, g:vimwiki_stripsym)
let ext = '.html'
let path = ''
if s:WikiIsLinkToNonWikiFile(word)
let ext = ''
" let path = g:vimwiki_home
endif
if s:isLinkToPic(word)
let strrep = '<img src="'.path.word.'" />'
else
let strrep = '<a href="'.path.word.ext.'">'.word.'</a>'
endif
let line = substitute(line, escape(str,'[]*?\'), strrep, "")
let posend = posbeg+len(str)
else
let done = 1
endif
elseif posbeg2 != -1
let str = matchstr(a:line, a:regexp2, posbeg2)
if str != ''
if s:isLinkToPic(str)
let strrep = '<img src="'.str.'" />'
else
let strrep = '<a href="'.str.'">'.str.'</a>'
endif
let line = substitute(line, str, strrep, "")
let posend = posbeg2+len(str)
else
let done = 1
endif
else
let done = 1
endif
endwhile
return line
endfunction "}}}
function! s:processLink(line) "{{{
let line = ''
let done = 0
let pos0 = 0
let pos1 = 0
let pos2 = 0
while !done
let pos1 = match(a:line, g:vimwiki_rxCode, pos2)
let pos2 = matchend(a:line, g:vimwiki_rxCode, pos1)
if pos1!=-1 && pos2!=-1
let line = line.s:Linkit(strpart(a:line, pos0, pos1-pos0), g:vimwiki_rxWikiWord, g:vimwiki_rxWeblink)
let line = line.strpart(a:line, pos1, pos2-pos1)
let pos0 = pos2
else
let line = line.s:Linkit(strpart(a:line, pos0, len(a:line)-pos0), g:vimwiki_rxWikiWord, g:vimwiki_rxWeblink)
let done = 1
endif
endwhile
return line
endfunction "}}}
"" TODO: processTODO(line)
"" change dangerous html symbols - < > & (line) "" change dangerous html symbols - < > & (line)
function! s:safeHTML(line) "{{{ function! s:safeHTML(line) "{{{
let line = substitute(a:line, '&', '\&amp;', 'g') let line = substitute(a:line, '&', '\&amp;', 'g')
@ -729,58 +818,117 @@ function! vimwiki#Wiki2HTML(path, wikifile) "{{{
return line return line
endfunction "}}} endfunction "}}}
function! s:Tagit(line, regexp, tagOpen, tagClose, cSymRemove) "{{{ "" Substitute text found by regexp_match with tagOpen.regexp_subst.tagClose
let line = a:line function! s:MakeTagHelper(line, regexp_match, tagOpen, tagClose, cSymRemove, func) " {{{
let done = 0 let pos = 0
while !done let lines = split(a:line, a:regexp_match, 1)
let str = matchstr(line, a:regexp) let res_line = ""
if str != '' for line in lines
let strrep = a:tagOpen.strpart(str, a:cSymRemove, len(str)-2*a:cSymRemove).a:tagClose let res_line = res_line.line
let line = substitute(line, a:regexp, escape(strrep, '[]*.?&\'), "") let matched = matchstr(a:line, a:regexp_match, pos)
if matched != ""
let toReplace = strpart(matched, a:cSymRemove, len(matched)-2*a:cSymRemove)
if a:func!=""
let toReplace = {a:func}(escape(toReplace, '\&*[]?%'))
else else
let done = 1 " let toReplace = a:tagOpen.escape(toReplace, '\&*[]?%').a:tagClose
let toReplace = a:tagOpen.toReplace.a:tagClose
endif
let res_line = res_line.toReplace
endif
let pos = matchend(a:line, a:regexp_match, pos)
endfor
return res_line
endfunction " }}}
"" Make tags only if not in ` ... `
"" ... should be function that process regexp_match deeper.
function! s:MakeTag(line, regexp_match, tagOpen, tagClose, ...) " {{{
"check if additional function exists
let func = ""
let cSym = 1
if a:0 == 2
let cSym = a:1
let func = a:2
elseif a:0 == 1
let cSym = a:1
endif
let patt_splitter = g:vimwiki_rxCode
let patt_splitter = '\('.g:vimwiki_rxCode.'\)\|\(<a href.\{-}</a>\)\|\(<img src.\{-}/>\)'
if g:vimwiki_rxCode == a:regexp_match
let res_line = s:MakeTagHelper(a:line, a:regexp_match, a:tagOpen, a:tagClose, cSym, func)
else
let pos = 0
let lines = split(a:line, patt_splitter, 1)
let res_line = ""
for line in lines
let res_line = res_line.s:MakeTagHelper(line, a:regexp_match, a:tagOpen, a:tagClose, cSym, func)
let res_line = res_line.matchstr(a:line, patt_splitter, pos)
let pos = matchend(a:line, patt_splitter, pos)
endfor
endif
return res_line
endfunction " }}}
"" Make <a href="link">link desc</a>
"" from [link link desc]
function! s:MakeExternalLink(entag) "{{{
let line = ''
if s:isWebLink(a:entag)
let lnkElements = split(a:entag)
let head = lnkElements[0]
let rest = join(lnkElements[1:])
if rest==""
let rest=head
endif
if s:isImgLink(rest)
if rest!=head
let line = '<a href="'.head.'"><img src="'.rest.'" /></a>'
else
let line = '<img src="'.rest.'" />'
endif
else
let line = '<a href="'.head.'">'.rest.'</a>'
endif
else
if s:isImgLink(a:entag)
let line = '<img src="'.a:entag.'" />'
else
let line = '<a href="'.a:entag.'">'.a:entag.'</a>'
endif
endif endif
endwhile
return line return line
endfunction "}}} endfunction "}}}
function! s:replacePairs(line, regexp, tagOpen, tagClose) "{{{ "" Make <a href="This is a link">This is a link</a>
"" from [[This is a link]]
function! s:MakeInternalLink(entag) "{{{
let line = '' let line = ''
let done = 0 if s:isImgLink(a:entag)
let line = '<img src="'.a:entag.'" />'
if a:regexp == g:vimwiki_rxCode
let line = s:Tagit(a:line, a:regexp, a:tagOpen, a:tagClose, 1)
else else
let pos0 = 0 let line = '<a href="'.a:entag.'.html">'.a:entag.'</a>'
let pos1 = 0
let pos2 = 0
while !done
"" TODO: improve it, improve it, improve it...
let pos1 = match(a:line, g:vimwiki_rxCode, pos2)
let tpos1 = match(a:line, g:vimwiki_rxWeblink, pos2)
let ttpos1 = match(a:line, g:vimwiki_rxWikiWord, pos2)
let pos2 = matchend(a:line, g:vimwiki_rxCode, pos1)
let tpos2 = matchend(a:line, g:vimwiki_rxWeblink, tpos1)
let ttpos2 = matchend(a:line, g:vimwiki_rxWikiWord, ttpos1)
if (pos1 < tpos1)
let pos1 = tpos1
endif endif
if (pos1 < ttpos1) return line
let pos1 = ttpos1 endfunction "}}}
endif
let pos2 = max([pos2, tpos2, ttpos2])
if pos1!=-1 && pos2!=-1 "" Make <a href="WikiWord">WikiWord</a>
let line = line.s:Tagit(strpart(a:line, pos0, pos1-pos0), a:regexp, a:tagOpen, a:tagClose, 1) "" from WikiWord
let line = line.strpart(a:line, pos1, pos2-pos1) function! s:MakeWikiWordLink(entag) "{{{
let pos0 = pos2 let line = '<a href="'.a:entag.'.html">'.a:entag.'</a>'
return line
endfunction "}}}
"" Make <a href="http://habamax.ru">http://habamax.ru</a>
"" from http://habamax.ru
function! s:MakeBareBoneLink(entag) "{{{
if s:isImgLink(a:entag)
let line = '<img src="'.a:entag.'" />'
else else
let line = line.s:Tagit(strpart(a:line, pos0, len(a:line)-pos0), a:regexp, a:tagOpen, a:tagClose, 1) let line = '<a href="'.a:entag.'">'.a:entag.'</a>'
let done = 1
endif endif
endwhile
endif
return line return line
endfunction "}}} endfunction "}}}
@ -829,7 +977,6 @@ function! vimwiki#Wiki2HTML(path, wikifile) "{{{
endif endif
"" TODO: `code` do not emphasize or bold it.
"" list "" list
if !processed if !processed
let [processed, lines] = s:processList(line, lists) let [processed, lines] = s:processList(line, lists)
@ -842,20 +989,34 @@ function! vimwiki#Wiki2HTML(path, wikifile) "{{{
if processed && table if processed && table
let table = s:closeTable(table, ldest) let table = s:closeTable(table, ldest)
endif endif
call map(lines, 's:replacePairs(v:val, ''_.\{-}_'', ''<em>'', ''</em>'')') call map(lines, 's:MakeTag(v:val, ''\[\[.\{-}\]\]'', '''', '''', 2, ''s:MakeInternalLink'')')
call map(lines, 's:replacePairs(v:val, ''\*.\{-}\*'', ''<strong>'', ''</strong>'')') call map(lines, 's:MakeTag(v:val, ''\[.\{-}\]'', '''', '''', 1, ''s:MakeExternalLink'')')
call map(lines, 's:processLink(v:val)') call map(lines, 's:MakeTag(v:val, g:vimwiki_rxWeblink, '''', '''', 0, ''s:MakeBareBoneLink'')')
call map(lines, 's:replacePairs(v:val, ''`.\{-}`'', ''<code>'', ''</code>'')') call map(lines, 's:MakeTag(v:val, g:vimwiki_rxWikiWord, '''', '''', 0, ''s:MakeWikiWordLink'')')
call map(lines, 's:MakeTag(v:val, g:vimwiki_rxItalic, ''<em>'', ''</em>'')')
call map(lines, 's:MakeTag(v:val, g:vimwiki_rxBold, ''<strong>'', ''</strong>'')')
call map(lines, 's:MakeTag(v:val, g:vimwiki_rxTodo, ''<span class="todo">'', ''</span>'', 0)')
call map(lines, 's:MakeTag(v:val, g:vimwiki_rxDelText, ''<span class="strike">'', ''</span>'', 2)')
call map(lines, 's:MakeTag(v:val, g:vimwiki_rxSuperScript, ''<sup><small>'', ''</small></sup>'', 1)')
call map(lines, 's:MakeTag(v:val, g:vimwiki_rxSubScript, ''<sub><small>'', ''</small></sub>'', 2)')
call map(lines, 's:MakeTag(v:val, g:vimwiki_rxCode, ''<code>'', ''</code>'')')
call extend(ldest, lines) call extend(ldest, lines)
endif endif
"" table "" table
if !processed if !processed
let [processed, lines, table] = s:processTable(line, table) let [processed, lines, table] = s:processTable(line, table)
call map(lines, 's:replacePairs(v:val, ''_.\{-}_'', ''<em>'', ''</em>'')') call map(lines, 's:MakeTag(v:val, ''\[\[.\{-}\]\]'', '''', '''', 2, ''s:MakeInternalLink'')')
call map(lines, 's:replacePairs(v:val, ''\*.\{-}\*'', ''<strong>'', ''</strong>'')') call map(lines, 's:MakeTag(v:val, ''\[.\{-}\]'', '''', '''', 1, ''s:MakeExternalLink'')')
call map(lines, 's:processLink(v:val)') call map(lines, 's:MakeTag(v:val, g:vimwiki_rxWeblink, '''', '''', 0, ''s:MakeBareBoneLink'')')
call map(lines, 's:replacePairs(v:val, ''`.\{-}`'', ''<code>'', ''</code>'')') call map(lines, 's:MakeTag(v:val, g:vimwiki_rxWikiWord, '''', '''', 0, ''s:MakeWikiWordLink'')')
call map(lines, 's:MakeTag(v:val, g:vimwiki_rxItalic, ''<em>'', ''</em>'')')
call map(lines, 's:MakeTag(v:val, g:vimwiki_rxBold, ''<strong>'', ''</strong>'')')
call map(lines, 's:MakeTag(v:val, g:vimwiki_rxTodo, ''<span class="todo">'', ''</span>'', 0)')
call map(lines, 's:MakeTag(v:val, g:vimwiki_rxDelText, ''<span class="strike">'', ''</span>'', 2)')
call map(lines, 's:MakeTag(v:val, g:vimwiki_rxSuperScript, ''<sup><small>'', ''</small></sup>'', 1)')
call map(lines, 's:MakeTag(v:val, g:vimwiki_rxSubScript, ''<sub><small>'', ''</small></sub>'', 2)')
call map(lines, 's:MakeTag(v:val, g:vimwiki_rxCode, ''<code>'', ''</code>'')')
call extend(ldest, lines) call extend(ldest, lines)
endif endif
@ -881,10 +1042,17 @@ function! vimwiki#Wiki2HTML(path, wikifile) "{{{
"" P "" P
if !processed if !processed
let line = s:replacePairs(line, '_.\{-}_', '<em>', '</em>') let line = s:MakeTag(line, '\[\[.\{-}\]\]', '', '', 2, 's:MakeInternalLink')
let line = s:replacePairs(line, '\*.\{-}\*', '<strong>', '</strong>') let line = s:MakeTag(line, '\[.\{-}\]', '', '', 1, 's:MakeExternalLink')
let line = s:processLink(line) let line = s:MakeTag(line, g:vimwiki_rxWeblink, '', '', 0, 's:MakeBareBoneLink')
let line = s:replacePairs(line, '`.\{-}`', '<code>', '</code>') let line = s:MakeTag(line, g:vimwiki_rxWikiWord, '', '', 0, 's:MakeWikiWordLink')
let line = s:MakeTag(line, g:vimwiki_rxItalic, '<em>', '</em>')
let line = s:MakeTag(line, g:vimwiki_rxBold, '<strong>', '</strong>')
let line = s:MakeTag(line, g:vimwiki_rxTodo, '<span class="todo">', '</span>', 0)
let line = s:MakeTag(line, g:vimwiki_rxDelText, '<span class="strike">', '</span>', 2)
let line = s:MakeTag(line, g:vimwiki_rxSuperScript, '<sup><small>', '</small></sup>', 1)
let line = s:MakeTag(line, g:vimwiki_rxSubScript, '<sub><small>', '</small></sub>', 2)
let line = s:MakeTag(line, g:vimwiki_rxCode, '<code>', '</code>')
let [processed, lines] = s:processP(line) let [processed, lines] = s:processP(line)
if processed && pre if processed && pre
let pre = s:closePre(pre, ldest) let pre = s:closePre(pre, ldest)
@ -921,3 +1089,284 @@ function! vimwiki#Wiki2HTML(path, wikifile) "{{{
endfunction "}}} endfunction "}}}
" 2}}} " 2}}}
syntax\vimwiki.vim [[[1
114
" Vim syntax file
" Language: Wiki
" Author: Maxim Kim (habamax at gmail dot com)
" Home: http://code.google.com/p/vimwiki/
" Filenames: *.wiki
" Last Change: [15.09.2008 - 12:07]
" Version: 0.5
" Quit if syntax file is already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
"" use max highlighting - could be quite slow if there are too many wikifiles
if g:vimwiki_maxhi
" Every WikiWord is nonexistent
execute 'syntax match wikiNoExistsWord /'.g:vimwiki_word1.'/'
execute 'syntax match wikiNoExistsWord /'.g:vimwiki_word2.'/'
" till we find them in g:vimwiki_home
call vimwiki#WikiHighlightWords()
else
" A WikiWord (unqualifiedWikiName)
execute 'syntax match wikiWord /'.g:vimwiki_word1.'/'
" A [[bracketed wiki word]]
execute 'syntax match wikiWord /'.g:vimwiki_word2.'/'
endif
" text: "this is a link (optional tooltip)":http://www.microsoft.com
" TODO: check URL syntax against RFC
let g:vimwiki_rxWeblink = '\("[^"(]\+\((\([^)]\+\))\)\?":\)\?\(https\?\|ftp\|gopher\|telnet\|file\|notes\|ms-help\):\(\(\(//\)\|\(\\\\\)\)\+[A-Za-z0-9:#@%/;$~_?+-=.&\-\\\\]*\)'
execute 'syntax match wikiLink `'.g:vimwiki_rxWeblink.'`'
" Emoticons: must come after the Textilisms, as later rules take precedence
" over earlier ones. This match is an approximation for the ~70 distinct
syntax match wikiEmoticons /\((.)\|:[()|$@]\|:-[DOPS()\]|$@]\|;)\|:'(\)/
let g:vimwiki_rxTodo = '\(TODO:\|DONE:\|FIXME:\|FIXED:\)'
execute 'syntax match wikiTodo /'. g:vimwiki_rxTodo .'/'
" Load concrete Wiki syntax
execute 'runtime! syntax/vimwiki_'.g:vimwiki_syntax.'.vim'
execute 'syntax match wikiBold /'.g:vimwiki_rxBold.'/'
execute 'syntax match wikiItalic /'.g:vimwiki_rxItalic.'/'
execute 'syntax match wikiCode /'.g:vimwiki_rxCode.'/'
execute 'syntax match wikiDelText /'.g:vimwiki_rxDelText.'/'
execute 'syntax match wikiSuperScript /'.g:vimwiki_rxSuperScript.'/'
execute 'syntax match wikiSubScript /'.g:vimwiki_rxSubScript.'/'
" Aggregate all the regular text highlighting into wikiText
syntax cluster wikiText contains=wikiItalic,wikiBold,wikiCode,wikiDelText,wikiSuperScript,wikiSubScript,wikiWord,wikiEmoticons
" Header levels, 1-6
execute 'syntax match wikiH1 /'.g:vimwiki_rxH1.'/'
execute 'syntax match wikiH2 /'.g:vimwiki_rxH2.'/'
execute 'syntax match wikiH3 /'.g:vimwiki_rxH3.'/'
execute 'syntax match wikiH4 /'.g:vimwiki_rxH4.'/'
execute 'syntax match wikiH5 /'.g:vimwiki_rxH5.'/'
execute 'syntax match wikiH6 /'.g:vimwiki_rxH6.'/'
" <hr>, horizontal rule
execute 'syntax match wikiHR /'.g:vimwiki_rxHR.'/'
" Tables. Each line starts and ends with '||'; each cell is separated by '||'
execute 'syntax match wikiTable /'.g:vimwiki_rxTable.'/'
" Bulleted list items start with whitespace(s), then '*'
" syntax match wikiList /^\s\+\(\*\|[1-9]\+0*\.\).*$/ contains=@wikiText
" highlight only bullets and digits.
execute 'syntax match wikiList /'.g:vimwiki_rxListBullet.'/'
execute 'syntax match wikiList /'.g:vimwiki_rxListNumber.'/'
" Treat all other lines that start with spaces as PRE-formatted text.
execute 'syntax match wikiPre /'.g:vimwiki_rxPre1.'/'
hi def link wikiH1 Title
hi def link wikiH2 wikiH1
hi def link wikiH3 wikiH2
hi def link wikiH4 wikiH3
hi def link wikiH5 wikiH4
hi def link wikiH6 wikiH5
hi def link wikiHR wikiH6
hi def wikiBold term=bold cterm=bold gui=bold
hi def wikiItalic term=italic cterm=italic gui=italic
hi def link wikiCode PreProc
hi def link wikiWord Underlined
hi def link wikiNoExistsWord Error
hi def link wikiPre PreProc
hi def link wikiLink Underlined
hi def link wikiList Type
hi def link wikiTable PreProc
hi def link wikiEmoticons Constant
hi def link wikiDelText Comment
hi def link wikiInsText Constant
hi def link wikiSuperScript Constant
hi def link wikiSubScript Constant
hi def link wikiTodo Todo
let b:current_syntax="vimwiki"
syntax\vimwiki_default.vim [[[1
54
" Vim syntax file
" Language: Wiki (vimwiki default)
" Author: Maxim Kim (habamax at gmail dot com)
" Home: http://code.google.com/p/vimwiki/
" Filenames: *.wiki
" Last Change: [15.09.2008 - 12:07]
" Version: 0.5
" text: *strong*
let g:vimwiki_rxBold = '\*[^*]\+\*'
" text: _emphasis_
let g:vimwiki_rxItalic = '_[^_]\+_'
" text: `code`
let g:vimwiki_rxCode = '`[^`]\+`'
" text: ~~deleted text~~
let g:vimwiki_rxDelText = '\~\~[^~]\+\~\~'
" text: ^superscript^
let g:vimwiki_rxSuperScript = '\^[^^]\+\^'
" text: ,,subscript,,
let g:vimwiki_rxSubScript = ',,[^,]\+,,'
" Header levels, 1-6
let g:vimwiki_rxH1 = '^!\{1}.*$'
let g:vimwiki_rxH2 = '^!\{2}.*$'
let g:vimwiki_rxH3 = '^!\{3}.*$'
let g:vimwiki_rxH4 = '^!\{4}.*$'
let g:vimwiki_rxH5 = '^!\{5}.*$'
let g:vimwiki_rxH6 = '^!\{6}.*$'
" <hr>, horizontal rule
let g:vimwiki_rxHR = '^----.*$'
" Tables. Each line starts and ends with '||'; each cell is separated by '||'
let g:vimwiki_rxTable = '||'
" Bulleted list items start with whitespace(s), then '*'
" syntax match wikiList /^\s\+\(\*\|[1-9]\+0*\.\).*$/ contains=@wikiText
" highlight only bullets and digits.
" let g:vimwiki_rxList = '^\s\+\(\*\|#\)'
let g:vimwiki_rxListBullet = '^\s\+\*'
let g:vimwiki_rxListNumber = '^\s\+#'
" Treat all other lines that start with spaces as PRE-formatted text.
let g:vimwiki_rxPre1 = '^\s\+[^[:blank:]*#].*$'
syntax region wikiPre start=/^{{{\s*$/ end=/^}}}\s*$/
syntax sync match wikiPreSync grouphere wikiPre /^{{{\s*$/
" vim:tw=0:
syntax\vimwiki_google.vim [[[1
53
" Vim syntax file
" Language: Wiki
" Author: Maxim Kim (habamax at gmail dot com)
" Home: http://code.google.com/p/vimwiki/
" Filenames: *.wiki
" Last Change: [15.09.2008 - 12:07]
" Version: 0.5
" text: *strong*
let g:vimwiki_rxBold = '\*[^*]\+\*'
" text: _emphasis_
let g:vimwiki_rxItalic = '_[^_]\+_'
" text: `code`
let g:vimwiki_rxCode = '`[^`]\+`'
" text: ~~deleted text~~
let g:vimwiki_rxDelText = '\~\~[^~]\+\~\~'
" text: ^superscript^
let g:vimwiki_rxSuperScript = '\^[^^]\+\^'
" text: ,,subscript,,
let g:vimwiki_rxSubScript = ',,[^,]\+,,'
" Header levels, 1-6
let g:vimwiki_rxH1 = '^\s*=\{1}.*=\{1}\s*$'
let g:vimwiki_rxH2 = '^\s*=\{2}.*=\{2}\s*$'
let g:vimwiki_rxH3 = '^\s*=\{3}.*=\{3}\s*$'
let g:vimwiki_rxH4 = '^\s*=\{4}.*=\{4}\s*$'
let g:vimwiki_rxH5 = '^\s*=\{5}.*=\{5}\s*$'
let g:vimwiki_rxH6 = '^\s*=\{6}.*=\{6}\s*$'
" <hr>, horizontal rule
let g:vimwiki_rxHR = '^----.*$'
" Tables. Each line starts and ends with '||'; each cell is separated by '||'
let g:vimwiki_rxTable = '||'
" Bulleted list items start with whitespace(s), then '*'
" syntax match wikiList /^\s\+\(\*\|[1-9]\+0*\.\).*$/ contains=@wikiText
" highlight only bullets and digits.
let g:vimwiki_rxListBullet = '^\s\+\*'
let g:vimwiki_rxListNumber = '^\s\+#'
" Treat all other lines that start with spaces as PRE-formatted text.
let g:vimwiki_rxPre1 = '^\s\+[^[:blank:]*#].*$'
syntax region wikiPre start=/^{{{\s*$/ end=/^}}}\s*$/
syntax sync match wikiPreSync grouphere wikiPre /^{{{\s*$/
" vim:tw=0:
syntax\vimwiki_media.vim [[[1
52
" Vim syntax file
" Language: Wiki (MediaWiki)
" Author: Maxim Kim (habamax at gmail dot com)
" Home: http://code.google.com/p/vimwiki/
" Filenames: *.wiki
" Last Change: [15.09.2008 - 12:07]
" Version: 0.5
" text: '''strong'''
let g:vimwiki_rxBold = "'''[^']\\+'''"
" text: ''emphasis''
let g:vimwiki_rxItalic = "''[^']\\+''"
" text: `code`
let g:vimwiki_rxCode = '`[^`]\+`'
" text: ~~deleted text~~
let g:vimwiki_rxDelText = '\~\~[^~]\+\~\~'
" text: ^superscript^
let g:vimwiki_rxSuperScript = '\^[^^]\+\^'
" text: ,,subscript,,
let g:vimwiki_rxSubScript = ',,[^,]\+,,'
" Header levels, 1-6
let g:vimwiki_rxH1 = '^\s*=\{1}.\+=\{1}\s*$'
let g:vimwiki_rxH2 = '^\s*=\{2}.\+=\{2}\s*$'
let g:vimwiki_rxH3 = '^\s*=\{3}.\+=\{3}\s*$'
let g:vimwiki_rxH4 = '^\s*=\{4}.\+=\{4}\s*$'
let g:vimwiki_rxH5 = '^\s*=\{5}.\+=\{5}\s*$'
let g:vimwiki_rxH6 = '^\s*=\{6}.\+=\{6}\s*$'
" <hr>, horizontal rule
let g:vimwiki_rxHR = '^----.*$'
" Tables. Each line starts and ends with '||'; each cell is separated by '||'
let g:vimwiki_rxTable = '||'
" Bulleted list items start with whitespace(s), then '*'
" highlight only bullets and digits.
let g:vimwiki_rxListBullet = '^\s*\*\+\([^*]*$\)\@='
let g:vimwiki_rxListNumber = '^\s*#\+'
" Treat all other lines that start with spaces as PRE-formatted text.
let g:vimwiki_rxPre1 = '^\s\+[^[:blank:]*#].*$'
syntax region wikiPre start=/^{{{\s*$/ end=/^}}}\s*$/
syntax sync match wikiPreSync grouphere wikiPre /^{{{\s*$/
" vim:tw=0: