Version 2.0.1.stu
* Follow (i.e. open target of) markdown reference-style links. * Bug fixes.
This commit is contained in:
@ -300,8 +300,10 @@ endfor
|
||||
" }}}
|
||||
|
||||
" concealed chars " {{{
|
||||
let cchar = ''
|
||||
if exists("+conceallevel")
|
||||
syntax conceal on
|
||||
let cchar = ' cchar=~ '
|
||||
endif
|
||||
|
||||
syntax spell toplevel
|
||||
@ -329,9 +331,9 @@ execute 'syn match VimwikiLinkChar /'.g:vimwiki_rxWikiInclPrefix1.'/'.options
|
||||
execute 'syn match VimwikiLinkChar /'.g:vimwiki_rxWikiInclSuffix1.'/'.options
|
||||
|
||||
" A shortener for long URLs: LinkRest (a middle part of the URL) is concealed
|
||||
execute 'syn match VimwikiLinkRest contained `\%(///\=[^/ \t]\+/\)\zs\S\{'
|
||||
execute 'syn match VimwikiLinkRest `\%(///\=[^/ \t]\+/\)\zs\S\{'
|
||||
\.g:vimwiki_url_mingain.',}\ze\%([/#?]\w\|\S\{'
|
||||
\.g:vimwiki_url_maxsave.'}\)` cchar=~ '.options
|
||||
\.g:vimwiki_url_maxsave.'}\)`'.cchar.options
|
||||
|
||||
execute 'syn match VimwikiEqInChar contained /'.g:vimwiki_char_eqin.'/'
|
||||
execute 'syn match VimwikiBoldChar contained /'.g:vimwiki_char_bold.'/'
|
||||
@ -586,12 +588,13 @@ if !empty(nested)
|
||||
\ '^\s*'.g:vimwiki_rxPreStart.'\%(.*[[:blank:][:punct:]]\)\?'.
|
||||
\ hl_syntax.'\%([[:blank:][:punct:]].*\)\?',
|
||||
\ '^\s*'.g:vimwiki_rxPreEnd, 'VimwikiPre')
|
||||
" call vimwiki#base#nested_syntax(vim_syntax,
|
||||
" \ '^\s*{{\$\%(.*[[:blank:][:punct:]]\)\?'.
|
||||
" \ hl_syntax.'\%([[:blank:][:punct:]].*\)\?',
|
||||
" \ '^\s*}}\$', 'VimwikiMath')
|
||||
endfor
|
||||
endif
|
||||
" LaTeX
|
||||
call vimwiki#base#nested_syntax('tex',
|
||||
\ '^\s*'.g:vimwiki_rxMathStart.'\%(.*[[:blank:][:punct:]]\)\?'.
|
||||
\ '\%([[:blank:][:punct:]].*\)\?',
|
||||
\ '^\s*'.g:vimwiki_rxMathEnd, 'VimwikiMath')
|
||||
"}}}
|
||||
|
||||
let timeend = vimwiki#u#time(starttime) "XXX
|
||||
|
@ -83,7 +83,7 @@ let g:vimwiki_rxPreStart = '```'
|
||||
let g:vimwiki_rxPreEnd = '```'
|
||||
|
||||
" Math block
|
||||
let g:vimwiki_rxMathStart = '{{\$'
|
||||
let g:vimwiki_rxMathEnd = '}}\$'
|
||||
let g:vimwiki_rxMathStart = '\$\$'
|
||||
let g:vimwiki_rxMathEnd = '\$\$'
|
||||
|
||||
let g:vimwiki_rxComment = '^\s*%%.*$'
|
||||
|
@ -101,7 +101,6 @@ let g:vimwiki_rxWikiLinkMatchDescr = ''.
|
||||
\ g:vimwiki_rxWikiLink1MatchDescr
|
||||
" }}}
|
||||
|
||||
|
||||
" LINKS: setup of wikiincl regexps {{{
|
||||
" }}}
|
||||
|
||||
@ -182,6 +181,15 @@ let g:vimwiki_rxAnyLink = g:vimwiki_rxWikiLink.'\|'.
|
||||
" }}}
|
||||
|
||||
|
||||
" LINKS: setup wikilink1 reference link definitions {{{
|
||||
let g:vimwiki_rxMkdRef = '\['.g:vimwiki_rxWikiLinkDescr.']:\%(\s\+\|\n\)'.
|
||||
\ g:vimwiki_rxWeblink0
|
||||
let g:vimwiki_rxMkdRefMatchDescr = '\[\zs'.g:vimwiki_rxWikiLinkDescr.'\ze]:\%(\s\+\|\n\)'.
|
||||
\ g:vimwiki_rxWeblink0
|
||||
let g:vimwiki_rxMkdRefMatchUrl = '\['.g:vimwiki_rxWikiLinkDescr.']:\%(\s\+\|\n\)\zs'.
|
||||
\ g:vimwiki_rxWeblink0.'\ze'
|
||||
" }}}
|
||||
|
||||
" }}} end of Links
|
||||
|
||||
" LINKS: highlighting is complicated due to "nonexistent" links feature {{{
|
||||
@ -214,6 +222,11 @@ function! s:wrap_wikilink1_rx(target) "{{{
|
||||
\ g:vimwiki_rxWikiLink1InvalidSuffix
|
||||
endfunction "}}}
|
||||
|
||||
function! s:existing_mkd_refs() "{{{
|
||||
call vimwiki#markdown_base#reset_mkd_refs()
|
||||
return "\n".join(keys(vimwiki#markdown_base#get_reflinks()), "\n")."\n"
|
||||
endfunction "}}}
|
||||
|
||||
function! s:highlight_existing_links() "{{{
|
||||
" Wikilink1
|
||||
" Conditional highlighting that depends on the existence of a wiki file or
|
||||
@ -222,8 +235,11 @@ function! s:highlight_existing_links() "{{{
|
||||
let safe_links = vimwiki#base#file_pattern(b:existing_wikifiles)
|
||||
" Wikilink1 Dirs set up upon BufEnter (see plugin/...)
|
||||
let safe_dirs = vimwiki#base#file_pattern(b:existing_wikidirs)
|
||||
" Ref links are cached
|
||||
let safe_reflinks = vimwiki#base#file_pattern(s:existing_mkd_refs())
|
||||
|
||||
" match [URL]
|
||||
|
||||
" match [URL][]
|
||||
let target = vimwiki#base#apply_template(g:vimwiki_WikiLink1Template1,
|
||||
\ safe_links, g:vimwiki_rxWikiLink1Descr, '')
|
||||
call s:add_target_syntax_ON(s:wrap_wikilink1_rx(target), 'VimwikiWikiLink1')
|
||||
@ -232,7 +248,7 @@ function! s:highlight_existing_links() "{{{
|
||||
\ safe_links, g:vimwiki_rxWikiLink1Descr, '')
|
||||
call s:add_target_syntax_ON(s:wrap_wikilink1_rx(target), 'VimwikiWikiLink1')
|
||||
|
||||
" match [DIRURL]
|
||||
" match [DIRURL][]
|
||||
let target = vimwiki#base#apply_template(g:vimwiki_WikiLink1Template1,
|
||||
\ safe_dirs, g:vimwiki_rxWikiLink1Descr, '')
|
||||
call s:add_target_syntax_ON(s:wrap_wikilink1_rx(target), 'VimwikiWikiLink1')
|
||||
@ -240,6 +256,15 @@ function! s:highlight_existing_links() "{{{
|
||||
let target = vimwiki#base#apply_template(g:vimwiki_WikiLink1Template2,
|
||||
\ safe_dirs, g:vimwiki_rxWikiLink1Descr, '')
|
||||
call s:add_target_syntax_ON(s:wrap_wikilink1_rx(target), 'VimwikiWikiLink1')
|
||||
|
||||
" match [MKDREF][]
|
||||
let target = vimwiki#base#apply_template(g:vimwiki_WikiLink1Template1,
|
||||
\ safe_reflinks, g:vimwiki_rxWikiLink1Descr, '')
|
||||
call s:add_target_syntax_ON(s:wrap_wikilink1_rx(target), 'VimwikiWikiLink1')
|
||||
" match [DESCRIPTION][MKDREF]
|
||||
let target = vimwiki#base#apply_template(g:vimwiki_WikiLink1Template2,
|
||||
\ safe_reflinks, g:vimwiki_rxWikiLink1Descr, '')
|
||||
call s:add_target_syntax_ON(s:wrap_wikilink1_rx(target), 'VimwikiWikiLink1')
|
||||
endfunction "}}}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user