support for numbered lists and much other list stuff

This commit is contained in:
EinfachToll 2013-07-08 11:37:35 +02:00
parent 1c88deeee0
commit 8744a31031
12 changed files with 1373 additions and 568 deletions

View File

@ -1424,8 +1424,7 @@ endfunction " }}}
" arguments rxUrl, rxDesc, and rxStyle are copied verbatim, without any " arguments rxUrl, rxDesc, and rxStyle are copied verbatim, without any
" special character escapes or substitutions. " special character escapes or substitutions.
function! vimwiki#base#apply_template(template, rxUrl, rxDesc, rxStyle) "{{{ function! vimwiki#base#apply_template(template, rxUrl, rxDesc, rxStyle) "{{{
let magic_chars = '.*[\^$' let lnk = vimwiki#u#escape(a:template)
let lnk = escape(a:template, magic_chars)
if a:rxUrl != "" if a:rxUrl != ""
let lnk = substitute(lnk, '__LinkUrl__', '\='."'".a:rxUrl."'", '') let lnk = substitute(lnk, '__LinkUrl__', '\='."'".a:rxUrl."'", '')
endif endif

File diff suppressed because it is too large Load Diff

View File

@ -447,7 +447,7 @@ endfunction "}}}
function! vimwiki#tbl#kbd_cr() "{{{ function! vimwiki#tbl#kbd_cr() "{{{
let lnum = line('.') let lnum = line('.')
if !s:is_table(getline(lnum)) if !s:is_table(getline(lnum))
return "\<CR>" return ""
endif endif
if s:is_separator(getline(lnum+1)) || !s:is_table(getline(lnum+1)) if s:is_separator(getline(lnum+1)) || !s:is_table(getline(lnum+1))
@ -507,9 +507,14 @@ function! vimwiki#tbl#format(lnum, ...) "{{{
endif endif
let indent = s:get_indent(a:lnum) let indent = s:get_indent(a:lnum)
if &expandtab
let indentstring = repeat(' ', indent)
else
let indentstring = repeat(' ', indent / &tabstop) . repeat(' ', indent % &tabstop)
endif
for [lnum, row] in s:get_aligned_rows(a:lnum, col1, col2) for [lnum, row] in s:get_aligned_rows(a:lnum, col1, col2)
let row = repeat(' ', indent).row let row = indentstring.row
call setline(lnum, row) call setline(lnum, row)
endfor endfor

View File

@ -75,3 +75,6 @@ function! vimwiki#u#path_common_pfx(path1, path2) "{{{
endif endif
endfunction "}}} endfunction "}}}
function! vimwiki#u#escape(string) "{{{
return escape(a:string, '.*[]\^$')
endfunction "}}}

View File

@ -1702,14 +1702,23 @@ Default: 0
Checked list items can be highlighted with a color: Checked list items can be highlighted with a color:
* [X] the whole line can be highlighted with the option set to 1. * [X] the whole line can be highlighted with the option set to 1.
* this line is highlighted as well with the option set to 2
* [ ] I wish vim could use strikethru. * [ ] I wish vim could use strikethru.
Value Description~ Value Description~
1 Highlight checked [X] check box with |group-name| "Comment". 0 Don't highlight anything.
0 Don't. 1 Highlight checked [X] list item with |group-name| "Comment".
2 Highlight checked [X] list item and all its child items.
Default: 0 Default: 0
Note: Option 2 does not work perfectly. Specifically, it might break on
preformatted text or if you mix tabs and spaces for indenting, and indented
headers will erroneously be highlighted.
Furthermore, if your list is long, Vim's highlight can break. Consider putting
>
au BufEnter file.wiki :syntax sync fromstart
in your .vimrc
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*g:vimwiki_global_ext* *g:vimwiki_global_ext*
@ -1786,12 +1795,15 @@ Default: 'Vimwiki'
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*g:vimwiki_listsyms* *g:vimwiki_listsyms*
String of 5 symbols for list items with checkboxes. List of 5 symbols for list items with checkboxes.
Default value is ' .oOX'. Default value is [' ', '.', 'o', 'O', 'X'].
g:vimwiki_listsyms[0] is for 0% done items. g:vimwiki_listsyms[0] is for 0% done items.
g:vimwiki_listsyms[4] is for 100% done items. g:vimwiki_listsyms[4] is for 100% done items.
You can set it to some more fancy symbols like this:
let g:vimwiki_listsyms = ['✗', '○', '◐', '●', '✓']
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*g:vimwiki_use_mouse* *g:vimwiki_use_mouse*

