From ab36532f754de9dd530eeeaf70b8f437c39fda36 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Thu, 5 Jun 2014 09:42:59 +0200 Subject: [PATCH 001/370] Tables can now be embedded in lists Solves #50 --- autoload/vimwiki/html.vim | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/autoload/vimwiki/html.vim b/autoload/vimwiki/html.vim index 71bd126..6e1c0cd 100644 --- a/autoload/vimwiki/html.vim +++ b/autoload/vimwiki/html.vim @@ -1165,6 +1165,14 @@ function! s:parse_line(line, state) " {{{ endif "}}} + " tables "{{{ + if !processed + let [processed, lines, state.table] = s:process_tag_table(line, + \ state.table, state.header_ids) + call extend(res_lines, lines) + endif + "}}} + " lists "{{{ if !processed let [processed, lines] = s:process_tag_list(line, state.lists) @@ -1212,14 +1220,6 @@ function! s:parse_line(line, state) " {{{ endif "}}} - " tables "{{{ - if !processed - let [processed, lines, state.table] = s:process_tag_table(line, - \ state.table, state.header_ids) - call extend(res_lines, lines) - endif - "}}} - " quotes "{{{ if !processed let [processed, lines, state.quote] = s:process_tag_quote(line, state.quote) From d33c64f7918b397c8cc191e7a5a486703f8b50be Mon Sep 17 00:00:00 2001 From: Aaron Franks Date: Sat, 7 Jun 2014 21:21:25 -0700 Subject: [PATCH 002/370] Fix ww text in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3d6a564..0e88cf2 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ With vimwiki you can: * manage todo-lists; * write documentation. -To do a quick start press ww (this is usually \ww) to go to your index +To do a quick start press `ww` (this is usually `\ww`) to go to your index wiki file. By default it is located in: ~/vimwiki/index.wiki From 4a04fc7519cedcf434a4665cd3c9aae401606866 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Thu, 19 Jun 2014 15:36:11 +0200 Subject: [PATCH 003/370] Recognize markdown links when renaming wiki file Fix #52 --- autoload/vimwiki/base.vim | 24 +++++++++-------------- syntax/vimwiki.vim | 31 +++++++++++++++++------------- syntax/vimwiki_markdown_custom.vim | 23 +++++++++++++++------- 3 files changed, 43 insertions(+), 35 deletions(-) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index ec4ae0b..0fec726 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -581,10 +581,8 @@ endfunction "}}} " vimwiki#base#backlinks function! vimwiki#base#backlinks() "{{{ let filename = expand("%:t:r") - let rx_wikilink = vimwiki#base#apply_template(g:vimwiki_WikiLinkTemplate1, - \ '\zs'.filename.'\ze\%(#.*\)\?', '.*', ''). - \ '\|'. vimwiki#base#apply_template(g:vimwiki_WikiLinkTemplate2, - \ '\zs'.filename.'\ze\%(#.*\)\?', '.*', '') + let rx_wikilink = vimwiki#base#apply_template( + \ g:vimwiki_WikiLinkMatchUrlTemplate, filename, '', '') execute 'lvimgrep "\C'.rx_wikilink.'" '. \ escape(VimwikiGet('path').'**/*'.VimwikiGet('ext'), ' ') endfunction "}}} @@ -821,17 +819,13 @@ endfunction " }}} function! s:update_wiki_links_dir(dir, old_fname, new_fname) " {{{ let old_fname = substitute(a:old_fname, '[/\\]', '[/\\\\]', 'g') let new_fname = a:new_fname - let old_fname_r = old_fname - let new_fname_r = new_fname - let old_fname_r = vimwiki#base#apply_template(g:vimwiki_WikiLinkTemplate1, - \ '\zs'.old_fname.'\ze\%(#.*\)\?', '.*', ''). - \ '\|'. vimwiki#base#apply_template(g:vimwiki_WikiLinkTemplate2, - \ '\zs'.old_fname.'\ze\%(#.*\)\?', '.*', '') + let old_fname_r = vimwiki#base#apply_template( + \ g:vimwiki_WikiLinkMatchUrlTemplate, old_fname, '', '') let files = split(glob(VimwikiGet('path').a:dir.'*'.VimwikiGet('ext')), '\n') for fname in files - call s:update_wiki_link(fname, old_fname_r, new_fname_r) + call s:update_wiki_link(fname, old_fname_r, new_fname) endfor endfunction " }}} @@ -1587,15 +1581,15 @@ endfunction " arguments rxUrl, rxDesc, and rxStyle are copied verbatim, without any " special character escapes or substitutions. function! vimwiki#base#apply_template(template, rxUrl, rxDesc, rxStyle) "{{{ - let lnk = vimwiki#u#escape(a:template) + let lnk = a:template if a:rxUrl != "" - let lnk = substitute(lnk, '__LinkUrl__', '\='."'".a:rxUrl."'", '') + let lnk = substitute(lnk, '__LinkUrl__', '\='."'".a:rxUrl."'", 'g') endif if a:rxDesc != "" - let lnk = substitute(lnk, '__LinkDescription__', '\='."'".a:rxDesc."'", '') + let lnk = substitute(lnk, '__LinkDescription__', '\='."'".a:rxDesc."'", 'g') endif if a:rxStyle != "" - let lnk = substitute(lnk, '__LinkStyle__', '\='."'".a:rxStyle."'", '') + let lnk = substitute(lnk, '__LinkStyle__', '\='."'".a:rxStyle."'", 'g') endif return lnk endfunction " }}} diff --git a/syntax/vimwiki.vim b/syntax/vimwiki.vim index 8a99c8b..48354cf 100644 --- a/syntax/vimwiki.vim +++ b/syntax/vimwiki.vim @@ -51,22 +51,30 @@ let s:time0 = vimwiki#u#time(g:starttime) "XXX " LINKS: setup of larger regexes {{{ " LINKS: setup wikilink regexps {{{ -let g:vimwiki_rxWikiLinkPrefix = '[[' -let g:vimwiki_rxWikiLinkSuffix = ']]' +let g:vimwiki_rxWikiLinkPrefix = '\[\[' +let g:vimwiki_rxWikiLinkSuffix = '\]\]' let g:vimwiki_rxWikiLinkSeparator = '|' " [[URL]] -let g:vimwiki_WikiLinkTemplate1 = g:vimwiki_rxWikiLinkPrefix . '__LinkUrl__'. +let g:vimwiki_WikiLinkTemplate1 = g:vimwiki_rxWikiLinkPrefix . '__LinkUrl__'. \ g:vimwiki_rxWikiLinkSuffix " [[URL|DESCRIPTION]] -let g:vimwiki_WikiLinkTemplate2 = g:vimwiki_rxWikiLinkPrefix . '__LinkUrl__'. +let g:vimwiki_WikiLinkTemplate2 = g:vimwiki_rxWikiLinkPrefix . '__LinkUrl__'. \ g:vimwiki_rxWikiLinkSeparator. '__LinkDescription__'. \ g:vimwiki_rxWikiLinkSuffix -" -let s:valid_chars = '[^\\\]]' -let g:vimwiki_rxWikiLinkPrefix = vimwiki#u#escape(g:vimwiki_rxWikiLinkPrefix) -let g:vimwiki_rxWikiLinkSuffix = vimwiki#u#escape(g:vimwiki_rxWikiLinkSuffix) -let g:vimwiki_rxWikiLinkSeparator = vimwiki#u#escape(g:vimwiki_rxWikiLinkSeparator) +" match every Wikilink with a given URL +let g:vimwiki_WikiLinkMatchUrlTemplate = + \ g:vimwiki_rxWikiLinkPrefix . + \ '\zs__LinkUrl__\ze\%(#.*\)\?' . + \ g:vimwiki_rxWikiLinkSuffix . + \ '\|' . + \ g:vimwiki_rxWikiLinkPrefix . + \ '\zs__LinkUrl__\ze\%(#.*\)\?' . + \ g:vimwiki_rxWikiLinkSeparator . + \ '.*' . + \ g:vimwiki_rxWikiLinkSuffix + +let s:valid_chars = '[^\\\]]' let g:vimwiki_rxWikiLinkUrl = s:valid_chars.'\{-}' let g:vimwiki_rxWikiLinkDescr = s:valid_chars.'\{-}' @@ -108,11 +116,8 @@ let g:vimwiki_WikiInclTemplate2 = g:vimwiki_rxWikiInclPrefix . '__LinkUrl__'. \ '__LinkDescription__'. \ g:vimwiki_rxWikiInclSuffix -let s:valid_chars = '[^\\\}]' -let g:vimwiki_rxWikiInclPrefix = vimwiki#u#escape(g:vimwiki_rxWikiInclPrefix) -let g:vimwiki_rxWikiInclSuffix = vimwiki#u#escape(g:vimwiki_rxWikiInclSuffix) -let g:vimwiki_rxWikiInclSeparator = vimwiki#u#escape(g:vimwiki_rxWikiInclSeparator) +let s:valid_chars = '[^\\\}]' let g:vimwiki_rxWikiInclUrl = s:valid_chars.'\{-}' let g:vimwiki_rxWikiInclArg = s:valid_chars.'\{-}' let g:vimwiki_rxWikiInclArgs = '\%('. g:vimwiki_rxWikiInclSeparator. g:vimwiki_rxWikiInclArg. '\)'.'\{-}' diff --git a/syntax/vimwiki_markdown_custom.vim b/syntax/vimwiki_markdown_custom.vim index b4a3f15..6f9f8cb 100644 --- a/syntax/vimwiki_markdown_custom.vim +++ b/syntax/vimwiki_markdown_custom.vim @@ -30,9 +30,9 @@ let g:vimwiki_rxWikiLink0MatchDescr = g:vimwiki_rxWikiLinkMatchDescr " LINKS: setup wikilink1 regexps {{{ " 1. [URL][], or [DESCRIPTION][URL] -let g:vimwiki_rxWikiLink1Prefix = '[' -let g:vimwiki_rxWikiLink1Suffix = ']' -let g:vimwiki_rxWikiLink1Separator = '][' +let g:vimwiki_rxWikiLink1Prefix = '\[' +let g:vimwiki_rxWikiLink1Suffix = '\]' +let g:vimwiki_rxWikiLink1Separator = '\]\[' " [URL][] let g:vimwiki_WikiLink1Template1 = g:vimwiki_rxWikiLink1Prefix . '__LinkUrl__'. @@ -42,11 +42,20 @@ let g:vimwiki_WikiLink1Template2 = g:vimwiki_rxWikiLink1Prefix . '__LinkDescript \ g:vimwiki_rxWikiLink1Separator. '__LinkUrl__'. \ g:vimwiki_rxWikiLink1Suffix " -let s:valid_chars = '[^\\\[\]]' +let g:vimwiki_WikiLinkMatchUrlTemplate .= + \ '\|' . + \ g:vimwiki_rxWikiLink1Prefix . + \ '.*' . + \ g:vimwiki_rxWikiLink1Separator . + \ '\zs__LinkUrl__\ze\%(#.*\)\?' . + \ g:vimwiki_rxWikiLink1Suffix . + \ '\|' . + \ g:vimwiki_rxWikiLink1Prefix . + \ '\zs__LinkUrl__\ze\%(#.*\)\?' . + \ g:vimwiki_rxWikiLink1Separator . + \ g:vimwiki_rxWikiLink1Suffix -let g:vimwiki_rxWikiLink1Prefix = vimwiki#u#escape(g:vimwiki_rxWikiLink1Prefix) -let g:vimwiki_rxWikiLink1Suffix = vimwiki#u#escape(g:vimwiki_rxWikiLink1Suffix) -let g:vimwiki_rxWikiLink1Separator = vimwiki#u#escape(g:vimwiki_rxWikiLink1Separator) +let s:valid_chars = '[^\\\[\]]' let g:vimwiki_rxWikiLink1Url = s:valid_chars.'\{-}' let g:vimwiki_rxWikiLink1Descr = s:valid_chars.'\{-}' From aa32fc2ba51778fb4d739de85283c04b89bd161b Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Sun, 22 Jun 2014 16:26:40 +0200 Subject: [PATCH 004/370] Fix wrong creation of links caused by previous commit --- syntax/vimwiki.vim | 108 ++++++++++++++++------------- syntax/vimwiki_markdown_custom.vim | 101 +++++++++++++++------------ 2 files changed, 117 insertions(+), 92 deletions(-) diff --git a/syntax/vimwiki.vim b/syntax/vimwiki.vim index 48354cf..786ee48 100644 --- a/syntax/vimwiki.vim +++ b/syntax/vimwiki.vim @@ -51,28 +51,32 @@ let s:time0 = vimwiki#u#time(g:starttime) "XXX " LINKS: setup of larger regexes {{{ " LINKS: setup wikilink regexps {{{ -let g:vimwiki_rxWikiLinkPrefix = '\[\[' -let g:vimwiki_rxWikiLinkSuffix = '\]\]' -let g:vimwiki_rxWikiLinkSeparator = '|' -" [[URL]] -let g:vimwiki_WikiLinkTemplate1 = g:vimwiki_rxWikiLinkPrefix . '__LinkUrl__'. - \ g:vimwiki_rxWikiLinkSuffix -" [[URL|DESCRIPTION]] -let g:vimwiki_WikiLinkTemplate2 = g:vimwiki_rxWikiLinkPrefix . '__LinkUrl__'. - \ g:vimwiki_rxWikiLinkSeparator. '__LinkDescription__'. - \ g:vimwiki_rxWikiLinkSuffix +let s:wikilink_prefix = '[[' +let s:wikilink_suffix = ']]' +let s:wikilink_separator = '|' +let s:rx_wikilink_prefix = vimwiki#u#escape(s:wikilink_prefix) +let s:rx_wikilink_suffix = vimwiki#u#escape(s:wikilink_suffix) +let s:rx_wikilink_separator = vimwiki#u#escape(s:wikilink_separator) -" match every Wikilink with a given URL +" templates for the creation of wiki links +" [[URL]] +let g:vimwiki_WikiLinkTemplate1 = s:wikilink_prefix . '__LinkUrl__'. + \ s:wikilink_suffix +" [[URL|DESCRIPTION]] +let g:vimwiki_WikiLinkTemplate2 = s:wikilink_prefix . '__LinkUrl__'. + \ s:wikilink_separator . '__LinkDescription__' . s:wikilink_suffix + +" template for matching all wiki links with a given target file let g:vimwiki_WikiLinkMatchUrlTemplate = - \ g:vimwiki_rxWikiLinkPrefix . + \ s:rx_wikilink_prefix . \ '\zs__LinkUrl__\ze\%(#.*\)\?' . - \ g:vimwiki_rxWikiLinkSuffix . + \ s:rx_wikilink_suffix . \ '\|' . - \ g:vimwiki_rxWikiLinkPrefix . + \ s:rx_wikilink_prefix . \ '\zs__LinkUrl__\ze\%(#.*\)\?' . - \ g:vimwiki_rxWikiLinkSeparator . + \ s:rx_wikilink_separator . \ '.*' . - \ g:vimwiki_rxWikiLinkSuffix + \ s:rx_wikilink_suffix let s:valid_chars = '[^\\\]]' let g:vimwiki_rxWikiLinkUrl = s:valid_chars.'\{-}' @@ -80,26 +84,26 @@ let g:vimwiki_rxWikiLinkDescr = s:valid_chars.'\{-}' let g:vimwiki_rxWord = '[^[:blank:]()\\]\+' -" + " [[URL]], or [[URL|DESCRIPTION]] " a) match [[URL|DESCRIPTION]] -let g:vimwiki_rxWikiLink = g:vimwiki_rxWikiLinkPrefix. - \ g:vimwiki_rxWikiLinkUrl.'\%('.g:vimwiki_rxWikiLinkSeparator. - \ g:vimwiki_rxWikiLinkDescr.'\)\?'.g:vimwiki_rxWikiLinkSuffix +let g:vimwiki_rxWikiLink = s:rx_wikilink_prefix. + \ g:vimwiki_rxWikiLinkUrl.'\%('.s:rx_wikilink_separator. + \ g:vimwiki_rxWikiLinkDescr.'\)\?'.s:rx_wikilink_suffix " b) match URL within [[URL|DESCRIPTION]] -let g:vimwiki_rxWikiLinkMatchUrl = g:vimwiki_rxWikiLinkPrefix. - \ '\zs'. g:vimwiki_rxWikiLinkUrl.'\ze\%('. g:vimwiki_rxWikiLinkSeparator. - \ g:vimwiki_rxWikiLinkDescr.'\)\?'.g:vimwiki_rxWikiLinkSuffix +let g:vimwiki_rxWikiLinkMatchUrl = s:rx_wikilink_prefix. + \ '\zs'. g:vimwiki_rxWikiLinkUrl.'\ze\%('. s:rx_wikilink_separator. + \ g:vimwiki_rxWikiLinkDescr.'\)\?'.s:rx_wikilink_suffix " c) match DESCRIPTION within [[URL|DESCRIPTION]] -let g:vimwiki_rxWikiLinkMatchDescr = g:vimwiki_rxWikiLinkPrefix. - \ g:vimwiki_rxWikiLinkUrl.g:vimwiki_rxWikiLinkSeparator.'\%('. - \ '\zs'. g:vimwiki_rxWikiLinkDescr. '\ze\)\?'. g:vimwiki_rxWikiLinkSuffix +let g:vimwiki_rxWikiLinkMatchDescr = s:rx_wikilink_prefix. + \ g:vimwiki_rxWikiLinkUrl.s:rx_wikilink_separator.'\%('. + \ '\zs'. g:vimwiki_rxWikiLinkDescr. '\ze\)\?'. s:rx_wikilink_suffix " }}} " LINKS: Syntax helper {{{ -let g:vimwiki_rxWikiLinkPrefix1 = g:vimwiki_rxWikiLinkPrefix. - \ g:vimwiki_rxWikiLinkUrl.g:vimwiki_rxWikiLinkSeparator -let g:vimwiki_rxWikiLinkSuffix1 = g:vimwiki_rxWikiLinkSuffix +let s:rx_wikilink_prefix1 = s:rx_wikilink_prefix . g:vimwiki_rxWikiLinkUrl . + \ s:rx_wikilink_separator +let s:rx_wikilink_suffix1 = s:rx_wikilink_suffix " }}} @@ -201,28 +205,34 @@ function! s:highlight_existing_links() "{{{ let safe_dirs = vimwiki#base#file_pattern(b:existing_wikidirs) " match [[URL]] - let target = vimwiki#base#apply_template(g:vimwiki_WikiLinkTemplate1, + let target = vimwiki#base#apply_template( + \ vimwiki#u#escape(g:vimwiki_WikiLinkTemplate1), \ safe_links, g:vimwiki_rxWikiLinkDescr, '') call s:add_target_syntax_ON(target, 'VimwikiLink') " match [[URL|DESCRIPTION]] - let target = vimwiki#base#apply_template(g:vimwiki_WikiLinkTemplate2, + let target = vimwiki#base#apply_template( + \ vimwiki#u#escape(g:vimwiki_WikiLinkTemplate2), \ safe_links, g:vimwiki_rxWikiLinkDescr, '') call s:add_target_syntax_ON(target, 'VimwikiLink') " match {{URL}} - let target = vimwiki#base#apply_template(g:vimwiki_WikiInclTemplate1, + let target = vimwiki#base#apply_template( + \ vimwiki#u#escape(g:vimwiki_WikiInclTemplate1), \ safe_links, g:vimwiki_rxWikiInclArgs, '') call s:add_target_syntax_ON(target, 'VimwikiLink') " match {{URL|...}} - let target = vimwiki#base#apply_template(g:vimwiki_WikiInclTemplate2, + let target = vimwiki#base#apply_template( + \ vimwiki#u#escape(g:vimwiki_WikiInclTemplate2), \ safe_links, g:vimwiki_rxWikiInclArgs, '') call s:add_target_syntax_ON(target, 'VimwikiLink') " match [[DIRURL]] - let target = vimwiki#base#apply_template(g:vimwiki_WikiLinkTemplate1, + let target = vimwiki#base#apply_template( + \ vimwiki#u#escape(g:vimwiki_WikiLinkTemplate1), \ safe_dirs, g:vimwiki_rxWikiLinkDescr, '') call s:add_target_syntax_ON(target, 'VimwikiLink') " match [[DIRURL|DESCRIPTION]] - let target = vimwiki#base#apply_template(g:vimwiki_WikiLinkTemplate2, + let target = vimwiki#base#apply_template( + \ vimwiki#u#escape(g:vimwiki_WikiLinkTemplate2), \ safe_dirs, g:vimwiki_rxWikiLinkDescr, '') call s:add_target_syntax_ON(target, 'VimwikiLink') endfunction "}}} @@ -259,20 +269,24 @@ let s:rxSchemes = '\%('. \ '\):' " a) match [[nonwiki-scheme-URL]] -let s:target = vimwiki#base#apply_template(g:vimwiki_WikiLinkTemplate1, +let s:target = vimwiki#base#apply_template( + \ vimwiki#u#escape(g:vimwiki_WikiLinkTemplate1), \ s:rxSchemes.g:vimwiki_rxWikiLinkUrl, g:vimwiki_rxWikiLinkDescr, '') call s:add_target_syntax_ON(s:target, 'VimwikiLink') " b) match [[nonwiki-scheme-URL|DESCRIPTION]] -let s:target = vimwiki#base#apply_template(g:vimwiki_WikiLinkTemplate2, +let s:target = vimwiki#base#apply_template( + \ vimwiki#u#escape(g:vimwiki_WikiLinkTemplate2), \ s:rxSchemes.g:vimwiki_rxWikiLinkUrl, g:vimwiki_rxWikiLinkDescr, '') call s:add_target_syntax_ON(s:target, 'VimwikiLink') " a) match {{nonwiki-scheme-URL}} -let s:target = vimwiki#base#apply_template(g:vimwiki_WikiInclTemplate1, +let s:target = vimwiki#base#apply_template( + \ vimwiki#u#escape(g:vimwiki_WikiInclTemplate1), \ s:rxSchemes.g:vimwiki_rxWikiInclUrl, g:vimwiki_rxWikiInclArgs, '') call s:add_target_syntax_ON(s:target, 'VimwikiLink') " b) match {{nonwiki-scheme-URL}[{...}]} -let s:target = vimwiki#base#apply_template(g:vimwiki_WikiInclTemplate2, +let s:target = vimwiki#base#apply_template( + \ vimwiki#u#escape(g:vimwiki_WikiInclTemplate2), \ s:rxSchemes.g:vimwiki_rxWikiInclUrl, g:vimwiki_rxWikiInclArgs, '') call s:add_target_syntax_ON(s:target, 'VimwikiLink') @@ -325,10 +339,10 @@ execute 'syn match VimwikiSubScript contained /'.g:vimwiki_char_subscript.'/'.s: " concealed link parts " {{{ if g:vimwiki_debug > 1 - echom 'WikiLink Prefix: '.g:vimwiki_rxWikiLinkPrefix - echom 'WikiLink Suffix: '.g:vimwiki_rxWikiLinkSuffix - echom 'WikiLink Prefix1: '.g:vimwiki_rxWikiLinkPrefix1 - echom 'WikiLink Suffix1: '.g:vimwiki_rxWikiLinkSuffix1 + echom 'WikiLink Prefix: '.s:rx_wikilink_prefix + echom 'WikiLink Suffix: '.s:rx_wikilink_suffix + echom 'WikiLink Prefix1: '.s:rx_wikilink_prefix1 + echom 'WikiLink Suffix1: '.s:rx_wikilink_suffix1 echom 'WikiIncl Prefix: '.g:vimwiki_rxWikiInclPrefix1 echom 'WikiIncl Suffix: '.g:vimwiki_rxWikiInclSuffix1 endif @@ -350,10 +364,10 @@ endif " is present) and may be concealed " conceal wikilinks -execute 'syn match VimwikiLinkChar /'.g:vimwiki_rxWikiLinkPrefix.'/'.s:options -execute 'syn match VimwikiLinkChar /'.g:vimwiki_rxWikiLinkSuffix.'/'.s:options -execute 'syn match VimwikiLinkChar /'.g:vimwiki_rxWikiLinkPrefix1.'/'.s:options -execute 'syn match VimwikiLinkChar /'.g:vimwiki_rxWikiLinkSuffix1.'/'.s:options +execute 'syn match VimwikiLinkChar /'.s:rx_wikilink_prefix.'/'.s:options +execute 'syn match VimwikiLinkChar /'.s:rx_wikilink_suffix.'/'.s:options +execute 'syn match VimwikiLinkChar /'.s:rx_wikilink_prefix1.'/'.s:options +execute 'syn match VimwikiLinkChar /'.s:rx_wikilink_suffix1.'/'.s:options " conceal wikiincls execute 'syn match VimwikiLinkChar /'.g:vimwiki_rxWikiInclPrefix.'/'.s:options diff --git a/syntax/vimwiki_markdown_custom.vim b/syntax/vimwiki_markdown_custom.vim index 6f9f8cb..502ebdd 100644 --- a/syntax/vimwiki_markdown_custom.vim +++ b/syntax/vimwiki_markdown_custom.vim @@ -30,30 +30,33 @@ let g:vimwiki_rxWikiLink0MatchDescr = g:vimwiki_rxWikiLinkMatchDescr " LINKS: setup wikilink1 regexps {{{ " 1. [URL][], or [DESCRIPTION][URL] -let g:vimwiki_rxWikiLink1Prefix = '\[' -let g:vimwiki_rxWikiLink1Suffix = '\]' -let g:vimwiki_rxWikiLink1Separator = '\]\[' +let s:wikilink_md_prefix = '[' +let s:wikilink_md_suffix = ']' +let s:wikilink_md_separator = '][' +let s:rx_wikilink_md_prefix = vimwiki#u#escape(s:wikilink_md_prefix) +let s:rx_wikilink_md_suffix = vimwiki#u#escape(s:wikilink_md_suffix) +let s:rx_wikilink_md_separator = vimwiki#u#escape(s:wikilink_md_separator) " [URL][] -let g:vimwiki_WikiLink1Template1 = g:vimwiki_rxWikiLink1Prefix . '__LinkUrl__'. - \ g:vimwiki_rxWikiLink1Separator. g:vimwiki_rxWikiLink1Suffix +let g:vimwiki_WikiLink1Template1 = s:wikilink_md_prefix . '__LinkUrl__'. + \ s:wikilink_md_separator. s:wikilink_md_suffix " [DESCRIPTION][URL] -let g:vimwiki_WikiLink1Template2 = g:vimwiki_rxWikiLink1Prefix . '__LinkDescription__'. - \ g:vimwiki_rxWikiLink1Separator. '__LinkUrl__'. - \ g:vimwiki_rxWikiLink1Suffix +let g:vimwiki_WikiLink1Template2 = s:wikilink_md_prefix. '__LinkDescription__'. + \ s:wikilink_md_separator. '__LinkUrl__'. + \ s:wikilink_md_suffix " let g:vimwiki_WikiLinkMatchUrlTemplate .= \ '\|' . - \ g:vimwiki_rxWikiLink1Prefix . + \ s:rx_wikilink_md_prefix . \ '.*' . - \ g:vimwiki_rxWikiLink1Separator . + \ s:rx_wikilink_md_separator . \ '\zs__LinkUrl__\ze\%(#.*\)\?' . - \ g:vimwiki_rxWikiLink1Suffix . + \ s:rx_wikilink_md_suffix . \ '\|' . - \ g:vimwiki_rxWikiLink1Prefix . + \ s:rx_wikilink_md_prefix . \ '\zs__LinkUrl__\ze\%(#.*\)\?' . - \ g:vimwiki_rxWikiLink1Separator . - \ g:vimwiki_rxWikiLink1Suffix + \ s:rx_wikilink_md_separator . + \ s:rx_wikilink_md_suffix let s:valid_chars = '[^\\\[\]]' let g:vimwiki_rxWikiLink1Url = s:valid_chars.'\{-}' @@ -61,37 +64,37 @@ let g:vimwiki_rxWikiLink1Descr = s:valid_chars.'\{-}' let g:vimwiki_rxWikiLink1InvalidPrefix = '[\]\[]\@ Date: Sun, 22 Jun 2014 17:43:26 +0200 Subject: [PATCH 005/370] Fix highlight of anchor links when maxhi is on --- syntax/vimwiki.vim | 3 ++- syntax/vimwiki_markdown_custom.vim | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/syntax/vimwiki.vim b/syntax/vimwiki.vim index 786ee48..17b9cd8 100644 --- a/syntax/vimwiki.vim +++ b/syntax/vimwiki.vim @@ -200,7 +200,8 @@ function! s:highlight_existing_links() "{{{ " Conditional highlighting that depends on the existence of a wiki file or " directory is only available for *schemeless* wiki links " Links are set up upon BufEnter (see plugin/...) - let safe_links = vimwiki#base#file_pattern(b:existing_wikifiles) + let safe_links = '\%('.vimwiki#base#file_pattern(b:existing_wikifiles) . + \ '\%(#[^|]*\)\?\|#[^|]*\)' " Wikilink Dirs set up upon BufEnter (see plugin/...) let safe_dirs = vimwiki#base#file_pattern(b:existing_wikidirs) diff --git a/syntax/vimwiki_markdown_custom.vim b/syntax/vimwiki_markdown_custom.vim index 502ebdd..af9ab96 100644 --- a/syntax/vimwiki_markdown_custom.vim +++ b/syntax/vimwiki_markdown_custom.vim @@ -242,7 +242,8 @@ function! s:highlight_existing_links() "{{{ " Conditional highlighting that depends on the existence of a wiki file or " directory is only available for *schemeless* wiki links " Links are set up upon BufEnter (see plugin/...) - let safe_links = vimwiki#base#file_pattern(b:existing_wikifiles) + 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 From 8d0e49272b1909967a1f3edcaf862520bd7238ea Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Tue, 24 Jun 2014 14:19:22 +0200 Subject: [PATCH 006/370] Add a note about how to integrate Tagbar --- doc/vimwiki.txt | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index aebe321..8828513 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -49,10 +49,11 @@ CONTENTS *vimwiki-contents* 12.2. Temporary Wiki |vimwiki-temporary-wiki| 12.3. Per-Wiki Options |vimwiki-local-options| 12.4. Global Options |vimwiki-global-options| - 13. Help |vimwiki-help| - 14. Developers |vimwiki-developers| - 15. Changelog |vimwiki-changelog| - 16. License |vimwiki-license| + 13. Miscellaneous |vimwiki-misc| + 14. Help |vimwiki-help| + 15. Developers |vimwiki-developers| + 16. Changelog |vimwiki-changelog| + 17. License |vimwiki-license| ============================================================================== @@ -2551,8 +2552,19 @@ mother tongue like this: > The default is 'Contents'. + ============================================================================== -13. Help *vimwiki-help* +13. Miscellaneous *vimwiki-misc* + +Tagbar integration~ +If you want the Tagbar plugin (http://majutsushi.github.io/tagbar/) to show +the headers of your wiki files in a side pane, download the Python script from +https://raw.githubusercontent.com/vimwiki/utils/master/vwtags.py and follow +the instructions in it. + + +============================================================================== +14. Help *vimwiki-help* Your help in making vimwiki better is really appreciated! Any help, whether it is a spelling correction or a code snippet to patch -- @@ -2562,7 +2574,7 @@ Issues can be filed at http://code.google.com/p/vimwiki/issues . ============================================================================== -14. Developers *vimwiki-developers* +15. Developers *vimwiki-developers* - Maxim Kim as original author. - Stuart Andrews @@ -2575,7 +2587,7 @@ Vim plugins: http://www.vim.org/scripts/script.php?script_id=2226 ============================================================================== -15. Changelog *vimwiki-changelog* +16. Changelog *vimwiki-changelog* ???~ @@ -2733,7 +2745,7 @@ http://code.google.com/p/vimwiki/issues/list * First public version. ============================================================================== -16. License *vimwiki-license* +17. License *vimwiki-license* The MIT Licence http://www.opensource.org/licenses/mit-license.php From bd1fb39f6c394b23cb5b3891a0e8230c8cdf74ee Mon Sep 17 00:00:00 2001 From: Dan Bernier Date: Wed, 25 Jun 2014 14:01:03 -0400 Subject: [PATCH 007/370] Update README.md Fix typos in README: "folow" -> "follow" --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3d6a564..1f56747 100644 --- a/README.md +++ b/README.md @@ -101,9 +101,9 @@ normal mode: * `ws` -- Select and open wiki index file. * `wd` -- Delete wiki file you are in. * `wr` -- Rename wiki file you are in. - * `` -- Folow/Create wiki link - * `` -- Split and folow/create wiki link - * `` -- Vertical split and folow/create wiki link + * `` -- Follow/Create wiki link + * `` -- Split and follow/create wiki link + * `` -- Vertical split and follow/create wiki link * `` -- Go back to parent(previous) wiki link * `` -- Find next wiki link * `` -- Find previous wiki link From a099a2cf3c819fb5e03f1abbea1bd17e32baa49e Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Fri, 4 Jul 2014 11:23:28 +0200 Subject: [PATCH 008/370] Disable 'shellslash' on Windows to avoid problems Probably fix #54 --- autoload/vimwiki/base.vim | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index 0fec726..b1a102c 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -466,7 +466,18 @@ function! vimwiki#base#system_open_link(url) "{{{ " handlers function! s:win32_handler(url) "http://vim.wikia.com/wiki/Opening_current_Vim_file_in_your_Windows_browser - execute 'silent ! start "Title" /B ' . shellescape(a:url, 1) + "disable 'shellslash', otherwise the url will be enclosed in single quotes, + "which is problematic + "see https://github.com/vimwiki/vimwiki/issues/54#issuecomment-48011289 + if exists('+shellslash') + let old_ssl = &shellslash + set noshellslash + let url = shellescape(a:url, 1) + let &shellslash = old_ssl + else + let url = shellescape(a:url, 1) + endif + execute 'silent ! start "Title" /B ' . url endfunction function! s:macunix_handler(url) execute '!open ' . shellescape(a:url, 1) From 77bc1b709bf88eec68ab5466a40732ed30b605f8 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Wed, 30 Jul 2014 21:26:07 +0200 Subject: [PATCH 009/370] Remove nonascii bullet symbol because of encoding probs --- autoload/vimwiki/html.vim | 2 +- doc/vimwiki.txt | 31 +++++++++---------------------- ftplugin/vimwiki.vim | 24 +++++++++++------------- syntax/vimwiki_default.vim | 4 ++-- 4 files changed, 23 insertions(+), 38 deletions(-) diff --git a/autoload/vimwiki/html.vim b/autoload/vimwiki/html.vim index 6e1c0cd..fec8155 100644 --- a/autoload/vimwiki/html.vim +++ b/autoload/vimwiki/html.vim @@ -1391,7 +1391,7 @@ function! vimwiki#html#Wiki2HTML(path_html, wikifile) "{{{ endif " prepare regexps for lists - let s:bullets = '[*•-]' + let s:bullets = '[*-]' let s:numbers = \'\C\%(#\|\d\+)\|\d\+\.\|[ivxlcdm]\+)\|[IVXLCDM]\+)\|\l\{1,2})\|\u\{1,2})\)' diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index 8828513..3de415b 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -380,14 +380,6 @@ gL- Change the symbol of the current list to -. To remap: > noremap glo :VimwikiChangeSymbolTo - noremap glO :VimwikiChangeSymbolInListTo - -< - *vimwiki_gl.* *vimwiki_gL.* -gl. Make a list item out of normal line or change the symbol - of the current item to •. -gL. Change the symbol of the current list to •. - To remap: > - noremap glo :VimwikiChangeSymbolTo • - noremap glO :VimwikiChangeSymbolInListTo • < *vimwiki_gl1* *vimwiki_gL1* gl1 Make a list item out of normal line or change the symbol @@ -516,13 +508,13 @@ INSERT MODE *vimwiki-list-mappings* < *vimwiki_i__* Change the symbol of the current list item to the next - available. From - to • to 1. to * to I) to a). + available. From - to 1. to * to I) to a). To remap: > :imap VimwikiListNextSymbol < *vimwiki_i__* Change the symbol of the current list item to the prev - available. From - to a) to I) to * to 1. to •. + available. From - to a) to I) to * to 1. To remap: > :imap VimwikiListPrevSymbol < @@ -860,9 +852,6 @@ two lines. Unordered lists: > - Bulleted list item 1 - Bulleted list item 2 -or: > - • Bulleted list item 1 - • Bulleted list item 2 or: > * Bulleted list item 1 * Bulleted list item 2 @@ -903,8 +892,8 @@ You can nest and mix the various types: > - Bulleted list item 2 a) Numbered list sub item 1 b) more ... - • and more ... - • ... + * and more ... + * ... c) Numbered list sub item 3 1. Numbered list sub sub item 1 2. Numbered list sub sub item 2 @@ -1391,7 +1380,6 @@ For default syntax, the following types are available: > - hyphen * asterisk # hash - • dot, use gl. to create it 1. number with period 1) number with parenthesis a) lower-case letter with parenthesis @@ -1424,9 +1412,8 @@ after a list using letters or vice versa, vimwiki will get confused because it cannot distinguish which is which (at least if the types are both upper case or both lower case). -See |vimwiki_glstar|, |vimwiki_gl#| |vimwiki_gl-|, |vimwiki_gl.|, -|vimwiki_gl-|, |vimwiki_gl1|, |vimwiki_gla|, |vimwiki_glA|, |vimwiki_gli|, -|vimwiki_glI| +See |vimwiki_glstar|, |vimwiki_gl#| |vimwiki_gl-|, |vimwiki_gl-|, +|vimwiki_gl1|, |vimwiki_gla|, |vimwiki_glA|, |vimwiki_gli|, |vimwiki_glI| Use glr and gLr, if the numbers of a numbered list are mixed up. See @@ -2031,9 +2018,9 @@ Width of left-hand margin for lists. When negative, the current |shiftwidth| is used. This affects the appearance of the generated links (see |:VimwikiGenerateLinks|), the Table of contents (|vimwiki-toc|) and the behavior of the list manipulation commands |:VimwikiListChangeLevel| and the -local mappings |vimwiki_glstar|, |vimwiki_gl#| |vimwiki_gl-|, |vimwiki_gl.|, -|vimwiki_gl-|, |vimwiki_gl1|, |vimwiki_gla|, |vimwiki_glA|, |vimwiki_gli|, -|vimwiki_glI| and |vimwiki_i__|. +local mappings |vimwiki_glstar|, |vimwiki_gl#| |vimwiki_gl-|, |vimwiki_gl-|, +|vimwiki_gl1|, |vimwiki_gla|, |vimwiki_glA|, |vimwiki_gli|, |vimwiki_glI| and +|vimwiki_i__|. Note: if you use MediaWiki syntax, you probably would like to set this option to 0, because every indented line is considered verbatim text. diff --git a/ftplugin/vimwiki.vim b/ftplugin/vimwiki.vim index b0bc3f1..da5fcba 100644 --- a/ftplugin/vimwiki.vim +++ b/ftplugin/vimwiki.vim @@ -562,23 +562,21 @@ endif noremap @@ -1107,9 +1192,9 @@ In this case, would be "../mathjax" (without quotes). ------------------------------------------------------------------------------ 5.9. Blockquotes *vimwiki-syntax-blockquotes* -Text started with 4 or more spaces is a blockquote. +Text which starts with 4 or more spaces is a blockquote. - This would be a blockquote in vimwiki. It is not highlighted in vim but + This would be a blockquote in Vimwiki. It is not highlighted in Vim but could be styled by CSS in HTML. Blockquotes are usually used to quote a long piece of text from another source. @@ -1117,145 +1202,31 @@ Text started with 4 or more spaces is a blockquote. ------------------------------------------------------------------------------ 5.10. Comments *vimwiki-syntax-comments* -Text line started with %% is a comment. +A line that starts with %% is a comment. E.g.: > %% this text would not be in HTML < - ------------------------------------------------------------------------------ 5.11. Horizontal line *vimwiki-syntax-hr* -4 or more dashes at the start of the line is a 'horizontal line' (
): > +4 or more dashes at the start of the line is a horizontal line (
): > ---- < ------------------------------------------------------------------------------- -5.12. Schemes *vimwiki-syntax-schemes* - -In addition to standard web schemes (e.g. "http:", "https:", "ftp:", etc.) a -number of special schemes are supported: "wikiX:", "diary:", "file:", "local:" -and schemeless. - -While "wikiX", "diary" and schemeless links are automatically opened in Vim, -all other links are opened with the system command, i.e. !xdg-open (Linux), -!open (Mac), or !start (Windows). To customize this behavior, see -|VimwikiLinkHandler|. - -Interwiki:~ - -If you maintain more than one wiki, you can create interwiki links between them -by adding a numbered prefix "wikiX:" in front of a link: > - [[wiki1:This is a link]] -or: > - [[wiki1:This is a link source|Description of the link]] - -The number behind "wiki" is in the range 0..N-1 and identifies the destination -wiki in |g:vimwiki_list|. - -Diary:~ - -The diary scheme is used to concisely link to diary entries: > - [[diary:2012-03-05]] - -This scheme precludes explicit inclusion of |vimwiki-option-diary_rel_path|, -and is most useful on subwiki pages to avoid links such as: > - [[../../diary/2012-03-05]] - -External files:~ - -The file and local schemes allow you to directly link to arbitray resources -using absolute or relative paths with extension: > - [[file:/home/somebody/a/b/c/music.mp3]] - [[file:C:/Users/somebody/d/e/f/music.mp3]] - [[file:~/a/b/c/music.mp3]] - [[file:../assets/data.csv|data (CSV)]] - [[local:C:/Users/somebody/d/e/f/music.mp3]] - [[file:/home/user/documents/|Link to a directory]] - -In Vim, "file:" and "local:" behave the same, i.e. you can use them with both -relative and absolute links. When converted to HTML, however, "file:" links -will become absolute links, while "local:" links become relative to the HTML -output directory. The latter can be useful if you copy your HTML files to -another computer. -To customize the HTML conversion of links, see |VimwikiLinkConverter|. - -Schemeless:~ - -Schemeless URLs, which are the default, are treated internally as "wikiX:" -URLs in all respects, where X is the number of the current wiki. - -When |vimwiki-option-maxhi| equals 1, a distinct highlighting style is used to -identify schemeless links whose targets are not found. All other links appear -as regular links even if the files to which they refer do not exist. - - ------------------------------------------------------------------------------- -5.13. Transclusions *vimwiki-syntax-transclude* - -Transclusion (Wiki-Include) Links~ - -Links that use "{{" and "}}" delimiters signify content that is to be -included into the Html output, rather than referenced via hyperlink. - -Wiki-include URLs may use any of the supported schemes, may be absolute or -relative, and need not end with an extension. - -The primary purpose for wiki-include links is to include images. - -Transclude from a local URL: > - {{file:../../images/vimwiki_logo.png}} -or from a universal URL: > - {{http://vimwiki.googlecode.com/hg/images/vimwiki_logo.png}} - -Transclude image with alternate text: > - {{http://vimwiki.googlecode.com/hg/images/vimwiki_logo.png|Vimwiki}} -in HTML: > - Vimwiki - -Transclude image with alternate text and some style: > - {{http://.../vimwiki_logo.png|cool stuff|style="width:150px; height: 120px;"}} -in HTML: > - cool stuff - -Transclude image _without_ alternate text and with css class: > - {{http://.../vimwiki_logo.png||class="center flow blabla"}} -in HTML: > - - -A trial feature allows you to supply your own handler for wiki-include links. -See |VimwikiWikiIncludeHandler|. - - ------------------------------------------------------------------------------- -5.14. Thumbnails *vimwiki-syntax-thumbnails* - -Thumbnail links~ -> -Thumbnail links are constructed like this: > - [[http://someaddr.com/bigpicture.jpg|{{http://someaddr.com/thumbnail.jpg}}]] - -in HTML: > - - or press and . Note that the mapping is not available in all terminals. -Furthermore, and have different behavior when the cursor is behind -an empty list item. See the table below. +Furthermore, and behave differently when the cursor is behind an +empty list item. See the table below. You can configure the behavior of and of like this: > inoremap :VimwikiReturn 1 5 @@ -1488,7 +1457,7 @@ Roman numerals go up to MMMM) and numbers up to 2147483647. or Also note that you can, of course, mix different list symbols in one list, but if you have the strange idea of putting a list with Romanian numerals right -after a list using letters or vice versa, vimwiki will get confused because +after a list using letters or vice versa, Vimwiki will get confused because it cannot distinguish which is which (at least if the types are both upper case or both lower case). @@ -1600,10 +1569,10 @@ To indent table indent the first row. Then format it with 'gqq'. 10. Diary *vimwiki-diary* The diary helps you make daily notes. You can easily add information into -vimwiki that should be sorted out later. Just hit ww to create -new daily note with name based on current date. +Vimwiki that should be sorted out later. Just hit ww to create +a new note for today with a name based on the current date. -To generate diary section with all available links one can use +To generate the diary section with all available links one can use |:VimwikiDiaryGenerateLinks| or wi . Note: it works only for diary index file. @@ -1675,11 +1644,11 @@ For jumping inside a single file, you can omit the file in the link: > ------------------------------------------------------------------------------ Table of Contents *vimwiki-toc* *vimwiki-table-of-contents* -You can add a 'table of contents' to your wiki file. +You can create a "table of contents" at the top of your wiki file. The commando |:VimwikiTOC| creates the magic header > = Contents = -at the top of your file and below it a list of all the headers in the current -file as links, so you can directly jump to specific parts of the file. +in the current file and below it a list of all the headers in this file as +links, so you can directly jump to specific parts of the file. For the indentation of the list, the value of |vimwiki-option-list_margin| is used. @@ -1699,7 +1668,7 @@ If you want to keep the TOC up to date automatically, use the option 12. Options *vimwiki-options* There are global options and local (per-wiki) options available to tune -vimwiki. +Vimwiki. Global options are configured via global variables. For a complete list of them, see |vimwiki-global-options|. @@ -1757,21 +1726,21 @@ For clarity, in your .vimrc file you can define wiki options using separate The creation of temporary wikis allows you to open files that would not -normally be recognized by vimwiki. +normally be recognized by Vimwiki. If a file with a registered wiki extension (see |vimwiki-register-extension|) is opened in a directory that: 1) is not listed in |g:vimwiki_list|, and 2) is not a subdirectory of any such directory, then a temporary wiki may be created and appended to the list of configured wikis in |g:vimwiki_list|. -In addition to vimwiki's editing functionality, the temporary wiki enables: 1) +In addition to Vimwiki's editing functionality, the temporary wiki enables: 1) wiki-linking to other files in the same subtree, 2) highlighting of existing wiki pages when |vimwiki-option-maxhi| is activated, and 3) html generation to |vimwiki-option-path_html|. Temporary wikis are configured using default |vimwiki-local-options|, except for the path, extension, and syntax options. The path and extension are set -using the file's location and extension. The syntax is set to vimwiki's +using the file's location and extension. The syntax is set to Vimwiki's default unless another syntax is registered via |vimwiki-register-extension|. Use |g:vimwiki_global_ext| to turn off creation of temporary wikis. @@ -1863,8 +1832,8 @@ Key Default value Values~ syntax default default, markdown, or media Description~ -Wiki syntax. You can use different markup languages (currently: vimwiki's -default, Markdown, and MediaWiki), but only vimwiki's default markup will be +Wiki syntax. You can use different markup languages (currently: Vimwiki's +default, Markdown, and MediaWiki), but only Vimwiki's default markup will be converted to HTML at the moment. To use Markdown's wiki markup: > @@ -1975,11 +1944,11 @@ This disables filesystem checks for wiki links. *vimwiki-option-nested_syntaxes* ------------------------------------------------------------------------------ Key Default value Values~ -nested_syntaxes {} pairs of highlight keyword and vim filetype +nested_syntaxes {} pairs of highlight keyword and Vim filetype Description~ You can configure preformatted text to be highlighted with any syntax -available for vim. +available for Vim. For example the following setup in your vimrc: > let wiki = {} let wiki.path = '~/my_wiki/' @@ -2147,7 +2116,7 @@ Checked list items can be highlighted with a color: * [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~ 0 Don't highlight anything. @@ -2179,7 +2148,7 @@ Value Description~ If your preferred wiki extension is .txt then you can > let g:vimwiki_global_ext = 0 -to restrict vimwiki's operation to only those paths listed in g:vimwiki_list. +to restrict Vimwiki's operation to only those paths listed in g:vimwiki_list. Other text files wouldn't be treated as wiki pages. Default: 1 @@ -2189,16 +2158,16 @@ Default: 1 *g:vimwiki_ext2syntax* *vimwiki-register-extension* A many-to-one map between file extensions and syntaxes whose purpose is to -register the extensions with vimwiki. +register the extensions with Vimwiki. E.g.: > let g:vimwiki_ext2syntax = {'.md': 'markdown', \ '.mkd': 'markdown', \ '.wiki': 'media'} -An extension that is registered with vimwiki can trigger creation of a +An extension that is registered with Vimwiki can trigger creation of a |vimwiki-temporary-wiki| with the associated syntax. File extensions used in -|g:vimwiki_list| are automatically registered with vimwiki using the default +|g:vimwiki_list| are automatically registered with Vimwiki using the default syntax. Default: {} @@ -2207,7 +2176,7 @@ Default: {} ------------------------------------------------------------------------------ *g:vimwiki_menu* -GUI menu of available wikies to select. +GUI menu of available wikis to select. Value Description~ '' No menu @@ -2246,7 +2215,7 @@ Default: 0 ------------------------------------------------------------------------------ *g:vimwiki_folding* -Enable/disable vimwiki's folding (outline) functionality. Folding in vimwiki +Enable/disable Vimwiki's folding (outline) functionality. Folding in Vimwiki can uses either the 'expr' or the 'syntax' |foldmethod| of Vim. Value Description~ @@ -2317,7 +2286,7 @@ something else: > endfunction A second example handles a new scheme, "vfile:", which behaves similar to -"file:", but the files are always opened with Vim: > +"file:", but the files are always opened with Vim in a new tab: > function! VimwikiLinkHandler(link) " Use Vim to open external files with the 'vfile:' scheme. E.g.: @@ -2343,8 +2312,11 @@ A second example handles a new scheme, "vfile:", which behaves similar to *VimwikiLinkConverter* This function can be overridden in your .vimrc to specify what a link looks -like when converted to HTML. It should return the HTML link if successful or -an empty string '' otherwise. +like when converted to HTML. The parameters of the function are: + - the link as a string + - the full path to the wiki file where the link is in + - the full path to the output html file +It should return the HTML link if successful or an empty string '' otherwise. This example changes how relative links to external files using the "local:" scheme look like in HTML. Per default, they would become links relative to @@ -2535,7 +2507,7 @@ Default: '' (empty) ------------------------------------------------------------------------------ *g:vimwiki_valid_html_tags* -Case-insensitive comma separated list of HTML tags that can be used in vimwiki. +Case-insensitive comma separated list of HTML tags that can be used in Vimwiki. Default: 'b,i,s,u,sub,sup,kbd,br,hr' @@ -2549,7 +2521,7 @@ should not be deleted after |:VimwikiAll2HTML|. Default: '' Example: -Consider you have 404.html and search.html in your vimwiki 'path_html'. +Consider you have 404.html and search.html in your Vimwiki 'path_html'. With: > let g:vimwiki_user_htmls = '404.html,search.html' they would not be deleted after |:VimwikiAll2HTML|. @@ -2558,10 +2530,10 @@ they would not be deleted after |:VimwikiAll2HTML|. ------------------------------------------------------------------------------ *g:vimwiki_conceallevel* -In vim73 |conceallevel| is local to window, thus if you open vimwiki buffer in +In vim73 |conceallevel| is local to window, thus if you open Vimwiki buffer in a new tab or window, it would be set to default value. -Vimwiki sets |conceallevel| to g:vimwiki_conceallevel everytime vimwiki buffer +Vimwiki sets |conceallevel| to g:vimwiki_conceallevel everytime Vimwiki buffer is entered. With default settings, Vimwiki conceals one-character markers, shortens long @@ -2573,7 +2545,7 @@ Default: 2 ------------------------------------------------------------------------------ *g:vimwiki_autowriteall* -In vim |autowriteall| is a global setting. With g:vimwiki_autowriteall vimwiki +In Vim |autowriteall| is a global setting. With g:vimwiki_autowriteall Vimwiki makes it local to its buffers. Value Description~ @@ -2646,7 +2618,7 @@ let g:vimwiki_diary_months = { ------------------------------------------------------------------------------ *g:vimwiki_toc_header* -A string with the magic header that tells vimwiki where the Table of Contents +A string with the magic header that tells Vimwiki where the Table of Contents is located in the file. You can change it to the appropriate word in your mother tongue like this: > let g:vimwiki_toc_header = 'Inhalt' @@ -2666,13 +2638,13 @@ The default is 'w'. ------------------------------------------------------------------------------ *g:vimwiki_auto_chdir* -When set to 1, enables auto-cd feature. Whenever vimwiki page is opened, -vimwiki performs an |:lcd| to the vimwiki folder to where the page belongs. +When set to 1, enables auto-cd feature. Whenever Vimwiki page is opened, +Vimwiki performs an |:lcd| to the Vimwiki folder to where the page belongs. Value Description~ 0 Do not change directory. -1 Change directory to vimwiki folder on opening page. +1 Change directory to Vimwiki folder on opening page. Default: 0 @@ -2688,14 +2660,20 @@ the instructions in it. ============================================================================== -14. Help *vimwiki-help* +14. Contributing *vimwiki-contributing* -Your help in making vimwiki better is really appreciated! +Your help in making Vimwiki better is really appreciated! Any help, whether it is a spelling correction or a code snippet to patch -- everything is welcomed. +Before filing a bug or starting to write a patch, check the latest development +version from https://github.com/vimwiki/vimwiki/tree/dev to see if your +problem is already fixed. + Issues can be filed at https://github.com/vimwiki/vimwiki/issues/ . +If you want to provide a pull request on GitHub, please start from the dev +branch, not from the master branch. ============================================================================== 15. Developers *vimwiki-developers* @@ -2703,7 +2681,7 @@ Issues can be filed at https://github.com/vimwiki/vimwiki/issues/ . - Maxim Kim as original author. - Stuart Andrews - Tomas Pospichal - - See the following sites for more: + - See the following sites for more: https://github.com/vimwiki/vimwiki/graphs/contributors http://code.google.com/p/vimwiki/people/list @@ -2783,9 +2761,9 @@ Summary ~ * No more [http://link description] links. * No more plain image links. Use transclusions. * No more image links identified by extension. Use transclusions. - * Interwiki links. See |vimwiki-syntax-schemes|. - * Link schemes. See |vimwiki-syntax-schemes|. - * Transclusions. See |vimwiki-syntax-transclude|. + * Interwiki links + * More link schemes + * Transclusions * Normalize link command. See |vimwiki_+|. * Improved diary organization and generation. See |vimwiki-diary|. * List manipulation. See |vimwiki-list-manipulation|. From b794a3bd3b6b4f0f26ff2eb227c2a1ba7de7fb72 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Sat, 21 Nov 2015 21:20:33 +0100 Subject: [PATCH 134/370] Restrict the distance of tag to header to two lines Suffices, I think. Also, clean the code a bit and correct the help file. Ref #85 --- autoload/vimwiki/tags.vim | 11 ++++++----- doc/vimwiki.txt | 9 +++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/autoload/vimwiki/tags.vim b/autoload/vimwiki/tags.vim index 4bd13a9..d06ab9e 100644 --- a/autoload/vimwiki/tags.vim +++ b/autoload/vimwiki/tags.vim @@ -62,7 +62,6 @@ endfunction " }}} function! s:scan_tags(lines, page_name) "{{{ let entries = [] - let page_name = a:page_name " Code wireframe to scan for headers -- borrowed from " vimwiki#base#get_anchors(), with minor modifications. @@ -73,7 +72,7 @@ function! s:scan_tags(lines, page_name) "{{{ let anchor_level = ['', '', '', '', '', '', ''] let current_complete_anchor = '' - let PROXIMITY_LINES_NR = 5 + let PROXIMITY_LINES_NR = 2 let header_line_nr = - (2 * PROXIMITY_LINES_NR) for line_nr in range(1, len(a:lines)) @@ -121,11 +120,13 @@ function! s:scan_tags(lines, page_name) "{{{ let entry.lineno = line_nr if line_nr <= PROXIMITY_LINES_NR && header_line_nr < 0 " Tag appeared at the top of the file - let entry.link = page_name + let entry.link = a:page_name elseif line_nr <= (header_line_nr + PROXIMITY_LINES_NR) - let entry.link = page_name . '#' . current_complete_anchor + " Tag appeared right below a header + let entry.link = a:page_name . '#' . current_complete_anchor else - let entry.link = page_name . '#' . tag + " Tag stands on its own + let entry.link = a:page_name . '#' . tag endif call add(entries, entry) endfor diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index 05733b3..4015f18 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -1227,10 +1227,11 @@ A tag is a sequence of non-space characters between two colons: > It is allowed to concatenate multiple tags in one line: > :tag-one:tag-two: < -If placed under a header, within 5 lines below it, the header is then "tagged" -with this tag, and tag search commands will jump to this specific header. -Otherwise the entire page is tagged, and search commands will jump -accordingly. +If placed in the first two lines of a file, the whole file is tagged. If +placed under a header, within the 2 lines below it, the header is then tagged +with this tag, and the tag search commands will jump to this specific header. +Otherwise, the tag stands of its own and the search command jumps directly to +it. Typing tags can be simplified by using Vim's omni completion (see |compl-omni|) like so: > From da899311c7cad7c9c1ef476c7f6767dabfa70e0a Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Sun, 22 Nov 2015 20:30:38 +0100 Subject: [PATCH 135/370] Clean up the help file (part 2) Notably, complete the changelog. --- doc/vimwiki.txt | 239 +++++++++++++++++++++++++++++------------------- 1 file changed, 143 insertions(+), 96 deletions(-) diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index 4015f18..0285e51 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -9,7 +9,7 @@ |___| |___| |_| |_||__| |__||___| |___| |_||___| ~ - Version: 2.1 + Version: 2.2 ============================================================================== CONTENTS *vimwiki* @@ -35,7 +35,7 @@ CONTENTS *vimwiki* 5.9. Blockquotes |vimwiki-syntax-blockquotes| 5.10. Comments |vimwiki-syntax-comments| 5.11. Horizontal line |vimwiki-syntax-hr| - 5.15. Tags |vimwiki-syntax-tags| + 5.12. Tags |vimwiki-syntax-tags| 6. Folding/Outline |vimwiki-folding| 7. Placeholders |vimwiki-placeholders| 8. Lists |vimwiki-lists| @@ -47,11 +47,10 @@ CONTENTS *vimwiki* 12.2. Temporary Wiki |vimwiki-temporary-wiki| 12.3. Per-Wiki Options |vimwiki-local-options| 12.4. Global Options |vimwiki-global-options| - 13. Miscellaneous |vimwiki-misc| - 14. Contributing |vimwiki-contributing| - 15. Developers |vimwiki-developers| - 16. Changelog |vimwiki-changelog| - 17. License |vimwiki-license| + 13. Contributing |vimwiki-contributing| + 14. Developers |vimwiki-developers| + 15. Changelog |vimwiki-changelog| + 16. License |vimwiki-license| ============================================================================== @@ -720,6 +719,7 @@ il A single list item. their instances. Supports |cmdline-completion|. If no arguments (tags) are specified, outputs all tags. + ============================================================================== 5. Wiki syntax *vimwiki-syntax* @@ -1215,7 +1215,7 @@ E.g.: > < ------------------------------------------------------------------------------ -5.15. Tags *vimwiki-syntax-tags* +5.12. Tags *vimwiki-syntax-tags* You can tag a wiki file, a header or an arbitrary place in a wiki file. Then, you can use Vim's built-in tag search functionality (see |tagsrch.txt|) or @@ -1470,8 +1470,8 @@ Use glr and gLr, if the numbers of a numbered list are mixed up. See |vimwiki_glr| and |vimwiki_gLr|. -Todo lists *vimwiki-todo-lists* ------------------------------------------------------------------------------ +Todo lists *vimwiki-todo-lists* You can have todo lists -- lists of items you can check/uncheck. @@ -1591,9 +1591,9 @@ Example of diary section: > See |g:vimwiki_diary_months| if you would like to rename months. - -Calendar integration *vimwiki-calendar* ------------------------------------------------------------------------------ +Calendar integration *vimwiki-calendar* + If you have Calendar.vim installed you can use it to create diary notes. Just open calendar with :Calendar and tap on the date. A wiki file will be created in the default wiki's diary. @@ -1606,8 +1606,8 @@ See |g:vimwiki_use_calendar| option to turn it off/on. ============================================================================== 12. Anchors *vimwiki-anchors* -Every header, tag, and bold text is an anchor. To jump to it, use a wikilink -of the form > +Every header, tag, and bold text can be used as an anchor. To jump to it, use +a wikilink of the form > [[file#anchor]] For example, consider the following file "Todo.wiki": > @@ -1658,13 +1658,24 @@ If you don't want the TOC to sit in the very first line, e.g. because you have a modeline there, put the magic header in the second or third line and run :VimwikiTOC to update the TOC. -If your language is not english, set the option |g:vimwiki_toc_header| to your -favorite translation. +If English is not your preferred language, set the option +|g:vimwiki_toc_header| to your favorite translation. If you want to keep the TOC up to date automatically, use the option |vimwiki-option-auto_toc|. +------------------------------------------------------------------------------ +Tagbar integration *vimwiki-tagbar* + +As an alternative to the Table of Contents, you can use the Tagbar plugin +(http://majutsushi.github.io/tagbar/) to show the headers of your wiki files +in a side pane. +Download the Python script from +https://raw.githubusercontent.com/vimwiki/utils/master/vwtags.py and follow +the instructions in it. + + ============================================================================== 12. Options *vimwiki-options* @@ -1688,13 +1699,13 @@ One or more wikis can be registered using the |g:vimwiki_list| variable. Each item in |g:vimwiki_list| is a |Dictionary| that holds all customizations available for a distinct wiki. The options dictionary has the form: > - {'option1': 'value1', 'option2: 'value2', ...} + {'option1': 'value1', 'option2': 'value2', ...} Consider the following: > let g:vimwiki_list = [{'path': '~/my_site/', 'path_html': '~/public_html/'}] -This defines one wiki located at ~/my_site/ that could be htmlized to -~/public_html/ +This defines one wiki located at ~/my_site/. When converted to HTML, the +produced HTML files go to ~/public_html/ . Another example: > let g:vimwiki_list = [{'path': '~/my_site/', 'path_html': '~/public_html/'}, @@ -1726,17 +1737,16 @@ For clarity, in your .vimrc file you can define wiki options using separate 12.2 Temporary Wiki *vimwiki-temporary-wiki* -The creation of temporary wikis allows you to open files that would not -normally be recognized by Vimwiki. +The creation of temporary wikis allows you to create a wiki on the fly. If a file with a registered wiki extension (see |vimwiki-register-extension|) is opened in a directory that: 1) is not listed in |g:vimwiki_list|, and 2) is -not a subdirectory of any such directory, then a temporary wiki may be created -and appended to the list of configured wikis in |g:vimwiki_list|. +not a subdirectory of any such directory, then a temporary wiki is created and +appended to the list of configured wikis in |g:vimwiki_list|. In addition to Vimwiki's editing functionality, the temporary wiki enables: 1) wiki-linking to other files in the same subtree, 2) highlighting of existing -wiki pages when |vimwiki-option-maxhi| is activated, and 3) html generation to +wiki pages when |vimwiki-option-maxhi| is activated, and 3) HTML generation to |vimwiki-option-path_html|. Temporary wikis are configured using default |vimwiki-local-options|, except @@ -1927,6 +1937,7 @@ or even > let g:vimwiki_list = [{'path': '~/my_pages/', \ 'css_name': 'css/main.css'}] < +Vimwiki comes with a default CSS file "style.css". *vimwiki-option-maxhi* @@ -1935,12 +1946,10 @@ Key Default value Values~ maxhi 0 0, 1 Description~ -Non-existent wiki links highlighting can be quite slow. If you still want it, -set maxhi to 1: > +If on, wiki links to non-existent wiki files are highlighted. However, it can +be quite slow. If you still want it, set maxhi to 1: > let g:vimwiki_list = [{'path': '~/my_site/', 'maxhi': 1}] -This disables filesystem checks for wiki links. - *vimwiki-option-nested_syntaxes* ------------------------------------------------------------------------------ @@ -1991,7 +2000,7 @@ Key Default value~ diary_rel_path diary/ Description~ -Related to |vimwiki-option-path| path for diary wiki-files. +The path to the diary wiki files, relative to |vimwiki-option-path|. *vimwiki-option-diary_index* @@ -2000,7 +2009,7 @@ Key Default value~ diary_index diary Description~ -Name of wiki-file that holds all links to dated wiki-files. +Name of wiki-file that holds all links to dated wiki files. *vimwiki-option-diary_header* @@ -2030,26 +2039,25 @@ custom_wiki2html '' Description~ The full path to an user-provided script that converts a wiki page to HTML. Vimwiki calls the provided |vimwiki-option-custom_wiki2html| script from the -command-line, using '!' invocation. +command-line, using |:!| invocation. -The following arguments, in this order, are passed to the -|vimwiki-option-custom_wiki2html| script: +The following arguments, in this order, are passed to the script: 1. force : [0/1] overwrite an existing file 2. syntax : the syntax chosen for this wiki 3. extension : the file extension for this wiki -4. output_dir : the full path of the output directory, i.e. 'path_html' +4. output_dir : the full path of the output directory 5. input_file : the full path of the wiki page 6. css_file : the full path of the css file for this wiki 7. template_path : the full path to the wiki's templates 8. template_default : the default template name 9. template_ext : the extension of template files 10. root_path : a count of ../ for pages buried in subdirs - if you have wikilink [[dir1/dir2/dir3/my page in a subdir]] then - %root_path% is replaced by '../../../'. + For example, if you have wikilink [[dir1/dir2/dir3/my page in a subdir]] + then this argument is '../../../'. Options 7-10 are experimental and may change in the future. If any of these -parameters is empty, then a hyphen "-" is passed to the script in its place. +parameters is empty, a hyphen "-" is passed to the script in its place. For an example and further instructions, refer to the following script: @@ -2060,6 +2068,7 @@ be located at http://code.google.com/p/vimwiki/issues/detail?id=384 To use the internal wiki2html converter, use an empty string (the default). + *vimwiki-option-list_margin* ------------------------------------------------------------------------------ Key Default value~ @@ -2113,11 +2122,11 @@ Default: 0 ------------------------------------------------------------------------------ *g:vimwiki_hl_cb_checked* -Checked list items can be highlighted with a color: +Highlight checked list items with a special color: * [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. + * [ ] this line is never highlighted Value Description~ 0 Don't highlight anything. @@ -2126,9 +2135,9 @@ Value Description~ 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 can be highlighted erroneously. +Note: Option 2 does not work perfectly. Specifically, it might break if the +list item contains preformatted text or if you mix tabs and spaces for +indenting. Also, indented headers can be highlighted erroneously. Furthermore, if your list is long, Vim's highlight can break. To solve this, consider putting > au BufEnter *.wiki :syntax sync fromstart @@ -2158,7 +2167,7 @@ Default: 1 ------------------------------------------------------------------------------ *g:vimwiki_ext2syntax* *vimwiki-register-extension* -A many-to-one map between file extensions and syntaxes whose purpose is to +A many-to-one mapping between file extensions and syntaxes whose purpose is to register the extensions with Vimwiki. E.g.: > @@ -2177,7 +2186,7 @@ Default: {} ------------------------------------------------------------------------------ *g:vimwiki_menu* -GUI menu of available wikis to select. +Create a menu in the menu bar of GVim, where you can open the available wikis. Value Description~ '' No menu @@ -2191,7 +2200,7 @@ Default: 'Vimwiki' ------------------------------------------------------------------------------ *g:vimwiki_listsyms* -String of 5 symbols for list items with checkboxes. +String of 5 symbols to show the progression of todo list items. Default value is ' .oOX'. The first char is for 0% done items. @@ -2201,6 +2210,7 @@ You can set it to some more fancy symbols like this: > let g:vimwiki_listsyms = '✗○◐●✓' + ------------------------------------------------------------------------------ *g:vimwiki_use_mouse* @@ -2263,10 +2273,10 @@ Default: 1 ------------------------------------------------------------------------------ *VimwikiLinkHandler* -A customizable link handler can be defined to override Vimwiki's opening of -links. Each recognized link, whether it is a wikilink, wiki-include link or a -weblink, is first passed to |VimwikiLinkHandler| to see if it can be handled. -The return value 1 indicates success. +A customizable link handler can be defined to override Vimwiki's behavior when +opening links. Each recognized link, whether it is a wikilink, wiki-include +link or a weblink, is first passed to |VimwikiLinkHandler| to see if it can be +handled. The return value 1 indicates success. If the link is not handled successfully, the behavior of Vimwiki depends on the scheme. "wiki:", "diary:" or schemeless links are opened in Vim. "file:" @@ -2316,7 +2326,7 @@ This function can be overridden in your .vimrc to specify what a link looks like when converted to HTML. The parameters of the function are: - the link as a string - the full path to the wiki file where the link is in - - the full path to the output html file + - the full path to the output HTML file It should return the HTML link if successful or an empty string '' otherwise. This example changes how relative links to external files using the "local:" @@ -2326,7 +2336,7 @@ the wiki file, i.e. a link [[local:../document.pdf]] becomes . Also, this function will copy document.pdf to the right place. > - fu! VimwikiLinkConverter(link, source_wiki_file, target_html_file) + function! VimwikiLinkConverter(link, source_wiki_file, target_html_file) if a:link =~# '^local:' let link_infos = vimwiki#base#resolve_link(a:link) let html_link = vimwiki#path#relpath( @@ -2338,19 +2348,19 @@ right place. > return html_link endif return '' - endfu + endfunction ------------------------------------------------------------------------------ *VimwikiWikiIncludeHandler* -Vimwiki includes the contents of a wiki-include URL as an image by default. +Vimwiki includes the content of a wiki-include URL as an image by default. A trial feature allows you to supply your own handler for wiki-include links. The handler should return the empty string when it does not recognize or cannot otherwise convert the link. A customized handler might look like this: > " Convert {{URL|#|ID}} -> URL#ID - function! VimwikiWikiIncludeHandler(value) "{{{ + function! VimwikiWikiIncludeHandler(value) let str = a:value " complete URL @@ -2366,7 +2376,7 @@ cannot otherwise convert the link. A customized handler might look like this: > " Return the empty string when unable to process link return '' - endfunction "}}} + endfunction < ------------------------------------------------------------------------------ @@ -2413,8 +2423,8 @@ Default: '' ------------------------------------------------------------------------------ *g:vimwiki_CJK_length* -Use special method to calculate correct length of the strings with double-wide -characters (to align table cells properly). +Use a special method to calculate the correct length of the strings with +double-wide characters (to align table cells properly). Value Description~ 0 Do not use it. @@ -2429,11 +2439,11 @@ date Vim, this option is obsolete. ------------------------------------------------------------------------------ *g:vimwiki_dir_link* -This option is about what to do with links to directories -- [[directory/]], -[[papers/]], etc. +This option is about what to do with links to directories, like +[[directory/]], [[papers/]], etc. Value Description~ -'' Open 'directory/' using standard netrw plugin. +'' Open 'directory/' using the standard netrw plugin. 'index' Open 'directory/index.wiki', create if needed. 'main' Open 'directory/main.wiki', create if needed. etc. @@ -2464,6 +2474,7 @@ Value Description~ 2 Header numbering is on. Headers are numbered starting from header level 2. etc. + Example when g:vimwiki_html_header_numbering = 2: > Header1 1 Header2 @@ -2509,6 +2520,8 @@ Default: '' (empty) *g:vimwiki_valid_html_tags* Case-insensitive comma separated list of HTML tags that can be used in Vimwiki. +When converting to HTML, these tags are left as they are, while every other +tag is escaped. Default: 'b,i,s,u,sub,sup,kbd,br,hr' @@ -2531,11 +2544,11 @@ they would not be deleted after |:VimwikiAll2HTML|. ------------------------------------------------------------------------------ *g:vimwiki_conceallevel* -In vim73 |conceallevel| is local to window, thus if you open Vimwiki buffer in -a new tab or window, it would be set to default value. +In Vim 7.3 |conceallevel| is local to the current window, thus if you open a +Vimwiki buffer in a new tab or window, it would be set to the default value. -Vimwiki sets |conceallevel| to g:vimwiki_conceallevel everytime Vimwiki buffer -is entered. +Vimwiki sets |conceallevel| to g:vimwiki_conceallevel every time a Vimwiki +buffer is entered. With default settings, Vimwiki conceals one-character markers, shortens long URLs and hides markers and URL for links that have a description. @@ -2616,26 +2629,29 @@ let g:vimwiki_diary_months = { \ 10: 'October', 11: 'November', 12: 'December' \ } + ------------------------------------------------------------------------------ *g:vimwiki_toc_header* A string with the magic header that tells Vimwiki where the Table of Contents -is located in the file. You can change it to the appropriate word in your -mother tongue like this: > +(see |vimwiki-toc|) is located in a file. You can change it to the +appropriate word in your mother tongue like this: > let g:vimwiki_toc_header = 'Inhalt' The default is 'Contents'. + ------------------------------------------------------------------------------ *g:vimwiki_map_prefix* -A string which specifies the prefix for all global mappings (and some local). -Use it to avoid conflicts with other plugins. Note that it must be defined -before the plugin loads. > +A string which specifies the prefix for all global mappings (and some local +ones). Use it to avoid conflicts with other plugins. Note that it must be +defined before the plugin loads. > let g:vimwiki_map_prefix = 'e' The default is 'w'. + ------------------------------------------------------------------------------ *g:vimwiki_auto_chdir* @@ -2651,17 +2667,7 @@ Default: 0 ============================================================================== -13. Miscellaneous *vimwiki-misc* - -Tagbar integration~ -If you want the Tagbar plugin (http://majutsushi.github.io/tagbar/) to show -the headers of your wiki files in a side pane, download the Python script from -https://raw.githubusercontent.com/vimwiki/utils/master/vwtags.py and follow -the instructions in it. - - -============================================================================== -14. Contributing *vimwiki-contributing* +13. Contributing *vimwiki-contributing* Your help in making Vimwiki better is really appreciated! Any help, whether it is a spelling correction or a code snippet to patch -- @@ -2676,8 +2682,11 @@ Issues can be filed at https://github.com/vimwiki/vimwiki/issues/ . If you want to provide a pull request on GitHub, please start from the dev branch, not from the master branch. +For questions, discussions, praise or rants there is a mailing list: +https://groups.google.com/forum/#!forum/vimwiki + ============================================================================== -15. Developers *vimwiki-developers* +14. Developers *vimwiki-developers* - Maxim Kim as original author. - Stuart Andrews @@ -2687,44 +2696,82 @@ branch, not from the master branch. http://code.google.com/p/vimwiki/people/list Web: https://github.com/vimwiki/vimwiki.git -Mail-List: https://groups.google.com/forum/#!forum/vimwiki Vim plugins: http://www.vim.org/scripts/script.php?script_id=2226 ============================================================================== -16. Changelog *vimwiki-changelog* +15. Changelog *vimwiki-changelog* -???~ +2.2~ - * Support for tags. - * Support for wiki links absolute to the wiki root - * The "file:" and "local:" schemes semantic changed slightly - * Added the |VimwikiLinkConverter| function - * Support for |g:vimwiki_auto_chdir| option. +New:~ * Support for anchors, see |vimwiki-anchors| * in this context, add support for TOC, see |vimwiki-toc| - * remove the now useless %toc placeholder * add omni completion of wiki links (files and anchors) - * the function base#resolve_scheme() now also returns the anchor - (important for custom VimwikiLinkHandlers) * new local option |vimwiki-option-auto_toc| * new global option |g:vimwiki_toc_header| + * Support for tags, see |vimwiki-syntax-tags| * List editing capabilities, see |vimwiki-lists|: * support for auto incrementing numbered lists * more key maps for list manipulation, see |vimwiki-list-manipulation| * improved automatic adjustment of checkboxes * text objects for list items, see |vimwiki-text-objects| - * g:vimwiki_auto_checkbox is now useless and removed - * Add the command |VimwikiCheckLinks| to check for broken links + * New command |VimwikiCheckLinks| to check for broken links + * New global option |g:vimwiki_auto_chdir| + * New global option |g:vimwiki_map_prefix| + * Support for wiki links absolute to the wiki root + * Added the |VimwikiLinkConverter| function + * Issue #24: Basic support for remote directories via netrw + * Issue #50: in HTML, tables can now be embedded in lists + * When converting to HTML, show a message with the output directory + * Add auto completion for |VimwikiGoto| + * Add Chinese Readme file + +Changed:~ + * replace the function vimwiki#base#resolve_scheme() by + vimwiki#base#resolve_link() (relevant if you have a custom + |VimwikiLinkHandler| which used this function) + * The semantic of "file:" and "local:" links changed slightly, see + |vimwiki-syntax-links| for what they mean now + * The meaning of a link like [[/some/directory/]] changed. It used to be + a link to the actual directory /some/directory/, now it's relative to + the root of the current wiki. Use [[file:/some/directory/]] for the old + behavior. + +Removed:~ + * the %toc placeholder is now useless. Use |vimwiki-toc| instead. + * the global option g:vimwiki_auto_checkbox is now useless and removed + +Fixed:~ * Issue 415: Disable folding if g:vimwiki_folding is set to '' * Fix slowdown in Vim 7.4 * Issue #12: Separate diaries from different wikis * Issue #13: Fix :VimwikiRenameLink on links containing a dot - * Issue #24: Basic support for remote directories via netrw * Always jump to previous link on , not to beginning of link * Issue #27: Fix on a visual selection sometimes not working + * |VimwikiBackLinks| now recognizes much more valid links + * Issue 424: make external links with #, % work under Linux + * Issue #39: don't htmlize stuff inside pre tags + * Issue #44: faster formatting of large tables + * Issue #52: Recognize markdown links when renaming wiki file + * Issue #54: Disable 'shellslash' on Windows to avoid problems + * Issue #81: Don't get stuck when converting a read-only file + * Issue #66: Better normalizing of links in diary + * Fix the menu in GVim, which was sometimes not shown correctly + * |VimwikiGenerateLinks| now also generates links for subdirectories + * Issue #93: Don't process placeholders inside preformatted text + * Issue #102: Add default values to some options like the doc says + * Issue #144: Fix bug with folds shortening on multibyte characters + * Issue #158: Detect the OS correctly + * |VimwikiGenerateLinks| now replaces a potentially existing old list + * Fix uneven indentation of list items with checkboxes in HTML * Various small fixes - * Corrected website links in documentation + * Corrected website links in documentation. code.google is dead, long live + Github! + +Issue numbers starting with '#' are issues from +https://github.com/vimwiki/vimwiki/issues/, all others from +http://code.google.com/p/vimwiki/issues/list 2.1~ @@ -2857,7 +2904,7 @@ http://code.google.com/p/vimwiki/issues/list * First public version. ============================================================================== -17. License *vimwiki-license* +16. License *vimwiki-license* The MIT Licence http://www.opensource.org/licenses/mit-license.php From c799d61b19d683ec86337f2ff0e846f9e0f76516 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Mon, 23 Nov 2015 13:10:46 +0100 Subject: [PATCH 136/370] Clean up the help file (part 3) Notably, put my name in the list of contributors. Well, and some other names, too. --- autoload/vimwiki/base.vim | 2 +- autoload/vimwiki/customwiki2html.sh | 2 +- doc/vimwiki.txt | 27 +++++++++++++++++++++------ 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index 2976f24..70438e8 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -183,7 +183,7 @@ function! vimwiki#base#file_pattern(files) "{{{ Get search regex from glob() " string. Aim to support *all* special characters, forcing the user to choose " names that are compatible with any external restrictions that they " encounter (e.g. filesystem, wiki conventions, other syntaxes, ...). - " See: http://code.google.com/p/vimwiki/issues/detail?id=316 + " See: https://github.com/vimwiki-backup/vimwiki/issues/316 " Change / to [/\\] to allow "Windows paths" return '\V\%('.join(a:files, '\|').'\)\m' endfunction "}}} diff --git a/autoload/vimwiki/customwiki2html.sh b/autoload/vimwiki/customwiki2html.sh index c5960b1..6b0c17a 100755 --- a/autoload/vimwiki/customwiki2html.sh +++ b/autoload/vimwiki/customwiki2html.sh @@ -6,7 +6,7 @@ # commenting / uncommenting the relevant lines below. # # NEW! An alternative converter was developed by Jason6Anderson, and can -# be located at http://code.google.com/p/vimwiki/issues/detail?id=384 +# be located at https://github.com/vimwiki-backup/vimwiki/issues/384 # # # To use this script, you must have the Discount converter installed. diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index 0285e51..bfe5bd4 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -2064,7 +2064,7 @@ For an example and further instructions, refer to the following script: $VIMHOME/autoload/vimwiki/customwiki2html.sh An alternative converter was developed by Jason6Anderson, and can -be located at http://code.google.com/p/vimwiki/issues/detail?id=384 +be located at https://github.com/vimwiki-backup/vimwiki/issues/384 To use the internal wiki2html converter, use an empty string (the default). @@ -2688,12 +2688,27 @@ https://groups.google.com/forum/#!forum/vimwiki ============================================================================== 14. Developers *vimwiki-developers* - - Maxim Kim as original author. - - Stuart Andrews +Contributors and their Github usernames in roughly chronological order: + + - Maxim Kim (habamax) as original author + - Stuart Andrews (tub78) - Tomas Pospichal - - See the following sites for more: - https://github.com/vimwiki/vimwiki/graphs/contributors - http://code.google.com/p/vimwiki/people/list + - Daniel Schemala (EinfachToll) as current maintainer + - Larry Hynes (larryhynes) + - Hector Arciga (harciga) + - Alexey Radkov (lyokha) + - Aaron Franks (af) + - Dan Bernier (danbernier) + - Carl Helmertz (chelmertz) + - Karl Yngve Lervåg (lervag) + - Patrick Davey (patrickdavey) + - Ivan Tishchenko (t7ko) + - 修昊 (Svtter) + - Marcelo D Montu (mMontu) + - John Kaul + +See the following site for more: + http://code.google.com/p/vimwiki/people/list Web: https://github.com/vimwiki/vimwiki.git Vim plugins: http://www.vim.org/scripts/script.php?script_id=2226 From 2f95a6a651bcc388af466e7377ae3ded3cfcc035 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Wed, 25 Nov 2015 10:43:26 +0100 Subject: [PATCH 137/370] Clean up the help file (part 4) --- doc/vimwiki.txt | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index bfe5bd4..fe01f83 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -48,7 +48,7 @@ CONTENTS *vimwiki* 12.3. Per-Wiki Options |vimwiki-local-options| 12.4. Global Options |vimwiki-global-options| 13. Contributing |vimwiki-contributing| - 14. Developers |vimwiki-developers| + 14. Development |vimwiki-development| 15. Changelog |vimwiki-changelog| 16. License |vimwiki-license| @@ -2677,7 +2677,7 @@ Before filing a bug or starting to write a patch, check the latest development version from https://github.com/vimwiki/vimwiki/tree/dev to see if your problem is already fixed. -Issues can be filed at https://github.com/vimwiki/vimwiki/issues/ . +Issues can be filed at https://github.com/vimwiki/vimwiki/issues/. If you want to provide a pull request on GitHub, please start from the dev branch, not from the master branch. @@ -2685,12 +2685,19 @@ branch, not from the master branch. For questions, discussions, praise or rants there is a mailing list: https://groups.google.com/forum/#!forum/vimwiki + ============================================================================== -14. Developers *vimwiki-developers* +14. Development *vimwiki-development* + +Homepage: http://vimwiki.github.io/ +Github: https://github.com/vimwiki/vimwiki/ +Vim plugins: http://www.vim.org/scripts/script.php?script_id=2226 +Old homepage: http://code.google.com/p/vimwiki/ Contributors and their Github usernames in roughly chronological order: - Maxim Kim (habamax) as original author + - the people here: http://code.google.com/p/vimwiki/people/list - Stuart Andrews (tub78) - Tomas Pospichal - Daniel Schemala (EinfachToll) as current maintainer @@ -2707,12 +2714,6 @@ Contributors and their Github usernames in roughly chronological order: - Marcelo D Montu (mMontu) - John Kaul -See the following site for more: - http://code.google.com/p/vimwiki/people/list - -Web: https://github.com/vimwiki/vimwiki.git -Vim plugins: http://www.vim.org/scripts/script.php?script_id=2226 - ============================================================================== 15. Changelog *vimwiki-changelog* @@ -2754,7 +2755,7 @@ Changed:~ behavior. Removed:~ - * the %toc placeholder is now useless. Use |vimwiki-toc| instead. + * the %toc placeholder is now useless, use |vimwiki-toc| instead * the global option g:vimwiki_auto_checkbox is now useless and removed Fixed:~ @@ -2786,7 +2787,8 @@ Fixed:~ Issue numbers starting with '#' are issues from https://github.com/vimwiki/vimwiki/issues/, all others from -http://code.google.com/p/vimwiki/issues/list +http://code.google.com/p/vimwiki/issues/list. They may be accessible from +https://github.com/vimwiki-backup/vimwiki/issues. 2.1~ From 399e9a4512fb9a400dfb5c4692cbbf95b5a88e0b Mon Sep 17 00:00:00 2001 From: Hongbo Liu Date: Thu, 26 Nov 2015 11:54:32 +0800 Subject: [PATCH 138/370] follow url silently in mac --- autoload/vimwiki/base.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index 70438e8..b3c1a2d 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -380,7 +380,7 @@ function! vimwiki#base#system_open_link(url) "{{{ execute 'silent ! start "Title" /B ' . url endfunction function! s:macunix_handler(url) - execute '!open ' . shellescape(a:url, 1) + call system('open ' . shellescape(a:url).' &') endfunction function! s:linux_handler(url) call system('xdg-open ' . shellescape(a:url).' &') From 7df0405c4e26cf8fe98d8b4b61b3d79702c953a9 Mon Sep 17 00:00:00 2001 From: Ivan Tishchenko Date: Fri, 27 Nov 2015 01:50:41 +0300 Subject: [PATCH 139/370] Fix sorting order of tags. Before the fix, tags file sorting was done alphabetically. That would treat line numbers as strings, and so, for example, if the same tag was placed on the same page on lines, say, 9 and 114, the order you would get, 114 would go first, instead of 9. Fix adds proper entries comparison to the sort function. --- autoload/vimwiki/tags.vim | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/autoload/vimwiki/tags.vim b/autoload/vimwiki/tags.vim index d06ab9e..ae7ee03 100644 --- a/autoload/vimwiki/tags.vim +++ b/autoload/vimwiki/tags.vim @@ -213,6 +213,38 @@ function! s:merge_tags(metadata, pagename, file_metadata) "{{{ return metadata endfunction " }}} +" s:tags_entry_cmp +" Compares two actual lines from tags file. Return value is in strcmp style. +" See help on sort() -- that's what this function is going to be used for. +" See also s:write_tags_metadata below -- that's where we compose these tags +" file lines. +" +" This function is needed for tags sorting, since plain sort() compares line +" numbers as strings, not integers, and so, for example, tag at line 14 +" preceeds the same tag on the same page at line 9. (Because string "14" is +" alphabetically 'less than' string "9".) +function! s:tags_entry_cmp(i1, i2) "{{{ + let items = [] + for orig_item in [a:i1, a:i2] + let fields = split(orig_item, "\t") + let item = {} + let item.text = fields[0]."\t".fields[1] + let item.lineno = 0 + matchstr(fields[2], '\m\d\+') + call add(items, item) + endfor + if items[0].text > items[1].text + return 1 + elseif items[0].text < items[1].text + return -1 + elseif items[0].lineno > items[1].lineno + return 1 + elseif items[0].lineno < items[1].lineno + return -1 + else + return 0 + endif +endfunction " }}} + " s:write_tags_metadata " Saves metadata object into a file. Throws exceptions in case of problems. function! s:write_tags_metadata(metadata) "{{{ @@ -234,7 +266,7 @@ function! s:write_tags_metadata(metadata) "{{{ \) endfor endfor - call sort(tags) + call sort(tags, "s:tags_entry_cmp") call insert(tags, "!_TAG_FILE_SORTED\t1\t") call writefile(tags, metadata_path) endfunction " }}} From d265df42f59973512d457a1d3c2d9906f5206661 Mon Sep 17 00:00:00 2001 From: Ivan Tishchenko Date: Fri, 27 Nov 2015 03:05:39 +0300 Subject: [PATCH 140/370] Prevent cursor moving up/down when TOC changes. getpos()/setpos() combination does not account for changes of lines count. So if you do getpos, then remove lines _above_ it, then do setpos -- it's going to be off. The fix calculates the "diff", and adjusts saved position for that diff (if any). --- autoload/vimwiki/base.vim | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index b3c1a2d..da68849 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -1144,6 +1144,10 @@ function! vimwiki#base#update_listing_in_buffer(strings, start_header, endif let old_cursor_pos = getpos('.') + let cursor_line = old_cursor_pos[1] + let is_cursor_after_listing = 0 + + let lines_diff = 0 if already_there " delete the old listing @@ -1152,9 +1156,19 @@ function! vimwiki#base#update_listing_in_buffer(strings, start_header, while end_lnum <= line('$') && getline(end_lnum) =~# a:content_regex let end_lnum += 1 endwhile + let is_cursor_after_listing = ( cursor_line >= end_lnum ) + " We'll be removing a range. But, apparently, if folds are enabled, Vim + " won't let you remove a range that overlaps with closed fold -- the entire + " fold gets deleted. So we temporarily disable folds, and then reenable + " them right back. + let foldenable_save = &l:foldenable + setlo nofoldenable silent exe start_lnum.','.string(end_lnum - 1).'delete _' + let &l:foldenable = foldenable_save + let lines_diff = 0 - (end_lnum - start_lnum) else let start_lnum = a:default_lnum + let is_cursor_after_listing = ( cursor_line > a:default_lnum ) let whitespaces_in_first_line = '' endif @@ -1164,6 +1178,7 @@ function! vimwiki#base#update_listing_in_buffer(strings, start_header, \ '__Header__', '\='."'".a:start_header."'", '') call append(start_lnum - 1, new_header) let start_lnum += 1 + let lines_diff += 1 + len(a:strings) for string in a:strings call append(start_lnum - 1, string) let start_lnum += 1 @@ -1171,8 +1186,12 @@ function! vimwiki#base#update_listing_in_buffer(strings, start_header, " append an empty line if there is not one if start_lnum <= line('$') && getline(start_lnum) !~# '\m^\s*$' call append(start_lnum - 1, '') + let lines_diff += 1 endif + if is_cursor_after_listing + let old_cursor_pos[1] += lines_diff + endif call setpos('.', old_cursor_pos) endfunction "}}} From 0d3f526a884d4f24915f2b78fb655a3237898620 Mon Sep 17 00:00:00 2001 From: Ivan Tishchenko Date: Fri, 27 Nov 2015 03:13:25 +0300 Subject: [PATCH 141/370] Preserve fold open/close status of the TOC on save. Since TOC is completely recreated, Vim loses its fold open/close status. If your TOC was open, after you save it gets closed. Fix will save fold status, and restore it after TOC is updated. --- autoload/vimwiki/base.vim | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index da68849..2b8cabd 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -1147,9 +1147,12 @@ function! vimwiki#base#update_listing_in_buffer(strings, start_header, let cursor_line = old_cursor_pos[1] let is_cursor_after_listing = 0 + let is_fold_closed = 1 + let lines_diff = 0 if already_there + let is_fold_closed = ( foldclosed(start_lnum) > 1 ) " delete the old listing let whitespaces_in_first_line = matchstr(getline(start_lnum), '\m^\s*') let end_lnum = start_lnum + 1 @@ -1189,6 +1192,12 @@ function! vimwiki#base#update_listing_in_buffer(strings, start_header, let lines_diff += 1 endif + " Open fold, if needed + if !is_fold_closed + exe start_lnum + norm zo + endif + if is_cursor_after_listing let old_cursor_pos[1] += lines_diff endif From 5247de4a0bb6eea640f0535b8ff1e7ca02d753dc Mon Sep 17 00:00:00 2001 From: Ivan Tishchenko Date: Fri, 27 Nov 2015 03:20:44 +0300 Subject: [PATCH 142/370] Prevent scrolling of large folds while filesave updates TOC. During TOC update, screen sometimes scrolls -- most often I've seen this when I'm working inside large enough fold (does not fit in one screen). Fix uses winsaveview()/winrestview() instead of getpos()/setpos(). Winview pair would also manage scroll position on screen, not just cursor position in text. --- autoload/vimwiki/base.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index 2b8cabd..7968f86 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -1143,8 +1143,8 @@ function! vimwiki#base#update_listing_in_buffer(strings, start_header, return endif - let old_cursor_pos = getpos('.') - let cursor_line = old_cursor_pos[1] + let winview_save = winsaveview() + let cursor_line = winview_save.lnum let is_cursor_after_listing = 0 let is_fold_closed = 1 @@ -1199,9 +1199,9 @@ function! vimwiki#base#update_listing_in_buffer(strings, start_header, endif if is_cursor_after_listing - let old_cursor_pos[1] += lines_diff + let winview_save.lnum += lines_diff endif - call setpos('.', old_cursor_pos) + call winrestview(winview_save) endfunction "}}} " WIKI link following functions {{{ From 7124a9be972b34559c2b68e935ac8fdb910f1cd5 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Mon, 30 Nov 2015 13:13:06 +0100 Subject: [PATCH 143/370] Add a note to the change log Hopefully not too late. Ref #173 --- doc/vimwiki.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index fe01f83..d4493d0 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -2744,6 +2744,8 @@ New:~ * Add Chinese Readme file Changed:~ + * Wiki files must not contain # anymore, because # is used to separate the + file from an anchor in a link. * replace the function vimwiki#base#resolve_scheme() by vimwiki#base#resolve_link() (relevant if you have a custom |VimwikiLinkHandler| which used this function) From 3eb20a6c98000a4930a34b370e8b352857da5904 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Mon, 30 Nov 2015 13:33:22 +0100 Subject: [PATCH 144/370] Fix regression bug: Normalize paths if settings changed after startup Fix #171 --- autoload/vimwiki/base.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index b3c1a2d..5c1d6af 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -1284,6 +1284,7 @@ function! vimwiki#base#goto_index(wnum, ...) "{{{ echom "--- Goto_index g:curr_idx=".g:vimwiki_current_idx." ww_idx=".idx."" endif + call Validate_wiki_options(idx) call vimwiki#base#edit_file(cmd, \ VimwikiGet('path', idx).VimwikiGet('index', idx). \ VimwikiGet('ext', idx), From 77fca9080c88f43119087ac62643ca2288320d9b Mon Sep 17 00:00:00 2001 From: Ivan Tishchenko Date: Tue, 1 Dec 2015 22:41:50 +0300 Subject: [PATCH 145/370] Fix code review notes on 'norm zo': - Only issue 'zo' if there is any fold at all. - Correct possible bug, code was using 'start_lnum' var, but it was changed/incremented which could lead to wrong results. - Use bang with norm, to prevent user re-mapping interfere with standard ones. --- autoload/vimwiki/base.vim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index 7968f86..4f56f59 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -1175,6 +1175,8 @@ function! vimwiki#base#update_listing_in_buffer(strings, start_header, let whitespaces_in_first_line = '' endif + let start_of_listing = start_lnum + " write new listing let new_header = whitespaces_in_first_line \ . substitute(g:vimwiki_rxH1_Template, @@ -1193,9 +1195,9 @@ function! vimwiki#base#update_listing_in_buffer(strings, start_header, endif " Open fold, if needed - if !is_fold_closed - exe start_lnum - norm zo + if !is_fold_closed && foldclosed(start_of_listing) + exe start_of_listing + norm! zo endif if is_cursor_after_listing From c2b0fd843bffa8798d247d5dbc08964182d0296d Mon Sep 17 00:00:00 2001 From: Ivan Tishchenko Date: Fri, 4 Dec 2015 15:33:03 +0400 Subject: [PATCH 146/370] Fix bug: saving a page would err out trying to open fold if folds are disabled or are configured differently. --- autoload/vimwiki/base.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index 4f56f59..d231415 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -1152,7 +1152,7 @@ function! vimwiki#base#update_listing_in_buffer(strings, start_header, let lines_diff = 0 if already_there - let is_fold_closed = ( foldclosed(start_lnum) > 1 ) + let is_fold_closed = ( foldclosed(start_lnum) > -1 ) " delete the old listing let whitespaces_in_first_line = matchstr(getline(start_lnum), '\m^\s*') let end_lnum = start_lnum + 1 @@ -1195,7 +1195,7 @@ function! vimwiki#base#update_listing_in_buffer(strings, start_header, endif " Open fold, if needed - if !is_fold_closed && foldclosed(start_of_listing) + if !is_fold_closed && ( foldclosed(start_of_listing) > -1 ) exe start_of_listing norm! zo endif From c565b38bb607b7996ff691e3ed98619b5a7fbaaa Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Mon, 7 Dec 2015 12:25:17 +0100 Subject: [PATCH 147/370] Remove some unreachable code --- autoload/vimwiki/diary.vim | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/autoload/vimwiki/diary.vim b/autoload/vimwiki/diary.vim index 540a766..54719f2 100644 --- a/autoload/vimwiki/diary.vim +++ b/autoload/vimwiki/diary.vim @@ -83,7 +83,7 @@ fun! s:read_captions(files) "{{{ return result endfun "}}} -fun! s:get_diary_links(...) "{{{ +fun! s:get_diary_links() "{{{ let rx = '^\d\{4}-\d\d-\d\d' let s_files = glob(VimwikiGet('path').VimwikiGet('diary_rel_path').'*'.VimwikiGet('ext')) let files = split(s_files, '\n') @@ -92,9 +92,6 @@ fun! s:get_diary_links(...) "{{{ " remove backup files (.wiki~) call filter(files, 'v:val !~# ''.*\~$''') - if a:0 - call add(files, a:1) - endif let links_with_captions = s:read_captions(files) return links_with_captions @@ -129,14 +126,10 @@ function! s:sort(lst) "{{{ endif endfunction "}}} -function! s:format_diary(...) "{{{ +function! s:format_diary() "{{{ let result = [] - if a:0 - let g_files = s:group_links(s:get_diary_links(a:1)) - else - let g_files = s:group_links(s:get_diary_links()) - endif + let g_files = s:group_links(s:get_diary_links()) for year in s:sort(keys(g_files)) call add(result, '') From 2a70e1517e20c0f81f357eac5bad5cb0aa803830 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Mon, 7 Dec 2015 12:27:32 +0100 Subject: [PATCH 148/370] Remove g:vimwiki_debug, which probably nobody used --- autoload/vimwiki/base.vim | 23 ----------------- autoload/vimwiki/html.vim | 18 -------------- autoload/vimwiki/markdown_base.vim | 15 ----------- doc/vimwiki.txt | 20 ++++++--------- plugin/vimwiki.vim | 40 ------------------------------ syntax/vimwiki.vim | 14 ----------- syntax/vimwiki_markdown_custom.vim | 13 ---------- 7 files changed, 7 insertions(+), 136 deletions(-) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index 03a8d4e..0d5e03e 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -141,18 +141,12 @@ endfunction " }}} " vimwiki#base#cache_buffer_state function! vimwiki#base#cache_buffer_state() "{{{ - if !exists('g:vimwiki_current_idx') && g:vimwiki_debug - echo "[Vimwiki Internal Error]: Missing global state variable: 'g:vimwiki_current_idx'" - endif let b:vimwiki_idx = g:vimwiki_current_idx endfunction "}}} " vimwiki#base#recall_buffer_state function! vimwiki#base#recall_buffer_state() "{{{ if !exists('b:vimwiki_idx') - if g:vimwiki_debug - echo "[Vimwiki Internal Error]: Missing buffer state variable: 'b:vimwiki_idx'" - endif return 0 else let g:vimwiki_current_idx = b:vimwiki_idx @@ -404,10 +398,6 @@ endfunction "}}} function! vimwiki#base#open_link(cmd, link, ...) "{{{ let link_infos = vimwiki#base#resolve_link(a:link) - if g:vimwiki_debug - echom 'open_link:' string(link_infos) - endif - if link_infos.filename == '' echom 'Vimwiki Error: Unable to resolve link!' return @@ -1310,10 +1300,6 @@ function! vimwiki#base#goto_index(wnum, ...) "{{{ let cmd = 'edit' endif - if g:vimwiki_debug == 3 - echom "--- Goto_index g:curr_idx=".g:vimwiki_current_idx." ww_idx=".idx."" - endif - call Validate_wiki_options(idx) call vimwiki#base#edit_file(cmd, \ VimwikiGet('path', idx).VimwikiGet('index', idx). @@ -1909,9 +1895,6 @@ function! s:normalize_link_syntax_n() " {{{ \ g:vimwiki_rxWikiLinkMatchUrl, g:vimwiki_rxWikiLinkMatchDescr, \ g:vimwiki_WikiLinkTemplate2) call vimwiki#base#replacestr_at_cursor(g:vimwiki_rxWikiLink, sub) - if g:vimwiki_debug > 1 - echomsg "WikiLink: ".lnk." Sub: ".sub - endif return endif @@ -1919,9 +1902,6 @@ function! s:normalize_link_syntax_n() " {{{ let lnk = vimwiki#base#matchstr_at_cursor(g:vimwiki_rxWikiIncl) if !empty(lnk) " NO-OP !! - if g:vimwiki_debug > 1 - echomsg "WikiIncl: ".lnk." Sub: ".lnk - endif return endif @@ -1938,9 +1918,6 @@ function! s:normalize_link_syntax_n() " {{{ \ g:vimwiki_WikiLinkTemplate1) endif call vimwiki#base#replacestr_at_cursor('\V'.lnk, sub) - if g:vimwiki_debug > 1 - echomsg "Word: ".lnk." Sub: ".sub - endif return endif diff --git a/autoload/vimwiki/html.vim b/autoload/vimwiki/html.vim index 4c4a769..f198f36 100644 --- a/autoload/vimwiki/html.vim +++ b/autoload/vimwiki/html.vim @@ -396,11 +396,6 @@ function! s:tag_wikiincl(value) "{{{ let link_infos = vimwiki#base#resolve_link(url_0) - " TODO: migrate non-essential debugging messages into g:VimwikiLog - if g:vimwiki_debug > 1 - echom string(link_infos) - endif - if link_infos.scheme =~# '\mlocal\|wiki\d\+\|diary' let url = vimwiki#path#relpath(fnamemodify(s:current_html_file, ':h'), \ link_infos.filename) @@ -455,12 +450,6 @@ function! s:tag_wikilink(value) "{{{ let html_link = link_infos.filename endif - " generate html output - " TODO: migrate non-essential debugging messages into g:VimwikiLog - if g:vimwiki_debug > 1 - echom string(link_infos) - endif - if link_infos.anchor != '' let anchor = substitute(link_infos.anchor, '#', '-', 'g') let html_link .= '#'.anchor @@ -1403,10 +1392,6 @@ function! vimwiki#html#Wiki2HTML(path_html, wikifile) "{{{ let lsource = readfile(wikifile) let ldest = [] - "if g:vimwiki_debug - " echo 'Generating HTML ... ' - "endif - call vimwiki#path#mkdir(path_html) " nohtml placeholder -- to skip html generation. @@ -1526,9 +1511,6 @@ function! vimwiki#html#Wiki2HTML(path_html, wikifile) "{{{ " measure the elapsed time let time1 = vimwiki#u#time(starttime) "XXX call VimwikiLog_extend('html',[htmlfile,time1]) - "if g:vimwiki_debug - " echon "\r".htmlfile.' written (time: '.time1.'s)' - "endif return path_html.htmlfile endfunction "}}} diff --git a/autoload/vimwiki/markdown_base.vim b/autoload/vimwiki/markdown_base.vim index a303de2..9301a1e 100644 --- a/autoload/vimwiki/markdown_base.vim +++ b/autoload/vimwiki/markdown_base.vim @@ -133,9 +133,6 @@ function! s:normalize_link_syntax_n() " {{{ let lnk = vimwiki#base#matchstr_at_cursor(g:vimwiki_rxWikiIncl) if !empty(lnk) " NO-OP !! - if g:vimwiki_debug > 1 - echomsg "WikiIncl: ".lnk." Sub: ".lnk - endif return endif @@ -146,9 +143,6 @@ function! s:normalize_link_syntax_n() " {{{ \ g:vimwiki_rxWikiLinkMatchUrl, g:vimwiki_rxWikiLinkMatchDescr, \ g:vimwiki_WikiLink1Template2) call vimwiki#base#replacestr_at_cursor(g:vimwiki_rxWikiLink0, sub) - if g:vimwiki_debug > 1 - echomsg "WikiLink: ".lnk." Sub: ".sub - endif return endif @@ -159,9 +153,6 @@ function! s:normalize_link_syntax_n() " {{{ \ g:vimwiki_rxWikiLinkMatchUrl, g:vimwiki_rxWikiLinkMatchDescr, \ g:vimwiki_WikiLinkTemplate2) call vimwiki#base#replacestr_at_cursor(g:vimwiki_rxWikiLink1, sub) - if g:vimwiki_debug > 1 - echomsg "WikiLink: ".lnk." Sub: ".sub - endif return endif @@ -172,9 +163,6 @@ function! s:normalize_link_syntax_n() " {{{ \ g:vimwiki_rxWeblinkMatchUrl, g:vimwiki_rxWeblinkMatchDescr, \ g:vimwiki_Weblink1Template) call vimwiki#base#replacestr_at_cursor(g:vimwiki_rxWeblink, sub) - if g:vimwiki_debug > 1 - echomsg "WebLink: ".lnk." Sub: ".sub - endif return endif @@ -187,9 +175,6 @@ function! s:normalize_link_syntax_n() " {{{ \ g:vimwiki_rxWord, '', \ g:vimwiki_WikiLinkTemplate1) call vimwiki#base#replacestr_at_cursor('\V'.lnk, sub) - if g:vimwiki_debug > 1 - echomsg "Word: ".lnk." Sub: ".sub - endif return endif diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index d4493d0..03c2571 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -2594,19 +2594,6 @@ Note: Default: 15 ------------------------------------------------------------------------------- -*g:vimwiki_debug* - -Controls verbosity of debugging output, for example, the diagnostic -information about HTML conversion. - -Value Description~ -0 Do not show debug messages. -1 Show debug messages. - -Default: 0 - - ------------------------------------------------------------------------------ *g:vimwiki_diary_months* @@ -2718,6 +2705,13 @@ Contributors and their Github usernames in roughly chronological order: ============================================================================== 15. Changelog *vimwiki-changelog* +???~ + +Removed:~ + * Removed the option g:vimwiki_debug, which probably nobody used. If you + want it back, file an issue at Github. + + 2.2~ New:~ diff --git a/plugin/vimwiki.vim b/plugin/vimwiki.vim index b969ff8..9068a72 100644 --- a/plugin/vimwiki.vim +++ b/plugin/vimwiki.vim @@ -71,16 +71,10 @@ function! s:vimwiki_idx() " {{{ endfunction " }}} function! s:setup_buffer_leave() "{{{ - if g:vimwiki_debug == 3 - echom "Setup_buffer_leave g:curr_idx=".g:vimwiki_current_idx." b:curr_idx=".s:vimwiki_idx()."" - endif if &filetype ==? 'vimwiki' " cache global vars of current state XXX: SLOW!? call vimwiki#base#cache_buffer_state() endif - if g:vimwiki_debug == 3 - echom " Setup_buffer_leave g:curr_idx=".g:vimwiki_current_idx." b:curr_idx=".s:vimwiki_idx()."" - endif let &autowriteall = s:vimwiki_autowriteall @@ -91,16 +85,10 @@ function! s:setup_buffer_leave() "{{{ endfunction "}}} function! s:setup_filetype() "{{{ - if g:vimwiki_debug == 3 - echom "Setup_filetype g:curr_idx=".g:vimwiki_current_idx." b:curr_idx=".s:vimwiki_idx()."" - endif let time0 = reltime() " start the clock "XXX " Find what wiki current buffer belongs to. let path = expand('%:p:h') let idx = vimwiki#base#find_wiki(path) - if g:vimwiki_debug == 3 - echom " Setup_filetype g:curr_idx=".g:vimwiki_current_idx." find_idx=".idx." b:curr_idx=".s:vimwiki_idx()."" - endif if idx == -1 && g:vimwiki_global_ext == 0 return @@ -124,23 +112,14 @@ function! s:setup_filetype() "{{{ endif " initialize and cache global vars of current state call vimwiki#base#setup_buffer_state(idx) - if g:vimwiki_debug ==3 - echom " Setup_filetype g:curr_idx=".g:vimwiki_current_idx." (reset_wiki_state) b:curr_idx=".s:vimwiki_idx()."" - endif unlet! b:vimwiki_fs_rescan set filetype=vimwiki - if g:vimwiki_debug ==3 - echom " Setup_filetype g:curr_idx=".g:vimwiki_current_idx." (set ft=vimwiki) b:curr_idx=".s:vimwiki_idx()."" - endif let time1 = vimwiki#u#time(time0) "XXX call VimwikiLog_extend('timing',['plugin:setup_filetype:time1',time1]) endfunction "}}} function! s:setup_buffer_enter() "{{{ - if g:vimwiki_debug ==3 - echom "Setup_buffer_enter g:curr_idx=".g:vimwiki_current_idx." b:curr_idx=".s:vimwiki_idx()."" - endif let time0 = reltime() " start the clock "XXX if !vimwiki#base#recall_buffer_state() " Find what wiki current buffer belongs to. @@ -150,9 +129,6 @@ function! s:setup_buffer_enter() "{{{ let path = expand('%:p:h') let idx = vimwiki#base#find_wiki(path) - if g:vimwiki_debug ==3 - echom " Setup_buffer_enter g:curr_idx=".g:vimwiki_current_idx." find_idx=".idx." b:curr_idx=".s:vimwiki_idx()."" - endif " The buffer's file is not in the path and user *does NOT* want his wiki " extension to be global -- Do not add new wiki. if idx == -1 && g:vimwiki_global_ext == 0 @@ -176,9 +152,6 @@ function! s:setup_buffer_enter() "{{{ endif " initialize and cache global vars of current state call vimwiki#base#setup_buffer_state(idx) - if g:vimwiki_debug ==3 - echom " Setup_buffer_enter g:curr_idx=".g:vimwiki_current_idx." (reset_wiki_state) b:curr_idx=".s:vimwiki_idx()."" - endif endif @@ -188,18 +161,12 @@ function! s:setup_buffer_enter() "{{{ " au GUIEnter * nested VimwikiIndex if &filetype == '' set filetype=vimwiki - if g:vimwiki_debug ==3 - echom " Setup_buffer_enter g:curr_idx=".g:vimwiki_current_idx." (set ft vimwiki) b:curr_idx=".s:vimwiki_idx()."" - endif elseif &syntax ==? 'vimwiki' " to force a rescan of the filesystem which may have changed " and update VimwikiLinks syntax group that depends on it; " b:vimwiki_fs_rescan indicates that setup_filetype() has not been run if exists("b:vimwiki_fs_rescan") && VimwikiGet('maxhi') set syntax=vimwiki - if g:vimwiki_debug ==3 - echom " Setup_buffer_enter g:curr_idx=".g:vimwiki_current_idx." (set syntax=vimwiki) b:curr_idx=".s:vimwiki_idx()."" - endif endif let b:vimwiki_fs_rescan = 1 endif @@ -238,16 +205,10 @@ function! s:setup_buffer_enter() "{{{ endfunction "}}} function! s:setup_buffer_reenter() "{{{ - if g:vimwiki_debug ==3 - echom "Setup_buffer_reenter g:curr_idx=".g:vimwiki_current_idx." b:curr_idx=".s:vimwiki_idx()."" - endif if !vimwiki#base#recall_buffer_state() " Do not repeat work of s:setup_buffer_enter() and s:setup_filetype() " Once should be enough ... endif - if g:vimwiki_debug ==3 - echom " Setup_buffer_reenter g:curr_idx=".g:vimwiki_current_idx." b:curr_idx=".s:vimwiki_idx()."" - endif if !exists("s:vimwiki_autowriteall") let s:vimwiki_autowriteall = &autowriteall endif @@ -444,7 +405,6 @@ call s:default('html_header_numbering', 0) call s:default('html_header_numbering_sym', '') call s:default('conceallevel', 2) call s:default('url_maxsave', 15) -call s:default('debug', 0) call s:default('diary_months', \ { diff --git a/syntax/vimwiki.vim b/syntax/vimwiki.vim index ded43f3..e2245a3 100644 --- a/syntax/vimwiki.vim +++ b/syntax/vimwiki.vim @@ -177,9 +177,6 @@ let g:vimwiki_rxAnyLink = g:vimwiki_rxWikiLink.'\|'. " LINKS: highlighting is complicated due to "nonexistent" links feature {{{ function! s:add_target_syntax_ON(target, type) " {{{ - if g:vimwiki_debug > 1 - echom '[vimwiki_debug] syntax target > '.a:target - endif let prefix0 = 'syntax match '.a:type.' `' let suffix0 = '` display contains=@NoSpell,VimwikiLinkRest,'.a:type.'Char' let prefix1 = 'syntax match '.a:type.'T `' @@ -189,9 +186,6 @@ function! s:add_target_syntax_ON(target, type) " {{{ endfunction "}}} function! s:add_target_syntax_OFF(target) " {{{ - if g:vimwiki_debug > 1 - echom '[vimwiki_debug] syntax target > '.a:target - endif let prefix0 = 'syntax match VimwikiNoExistsLink `' let suffix0 = '` display contains=@NoSpell,VimwikiLinkRest,VimwikiLinkChar' let prefix1 = 'syntax match VimwikiNoExistsLinkT `' @@ -344,14 +338,6 @@ execute 'syn match VimwikiSubScript contained /'.g:vimwiki_char_subscript.'/'.s: " }}} " concealed link parts " {{{ -if g:vimwiki_debug > 1 - echom 'WikiLink Prefix: '.s:rx_wikilink_prefix - echom 'WikiLink Suffix: '.s:rx_wikilink_suffix - echom 'WikiLink Prefix1: '.s:rx_wikilink_prefix1 - echom 'WikiLink Suffix1: '.s:rx_wikilink_suffix1 - echom 'WikiIncl Prefix: '.g:vimwiki_rxWikiInclPrefix1 - echom 'WikiIncl Suffix: '.g:vimwiki_rxWikiInclSuffix1 -endif " define the conceal attribute for links only if Vim is new enough to handle it " and the user has g:vimwiki_url_maxsave > 0 diff --git a/syntax/vimwiki_markdown_custom.vim b/syntax/vimwiki_markdown_custom.vim index b1658fd..7677dd7 100644 --- a/syntax/vimwiki_markdown_custom.vim +++ b/syntax/vimwiki_markdown_custom.vim @@ -204,9 +204,6 @@ let g:vimwiki_rxMkdRefMatchUrl = '\['.g:vimwiki_rxWikiLinkDescr.']:\%(\s\+\|\n\) " LINKS: highlighting is complicated due to "nonexistent" links feature {{{ function! s:add_target_syntax_ON(target, type) " {{{ - if g:vimwiki_debug > 1 - echom '[vimwiki_debug] syntax target > '.a:target - endif let prefix0 = 'syntax match '.a:type.' `' let suffix0 = '` display contains=@NoSpell,VimwikiLinkRest,'.a:type.'Char' let prefix1 = 'syntax match '.a:type.'T `' @@ -216,9 +213,6 @@ function! s:add_target_syntax_ON(target, type) " {{{ endfunction "}}} function! s:add_target_syntax_OFF(target, type) " {{{ - if g:vimwiki_debug > 1 - echom '[vimwiki_debug] syntax target > '.a:target - endif let prefix0 = 'syntax match VimwikiNoExistsLink `' let suffix0 = '` display contains=@NoSpell,VimwikiLinkRest,'.a:type.'Char' let prefix1 = 'syntax match VimwikiNoExistsLinkT `' @@ -340,13 +334,6 @@ endif syntax spell toplevel -if g:vimwiki_debug > 1 - echom 'WikiLink1 Prefix: '.g:vimwiki_rxWikiLink1Prefix1 - echom 'WikiLink1 Suffix: '.g:vimwiki_rxWikiLink1Suffix1 - echom 'Weblink1 Prefix: '.g:vimwiki_rxWeblink1Prefix1 - echom 'Weblink1 Suffix: '.g:vimwiki_rxWeblink1Suffix1 -endif - " VimwikiWikiLink1Char is for syntax markers (and also URL when a description " is present) and may be concealed let s:options = ' contained transparent contains=NONE' From 9be96884bacf69066c69ebb33723cb3082761712 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Mon, 7 Dec 2015 12:29:25 +0100 Subject: [PATCH 149/370] Remove g:VimwikiLog and the timing stuff For profiling, there is Vim's :profile command --- autoload/vimwiki/base.vim | 1 - autoload/vimwiki/html.vim | 9 +-------- autoload/vimwiki/u.vim | 5 ----- plugin/vimwiki.vim | 21 --------------------- syntax/vimwiki.vim | 11 ----------- syntax/vimwiki_markdown_custom.vim | 4 ---- 6 files changed, 1 insertion(+), 50 deletions(-) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index 0d5e03e..fe3c341 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -185,7 +185,6 @@ endfunction "}}} " vimwiki#base#subdir "FIXME TODO slow and faulty function! vimwiki#base#subdir(path, filename) "{{{ - let g:VimwikiLog.subdir += 1 "XXX let path = a:path " ensure that we are not fooled by a symbolic link "FIXME if we are not "fooled", we end up in a completely different wiki? diff --git a/autoload/vimwiki/html.vim b/autoload/vimwiki/html.vim index f198f36..1d4b562 100644 --- a/autoload/vimwiki/html.vim +++ b/autoload/vimwiki/html.vim @@ -1367,9 +1367,6 @@ function! vimwiki#html#CustomWiki2HTML(path, wikifile, force) "{{{ endfunction " }}} function! vimwiki#html#Wiki2HTML(path_html, wikifile) "{{{ - - let starttime = reltime() " start the clock - let done = 0 let wikifile = fnamemodify(a:wikifile, ":p") @@ -1496,7 +1493,7 @@ function! vimwiki#html#Wiki2HTML(path_html, wikifile) "{{{ call map(html_lines, 'substitute(v:val, "%encoding%", "'. enc .'", "g")') let html_lines = s:html_insert_contents(html_lines, ldest) " %contents% - + "" make html file. call writefile(html_lines, path_html.htmlfile) let done = 1 @@ -1508,10 +1505,6 @@ function! vimwiki#html#Wiki2HTML(path_html, wikifile) "{{{ return endif - " measure the elapsed time - let time1 = vimwiki#u#time(starttime) "XXX - call VimwikiLog_extend('html',[htmlfile,time1]) - return path_html.htmlfile endfunction "}}} diff --git a/autoload/vimwiki/u.vim b/autoload/vimwiki/u.vim index 51f35da..fd7e716 100644 --- a/autoload/vimwiki/u.vim +++ b/autoload/vimwiki/u.vim @@ -32,11 +32,6 @@ function! vimwiki#u#is_macos() return os == 'Darwin' || os == 'Mac' endfunction -function! vimwiki#u#time(starttime) "{{{ - " measure the elapsed time and cut away miliseconds and smaller - return matchstr(reltimestr(reltime(a:starttime)),'\d\+\(\.\d\d\)\=') -endfunction "}}} - function! vimwiki#u#count_first_sym(line) "{{{ let first_sym = matchstr(a:line, '\S') return len(matchstr(a:line, first_sym.'\+')) diff --git a/plugin/vimwiki.vim b/plugin/vimwiki.vim index 9068a72..09ad886 100644 --- a/plugin/vimwiki.vim +++ b/plugin/vimwiki.vim @@ -11,18 +11,6 @@ let g:loaded_vimwiki = 1 let s:old_cpo = &cpo set cpo&vim -" Logging and performance instrumentation "{{{ -let g:VimwikiLog = {} -let g:VimwikiLog.path = 0 " # of calls to VimwikiGet with path or path_html -let g:VimwikiLog.path_html = 0 " # of calls to path_html() -let g:VimwikiLog.normalize_path = 0 " # of calls to normalize_path() -let g:VimwikiLog.subdir = 0 " # of calls to vimwiki#base#subdir() -let g:VimwikiLog.timing = [] " various timing measurements -let g:VimwikiLog.html = [] " html conversion timing -function! VimwikiLog_extend(what,...) "{{{ - call extend(g:VimwikiLog[a:what],a:000) -endfunction "}}} -"}}} " HELPER functions {{{ function! s:default(varname, value) "{{{ @@ -36,14 +24,12 @@ function! s:path_html(idx) "{{{ if !empty(path_html) return path_html else - let g:VimwikiLog.path_html += 1 "XXX let path = VimwikiGet('path', a:idx) return substitute(path, '[/\\]\+$', '', '').'_html/' endif endfunction "}}} function! s:normalize_path(path) "{{{ - let g:VimwikiLog.normalize_path += 1 "XXX " resolve doesn't work quite right with symlinks ended with / or \ let path = substitute(a:path, '[/\\]\+$', '', '') if path !~# '^scp:' @@ -85,7 +71,6 @@ function! s:setup_buffer_leave() "{{{ endfunction "}}} function! s:setup_filetype() "{{{ - let time0 = reltime() " start the clock "XXX " Find what wiki current buffer belongs to. let path = expand('%:p:h') let idx = vimwiki#base#find_wiki(path) @@ -115,12 +100,9 @@ function! s:setup_filetype() "{{{ unlet! b:vimwiki_fs_rescan set filetype=vimwiki - let time1 = vimwiki#u#time(time0) "XXX - call VimwikiLog_extend('timing',['plugin:setup_filetype:time1',time1]) endfunction "}}} function! s:setup_buffer_enter() "{{{ - let time0 = reltime() " start the clock "XXX if !vimwiki#base#recall_buffer_state() " Find what wiki current buffer belongs to. " If wiki does not exist in g:vimwiki_list -- add new wiki there with @@ -170,7 +152,6 @@ function! s:setup_buffer_enter() "{{{ endif let b:vimwiki_fs_rescan = 1 endif - let time1 = vimwiki#u#time(time0) "XXX " Settings foldmethod, foldexpr and foldtext are local to window. Thus in a " new tab with the same buffer folding is reset to vim defaults. So we @@ -200,8 +181,6 @@ function! s:setup_buffer_enter() "{{{ if g:vimwiki_menu != "" exe 'nmenu enable '.g:vimwiki_menu.'.Table' endif - "let time2 = vimwiki#u#time(time0) "XXX - call VimwikiLog_extend('timing',['plugin:setup_buffer_enter:time1',time1]) endfunction "}}} function! s:setup_buffer_reenter() "{{{ diff --git a/syntax/vimwiki.vim b/syntax/vimwiki.vim index e2245a3..fbd4679 100644 --- a/syntax/vimwiki.vim +++ b/syntax/vimwiki.vim @@ -10,14 +10,12 @@ elseif exists("b:current_syntax") endif "TODO do nothing if ...? (?) -let g:starttime = reltime() " start the clock if VimwikiGet('maxhi') let b:existing_wikifiles = \ vimwiki#base#get_wikilinks(g:vimwiki_current_idx, 1) let b:existing_wikidirs = \ vimwiki#base#get_wiki_directories(g:vimwiki_current_idx) endif -let s:timescans = vimwiki#u#time(g:starttime) "XXX "let b:xxx = 1 "TODO ? update wikilink syntax group here if really needed (?) for :e and such "if VimwikiGet('maxhi') @@ -47,8 +45,6 @@ let g:vimwiki_rxWeblinkUrl = g:vimwiki_rxWebProtocols . call vimwiki#u#reload_regexes() -let s:time0 = vimwiki#u#time(g:starttime) "XXX - " LINKS: setup of larger regexes {{{ " LINKS: setup wikilink regexps {{{ @@ -246,16 +242,12 @@ if VimwikiGet('maxhi') call s:add_target_syntax_OFF(g:vimwiki_rxWikiIncl) " Subsequently, links verified on vimwiki's path are highlighted as existing - let s:time01 = vimwiki#u#time(g:starttime) "XXX call s:highlight_existing_links() - let s:time02 = vimwiki#u#time(g:starttime) "XXX else - let s:time01 = vimwiki#u#time(g:starttime) "XXX " Wikilink call s:add_target_syntax_ON(g:vimwiki_rxWikiLink, 'VimwikiLink') " WikiIncl call s:add_target_syntax_ON(g:vimwiki_rxWikiIncl, 'VimwikiLink') - let s:time02 = vimwiki#u#time(g:starttime) "XXX endif " Weblink @@ -613,6 +605,3 @@ call vimwiki#base#nested_syntax('tex', syntax spell toplevel - -let s:timeend = vimwiki#u#time(g:starttime) "XXX -call VimwikiLog_extend('timing',['syntax:scans',s:timescans],['syntax:regexloaded',s:time0],['syntax:beforeHLexisting',s:time01],['syntax:afterHLexisting',s:time02],['syntax:end',s:timeend]) diff --git a/syntax/vimwiki_markdown_custom.vim b/syntax/vimwiki_markdown_custom.vim index 7677dd7..db39421 100644 --- a/syntax/vimwiki_markdown_custom.vim +++ b/syntax/vimwiki_markdown_custom.vim @@ -285,14 +285,10 @@ if VimwikiGet('maxhi') call s:add_target_syntax_OFF(g:vimwiki_rxWikiLink1, 'VimwikiWikiLink1') " Subsequently, links verified on vimwiki's path are highlighted as existing - let s:time01 = vimwiki#u#time(g:starttime) "XXX call s:highlight_existing_links() - let s:time02 = vimwiki#u#time(g:starttime) "XXX else - let s:time01 = vimwiki#u#time(g:starttime) "XXX " Wikilink call s:add_target_syntax_ON(g:vimwiki_rxWikiLink1, 'VimwikiWikiLink1') - let s:time02 = vimwiki#u#time(g:starttime) "XXX endif " Weblink From e0d72759a6b6531c55527171396e6bf6961ec98a Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Thu, 10 Dec 2015 16:07:36 +0100 Subject: [PATCH 150/370] Remember kids: always use :normal! with the bang in plugins Fix #175 --- doc/vimwiki.txt | 4 +++- plugin/vimwiki.vim | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index 03c2571..6c01e3e 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -2705,12 +2705,14 @@ Contributors and their Github usernames in roughly chronological order: ============================================================================== 15. Changelog *vimwiki-changelog* -???~ +2.2.1~ Removed:~ * Removed the option g:vimwiki_debug, which probably nobody used. If you want it back, file an issue at Github. +Fixed:~ + * don't do random things when the user has remapped the z key 2.2~ diff --git a/plugin/vimwiki.vim b/plugin/vimwiki.vim index 09ad886..a910e54 100644 --- a/plugin/vimwiki.vim +++ b/plugin/vimwiki.vim @@ -169,7 +169,7 @@ function! s:setup_buffer_enter() "{{{ setlocal foldtext=VimwikiFoldText() else setlocal fdm=manual - exe "normal zE" + normal! zE endif " And conceal level too. From 3bd3d9b86036b21aecd69f0a1e572643d626c280 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Thu, 10 Dec 2015 16:19:26 +0100 Subject: [PATCH 151/370] Update changelog --- doc/vimwiki.txt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index 6c01e3e..4706fce 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -2700,21 +2700,28 @@ Contributors and their Github usernames in roughly chronological order: - 修昊 (Svtter) - Marcelo D Montu (mMontu) - John Kaul + - Hongbo Liu (hiberabyss) ============================================================================== 15. Changelog *vimwiki-changelog* -2.2.1~ + +2.2.1 (2015-12-10)~ Removed:~ * Removed the option g:vimwiki_debug, which probably nobody used. If you want it back, file an issue at Github. Fixed:~ - * don't do random things when the user has remapped the z key + * Don't do random things when the user has remapped the z key + * Don't ask for confirmation when following an URL in MacOS + * Always jump to the first occurrence of a tag in a file + * Don't move the cursor when updating the TOC + * Fix some issues with the TOC when folding is enabled -2.2~ + +2.2 (2015-11-25)~ New:~ * Support for anchors, see |vimwiki-anchors| From 949b29b6943a0448f6d4551d62d2d24843b00496 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Mon, 14 Dec 2015 10:36:16 +0100 Subject: [PATCH 152/370] Fix tags file path when 'path' contains spaces Fix #176 --- ftplugin/vimwiki.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ftplugin/vimwiki.vim b/ftplugin/vimwiki.vim index f34300c..9d17fd5 100644 --- a/ftplugin/vimwiki.vim +++ b/ftplugin/vimwiki.vim @@ -31,7 +31,7 @@ execute 'setlocal suffixesadd='.VimwikiGet('ext') setlocal isfname-=[,] " gf}}} -exe "setlocal tags+=" . vimwiki#tags#metadata_file_path() +exe "setlocal tags+=" . escape(vimwiki#tags#metadata_file_path(), ' \|"') " MISC }}} From b0cc6ff0de49820acc4b385b41726b213d474087 Mon Sep 17 00:00:00 2001 From: zhang_ji Date: Mon, 18 Jan 2016 16:51:08 +0800 Subject: [PATCH 153/370] fix #64: markdown style link support --- autoload/vimwiki/markdown_base.vim | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/autoload/vimwiki/markdown_base.vim b/autoload/vimwiki/markdown_base.vim index 9301a1e..3053629 100644 --- a/autoload/vimwiki/markdown_base.vim +++ b/autoload/vimwiki/markdown_base.vim @@ -108,6 +108,8 @@ function! vimwiki#markdown_base#follow_link(split, ...) "{{{ Parse link at curso if lnk != "" if !VimwikiLinkHandler(lnk) if !vimwiki#markdown_base#open_reflink(lnk) + " remove the extension from the filename if exists + let lnk = substitute(lnk, VimwikiGet('ext').'$', '', '') call vimwiki#base#open_link(cmd, lnk) endif endif @@ -173,7 +175,7 @@ function! s:normalize_link_syntax_n() " {{{ if !empty(lnk) let sub = vimwiki#base#normalize_link_helper(lnk, \ g:vimwiki_rxWord, '', - \ g:vimwiki_WikiLinkTemplate1) + \ g:vimwiki_Weblink1Template) call vimwiki#base#replacestr_at_cursor('\V'.lnk, sub) return endif @@ -192,9 +194,10 @@ function! s:normalize_link_syntax_v() " {{{ try norm! gvy let visual_selection = @" - let visual_selection = substitute(g:vimwiki_WikiLinkTemplate1, '__LinkUrl__', '\='."'".visual_selection."'", '') + let link = substitute(g:vimwiki_Weblink1Template, '__LinkUrl__', '\='."'".visual_selection."'", '') + let link = substitute(link, '__LinkDescription__', '\='."''", '') - call setreg('"', visual_selection, 'v') + call setreg('"', link, 'v') " paste result norm! `>pgvd From bb3026dba86e182881e1549660f1134bc42abb86 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Thu, 21 Jan 2016 13:25:04 +0100 Subject: [PATCH 154/370] Include subdir in wiki page name when rebuilding tags Ref #184 --- autoload/vimwiki/tags.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autoload/vimwiki/tags.vim b/autoload/vimwiki/tags.vim index ae7ee03..3bb4ce2 100644 --- a/autoload/vimwiki/tags.vim +++ b/autoload/vimwiki/tags.vim @@ -41,12 +41,14 @@ function! vimwiki#tags#update_tags(full_rebuild, all_files) "{{{ call s:write_tags_metadata(metadata) else " full rebuild let files = vimwiki#base#find_files(g:vimwiki_current_idx, 0) + let wiki_base_dir = VimwikiGet('path', g:vimwiki_current_idx) let tags_file_last_modification = \ getftime(vimwiki#tags#metadata_file_path()) let metadata = s:load_tags_metadata() for file in files if all_files || getftime(file) >= tags_file_last_modification - let page_name = fnamemodify(file, ':t:r') + let subdir = vimwiki#base#subdir(wiki_base_dir, file) + let page_name = subdir . fnamemodify(file, ':t:r') let tags = s:scan_tags(readfile(file), page_name) let metadata = s:remove_page_from_tags(metadata, page_name) let metadata = s:merge_tags(metadata, page_name, tags) From ff90e980de00e6bf7ec2f4dd8aa69f3d680927e6 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Thu, 21 Jan 2016 13:27:08 +0100 Subject: [PATCH 155/370] Locate the .tags file correctly on windows Ref #184 --- autoload/vimwiki/path.vim | 19 +++++++++++++++++++ autoload/vimwiki/tags.vim | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/autoload/vimwiki/path.vim b/autoload/vimwiki/path.vim index 5cca141..f57c6fb 100644 --- a/autoload/vimwiki/path.vim +++ b/autoload/vimwiki/path.vim @@ -148,3 +148,22 @@ function! vimwiki#path#is_absolute(path) "{{{ return a:path =~# '\m^/\|\~/' endif endfunction "}}} + + +" Combine a directory and a file into one path, doesn't generate duplicate +" path separator in case the directory is also having an ending / or \. This +" is because on windows ~\vimwiki//.tags is invalid but ~\vimwiki/.tags is a +" valid path. +if vimwiki#u#is_windows() + function! vimwiki#path#join_path(directory, file) + let directory = vimwiki#path#chomp_slash(a:directory) + let file = substitute(a:file, '\m^[\\/]\+', '', '') + return directory . '/' . file + endfunction +else + function! vimwiki#path#join_path(directory, file) + let directory = substitute(a:directory, '\m/\+$', '', '') + let file = substitute(a:file, '\m^/\+', '', '') + return directory . '/' . file + endfunction +endif diff --git a/autoload/vimwiki/tags.vim b/autoload/vimwiki/tags.vim index 3bb4ce2..79068c1 100644 --- a/autoload/vimwiki/tags.vim +++ b/autoload/vimwiki/tags.vim @@ -141,7 +141,7 @@ endfunction " }}} " vimwiki#tags#metadata_file_path " Returns tags metadata file path function! vimwiki#tags#metadata_file_path() abort "{{{ - return fnamemodify(VimwikiGet('path') . '/' . s:TAGS_METADATA_FILE_NAME, ':p') + return fnamemodify(vimwiki#path#join_path(VimwikiGet('path'), s:TAGS_METADATA_FILE_NAME), ':p') endfunction " }}} " s:load_tags_metadata From 1db59242713d5ea6920696e9b1e1108238df8411 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Thu, 21 Jan 2016 13:27:43 +0100 Subject: [PATCH 156/370] Update the changelog --- doc/vimwiki.txt | 56 ++++++++++++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index 8051095..221d046 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -2704,30 +2704,49 @@ Old homepage: http://code.google.com/p/vimwiki/ Contributors and their Github usernames in roughly chronological order: - - Maxim Kim (habamax) as original author + - Maxim Kim (@habamax) as original author - the people here: http://code.google.com/p/vimwiki/people/list - - Stuart Andrews (tub78) + - Stuart Andrews (@tub78) - Tomas Pospichal - - Daniel Schemala (EinfachToll) as current maintainer - - Larry Hynes (larryhynes) - - Hector Arciga (harciga) - - Alexey Radkov (lyokha) - - Aaron Franks (af) - - Dan Bernier (danbernier) - - Carl Helmertz (chelmertz) - - Karl Yngve Lervåg (lervag) - - Patrick Davey (patrickdavey) - - Ivan Tishchenko (t7ko) - - 修昊 (Svtter) - - Marcelo D Montu (mMontu) + - Daniel Schemala (@EinfachToll) as current maintainer + - Larry Hynes (@larryhynes) + - Hector Arciga (@harciga) + - Alexey Radkov (@lyokha) + - Aaron Franks (@af) + - Dan Bernier (@danbernier) + - Carl Helmertz (@chelmertz) + - Karl Yngve Lervåg (@lervag) + - Patrick Davey (@patrickdavey) + - Ivan Tishchenko (@t7ko) + - 修昊 (@Svtter) + - Marcelo D Montu (@mMontu) - John Kaul - - Hongbo Liu (hiberabyss) + - Hongbo Liu (@hiberabyss) + - @Tomsod + - @wangzq ============================================================================== 15. Changelog *vimwiki-changelog* +Issue numbers starting with '#' are issues from +https://github.com/vimwiki/vimwiki/issues/, all others from +http://code.google.com/p/vimwiki/issues/list. They may be accessible from +https://github.com/vimwiki-backup/vimwiki/issues. + + +???~ + +New: + * Add |:VimwikiMakeYesterdayDiaryNote| command + +Fixed: + * Issue #176: Fix issue when the wiki path contains spaces + * Also look for tags in wiki files in subdirectories + * Locate the .tags file correctly on Windows + + 2.2.1 (2015-12-10)~ Removed:~ @@ -2735,7 +2754,7 @@ Removed:~ want it back, file an issue at Github. Fixed:~ - * Don't do random things when the user has remapped the z key + * Issue #175: Don't do random things when the user has remapped the z key * Don't ask for confirmation when following an URL in MacOS * Always jump to the first occurrence of a tag in a file * Don't move the cursor when updating the TOC @@ -2811,11 +2830,6 @@ Fixed:~ * Corrected website links in documentation. code.google is dead, long live Github! -Issue numbers starting with '#' are issues from -https://github.com/vimwiki/vimwiki/issues/, all others from -http://code.google.com/p/vimwiki/issues/list. They may be accessible from -https://github.com/vimwiki-backup/vimwiki/issues. - 2.1~ * Concealing of links can be turned off - set |g:vimwiki_url_maxsave| to 0. From 78cef05fa34571111fa026ed4bc4d852f4a94608 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Fri, 22 Jan 2016 13:32:01 +0100 Subject: [PATCH 157/370] Fix HTML conversion of headers containing links Fix #183 --- autoload/vimwiki/html.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/vimwiki/html.vim b/autoload/vimwiki/html.vim index 1d4b562..8a6685c 100644 --- a/autoload/vimwiki/html.vim +++ b/autoload/vimwiki/html.vim @@ -1046,6 +1046,8 @@ function! s:process_tag_h(line, id) "{{{ let h_part .= '>' endif + let h_text = s:process_inline_tags(h_text, a:id) + let line = h_part.h_text.'' let processed = 1 @@ -1252,8 +1254,6 @@ function! s:parse_line(line, state) " {{{ let state.quote = s:close_tag_quote(state.quote, res_lines) let state.para = s:close_tag_para(state.para, res_lines) - let line = s:process_inline_tags(line, state.header_ids) - call add(res_lines, line) endif endif From 91a004bc232bade9754b092ac29c03b3c16066ea Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Mon, 25 Jan 2016 13:47:41 +0100 Subject: [PATCH 158/370] Remove superfluous debug message --- autoload/vimwiki/tbl.vim | 1 - 1 file changed, 1 deletion(-) diff --git a/autoload/vimwiki/tbl.vim b/autoload/vimwiki/tbl.vim index d8c1cb3..b05d67c 100644 --- a/autoload/vimwiki/tbl.vim +++ b/autoload/vimwiki/tbl.vim @@ -415,7 +415,6 @@ function! vimwiki#tbl#goto_prev_col() "{{{ let newcol = s:get_indent(lnum) let max_lens = s:get_cell_max_lens(lnum) let prev_cell_len = 0 - echom string(max_lens) for cell_len in values(max_lens) let delta = cell_len + 3 " +3 == 2 spaces + 1 separator |... if newcol + delta > curcol-1 From fc947523b0fce5923426216ded5b6b46055bd59e Mon Sep 17 00:00:00 2001 From: mMontu Date: Wed, 27 Jan 2016 10:14:49 -0200 Subject: [PATCH 159/370] Dynamically detect nested syntaxes (fix #128) --- autoload/vimwiki/base.vim | 12 ++++++++++++ syntax/vimwiki.vim | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index dceb57d..7fb1f7f 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -1926,6 +1926,18 @@ function! vimwiki#base#normalize_link(is_visual_mode) "{{{ endif endfunction "}}} +" vimwiki#base#detect_nested_syntax +function! vimwiki#base#detect_nested_syntax() "{{{ + let last_word = '\v.*<(\w+)\s*$' + let lines = map(filter(getline(1, "$"), 'v:val =~ "{{{" && v:val =~ last_word'), + \ 'substitute(v:val, last_word, "\\=submatch(1)", "")') + let dict = {} + for elem in lines + exe "let dict.".elem." = elem" + endfor + return dict +endfunction "}}} + " }}} " Command completion functions {{{ diff --git a/syntax/vimwiki.vim b/syntax/vimwiki.vim index fb52ff6..4cf9d91 100644 --- a/syntax/vimwiki.vim +++ b/syntax/vimwiki.vim @@ -600,7 +600,7 @@ call vimwiki#u#reload_regexes_custom() let b:current_syntax="vimwiki" " EMBEDDED syntax setup "{{{ -let s:nested = VimwikiGet('nested_syntaxes') +let s:nested = extend(VimwikiGet('nested_syntaxes'), vimwiki#base#detect_nested_syntax()) if !empty(s:nested) for [s:hl_syntax, s:vim_syntax] in items(s:nested) call vimwiki#base#nested_syntax(s:vim_syntax, From a2888692fd05f9c60c4f0a2e5798d75add641690 Mon Sep 17 00:00:00 2001 From: mMontu Date: Wed, 27 Jan 2016 13:30:30 -0200 Subject: [PATCH 160/370] Option for automatic detection of nested syntaxes --- doc/vimwiki.txt | 14 ++++++++++++++ plugin/vimwiki.vim | 1 + syntax/vimwiki.vim | 5 ++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index c145211..ae11ca2 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -1940,6 +1940,20 @@ or in: > }}} +*vimwiki-option-automatic_nested_syntaxes* +------------------------------------------------------------------------------ +Key Default value~ +automatic_nested_syntaxes 1 + +Description~ +Allows for smaller |vimwiki-option-nested_syntaxes| dictionaries, by turning +entry for python on the previous example unnecessary: > + let wiki.nested_syntaxes = {'python': 'python', 'c++': 'cpp'} + +It requires that the file is reloaded (|:edit|) after new |filetype| is +included in a file. + + *vimwiki-option-diary_rel_path* ------------------------------------------------------------------------------ Key Default value~ diff --git a/plugin/vimwiki.vim b/plugin/vimwiki.vim index 8d3a577..a9fc7e2 100644 --- a/plugin/vimwiki.vim +++ b/plugin/vimwiki.vim @@ -390,6 +390,7 @@ let s:vimwiki_defaults.template_default = '' let s:vimwiki_defaults.template_ext = '' let s:vimwiki_defaults.nested_syntaxes = {} +let s:vimwiki_defaults.automatic_nested_syntaxes = 1 let s:vimwiki_defaults.auto_export = 0 let s:vimwiki_defaults.auto_toc = 0 " is wiki temporary -- was added to g:vimwiki_list by opening arbitrary wiki diff --git a/syntax/vimwiki.vim b/syntax/vimwiki.vim index 4cf9d91..8925b95 100644 --- a/syntax/vimwiki.vim +++ b/syntax/vimwiki.vim @@ -600,7 +600,10 @@ call vimwiki#u#reload_regexes_custom() let b:current_syntax="vimwiki" " EMBEDDED syntax setup "{{{ -let s:nested = extend(VimwikiGet('nested_syntaxes'), vimwiki#base#detect_nested_syntax()) +let s:nested = VimwikiGet('nested_syntaxes') +if VimwikiGet('automatic_nested_syntaxes') + let s:nested = extend(s:nested, vimwiki#base#detect_nested_syntax()) +endif if !empty(s:nested) for [s:hl_syntax, s:vim_syntax] in items(s:nested) call vimwiki#base#nested_syntax(s:vim_syntax, From 5f9dbca89c593e710b0399d0ecc37c5b83d28d4f Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Thu, 28 Jan 2016 10:52:40 +0100 Subject: [PATCH 161/370] Small cleanup of the merged PR Ref #187 --- autoload/vimwiki/base.vim | 2 +- doc/vimwiki.txt | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index 0681c8a..f6f5772 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -1972,7 +1972,7 @@ function! vimwiki#base#detect_nested_syntax() "{{{ \ 'substitute(v:val, last_word, "\\=submatch(1)", "")') let dict = {} for elem in lines - exe "let dict.".elem." = elem" + let dict[elem] = elem endfor return dict endfunction "}}} diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index b5793ca..2c4f378 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -2017,16 +2017,24 @@ or in: > *vimwiki-option-automatic_nested_syntaxes* ------------------------------------------------------------------------------ -Key Default value~ -automatic_nested_syntaxes 1 +Key Default value~ +automatic_nested_syntaxes 1 Description~ -Allows for smaller |vimwiki-option-nested_syntaxes| dictionaries, by turning -entry for python on the previous example unnecessary: > - let wiki.nested_syntaxes = {'python': 'python', 'c++': 'cpp'} +If set, the nested syntaxes (|vimwiki-option-nested_syntaxes|) are +automatically derived when opening a buffer. +Just write your preformatted text in your file like this > + {{{xxx + my preformatted text + }}} -It requires that the file is reloaded (|:edit|) after new |filetype| is -included in a file. +where xxx is a Vim filetype. + +Note that you may have to reload the file (|:edit|) to see the highlight. + +Since every file is scanned for the markers of preformatted text when it is +opened, it can be slow when you have huge files. In this case, set this option +to 0. *vimwiki-option-diary_rel_path* From 0ea8d85b7f3a5fbad0bfc95cd4b48ea1a6e6c3df Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Fri, 19 Feb 2016 11:32:58 +0100 Subject: [PATCH 162/370] Sort links in the list generated by VimwikiGenerateTags Fix #192 --- autoload/vimwiki/tags.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/vimwiki/tags.vim b/autoload/vimwiki/tags.vim index 79068c1..8c9cc5f 100644 --- a/autoload/vimwiki/tags.vim +++ b/autoload/vimwiki/tags.vim @@ -317,7 +317,7 @@ function! vimwiki#tags#generate_tags(...) abort "{{{ \ '', \ substitute(g:vimwiki_rxH2_Template, '__Header__', tagname, ''), \ '' ]) - for taglink in tags_entries[tagname] + for taglink in sort(tags_entries[tagname]) call add(lines, bullet . \ substitute(g:vimwiki_WikiLinkTemplate1, '__LinkUrl__', taglink, '')) endfor From 6d96516ab49704a5b59d102a1de08ddb691afab2 Mon Sep 17 00:00:00 2001 From: zhang_ji Date: Mon, 22 Feb 2016 16:00:37 +0800 Subject: [PATCH 163/370] enhance #64: generate same link type for visual mode and normal mode --- autoload/vimwiki/markdown_base.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/vimwiki/markdown_base.vim b/autoload/vimwiki/markdown_base.vim index 3053629..ef2eb36 100644 --- a/autoload/vimwiki/markdown_base.vim +++ b/autoload/vimwiki/markdown_base.vim @@ -195,7 +195,7 @@ function! s:normalize_link_syntax_v() " {{{ norm! gvy let visual_selection = @" let link = substitute(g:vimwiki_Weblink1Template, '__LinkUrl__', '\='."'".visual_selection."'", '') - let link = substitute(link, '__LinkDescription__', '\='."''", '') + let link = substitute(link, '__LinkDescription__', '\='."'".visual_selection."'", '') call setreg('"', link, 'v') From c2d18692279b577b3d31c8c9588d92c0ad2321ce Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 29 Feb 2016 16:12:56 -0500 Subject: [PATCH 164/370] Escape tilde (~) in path names otherwise regex comparison gets upset --- autoload/vimwiki/u.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/vimwiki/u.vim b/autoload/vimwiki/u.vim index fd7e716..29f53e2 100644 --- a/autoload/vimwiki/u.vim +++ b/autoload/vimwiki/u.vim @@ -38,7 +38,7 @@ function! vimwiki#u#count_first_sym(line) "{{{ endfunction "}}} function! vimwiki#u#escape(string) "{{{ - return escape(a:string, '.*[]\^$') + return escape(a:string, '~.*[]\^$') endfunction "}}} " Load concrete Wiki syntax: sets regexes and templates for headers and links From 4bd0690a526963784a4811803dfacf40a9dd7052 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Fri, 18 Mar 2016 15:16:59 +0100 Subject: [PATCH 165/370] Simplify some regexes --- autoload/vimwiki/lst.vim | 8 ++++---- ftplugin/vimwiki.vim | 6 +++--- syntax/vimwiki.vim | 22 ++++++++++++++-------- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/autoload/vimwiki/lst.vim b/autoload/vimwiki/lst.vim index db1680a..ee465e4 100644 --- a/autoload/vimwiki/lst.vim +++ b/autoload/vimwiki/lst.vim @@ -376,10 +376,10 @@ endfunction "}}} "If there is no second argument, 0 is returned at a header, otherwise the "header is skipped function! s:get_next_line(lnum, ...) "{{{ - if getline(a:lnum) =~# '^\s*'.g:vimwiki_rxPreStart + if getline(a:lnum) =~# g:vimwiki_rxPreStart let cur_ln = a:lnum + 1 while cur_ln <= line('$') && - \ getline(cur_ln) !~# '^\s*'.g:vimwiki_rxPreEnd.'\s*$' + \ getline(cur_ln) !~# g:vimwiki_rxPreEnd let cur_ln += 1 endwhile let next_line = cur_ln @@ -404,10 +404,10 @@ endfunction "}}} function! s:get_prev_line(lnum) "{{{ let prev_line = prevnonblank(a:lnum-1) - if getline(prev_line) =~# '^\s*'.g:vimwiki_rxPreEnd.'\s*$' + if getline(prev_line) =~# g:vimwiki_rxPreEnd let cur_ln = a:lnum - 1 while 1 - if cur_ln == 0 || getline(cur_ln) =~# '^\s*'.g:vimwiki_rxPreStart + if cur_ln == 0 || getline(cur_ln) =~# g:vimwiki_rxPreStart break endif let cur_ln -= 1 diff --git a/ftplugin/vimwiki.vim b/ftplugin/vimwiki.vim index 9d17fd5..d3c4e95 100644 --- a/ftplugin/vimwiki.vim +++ b/ftplugin/vimwiki.vim @@ -173,9 +173,9 @@ function! VimwikiFoldLevel(lnum) "{{{ if line =~# g:vimwiki_rxHeader return '>'.vimwiki#u#count_first_sym(line) " Code block folding... - elseif line =~# '^\s*'.g:vimwiki_rxPreStart + elseif line =~# g:vimwiki_rxPreStart return 'a1' - elseif line =~# '^\s*'.g:vimwiki_rxPreEnd.'\s*$' + elseif line =~# g:vimwiki_rxPreEnd return 's1' else return "=" @@ -221,7 +221,7 @@ function! VimwikiFoldText() "{{{ let main_text = substitute(line, '^\s*', repeat(' ',indent(v:foldstart)), '') let fold_len = v:foldend - v:foldstart + 1 let len_text = ' ['.fold_len.'] ' - if line !~# '^\s*'.g:vimwiki_rxPreStart + if line !~# g:vimwiki_rxPreStart let [main_text, spare_len] = s:shorten_text(main_text, 50) return main_text.len_text else diff --git a/syntax/vimwiki.vim b/syntax/vimwiki.vim index 479bc67..f45cb02 100644 --- a/syntax/vimwiki.vim +++ b/syntax/vimwiki.vim @@ -315,6 +315,12 @@ endfor " }}} +let g:vimwiki_rxPreStart = '^\s*'.g:vimwiki_rxPreStart +let g:vimwiki_rxPreEnd = '^\s*'.g:vimwiki_rxPreEnd.'\s*$' + +let g:vimwiki_rxMathStart = '^\s*'.g:vimwiki_rxMathStart +let g:vimwiki_rxMathEnd = '^\s*'.g:vimwiki_rxMathEnd.'\s*$' + " possibly concealed chars " {{{ let s:conceal = exists("+conceallevel") ? ' conceal' : '' @@ -444,11 +450,11 @@ execute 'syntax match VimwikiCodeT /'.g:vimwiki_rxCode.'/ contained contains=Vim "
horizontal rule execute 'syntax match VimwikiHR /'.g:vimwiki_rxHR.'/' -execute 'syntax region VimwikiPre start=/^\s*'.g:vimwiki_rxPreStart. - \ '/ end=/^\s*'.g:vimwiki_rxPreEnd.'\s*$/ contains=@Spell' +execute 'syntax region VimwikiPre start=/'.g:vimwiki_rxPreStart. + \ '/ end=/'.g:vimwiki_rxPreEnd.'/ contains=@Spell' -execute 'syntax region VimwikiMath start=/^\s*'.g:vimwiki_rxMathStart. - \ '/ end=/^\s*'.g:vimwiki_rxMathEnd.'\s*$/ contains=@Spell' +execute 'syntax region VimwikiMath start=/'.g:vimwiki_rxMathStart. + \ '/ end=/'.g:vimwiki_rxMathEnd.'/ contains=@Spell' " placeholders @@ -594,16 +600,16 @@ endif if !empty(s:nested) for [s:hl_syntax, s:vim_syntax] in items(s:nested) call vimwiki#base#nested_syntax(s:vim_syntax, - \ '^\s*'.g:vimwiki_rxPreStart.'\%(.*[[:blank:][:punct:]]\)\?'. + \ g:vimwiki_rxPreStart.'\%(.*[[:blank:][:punct:]]\)\?'. \ s:hl_syntax.'\%([[:blank:][:punct:]].*\)\?', - \ '^\s*'.g:vimwiki_rxPreEnd, 'VimwikiPre') + \ g:vimwiki_rxPreEnd, 'VimwikiPre') endfor endif " LaTeX call vimwiki#base#nested_syntax('tex', - \ '^\s*'.g:vimwiki_rxMathStart.'\%(.*[[:blank:][:punct:]]\)\?'. + \ g:vimwiki_rxMathStart.'\%(.*[[:blank:][:punct:]]\)\?'. \ '\%([[:blank:][:punct:]].*\)\?', - \ '^\s*'.g:vimwiki_rxMathEnd, 'VimwikiMath') + \ g:vimwiki_rxMathEnd, 'VimwikiMath') "}}} From 4c2e13a2844a3df0af5280227cdaf7d3c63d7f30 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Fri, 18 Mar 2016 15:18:23 +0100 Subject: [PATCH 166/370] Skip preformatted and math text while scanning for headers Fix #191 --- autoload/vimwiki/base.vim | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index f6f5772..94966c5 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -1736,10 +1736,27 @@ endfunction " }}} " a:create == 0: update if TOC exists function! vimwiki#base#table_of_contents(create) " collect new headers + let is_inside_pre_or_math = 0 " 1: inside pre, 2: inside math, 0: outside let headers = [] let headers_levels = [['', 0], ['', 0], ['', 0], ['', 0], ['', 0], ['', 0]] for lnum in range(1, line('$')) let line_content = getline(lnum) + if (is_inside_pre_or_math == 1 && line_content =~# g:vimwiki_rxPreEnd) || + \ (is_inside_pre_or_math == 2 && line_content =~# g:vimwiki_rxMathEnd) + let is_inside_pre_or_math = 0 + continue + endif + if is_inside_pre_or_math > 0 + continue + endif + if line_content =~# g:vimwiki_rxPreStart + let is_inside_pre_or_math = 1 + continue + endif + if line_content =~# g:vimwiki_rxMathStart + let is_inside_pre_or_math = 2 + continue + endif if line_content !~# g:vimwiki_rxHeader continue endif From 4956976bb64a4a49bd8b346e6ab7adfa5af0bf6d Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Sat, 19 Mar 2016 19:55:08 +0100 Subject: [PATCH 167/370] Some fixes in the doc --- doc/vimwiki.txt | 112 ++++++++++++++++++++++++------------------------ 1 file changed, 57 insertions(+), 55 deletions(-) diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index 2c4f378..c5a39b6 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -78,8 +78,8 @@ Feed it with the following example: Place your cursor on 'Tasks' and press Enter to create a link. Once pressed, 'Tasks' will become '[[Tasks]]' -- a Vimwiki link. Press Enter again to -open it. Edit the file, save it, and then press Backspace to jump back to your -index. +open it. Edit the file, save it, and then press Backspace to jump back to +your index. A Vimwiki link can be constructed from more than one word. Just visually select the words to be linked and press Enter. Try it with 'Project @@ -376,70 +376,72 @@ gLr Renumber list items in all numbered lists in the whole :nmap VimwikiRenumberAllLists < *vimwiki_glstar* *vimwiki_gLstar* -gl* Make a list item out of normal line or change the symbol - of the current item to *. +gl* Make a list item out of a normal line or change the + symbol of the current item to *. gL* Change the symbol of the current list to *. To remap: > noremap glo :VimwikiChangeSymbolTo * noremap glO :VimwikiChangeSymbolInListTo * < *vimwiki_gl#* *vimwiki_gL#* -gl# Make a list item out of normal line or change the symbol - of the current item to #. +gl# Make a list item out of a normal line or change the + symbol of the current item to #. gL# Change the symbol of the current list to #. To remap: > noremap glo :VimwikiChangeSymbolTo # noremap glO :VimwikiChangeSymbolInListTo # < *vimwiki_gl-* *vimwiki_gL-* -gl- Make a list item out of normal line or change the symbol - of the current item to -. +gl- Make a list item out of a normal line or change the + symbol of the current item to -. gL- Change the symbol of the current list to -. To remap: > noremap glo :VimwikiChangeSymbolTo - noremap glO :VimwikiChangeSymbolInListTo - < *vimwiki_gl1* *vimwiki_gL1* -gl1 Make a list item out of normal line or change the symbol - of the current item to 1., the numbering is adjusted - according to the surrounding list items. +gl1 Make a list item out of a normal line or change the + symbol of the current item to 1., the numbering is + adjusted according to the surrounding list items. gL1 Change the symbol of the current list to 1. 2. 3. ... To remap: > noremap glo :VimwikiChangeSymbolTo 1. noremap glO :VimwikiChangeSymbolInListTo 1. < *vimwiki_gla* *vimwiki_gLa* -gla Make a list item out of normal line or change the symbol - of the current item to a), the numbering is adjusted - according to the surrounding list items. +gla Make a list item out of a normal line or change the + symbol of the current item to a), the numbering is + adjusted according to the surrounding list items. gLa Change the symbol of the current list to a) b) c) ... To remap: > noremap glo :VimwikiChangeSymbolTo a) noremap glO :VimwikiChangeSymbolInListTo a) < *vimwiki_glA* *vimwiki_gLA* -glA Make a list item out of normal line or change the symbol - of the current item to A), the numbering is adjusted - according to the surrounding list items. +glA Make a list item out of a normal line or change the + symbol of the current item to A), the numbering is + adjusted according to the surrounding list items. gLA Change the symbol of the current list to A) B) C) ... To remap: > noremap glo :VimwikiChangeSymbolTo A) noremap glO :VimwikiChangeSymbolInListTo A) < *vimwiki_gli* *vimwiki_gLi* -gli Make a list item out of normal line or change the symbol - of the current item to i), the numbering is adjusted - according to the surrounding list items. -gLi Change the symbol of the current list to i) ii) iii) ... +gli Make a list item out of a normal line or change the + symbol of the current item to i), the numbering is + adjusted according to the surrounding list items. +gLi Change the symbol of the current list to + i) ii) iii) ... To remap: > noremap glo :VimwikiChangeSymbolTo i) noremap glO :VimwikiChangeSymbolInListTo i) < *vimwiki_glI* *vimwiki_gLI* -glI Make a list item out of normal line or change the symbol - of the current item to I), the numbering is adjusted - according to the surrounding list items. -gLI Change the symbol of the current list to I) II) III) ... +glI Make a list item out of a normal line or change the + symbol of the current item to I), the numbering is + adjusted according to the surrounding list items. +gLI Change the symbol of the current list to + I) II) III) ... To remap: > noremap glo :VimwikiChangeSymbolTo I) noremap glO :VimwikiChangeSymbolInListTo I) @@ -814,8 +816,8 @@ identify wikilinks whose targets are not found. Interwiki:~ -If you maintain more than one wiki, you can create interwiki links between them -by adding a numbered prefix "wikiX:" in front of a link: > +If you maintain more than one wiki, you can create interwiki links between +them by adding a numbered prefix "wikiX:" in front of a link: > [[wiki1:This is a link]] or: > [[wiki1:This is a link source|Description of the link]] @@ -894,7 +896,7 @@ in HTML: > alt="Vimwiki"/> Transclude image with alternate text and some style: > - {{http://.../vimwiki_logo.png|cool stuff|style="width:150px; height: 120px;"}} + {{http://.../vimwiki_logo.png|cool stuff|style="width:150px;height:120px;"}} in HTML: > cool stuff @@ -935,7 +937,7 @@ Reference-style links: > a) [Link Name][Id] b) [Id][], using the "implicit link name" shortcut -Reference style links must always include *two* consecutive pairs of +Reference style links must always include two consecutive pairs of [-brackets, and field entries can not use "[" or "]". @@ -1170,7 +1172,7 @@ E.g.: }}$ Note: no matter how many lines are used in the text file, the HTML will -compress it to *one* line only. +compress it to one line only. Block environment is similar to block display, but is able to use specific LaTeX environments, such as 'align'. The syntax is the same as for block @@ -1185,7 +1187,7 @@ Similar compression rules for the HTML page hold (as MathJax interprets the LaTeX code). Note: the highlighting in Vim is automatic. For the rendering in HTML, you -have two *alternative* options: +have two alternative options: 1. using the MathJax server for rendering (needs internet connection). Add to your HTML template the following line: @@ -1221,7 +1223,7 @@ Text which starts with 4 or more spaces is a blockquote. ------------------------------------------------------------------------------ -5.10. Comments *vimwiki-syntax-comments* +5.10. Comments *vimwiki-syntax-comments* A line that starts with %% is a comment. E.g.: > @@ -1236,7 +1238,7 @@ E.g.: > < ------------------------------------------------------------------------------ -5.12. Tags *vimwiki-syntax-tags* +5.12. Tags *vimwiki-syntax-tags* You can tag a wiki file, a header or an arbitrary place in a wiki file. Then, you can use Vim's built-in tag search functionality (see |tagsrch.txt|) or @@ -1311,7 +1313,7 @@ Hit |zr| one more time: * [ ] Do stuff 3~ Note: If you use the default Vimwiki syntax, folding on list items will work -properly only if all of them are indented using the current |shiftwidth|. +properly only if all of them are indented using the current 'shiftwidth'. For MediaWiki, * or # should be in the first column. To turn folding on/off check |g:vimwiki_folding|. @@ -1640,21 +1642,21 @@ For example, consider the following file "Todo.wiki": > - [ ] beg for *pay rise* == Knitting club == === Knitting projects === - - [ ] a funny *pig* - - [ ] a scary *dog* + - [ ] a *funny pig* + - [ ] a *scary dog* Then, to jump from your index.wiki directly to your knitting projects, use: > [[Todo#Knitting projects]] Or, to jump to an individual project, use this link: > - [[Todo#pig]] + [[Todo#funny pig]] Or, to jump to a tag, use this link: > [[Todo#todo-lists]] If there are multiple instances of an anchor, you can use the long form which consists of the complete header hierarchy, separated by '#': > - [[Todo#My tasks#Knitting club#Knitting projects#dog]] + [[Todo#My tasks#Knitting club#Knitting projects#scary dog]] If you don't feel like typing the whole stuff, type just [[Todo# and then |i_CTRL-X_CTRL-O| to start the omni completion of anchors. @@ -1714,7 +1716,7 @@ described in |vimwiki-temporary-wiki|. For a list of per-wiki options, see ------------------------------------------------------------------------------ -12.1 Registered Wiki *g:vimwiki_list* *vimwiki-register-wiki* +12.1 Registered Wiki *g:vimwiki_list* *vimwiki-register-wiki* One or more wikis can be registered using the |g:vimwiki_list| variable. @@ -1755,7 +1757,7 @@ For clarity, in your .vimrc file you can define wiki options using separate ------------------------------------------------------------------------------ -12.2 Temporary Wiki *vimwiki-temporary-wiki* +12.2 Temporary Wiki *vimwiki-temporary-wiki* The creation of temporary wikis allows you to create a wiki on the fly. @@ -2118,7 +2120,7 @@ Key Default value~ list_margin -1 Description~ -Width of left-hand margin for lists. When negative, the current |shiftwidth| +Width of left-hand margin for lists. When negative, the current 'shiftwidth' is used. This affects the appearance of the generated links (see |:VimwikiGenerateLinks|), the Table of contents (|vimwiki-toc|) and the behavior of the list manipulation commands |:VimwikiListChangeLevel| and the @@ -2273,10 +2275,10 @@ Enable/disable Vimwiki's folding (outline) functionality. Folding in Vimwiki can uses either the 'expr' or the 'syntax' |foldmethod| of Vim. Value Description~ -'' Disable folding. -'expr' Folding based on expression (folds sections and code blocks). -'syntax' Folding based on syntax (folds sections; slower than 'expr'). -'list' Folding based on expression (folds list subitems; much slower). +'' Disable folding +'expr' Folding based on expression (folds sections and code blocks) +'syntax' Folding based on syntax (folds sections; slower than 'expr') +'list' Folding based on expression (folds list subitems; much slower) Default: '' @@ -2449,7 +2451,7 @@ Default: 1 ------------------------------------------------------------------------------ *g:vimwiki_w32_dir_enc* -Convert directory name from current |encoding| into 'g:vimwiki_w32_dir_enc' +Convert directory name from current 'encoding' into 'g:vimwiki_w32_dir_enc' before it is created. If you have 'enc=utf-8' and set up > @@ -2475,7 +2477,7 @@ Value Description~ Default: 0 -Note: Vim 7.3 has a new function |strdisplaywidth|, so for users of an up to +Note: Vim 7.3 has a new function |strdisplaywidth()|, so for users of an up to date Vim, this option is obsolete. @@ -2562,9 +2564,9 @@ Default: '' (empty) ------------------------------------------------------------------------------ *g:vimwiki_valid_html_tags* -Case-insensitive comma separated list of HTML tags that can be used in Vimwiki. -When converting to HTML, these tags are left as they are, while every other -tag is escaped. +Case-insensitive comma separated list of HTML tags that can be used in +Vimwiki. When converting to HTML, these tags are left as they are, while +every other tag is escaped. Default: 'b,i,s,u,sub,sup,kbd,br,hr' @@ -2587,10 +2589,10 @@ they would not be deleted after |:VimwikiAll2HTML|. ------------------------------------------------------------------------------ *g:vimwiki_conceallevel* -In Vim 7.3 |conceallevel| is local to the current window, thus if you open a +In Vim 7.3 'conceallevel' is local to the current window, thus if you open a Vimwiki buffer in a new tab or window, it would be set to the default value. -Vimwiki sets |conceallevel| to g:vimwiki_conceallevel every time a Vimwiki +Vimwiki sets 'conceallevel' to g:vimwiki_conceallevel every time a Vimwiki buffer is entered. With default settings, Vimwiki conceals one-character markers, shortens long @@ -2602,7 +2604,7 @@ Default: 2 ------------------------------------------------------------------------------ *g:vimwiki_autowriteall* -In Vim |autowriteall| is a global setting. With g:vimwiki_autowriteall Vimwiki +In Vim 'autowriteall' is a global setting. With g:vimwiki_autowriteall Vimwiki makes it local to its buffers. Value Description~ @@ -2797,7 +2799,7 @@ New:~ * more key maps for list manipulation, see |vimwiki-list-manipulation| * improved automatic adjustment of checkboxes * text objects for list items, see |vimwiki-text-objects| - * New command |VimwikiCheckLinks| to check for broken links + * New command |:VimwikiCheckLinks| to check for broken links * New global option |g:vimwiki_auto_chdir| * New global option |g:vimwiki_map_prefix| * Support for wiki links absolute to the wiki root @@ -2805,7 +2807,7 @@ New:~ * Issue #24: Basic support for remote directories via netrw * Issue #50: in HTML, tables can now be embedded in lists * When converting to HTML, show a message with the output directory - * Add auto completion for |VimwikiGoto| + * Add auto completion for |:VimwikiGoto| * Add Chinese Readme file Changed:~ From 68cdfe36dfddc0d6e67d06938748ff538c00cc24 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Sat, 19 Mar 2016 21:29:42 +0100 Subject: [PATCH 168/370] Unify all messages to the user --- autoload/vimwiki/base.vim | 32 ++++++++++++++++---------------- autoload/vimwiki/diary.vim | 6 +++--- autoload/vimwiki/html.vim | 24 ++++++++++++------------ doc/vimwiki.txt | 2 +- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index 94966c5..0f4cfef 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -390,7 +390,7 @@ function! vimwiki#base#system_open_link(url) "{{{ return endif endtry - echomsg 'Default Vimwiki link handler was unable to open the HTML file!' + echomsg 'Vimwiki Error: Default Vimwiki link handler was unable to open the HTML file!' endfunction "}}} " vimwiki#base#open_link @@ -398,7 +398,7 @@ function! vimwiki#base#open_link(cmd, link, ...) "{{{ let link_infos = vimwiki#base#resolve_link(a:link) if link_infos.filename == '' - echom 'Vimwiki Error: Unable to resolve link!' + echomsg 'Vimwiki Error: Unable to resolve link!' return endif @@ -505,7 +505,7 @@ function! vimwiki#base#backlinks() "{{{ endfor if empty(locations) - echom 'vimwiki: no other file links to this file' + echomsg 'Vimwiki: No other file links to this file' else call setloclist(0, locations, 'r') lopen @@ -823,7 +823,7 @@ function! vimwiki#base#check_links() "{{{ endfor if empty(errors) - echom 'Vimwiki: all links are OK' + echomsg 'Vimwiki: All links are OK' else call setqflist(errors, 'r') copen @@ -846,8 +846,8 @@ function! vimwiki#base#edit_file(command, filename, anchor, ...) "{{{ let ok = vimwiki#path#mkdir(dir, 1) if !ok - echom ' ' - echom 'Vimwiki: Unable to edit file in non-existent directory: '.dir + echomsg ' ' + echomsg 'Vimwiki Error: Unable to edit file in non-existent directory: '.dir return endif @@ -880,7 +880,7 @@ endfunction " }}} function! vimwiki#base#search_word(wikiRx, cmd) "{{{ let match_line = search(a:wikiRx, 's'.a:cmd) if match_line == 0 - echomsg 'vimwiki: Wiki link not found.' + echomsg 'Vimwiki: Wiki link not found' endif endfunction " }}} @@ -1281,7 +1281,7 @@ endfunction " }}} " vimwiki#base#goto_index function! vimwiki#base#goto_index(wnum, ...) "{{{ if a:wnum > len(g:vimwiki_list) - echom "vimwiki: Wiki ".a:wnum." is not registered in g:vimwiki_list!" + echomsg 'Vimwiki Error: Wiki '.a:wnum.' is not registered in g:vimwiki_list!' return endif @@ -1319,7 +1319,7 @@ function! vimwiki#base#delete_link() "{{{ try call delete(fname) catch /.*/ - echomsg 'vimwiki: Cannot delete "'.expand('%:t:r').'"!' + echomsg 'Vimwiki Error: Cannot delete "'.expand('%:t:r').'"!' return endtry @@ -1340,7 +1340,7 @@ function! vimwiki#base#rename_link() "{{{ " there is no file (new one maybe) if glob(expand('%:p')) == '' - echomsg 'vimwiki: Cannot rename "'.expand('%:p'). + echomsg 'Vimwiki Error: Cannot rename "'.expand('%:p'). \'". It does not exist! (New file? Save it before renaming.)' return endif @@ -1354,13 +1354,13 @@ function! vimwiki#base#rename_link() "{{{ if new_link =~# '[/\\]' " It is actually doable but I do not have free time to do it. - echomsg 'vimwiki: Cannot rename to a filename with path!' + echomsg 'Vimwiki Error: Cannot rename to a filename with path!' return endif " check new_fname - it should be 'good', not empty if substitute(new_link, '\s', '', 'g') == '' - echomsg 'vimwiki: Cannot rename to an empty filename!' + echomsg 'Vimwiki Error: Cannot rename to an empty filename!' return endif @@ -1375,19 +1375,19 @@ function! vimwiki#base#rename_link() "{{{ " do not rename if file with such name exists let fname = glob(new_fname) if fname != '' - echomsg 'vimwiki: Cannot rename to "'.new_fname. + echomsg 'Vimwiki Error: Cannot rename to "'.new_fname. \ '". File with that name exist!' return endif " rename wiki link file try - echomsg "Renaming ".VimwikiGet('path').old_fname." to ".new_fname + echomsg 'Vimwiki: Renaming '.VimwikiGet('path').old_fname.' to '.new_fname let res = rename(expand('%:p'), expand(new_fname)) if res != 0 throw "Cannot rename!" end catch /.*/ - echomsg 'vimwiki: Cannot rename "'.expand('%:t:r').'" to "'.new_fname.'"' + echomsg 'Vimwiki Error: Cannot rename "'.expand('%:t:r').'" to "'.new_fname.'"' return endtry @@ -1428,7 +1428,7 @@ function! vimwiki#base#rename_link() "{{{ \ cur_buffer[1]]) " execute 'bwipeout '.escape(cur_buffer[0], ' ') - echomsg old_fname." is renamed to ".new_fname + echomsg 'Vimwiki: '.old_fname.' is renamed to '.new_fname let &more = setting_more endfunction " }}} diff --git a/autoload/vimwiki/diary.vim b/autoload/vimwiki/diary.vim index 54719f2..7d773e8 100644 --- a/autoload/vimwiki/diary.vim +++ b/autoload/vimwiki/diary.vim @@ -161,7 +161,7 @@ endfunction "}}} function! vimwiki#diary#make_note(wnum, ...) "{{{ if a:wnum > len(g:vimwiki_list) - echom "vimwiki: Wiki ".a:wnum." is not registered in g:vimwiki_list!" + echomsg 'Vimwiki Error: Wiki '.a:wnum.' is not registered in g:vimwiki_list!' return endif @@ -191,7 +191,7 @@ endfunction "}}} function! vimwiki#diary#goto_diary_index(wnum) "{{{ if a:wnum > len(g:vimwiki_list) - echom "vimwiki: Wiki ".a:wnum." is not registered in g:vimwiki_list!" + echomsg 'Vimwiki Error: Wiki '.a:wnum.' is not registered in g:vimwiki_list!' return endif @@ -254,7 +254,7 @@ function! vimwiki#diary#generate_diary_section() "{{{ call vimwiki#base#update_listing_in_buffer(s:format_diary(), \ VimwikiGet('diary_header'), content_rx, line('$')+1, 1) else - echom "vimwiki: You can generate diary links only in a diary index page!" + echomsg 'Vimwiki Error: You can generate diary links only in a diary index page!' endif endfunction "}}} diff --git a/autoload/vimwiki/html.vim b/autoload/vimwiki/html.vim index 8a6685c..e5ab69c 100644 --- a/autoload/vimwiki/html.vim +++ b/autoload/vimwiki/html.vim @@ -80,7 +80,7 @@ function! s:create_default_CSS(path) " {{{ if default_css != '' let lines = readfile(default_css) call writefile(lines, css_full_name) - echomsg "Default style.css has been created." + echomsg 'Vimwiki: Default style.css has been created' endif endif endfunction "}}} @@ -112,7 +112,7 @@ function! s:get_html_template(template) "{{{ let lines = readfile(template_name) return lines catch /E484/ - echomsg 'vimwiki: html template '.template_name. + echomsg 'Vimwiki: HTML template '.template_name. \ ' does not exist!' endtry endif @@ -171,7 +171,7 @@ function! s:delete_html_files(path) "{{{ try call delete(fname) catch - echomsg 'vimwiki: Cannot delete '.fname + echomsg 'Vimwiki Error: Cannot delete '.fname endtry endfor endfunction "}}} @@ -1501,7 +1501,7 @@ function! vimwiki#html#Wiki2HTML(path_html, wikifile) "{{{ endif if done == 0 - echomsg 'vimwiki: conversion to HTML is not supported for this syntax!!!' + echomsg 'Vimwiki Error: Conversion to HTML is not supported for this syntax' return endif @@ -1511,11 +1511,11 @@ endfunction "}}} function! vimwiki#html#WikiAll2HTML(path_html) "{{{ if !s:syntax_supported() && !s:use_custom_wiki2html() - echomsg 'vimwiki: conversion to HTML is not supported for this syntax!!!' + echomsg 'Vimwiki Error: Conversion to HTML is not supported for this syntax' return endif - echomsg 'Saving vimwiki files...' + echomsg 'Vimwiki: Saving Vimwiki files ...' let save_eventignore = &eventignore let &eventignore = "all" let cur_buf = bufname('%') @@ -1526,10 +1526,10 @@ function! vimwiki#html#WikiAll2HTML(path_html) "{{{ let path_html = expand(a:path_html) call vimwiki#path#mkdir(path_html) - echomsg 'Deleting non-wiki html files...' + echomsg 'Vimwiki: Deleting non-wiki html files ...' call s:delete_html_files(path_html) - echomsg 'Converting wiki to html files...' + echomsg 'Vimwiki: Converting wiki to html files ...' let setting_more = &more setlocal nomore @@ -1547,11 +1547,11 @@ function! vimwiki#html#WikiAll2HTML(path_html) "{{{ call VimwikiSet('invsubdir', vimwiki#base#invsubdir(subdir)) if !s:is_html_uptodate(wikifile) - echomsg 'Processing '.wikifile + echomsg 'Vimwiki: Processing '.wikifile call vimwiki#html#Wiki2HTML(path_html, wikifile) else - echomsg 'Skipping '.wikifile + echomsg 'Vimwiki: Skipping '.wikifile endif endfor " reset 'subdir' state variable @@ -1559,8 +1559,8 @@ function! vimwiki#html#WikiAll2HTML(path_html) "{{{ call VimwikiSet('invsubdir', current_invsubdir) call s:create_default_CSS(path_html) - echomsg 'HTML exported to '.path_html - echomsg 'Done!' + echomsg 'Vimwiki: HTML exported to '.path_html + echomsg 'Vimwiki: Done!' let &more = setting_more endfunction "}}} diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index c5a39b6..c15be18 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -2356,7 +2356,7 @@ A second example handles a new scheme, "vfile:", which behaves similar to endif let link_infos = vimwiki#base#resolve_link(link) if link_infos.filename == '' - echom 'Vimwiki Error: Unable to resolve link!' + echomsg 'Vimwiki Error: Unable to resolve link!' return 0 else exe 'tabnew ' . fnameescape(link_infos.filename) From 0001b3cda9dbf6942823626d8dd1041f6a7519e9 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Sat, 19 Mar 2016 22:01:25 +0100 Subject: [PATCH 169/370] Copy CSS file also with :Vimwiki2HTML --- autoload/vimwiki/html.vim | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/autoload/vimwiki/html.vim b/autoload/vimwiki/html.vim index e5ab69c..584985f 100644 --- a/autoload/vimwiki/html.vim +++ b/autoload/vimwiki/html.vim @@ -80,9 +80,10 @@ function! s:create_default_CSS(path) " {{{ if default_css != '' let lines = readfile(default_css) call writefile(lines, css_full_name) - echomsg 'Vimwiki: Default style.css has been created' + return 1 endif endif + return 0 endfunction "}}} function! s:template_full_name(name) "{{{ @@ -1366,7 +1367,7 @@ function! vimwiki#html#CustomWiki2HTML(path, wikifile, force) "{{{ \ (len(VimwikiGet('subdir')) > 0 ? shellescape(s:root_path(VimwikiGet('subdir'))) : '-')) endfunction " }}} -function! vimwiki#html#Wiki2HTML(path_html, wikifile) "{{{ +function! s:convert_file(path_html, wikifile) "{{{ let done = 0 let wikifile = fnamemodify(a:wikifile, ":p") @@ -1456,13 +1457,13 @@ function! vimwiki#html#Wiki2HTML(path_html, wikifile) "{{{ if nohtml echon "\r"."%nohtml placeholder found" - return + return '' endif call s:remove_blank_lines(ldest) - "" process end of file - "" close opened tags if any + " process end of file + " close opened tags if any let lines = [] call s:close_tag_quote(state.quote, lines) call s:close_tag_para(state.para, lines) @@ -1494,7 +1495,6 @@ function! vimwiki#html#Wiki2HTML(path_html, wikifile) "{{{ let html_lines = s:html_insert_contents(html_lines, ldest) " %contents% - "" make html file. call writefile(html_lines, path_html.htmlfile) let done = 1 @@ -1502,12 +1502,19 @@ function! vimwiki#html#Wiki2HTML(path_html, wikifile) "{{{ if done == 0 echomsg 'Vimwiki Error: Conversion to HTML is not supported for this syntax' - return + return '' endif return path_html.htmlfile endfunction "}}} +function! vimwiki#html#Wiki2HTML(path_html, wikifile) "{{{ + let result = s:convert_file(a:path_html, a:wikifile) + if result != '' + call s:create_default_CSS(a:path_html) + endif + return result +endfunction "}}} function! vimwiki#html#WikiAll2HTML(path_html) "{{{ if !s:syntax_supported() && !s:use_custom_wiki2html() @@ -1549,7 +1556,7 @@ function! vimwiki#html#WikiAll2HTML(path_html) "{{{ if !s:is_html_uptodate(wikifile) echomsg 'Vimwiki: Processing '.wikifile - call vimwiki#html#Wiki2HTML(path_html, wikifile) + call s:convert_file(path_html, wikifile) else echomsg 'Vimwiki: Skipping '.wikifile endif @@ -1558,7 +1565,10 @@ function! vimwiki#html#WikiAll2HTML(path_html) "{{{ call VimwikiSet('subdir', current_subdir) call VimwikiSet('invsubdir', current_invsubdir) - call s:create_default_CSS(path_html) + let created = s:create_default_CSS(path_html) + if created + echomsg 'Vimwiki: Default style.css has been created' + endif echomsg 'Vimwiki: HTML exported to '.path_html echomsg 'Vimwiki: Done!' From 722d6e4b9a0d66ec09abdbed175fb7a19dc99313 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Mon, 21 Mar 2016 09:02:22 +0100 Subject: [PATCH 170/370] '+' on a raw url surrounds it with brackets Fix #188 --- autoload/vimwiki/base.vim | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index 0f4cfef..45949d0 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -1921,6 +1921,15 @@ function! s:normalize_link_syntax_n() " {{{ return endif + " try Weblink + let lnk = vimwiki#base#matchstr_at_cursor(g:vimwiki_rxWeblink) + if !empty(lnk) + let sub = vimwiki#base#normalize_link_helper(lnk, + \ lnk, '', g:vimwiki_WikiLinkTemplate2) + call vimwiki#base#replacestr_at_cursor(g:vimwiki_rxWeblink, sub) + return + endif + " try Word (any characters except separators) " rxWord is less permissive than rxWikiLinkUrl which is used in " normalize_link_syntax_v From 129c2818106bdb9230bbd99ee8eb81fa47c7a414 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Thu, 31 Mar 2016 12:10:27 +0200 Subject: [PATCH 171/370] Update changelog --- doc/vimwiki.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index c15be18..a8d21a9 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -9,7 +9,7 @@ |___| |___| |_| |_||__| |__||___| |___| |_||___| ~ - Version: 2.2 + Version: 2.3 ============================================================================== CONTENTS *vimwiki* @@ -2748,6 +2748,8 @@ Contributors and their Github usernames in roughly chronological order: - Hongbo Liu (@hiberabyss) - @Tomsod - @wangzq + - Jinzhou Zhang (@lotabout) + - Michael Riley (@optik-aper) ============================================================================== @@ -2760,15 +2762,23 @@ http://code.google.com/p/vimwiki/issues/list. They may be accessible from https://github.com/vimwiki-backup/vimwiki/issues. -???~ +2.3 (2016-03-31)~ New: * Add |:VimwikiMakeYesterdayDiaryNote| command + * Issue #128: add option |vimwiki-option-automatic_nested_syntaxes| + * Issue #192: Sort links in the list generated by |:VimwikiGenerateTags| Fixed: * Issue #176: Fix issue when the wiki path contains spaces * Also look for tags in wiki files in subdirectories * Locate the .tags file correctly on Windows + * Issue #183: Fix HTML conversion of headers containing links + * Issue #64: create correct Markdown links when pressing CR on a word + * Issue #191: ignore headers inside preformatted text when creating the TOC + * Create the standard CSS file also if only one file is converted to HTML + * Fix #188: |vimwiki_+| on a raw url surrounds it with brackets + * various minor fixes 2.2.1 (2015-12-10)~ From 7e3234e0bfa0d9b4023b13825d479eea896fd289 Mon Sep 17 00:00:00 2001 From: irfan sharif Date: Sun, 24 Apr 2016 16:45:21 -0400 Subject: [PATCH 172/370] fix vimwiki.txt intro tag previously redirected to `CONTENTS` page, changed to redirect to `Intro` page --- doc/vimwiki.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index a8d21a9..9cc5dd9 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -14,7 +14,7 @@ ============================================================================== CONTENTS *vimwiki* - 1. Intro |vimwiki| + 1. Intro |vimwiki-intro| 2. Prerequisites |vimwiki-prerequisites| 3. Mappings |vimwiki-mappings| 3.1. Global mappings |vimwiki-global-mappings| From 3a5a5ef0ad7a8efc0e9c67705898b26507e04cf5 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Tue, 17 May 2016 20:29:59 +0200 Subject: [PATCH 173/370] Prefer the value of nested_syntaxes over detected syntax --- syntax/vimwiki.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax/vimwiki.vim b/syntax/vimwiki.vim index f45cb02..0669fa7 100644 --- a/syntax/vimwiki.vim +++ b/syntax/vimwiki.vim @@ -595,7 +595,7 @@ let b:current_syntax="vimwiki" " EMBEDDED syntax setup "{{{ let s:nested = VimwikiGet('nested_syntaxes') if VimwikiGet('automatic_nested_syntaxes') - let s:nested = extend(s:nested, vimwiki#base#detect_nested_syntax()) + let s:nested = extend(s:nested, vimwiki#base#detect_nested_syntax(), "keep") endif if !empty(s:nested) for [s:hl_syntax, s:vim_syntax] in items(s:nested) From 3f661178940b5490eefd357ce83e91e5522030f3 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Mon, 23 May 2016 22:02:03 +0200 Subject: [PATCH 174/370] When sorting tags, always match case because Vim expects it --- autoload/vimwiki/tags.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/vimwiki/tags.vim b/autoload/vimwiki/tags.vim index 8c9cc5f..9585641 100644 --- a/autoload/vimwiki/tags.vim +++ b/autoload/vimwiki/tags.vim @@ -234,9 +234,9 @@ function! s:tags_entry_cmp(i1, i2) "{{{ let item.lineno = 0 + matchstr(fields[2], '\m\d\+') call add(items, item) endfor - if items[0].text > items[1].text + if items[0].text ># items[1].text return 1 - elseif items[0].text < items[1].text + elseif items[0].text <# items[1].text return -1 elseif items[0].lineno > items[1].lineno return 1 From 777569f95fba78408d2ee0cdddcd39e08b51d351 Mon Sep 17 00:00:00 2001 From: mMontu Date: Tue, 12 Jul 2016 11:41:44 -0300 Subject: [PATCH 175/370] Workaround for slow folding methods (issue #225) --- doc/vimwiki.txt | 2 ++ plugin/vimwiki.vim | 14 +++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index 9cc5dd9..7192574 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -2288,6 +2288,8 @@ Limitations: - 'list' is intended to work with lists nicely indented with 'shiftwidth'. - 'syntax' is only available for the default syntax so far. +The options above can be suffixed with ':quick' (e.g.: 'expr:quick') in order +to use some workarounds to make folds work faster. ------------------------------------------------------------------------------ *g:vimwiki_list_ignore_newline* diff --git a/plugin/vimwiki.vim b/plugin/vimwiki.vim index d7abb6c..90fb166 100644 --- a/plugin/vimwiki.vim +++ b/plugin/vimwiki.vim @@ -156,15 +156,15 @@ function! s:setup_buffer_enter() "{{{ " Settings foldmethod, foldexpr and foldtext are local to window. Thus in a " new tab with the same buffer folding is reset to vim defaults. So we " insist vimwiki folding here. - if g:vimwiki_folding ==? 'expr' + if g:vimwiki_folding =~? '^expr.*' setlocal fdm=expr setlocal foldexpr=VimwikiFoldLevel(v:lnum) setlocal foldtext=VimwikiFoldText() - elseif g:vimwiki_folding ==? 'list' || g:vimwiki_folding ==? 'lists' + elseif g:vimwiki_folding =~? '^list.*' || g:vimwiki_folding ==? '^lists.*' setlocal fdm=expr setlocal foldexpr=VimwikiFoldListLevel(v:lnum) setlocal foldtext=VimwikiFoldText() - elseif g:vimwiki_folding ==? 'syntax' + elseif g:vimwiki_folding =~? '^syntax.*' setlocal fdm=syntax setlocal foldtext=VimwikiFoldText() else @@ -446,6 +446,14 @@ augroup vimwiki exe 'autocmd InsertLeave *'.s:ext.' call vimwiki#tbl#format(line("."))' exe 'autocmd InsertEnter *'.s:ext.' call vimwiki#tbl#reset_tw(line("."))' endif + if g:vimwiki_folding =~? ':quick$' + " from http://vim.wikia.com/wiki/Keep_folds_closed_while_inserting_text + " Don't screw up folds when inserting text that might affect them, until + " leaving insert mode. Foldmethod is local to the window. Protect against + " screwing up folding when switching between windows. + exe 'autocmd InsertEnter *'.s:ext.' if !exists("w:last_fdm") | let w:last_fdm=&foldmethod | setlocal foldmethod=manual | endif' + exe 'autocmd InsertLeave,WinLeave *'.s:ext.' if exists("w:last_fdm") | let &l:foldmethod=w:last_fdm | unlet w:last_fdm | endif' + endif endfor augroup END "}}} From 85342196941a7f2e5293cbf3cf4031854f63e445 Mon Sep 17 00:00:00 2001 From: John Conroy Date: Sat, 29 Oct 2016 00:58:15 -0400 Subject: [PATCH 176/370] Automatic detection of nested syntaxes in markdown --- autoload/vimwiki/base.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index 45949d0..e943b52 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -1994,7 +1994,7 @@ endfunction "}}} " vimwiki#base#detect_nested_syntax function! vimwiki#base#detect_nested_syntax() "{{{ let last_word = '\v.*<(\w+)\s*$' - let lines = map(filter(getline(1, "$"), 'v:val =~ "{{{" && v:val =~ last_word'), + let lines = map(filter(getline(1, "$"), 'v:val =~ "\\%({{{\\|```\\)" && v:val =~ last_word'), \ 'substitute(v:val, last_word, "\\=submatch(1)", "")') let dict = {} for elem in lines From 0966031234836c8807264071cccc1670d1be123d Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Thu, 24 Nov 2016 16:46:56 +0100 Subject: [PATCH 177/370] Highlight math not using TeX but TeX math Fix #236 --- autoload/vimwiki/base.vim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index e943b52..748ccbd 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -1079,6 +1079,14 @@ function! vimwiki#base#nested_syntax(filetype, start, end, textSnipHl) abort "{{ else unlet b:current_syntax endif + + " Fix issue #236: tell Vimwiki to think in maths when encountering maths + " blocks like {{$ }}$. Here, we don't want the tex highlight group, but the + " group for tex math. + if a:textSnipHl ==# 'VimwikiMath' + let group='texMathZoneGroup' + endif + execute 'syntax region textSnip'.ft. \ ' matchgroup='.a:textSnipHl. \ ' start="'.a:start.'" end="'.a:end.'"'. From 3b96f8ffeb6610d5747e36feabcbde85ec42d78e Mon Sep 17 00:00:00 2001 From: Christian Rondeau Date: Mon, 5 Dec 2016 18:17:38 -0500 Subject: [PATCH 178/370] Prevent imap of `` if already mapped --- ftplugin/vimwiki.vim | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ftplugin/vimwiki.vim b/ftplugin/vimwiki.vim index d3c4e95..1f96ec2 100644 --- a/ftplugin/vimwiki.vim +++ b/ftplugin/vimwiki.vim @@ -564,13 +564,14 @@ function! s:CR(normal, just_mrkr) "{{{ call vimwiki#lst#kbd_cr(a:normal, a:just_mrkr) endfunction "}}} -if maparg('', 'i') !~? ':VimwikiReturn' - inoremap :VimwikiReturn 1 5 +if !hasmapto('VimwikiReturn', 'i') + if maparg('', 'i') !~? ':VimwikiReturn' + inoremap :VimwikiReturn 1 5 + endif + if maparg('', 'i') !~? ':VimwikiReturn' + inoremap :VimwikiReturn 2 2 + endif endif -if maparg('', 'i') !~? ':VimwikiReturn' - inoremap :VimwikiReturn 2 2 -endif - "Table mappings if g:vimwiki_table_mappings From 4c5b0fec6ba270c6ac5a30e7ea41fcc31c95a998 Mon Sep 17 00:00:00 2001 From: Alex Thorne Date: Mon, 12 Dec 2016 22:20:52 +0000 Subject: [PATCH 179/370] Fix typo in docs --- doc/vimwiki.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index 9cc5dd9..244519e 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -854,7 +854,7 @@ Raw URLs are also supported: > External files~ -The "file:" and "local:" schemes allow you to directly link to arbitray +The "file:" and "local:" schemes allow you to directly link to arbitrary resources using absolute or relative paths: > [[file:/home/somebody/a/b/c/music.mp3]] [[file:C:/Users/somebody/d/e/f/music.mp3]] From febf716bf5870a2e5318ec5bd6d2307a7e43c6bb Mon Sep 17 00:00:00 2001 From: Shafqat Bhuiyan Date: Tue, 13 Dec 2016 10:30:51 +1100 Subject: [PATCH 180/370] Fix example mapping for decreasing list item level --- doc/vimwiki.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index 9cc5dd9..9119ddb 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -363,7 +363,7 @@ glh Decrease the level of a list item. gLh Decrease the level of a list item and all child items. To remap: > :map << VimwikiDecreaseLvlSingleItem - :map >>> VimwikiDecreaseLvlWholeItem + :map <<< VimwikiDecreaseLvlWholeItem < *vimwiki_glr* *vimwiki_gLr* glr Renumber list items if the cursor is on a numbered From 690936ec97c370afe6b2f38d51b4c2a2c6255bff Mon Sep 17 00:00:00 2001 From: Bradley Cicenas Date: Sun, 18 Dec 2016 12:23:14 +0000 Subject: [PATCH 181/370] add vundle install steps to readme --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 9eee1f1..5816229 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,13 @@ Installation using [Pathogen](http://www.vim.org/scripts/script.php?script_id=23 cd bundle git clone https://github.com/vimwiki/vimwiki.git +Installation using [Vundle](https://github.com/VundleVim/Vundle.vim) +------------------------------------------------------------------------------ + +Add `Plugin 'vimwiki/vimwiki'` to your vimrc file and run + + vim +PluginInstall +qall + Or download the [zip archive](https://github.com/vimwiki/vimwiki/archive/master.zip) and extract it in `~/.vim/bundle/` Then launch Vim, run `:Helptags` and then `:help vimwiki` to verify it was installed. From 6b34e954e8fd669e302e7ad5d679b8448dc128f1 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Wed, 21 Dec 2016 17:09:25 +0100 Subject: [PATCH 182/370] Add new functions for variable access Ref #256 --- autoload/vimwiki/vars.vim | 203 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 203 insertions(+) create mode 100644 autoload/vimwiki/vars.vim diff --git a/autoload/vimwiki/vars.vim b/autoload/vimwiki/vars.vim new file mode 100644 index 0000000..f7ccdb8 --- /dev/null +++ b/autoload/vimwiki/vars.vim @@ -0,0 +1,203 @@ +" vim:tabstop=2:shiftwidth=2:expandtab:textwidth=99 +" Vimwiki autoload plugin file +" Desc: stuff concerning Vimwiki's state +" Home: https://github.com/vimwiki/vimwiki/ + + +" copy the user's settings from variables of the form g:vimwiki_