View File

@ -11,7 +11,7 @@ let b:did_ftplugin = 1 " Don't load another plugin for this buffer
" UNDO list {{{ " UNDO list {{{
" Reset the following options to undo this plugin. " Reset the following options to undo this plugin.
let b:undo_ftplugin = "setlocal ". let b:undo_ftplugin = "setlocal ".
\ "suffixesadd< isfname< comments< ". \ "suffixesadd< isfname< formatlistpat< ".
\ "formatoptions< foldtext< ". \ "formatoptions< foldtext< ".
\ "foldmethod< foldexpr< commentstring< " \ "foldmethod< foldexpr< commentstring< "
" UNDO }}} " UNDO }}}
@ -32,29 +32,69 @@ setlocal isfname-=[,]
" gf}}} " gf}}}
" Autocreate list items {{{ " Autocreate list items {{{
" for list items, and list items with checkboxes " for bulleted and numbered list items, and list items with checkboxes
setlocal formatoptions+=tnro setlocal autoindent
setlocal formatoptions-=cq setlocal nosmartindent
setlocal nocindent
setlocal comments=""
setlocal formatoptions-=c
setlocal formatoptions-=r
setlocal formatoptions-=o
setlocal formatoptions-=2
setlocal formatoptions+=n
if VimwikiGet('syntax') == 'default' if VimwikiGet('syntax') == 'default'
setl comments=b:*,b:#,b:- "1 means multiple bullets, like * ** ***
setl formatlistpat=^\\s*[*#-]\\s* let g:vimwiki_bullet_points = { '-':0, '*':1, '#':1 , '◆':1}
let g:vimwiki_bullet_numbers = ['1iIaA', '.)]']
"this should contain at least one element
"it is used for i_<C-A> among other things
let g:vimwiki_list_markers = ['-', '#', '◆', '1.', 'i)', 'a)']
elseif VimwikiGet('syntax') == 'markdown' elseif VimwikiGet('syntax') == 'markdown'
setlocal comments=fb:*,fb:-,fb:+,nb:> commentstring=\ >\ %s let g:vimwiki_bullet_points = { '-':0, '*':0, '+':0 }
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+j let g:vimwiki_bullet_numbers = ['1', '.']
else let g:vimwiki_list_markers = ['-', '*', '+', '1.']
setl comments=n:*,n:# else "media
"better leave this as it is, because media syntax is special
let g:vimwiki_bullet_points = { '*':1, '#':1 }
let g:vimwiki_bullet_numbers = ['', '']
let g:vimwiki_list_markers = ['*', '#']
endif endif
let g:vimwiki_rxListBullet = join( map(keys(g:vimwiki_bullet_points), 'vimwiki#u#escape(v:val) . repeat("\\+", g:vimwiki_bullet_points[v:val])') , '\|')
"create regex for numbered list
if g:vimwiki_bullet_numbers[0] == ''
"regex that matches nothing
let g:vimwiki_rxListNumber = '$^'
else
let s:char_to_rx = {'1': '\d\+', 'i': '[ivxlcdm]\+', 'I': '[IVXLCDM]\+', 'a': '\l\{1,3}', 'A': '\u\{1,3}'}
let g:vimwiki_rxListNumber = '\C\%(' . join( map(split(g:vimwiki_bullet_numbers[0], '.\zs'), "s:char_to_rx[v:val]"), '\|').'\)'
let g:vimwiki_rxListNumber .= '['.vimwiki#u#escape(g:vimwiki_bullet_numbers[1]).']'
endif
if VimwikiGet('syntax') == 'default' || VimwikiGet('syntax') == 'markdown'
let g:vimwiki_rxListItemAndChildren = '^\(\s*\)\%('.g:vimwiki_rxListBullet.'\|'.g:vimwiki_rxListNumber.'\)\s\+\['.g:vimwiki_listsyms[4].'\]\s.*\%(\n\%(\1\s.*\|^$\)\)*'
else
let g:vimwiki_rxListItemAndChildren = '^\('.g:vimwiki_rxListBullet.'\)\s\+\['.g:vimwiki_listsyms[4].'\]\s.*\%(\n\%(\1\%('.g:vimwiki_rxListBullet.'\).*\|^$\|^\s.*\)\)*'
endif
"Create 'formatlistpat'
let &formatlistpat = vimwiki#lst#get_list_item_rx(1)
if !empty(&langmap) if !empty(&langmap)
" Valid only if langmap is a comma separated pairs of chars " Valid only if langmap is a comma separated pairs of chars
let l_o = matchstr(&langmap, '\C,\zs.\zeo,') let l_o = matchstr(&langmap, '\C,\zs.\zeo,')
if l_o if l_o
exe 'nnoremap <buffer> '.l_o.' :call vimwiki#lst#kbd_oO("o")<CR>a' exe 'nnoremap <buffer> '.l_o.' :call vimwiki#lst#kbd_o()<CR>a'
endif endif
let l_O = matchstr(&langmap, '\C,\zs.\zeO,') let l_O = matchstr(&langmap, '\C,\zs.\zeO,')
if l_O if l_O
exe 'nnoremap <buffer> '.l_O.' :call vimwiki#lst#kbd_oO("O")<CR>a' exe 'nnoremap <buffer> '.l_O.' :call vimwiki#lst#kbd_O()<CR>a'
endif endif
endif endif
@ -277,7 +317,7 @@ command! -buffer -nargs=? VimwikiNormalizeLink call vimwiki#base#normalize_link(
command! -buffer VimwikiTabnewLink call vimwiki#base#follow_link('tabnew') command! -buffer VimwikiTabnewLink call vimwiki#base#follow_link('tabnew')
command! -buffer -range VimwikiToggleListItem call vimwiki#lst#ToggleListItem(<line1>, <line2>) command! -buffer -range VimwikiToggleCheckbox call vimwiki#lst#toggle_cb(<line1>, <line2>)
command! -buffer VimwikiGenerateLinks call vimwiki#base#generate_links() command! -buffer VimwikiGenerateLinks call vimwiki#base#generate_links()
@ -294,7 +334,12 @@ command! -buffer -nargs=1 VimwikiGoto call vimwiki#base#goto("<args>")
" list commands " list commands
command! -buffer -nargs=* VimwikiListChangeLevel call vimwiki#lst#change_level(<f-args>) command! -buffer -range -nargs=1 VimwikiListChangeMarker call vimwiki#lst#change_marker(<line1>, <line2>, <f-args>)
command! -buffer -nargs=1 VimwikiListChangeMarkerInList call vimwiki#lst#change_marker_in_list(<f-args>)
command! -buffer -nargs=+ VimwikiListLineBreak call <SID>CR(<f-args>)
command! -buffer -range -nargs=1 VimwikiListIncreaseLvl call vimwiki#lst#change_level(<line1>, <line2>, 'increase', <f-args>)
command! -buffer -range -nargs=1 VimwikiListDecreaseLvl call vimwiki#lst#change_level(<line1>, <line2>, 'decrease', <f-args>)
command! -buffer -range VimwikiListRemoveCB call vimwiki#lst#remove_cb(<line1>, <line2>)
" table commands " table commands
command! -buffer -nargs=* VimwikiTable call vimwiki#tbl#create(<f-args>) command! -buffer -nargs=* VimwikiTable call vimwiki#tbl#create(<f-args>)
@ -405,15 +450,18 @@ endif
nnoremap <silent><script><buffer> nnoremap <silent><script><buffer>
\ <Plug>VimwikiRenameLink :VimwikiRenameLink<CR> \ <Plug>VimwikiRenameLink :VimwikiRenameLink<CR>
if !hasmapto('<Plug>VimwikiToggleListItem') if !hasmapto('<Plug>VimwikiToggleCheckbox')
nmap <silent><buffer> <C-Space> <Plug>VimwikiToggleListItem nmap <silent><buffer> <C-Space> <Plug>VimwikiToggleCheckbox
vmap <silent><buffer> <C-Space> <Plug>VimwikiToggleListItem vmap <silent><buffer> <C-Space> <Plug>VimwikiToggleCheckbox
if has("unix") if has("unix")
nmap <silent><buffer> <C-@> <Plug>VimwikiToggleListItem nmap <silent><buffer> <C-@> <Plug>VimwikiToggleCheckbox
vmap <silent><buffer> <C-@> <Plug>VimwikiToggleCheckbox
endif endif
endif endif
nnoremap <silent><script><buffer> nnoremap <silent><script><buffer>
\ <Plug>VimwikiToggleListItem :VimwikiToggleListItem<CR> \ <Plug>VimwikiToggleCheckbox :VimwikiToggleCheckbox<CR>
vnoremap <silent><script><buffer>
\ <Plug>VimwikiToggleCheckbox :VimwikiToggleCheckbox<CR>
if !hasmapto('<Plug>VimwikiDiaryNextDay') if !hasmapto('<Plug>VimwikiDiaryNextDay')
nmap <silent><buffer> <C-Down> <Plug>VimwikiDiaryNextDay nmap <silent><buffer> <C-Down> <Plug>VimwikiDiaryNextDay
@ -427,42 +475,67 @@ endif
nnoremap <silent><script><buffer> nnoremap <silent><script><buffer>
\ <Plug>VimwikiDiaryPrevDay :VimwikiDiaryPrevDay<CR> \ <Plug>VimwikiDiaryPrevDay :VimwikiDiaryPrevDay<CR>
function! s:CR() "{{{ function! s:CR(normal, just_mrkr) "{{{
let res = vimwiki#lst#kbd_cr() if g:vimwiki_table_mappings
if res == "\<CR>" && g:vimwiki_table_mappings
let res = vimwiki#tbl#kbd_cr() let res = vimwiki#tbl#kbd_cr()
if res != ""
exe "normal! " . res . "\<Right>"
return
endif
endif endif
return res call vimwiki#lst#kbd_cr(a:normal, a:just_mrkr)
endfunction "}}} endfunction "}}}
" List and Table <CR> mapping
inoremap <buffer> <expr> <CR> <SID>CR()
" List mappings " List mappings
nnoremap <buffer> o :<C-U>call vimwiki#lst#kbd_oO('o')<CR> inoremap <buffer> <CR> <Esc>:VimwikiListLineBreak 1 5<CR>
nnoremap <buffer> O :<C-U>call vimwiki#lst#kbd_oO('O')<CR> inoremap <buffer> <S-CR> <Esc>:VimwikiListLineBreak 2 2<CR>
nnoremap <buffer> gll :VimwikiListChangeLevel <<<CR> nnoremap <silent> <buffer> o :call vimwiki#lst#kbd_o()<CR>
nnoremap <buffer> glm :VimwikiListChangeLevel >><CR> nnoremap <silent> <buffer> O :call vimwiki#lst#kbd_O()<CR>
nnoremap <buffer> gl* :VimwikiListChangeLevel *<CR> map <silent> <buffer> glh :VimwikiListDecreaseLvl 0<CR>
nnoremap <buffer> gl8 :VimwikiListChangeLevel *<CR> map <silent> <buffer> gll :VimwikiListIncreaseLvl 0<CR>
if VimwikiGet('syntax') == 'default' map <silent> <buffer> gLh :VimwikiListDecreaseLvl 1<CR>
nnoremap <buffer> gl- :VimwikiListChangeLevel -<CR> map <silent> <buffer> gLl :VimwikiListIncreaseLvl 1<CR>
nnoremap <buffer> gl# :VimwikiListChangeLevel #<CR> map <silent> <buffer> gLH glH
nnoremap <buffer> gl3 :VimwikiListChangeLevel #<CR> map <silent> <buffer> gLL gLl
elseif VimwikiGet('syntax') == 'markdown' inoremap <buffer> <C-D> <C-O>:VimwikiListDecreaseLvl 0<CR>
nnoremap <buffer> gl- :VimwikiListChangeLevel -<CR> inoremap <buffer> <C-T> <C-O>:VimwikiListIncreaseLvl 0<CR>
nnoremap <buffer> gl1 :VimwikiListChangeLevel 1.<CR> inoremap <buffer> <C-A> <C-O>:VimwikiListChangeMarker next<CR>
elseif VimwikiGet('syntax') == 'media' inoremap <buffer> <C-S> <C-O>:VimwikiListChangeMarker prev<CR>
nnoremap <buffer> gl# :VimwikiListChangeLevel #<CR> nmap <silent> <buffer> glr :call vimwiki#lst#adjust_numbered_list()<CR>
nnoremap <buffer> gl3 :VimwikiListChangeLevel #<CR> nmap <silent> <buffer> gLr :call vimwiki#lst#adjust_whole_buffer()<CR>
endif nmap <silent> <buffer> gLR gLr
noremap <silent> <buffer> gl<Space> :VimwikiListRemoveCB<CR>
map <silent> <buffer> gL<Space> :call vimwiki#lst#remove_cb_in_list()<CR>
inoremap <silent> <buffer> <C-B> <Esc>:call vimwiki#lst#toggle_list_item()<CR>
for s:k in keys(g:vimwiki_bullet_points)
exe 'noremap <silent> <buffer> gl'.s:k.' :VimwikiListChangeMarker '.s:k.'<CR>'
exe 'noremap <silent> <buffer> gL'.s:k.' :VimwikiListChangeMarkerInList '.s:k.'<CR>'
endfor
for s:a in split(g:vimwiki_bullet_numbers[0], '.\zs')
let chars = split(g:vimwiki_bullet_numbers[1], '.\zs')
if len(chars) == 0
exe 'noremap <silent> <buffer> gl'.s:a.' :VimwikiListChangeMarker '.s:a.'<CR>'
exe 'noremap <silent> <buffer> gL'.s:a.' :VimwikiListChangeMarkerInList '.s:a.'<CR>'
elseif len(chars) == 1
exe 'noremap <silent> <buffer> gl'.s:a.' :VimwikiListChangeMarker '.s:a.chars[0].'<CR>'
exe 'noremap <silent> <buffer> gL'.s:a.' :VimwikiListChangeMarkerInList '.s:a.chars[0].'<CR>'
else
for s:b in chars
exe 'noremap <silent> <buffer> gl'.s:a.s:b.' :VimwikiListChangeMarker '.s:a.s:b.'<CR>'
exe 'noremap <silent> <buffer> gL'.s:a.s:b.' :VimwikiListChangeMarkerInList '.s:a.s:b.'<CR>'
endfor
endif
endfor
"Table mappings
if g:vimwiki_table_mappings
inoremap <expr> <buffer> <Tab> vimwiki#tbl#kbd_tab()
inoremap <expr> <buffer> <S-Tab> vimwiki#tbl#kbd_shift_tab()
endif
" Table mappings
if g:vimwiki_table_mappings
inoremap <expr> <buffer> <Tab> vimwiki#tbl#kbd_tab()
inoremap <expr> <buffer> <S-Tab> vimwiki#tbl#kbd_shift_tab()
endif
nnoremap <buffer> gqq :VimwikiTableAlignQ<CR> nnoremap <buffer> gqq :VimwikiTableAlignQ<CR>
nnoremap <buffer> gww :VimwikiTableAlignW<CR> nnoremap <buffer> gww :VimwikiTableAlignW<CR>

View File

@ -392,7 +392,7 @@ call s:default('ext2syntax', {}) " syntax map keyed on extension
call s:default('hl_headers', 0) call s:default('hl_headers', 0)
call s:default('hl_cb_checked', 0) call s:default('hl_cb_checked', 0)
call s:default('list_ignore_newline', 1) call s:default('list_ignore_newline', 1)
call s:default('listsyms', ' .oOX') call s:default('listsyms', [' ', '.', 'o', 'O', 'X'])
call s:default('use_calendar', 1) call s:default('use_calendar', 1)
call s:default('table_mappings', 1) call s:default('table_mappings', 1)
call s:default('table_auto_fmt', 1) call s:default('table_auto_fmt', 1)

View File

@ -49,9 +49,6 @@ execute 'runtime! syntax/vimwiki_'.VimwikiGet('syntax').'.vim'
" ------------------------------------------------------------------------- " -------------------------------------------------------------------------
let time0 = vimwiki#u#time(starttime) "XXX let time0 = vimwiki#u#time(starttime) "XXX
let g:vimwiki_rxListItem = '\('.
\ g:vimwiki_rxListBullet.'\|'.g:vimwiki_rxListNumber.
\ '\)'
" LINKS: setup of larger regexes {{{ " LINKS: setup of larger regexes {{{
@ -67,12 +64,11 @@ let g:vimwiki_WikiLinkTemplate2 = g:vimwiki_rxWikiLinkPrefix . '__LinkUrl__'.
\ g:vimwiki_rxWikiLinkSeparator. '__LinkDescription__'. \ g:vimwiki_rxWikiLinkSeparator. '__LinkDescription__'.
\ g:vimwiki_rxWikiLinkSuffix \ g:vimwiki_rxWikiLinkSuffix
" "
let magic_chars = '.*[]\^$'
let valid_chars = '[^\\\]]' let valid_chars = '[^\\\]]'
let g:vimwiki_rxWikiLinkPrefix = escape(g:vimwiki_rxWikiLinkPrefix, magic_chars) let g:vimwiki_rxWikiLinkPrefix = vimwiki#u#escape(g:vimwiki_rxWikiLinkPrefix)
let g:vimwiki_rxWikiLinkSuffix = escape(g:vimwiki_rxWikiLinkSuffix, magic_chars) let g:vimwiki_rxWikiLinkSuffix = vimwiki#u#escape(g:vimwiki_rxWikiLinkSuffix)
let g:vimwiki_rxWikiLinkSeparator = escape(g:vimwiki_rxWikiLinkSeparator, magic_chars) let g:vimwiki_rxWikiLinkSeparator = vimwiki#u#escape(g:vimwiki_rxWikiLinkSeparator)
let g:vimwiki_rxWikiLinkUrl = valid_chars.'\{-}' let g:vimwiki_rxWikiLinkUrl = valid_chars.'\{-}'
let g:vimwiki_rxWikiLinkDescr = valid_chars.'\{-}' let g:vimwiki_rxWikiLinkDescr = valid_chars.'\{-}'
@ -116,9 +112,9 @@ let g:vimwiki_WikiInclTemplate2 = g:vimwiki_rxWikiInclPrefix . '__LinkUrl__'.
let valid_chars = '[^\\\}]' let valid_chars = '[^\\\}]'
let g:vimwiki_rxWikiInclPrefix = escape(g:vimwiki_rxWikiInclPrefix, magic_chars) let g:vimwiki_rxWikiInclPrefix = vimwiki#u#escape(g:vimwiki_rxWikiInclPrefix)
let g:vimwiki_rxWikiInclSuffix = escape(g:vimwiki_rxWikiInclSuffix, magic_chars) let g:vimwiki_rxWikiInclSuffix = vimwiki#u#escape(g:vimwiki_rxWikiInclSuffix)
let g:vimwiki_rxWikiInclSeparator = escape(g:vimwiki_rxWikiInclSeparator, magic_chars) let g:vimwiki_rxWikiInclSeparator = vimwiki#u#escape(g:vimwiki_rxWikiInclSeparator)
let g:vimwiki_rxWikiInclUrl = valid_chars.'\{-}' let g:vimwiki_rxWikiInclUrl = valid_chars.'\{-}'
let g:vimwiki_rxWikiInclArg = valid_chars.'\{-}' let g:vimwiki_rxWikiInclArg = valid_chars.'\{-}'
let g:vimwiki_rxWikiInclArgs = '\%('. g:vimwiki_rxWikiInclSeparator. g:vimwiki_rxWikiInclArg. '\)'.'\{-}' let g:vimwiki_rxWikiInclArgs = '\%('. g:vimwiki_rxWikiInclSeparator. g:vimwiki_rxWikiInclArg. '\)'.'\{-}'
@ -406,24 +402,19 @@ syntax match VimwikiCellSeparator
\ /\%(|\)\|\%(-\@<=+\-\@=\)\|\%([|+]\@<=-\+\)/ contained \ /\%(|\)\|\%(-\@<=+\-\@=\)\|\%([|+]\@<=-\+\)/ contained
" List items " List items
execute 'syntax match VimwikiList /'.g:vimwiki_rxListBullet.'/' execute 'syntax match VimwikiList /'.vimwiki#lst#get_list_item_rx(0).'/'
execute 'syntax match VimwikiList /'.g:vimwiki_rxListNumber.'/'
execute 'syntax match VimwikiList /'.g:vimwiki_rxListDefine.'/' execute 'syntax match VimwikiList /'.g:vimwiki_rxListDefine.'/'
" List item checkbox execute 'syntax match VimwikiListTodo /'.vimwiki#lst#get_list_item_rx(1).'/'
"syntax match VimwikiCheckBox /\[.\?\]/
let g:vimwiki_rxCheckBox = '\s*\[['.g:vimwiki_listsyms.']\?\]\s' if g:vimwiki_hl_cb_checked == 1
" Todo lists have a checkbox execute 'syntax match VimwikiCheckBoxDone /'.vimwiki#lst#get_list_item_rx(0).'\s*\['.g:vimwiki_listsyms[4].'\]\s.*$/ '.
execute 'syntax match VimwikiListTodo /'.g:vimwiki_rxListBullet.g:vimwiki_rxCheckBox.'/' \ 'contains=VimwikiNoExistsLink,VimwikiLink,@Spell'
execute 'syntax match VimwikiListTodo /'.g:vimwiki_rxListNumber.g:vimwiki_rxCheckBox.'/'
if g:vimwiki_hl_cb_checked elseif g:vimwiki_hl_cb_checked == 2
execute 'syntax match VimwikiCheckBoxDone /'. execute 'syntax match VimwikiCheckBoxDone /'.g:vimwiki_rxListItemAndChildren.'/ contains=VimwikiNoExistsLink,VimwikiLink,@Spell'
\ g:vimwiki_rxListBullet.'\s*\['.g:vimwiki_listsyms[4].'\]\s.*$/'.
\ ' contains=VimwikiNoExistsLink,VimwikiLink'
execute 'syntax match VimwikiCheckBoxDone /'.
\ g:vimwiki_rxListNumber.'\s*\['.g:vimwiki_listsyms[4].'\]\s.*$/'.
\ ' contains=VimwikiNoExistsLink,VimwikiLink'
endif endif
execute 'syntax match VimwikiEqIn /'.g:vimwiki_rxEqIn.'/ contains=VimwikiEqInChar' execute 'syntax match VimwikiEqIn /'.g:vimwiki_rxEqIn.'/ contains=VimwikiEqInChar'
execute 'syntax match VimwikiEqInT /'.g:vimwiki_rxEqIn.'/ contained contains=VimwikiEqInCharT' execute 'syntax match VimwikiEqInT /'.g:vimwiki_rxEqIn.'/ contained contains=VimwikiEqInCharT'

View File

@ -72,10 +72,6 @@ let g:vimwiki_rxHR = '^-----*$'
" Tables. Each line starts and ends with '|'; each cell is separated by '|' " Tables. Each line starts and ends with '|'; each cell is separated by '|'
let g:vimwiki_rxTableSep = '|' let g:vimwiki_rxTableSep = '|'
" List items start with optional whitespace(s) then '* ' or '# '
let g:vimwiki_rxListBullet = '^\s*[*-]\s'
let g:vimwiki_rxListNumber = '^\s*#\s'
let g:vimwiki_rxListDefine = '::\(\s\|$\)' let g:vimwiki_rxListDefine = '::\(\s\|$\)'
" Preformatted text " Preformatted text

View File

@ -72,10 +72,6 @@ let g:vimwiki_rxHR = '^-----*$'
" Tables. Each line starts and ends with '|'; each cell is separated by '|' " Tables. Each line starts and ends with '|'; each cell is separated by '|'
let g:vimwiki_rxTableSep = '|' let g:vimwiki_rxTableSep = '|'
" List items start with optional whitespace(s) then '* ' or '1. ', '2. ', etc.
let g:vimwiki_rxListBullet = '^\s*[*+-]\s'
let g:vimwiki_rxListNumber = '^\s*[0-9]\+\.\s'
let g:vimwiki_rxListDefine = '::\%(\s\|$\)' let g:vimwiki_rxListDefine = '::\%(\s\|$\)'
" Preformatted text " Preformatted text

View File

@ -42,12 +42,11 @@ let g:vimwiki_WikiLink1Template2 = g:vimwiki_rxWikiLink1Prefix . '__LinkDescript
\ g:vimwiki_rxWikiLink1Separator. '__LinkUrl__'. \ g:vimwiki_rxWikiLink1Separator. '__LinkUrl__'.
\ g:vimwiki_rxWikiLink1Suffix \ g:vimwiki_rxWikiLink1Suffix
" "
let magic_chars = '.*[]\^$'
let valid_chars = '[^\\\[\]]' let valid_chars = '[^\\\[\]]'
let g:vimwiki_rxWikiLink1Prefix = escape(g:vimwiki_rxWikiLink1Prefix, magic_chars) let g:vimwiki_rxWikiLink1Prefix = vimwiki#u#escape(g:vimwiki_rxWikiLink1Prefix)
let g:vimwiki_rxWikiLink1Suffix = escape(g:vimwiki_rxWikiLink1Suffix, magic_chars) let g:vimwiki_rxWikiLink1Suffix = vimwiki#u#escape(g:vimwiki_rxWikiLink1Suffix)
let g:vimwiki_rxWikiLink1Separator = escape(g:vimwiki_rxWikiLink1Separator, magic_chars) let g:vimwiki_rxWikiLink1Separator = vimwiki#u#escape(g:vimwiki_rxWikiLink1Separator)
let g:vimwiki_rxWikiLink1Url = valid_chars.'\{-}' let g:vimwiki_rxWikiLink1Url = valid_chars.'\{-}'
let g:vimwiki_rxWikiLink1Descr = valid_chars.'\{-}' let g:vimwiki_rxWikiLink1Descr = valid_chars.'\{-}'
@ -125,12 +124,11 @@ let g:vimwiki_Weblink1Template = g:vimwiki_rxWeblink1Prefix . '__LinkDescription
\ g:vimwiki_rxWeblink1Separator. '__LinkUrl__'. \ g:vimwiki_rxWeblink1Separator. '__LinkUrl__'.
\ g:vimwiki_rxWeblink1Suffix \ g:vimwiki_rxWeblink1Suffix
let magic_chars = '.*[]\^$'
let valid_chars = '[^\\]' let valid_chars = '[^\\]'
let g:vimwiki_rxWeblink1Prefix = escape(g:vimwiki_rxWeblink1Prefix, magic_chars) let g:vimwiki_rxWeblink1Prefix = vimwiki#u#escape(g:vimwiki_rxWeblink1Prefix)
let g:vimwiki_rxWeblink1Suffix = escape(g:vimwiki_rxWeblink1Suffix, magic_chars) let g:vimwiki_rxWeblink1Suffix = vimwiki#u#escape(g:vimwiki_rxWeblink1Suffix)
let g:vimwiki_rxWeblink1Separator = escape(g:vimwiki_rxWeblink1Separator, magic_chars) let g:vimwiki_rxWeblink1Separator = vimwiki#u#escape(g:vimwiki_rxWeblink1Separator)
let g:vimwiki_rxWeblink1Url = valid_chars.'\{-}' let g:vimwiki_rxWeblink1Url = valid_chars.'\{-}'
let g:vimwiki_rxWeblink1Descr = valid_chars.'\{-}' let g:vimwiki_rxWeblink1Descr = valid_chars.'\{-}'

View File

@ -53,11 +53,6 @@ let g:vimwiki_rxHR = '^-----*$'
" Tables. Each line starts and ends with '|'; each cell is separated by '|' " Tables. Each line starts and ends with '|'; each cell is separated by '|'
let g:vimwiki_rxTableSep = '|' let g:vimwiki_rxTableSep = '|'
" Bulleted list items start with whitespace(s), then '*'
" highlight only bullets and digits.
let g:vimwiki_rxListBullet = '^\s*\*\+\s\%([^*]*$\)\@='
let g:vimwiki_rxListNumber = '^\s*#\+\s'
let g:vimwiki_rxListDefine = '^\%(;\|:\)\s' let g:vimwiki_rxListDefine = '^\%(;\|:\)\s'
" Preformatted text " Preformatted text