From 04c149bb0cf0e8e57236ae2dd55dd526c9b2d400 Mon Sep 17 00:00:00 2001 From: Maxim Kim Date: Wed, 9 Dec 2009 00:00:00 +0000 Subject: [PATCH] Version 0.9.7 * NEW: Default checkbox symbols are changed to [ ], [.], [o], [O], [X]. You can change them using |g:vimwiki-listsyms| variable. * NEW: Color group names are renamed from wikiBold, wikiItalic, etc to VimwikiBold, VimwikiItalic, etc. * NEW: Open external links in a browser. There are default browsers defined in |g:vimwiki_browsers| list. You can also redefine |VimwikiWeblinkHandler| function to open weblinks in other programs. * NEW: Issue 25: Toggle the states of multiple TODO list items at a time (in VISUAL and in VISUAL LINE modes) * NEW: Issue 26: Highlight code snippets in vimwiki's pre. See |vimwiki-option-nested_syntaxes|. Thanks kriomant. * NEW: Issue 27: Automatic garbage deletion from html directory. * NEW: Save all open vimwiki buffers before export to html. * NEW: Issue 29: Custom :Search command. * NEW: Header text objects are now expandable in VISUAL mode. Tap 'vah' to select a header. Tap again 'ah' to expand selection further. Thanks Andy Wokula. * FIX: Folding settings are reset to vim defaults in a new tab (think of \wt) so you cannot hide things in folds. * FIX: https links in form of [https://hello.world.com] are not exported into html. Thanks Saurabh Sarpal for the patch. --- vimwiki_0_9_6.vba => vimwiki_0_9_7.vba | 1461 +++++++++++++++--------- 1 file changed, 903 insertions(+), 558 deletions(-) rename vimwiki_0_9_6.vba => vimwiki_0_9_7.vba (80%) diff --git a/vimwiki_0_9_6.vba b/vimwiki_0_9_7.vba similarity index 80% rename from vimwiki_0_9_6.vba rename to vimwiki_0_9_7.vba index 85452fc..6fd91a0 100644 --- a/vimwiki_0_9_6.vba +++ b/vimwiki_0_9_7.vba @@ -2,7 +2,7 @@ UseVimball finish syntax\vimwiki.vim [[[1 -127 +140 " Vimwiki syntax file " Author: Maxim Kim " Home: http://code.google.com/p/vimwiki/ @@ -19,117 +19,130 @@ endif if VimwikiGet('maxhi') " Every WikiWord is nonexistent if g:vimwiki_camel_case - execute 'syntax match wikiNoExistsWord /\%(^\|[^!]\)\zs'.g:vimwiki_word1.'/' + execute 'syntax match VimwikiNoExistsWord /\%(^\|[^!]\)\zs'.g:vimwiki_word1.'/' endif - execute 'syntax match wikiNoExistsWord /'.g:vimwiki_word2.'/' - execute 'syntax match wikiNoExistsWord /'.g:vimwiki_word3.'/' + execute 'syntax match VimwikiNoExistsWord /'.g:vimwiki_word2.'/' + execute 'syntax match VimwikiNoExistsWord /'.g:vimwiki_word3.'/' " till we find them in vimwiki's path call vimwiki#WikiHighlightWords() else " A WikiWord (unqualifiedWikiName) - execute 'syntax match wikiWord /\%(^\|[^!]\)\zs\<'.g:vimwiki_word1.'\>/' + execute 'syntax match VimwikiWord /\%(^\|[^!]\)\zs\<'.g:vimwiki_word1.'\>/' " A [[bracketed wiki word]] - execute 'syntax match wikiWord /'.g:vimwiki_word2.'/' + execute 'syntax match VimwikiWord /'.g:vimwiki_word2.'/' endif -execute 'syntax match wikiLink `'.g:vimwiki_rxWeblink.'`' +execute 'syntax match VimwikiLink `'.g:vimwiki_rxWeblink.'`' " Emoticons: must come after the Textilisms, as later rules take precedence " over earlier ones. This match is an approximation for the ~70 distinct -syntax match wikiEmoticons /\%((.)\|:[()|$@]\|:-[DOPS()\]|$@]\|;)\|:'(\)/ +syntax match VimwikiEmoticons /\%((.)\|:[()|$@]\|:-[DOPS()\]|$@]\|;)\|:'(\)/ let g:vimwiki_rxTodo = '\C\%(TODO:\|DONE:\|FIXME:\|FIXED:\|XXX:\)' -execute 'syntax match wikiTodo /'. g:vimwiki_rxTodo .'/' +execute 'syntax match VimwikiTodo /'. g:vimwiki_rxTodo .'/' " Load concrete Wiki syntax execute 'runtime! syntax/vimwiki_'.VimwikiGet('syntax').'.vim' " Tables -execute 'syntax match wikiTable /'.g:vimwiki_rxTable.'/' +execute 'syntax match VimwikiTable /'.g:vimwiki_rxTable.'/' -execute 'syntax match wikiBold /'.g:vimwiki_rxBold.'/' +execute 'syntax match VimwikiBold /'.g:vimwiki_rxBold.'/' -execute 'syntax match wikiItalic /'.g:vimwiki_rxItalic.'/' +execute 'syntax match VimwikiItalic /'.g:vimwiki_rxItalic.'/' -execute 'syntax match wikiBoldItalic /'.g:vimwiki_rxBoldItalic.'/' +execute 'syntax match VimwikiBoldItalic /'.g:vimwiki_rxBoldItalic.'/' -execute 'syntax match wikiItalicBold /'.g:vimwiki_rxItalicBold.'/' +execute 'syntax match VimwikiItalicBold /'.g:vimwiki_rxItalicBold.'/' -execute 'syntax match wikiDelText /'.g:vimwiki_rxDelText.'/' +execute 'syntax match VimwikiDelText /'.g:vimwiki_rxDelText.'/' -execute 'syntax match wikiSuperScript /'.g:vimwiki_rxSuperScript.'/' +execute 'syntax match VimwikiSuperScript /'.g:vimwiki_rxSuperScript.'/' -execute 'syntax match wikiSubScript /'.g:vimwiki_rxSubScript.'/' +execute 'syntax match VimwikiSubScript /'.g:vimwiki_rxSubScript.'/' -execute 'syntax match wikiCode /'.g:vimwiki_rxCode.'/' +execute 'syntax match VimwikiCode /'.g:vimwiki_rxCode.'/' "
horizontal rule -execute 'syntax match wikiHR /'.g:vimwiki_rxHR.'/' +execute 'syntax match VimwikiHR /'.g:vimwiki_rxHR.'/' " List items -execute 'syntax match wikiList /'.g:vimwiki_rxListBullet.'/' -execute 'syntax match wikiList /'.g:vimwiki_rxListNumber.'/' -execute 'syntax match wikiList /'.g:vimwiki_rxListDefine.'/' +execute 'syntax match VimwikiList /'.g:vimwiki_rxListBullet.'/' +execute 'syntax match VimwikiList /'.g:vimwiki_rxListNumber.'/' +execute 'syntax match VimwikiList /'.g:vimwiki_rxListDefine.'/' -execute 'syntax region wikiPre start=/'.g:vimwiki_rxPreStart. - \ '/ end=/'.g:vimwiki_rxPreEnd.'/ contains=wikiComment' +execute 'syntax region VimwikiPre start=/'.g:vimwiki_rxPreStart. + \ '/ end=/'.g:vimwiki_rxPreEnd.'/ contains=VimwikiComment' " List item checkbox -syntax match wikiCheckBox /\[.\?\]/ +syntax match VimwikiCheckBox /\[.\?\]/ if g:vimwiki_hl_cb_checked - execute 'syntax match wikiCheckBoxDone /'.g:vimwiki_rxListBullet.'\s*\[x\].*$/' - execute 'syntax match wikiCheckBoxDone /'.g:vimwiki_rxListNumber.'\s*\[x\].*$/' + execute 'syntax match VimwikiCheckBoxDone /'.g:vimwiki_rxListBullet.'\s*\[x\].*$/' + execute 'syntax match VimwikiCheckBoxDone /'.g:vimwiki_rxListNumber.'\s*\[x\].*$/' endif -syntax region wikiComment start='' +syntax region VimwikiComment start='' -if !vimwiki#hl_exists("wikiHeader1") - execute 'syntax match wikiHeader /'.g:vimwiki_rxHeader.'/' +if !vimwiki#hl_exists("VimwikiHeader1") + execute 'syntax match VimwikiHeader /'.g:vimwiki_rxHeader.'/' else " Header levels, 1-6 - execute 'syntax match wikiHeader1 /'.g:vimwiki_rxH1.'/' - execute 'syntax match wikiHeader2 /'.g:vimwiki_rxH2.'/' - execute 'syntax match wikiHeader3 /'.g:vimwiki_rxH3.'/' - execute 'syntax match wikiHeader4 /'.g:vimwiki_rxH4.'/' - execute 'syntax match wikiHeader5 /'.g:vimwiki_rxH5.'/' - execute 'syntax match wikiHeader6 /'.g:vimwiki_rxH6.'/' + execute 'syntax match VimwikiHeader1 /'.g:vimwiki_rxH1.'/' + execute 'syntax match VimwikiHeader2 /'.g:vimwiki_rxH2.'/' + execute 'syntax match VimwikiHeader3 /'.g:vimwiki_rxH3.'/' + execute 'syntax match VimwikiHeader4 /'.g:vimwiki_rxH4.'/' + execute 'syntax match VimwikiHeader5 /'.g:vimwiki_rxH5.'/' + execute 'syntax match VimwikiHeader6 /'.g:vimwiki_rxH6.'/' endif -if !vimwiki#hl_exists("wikiHeader1") - hi def link wikiHeader Title +" group names "{{{ +if !vimwiki#hl_exists("VimwikiHeader1") + hi def link VimwikiHeader Title else - hi def link wikiHeader1 Title - hi def link wikiHeader2 Title - hi def link wikiHeader3 Title - hi def link wikiHeader4 Title - hi def link wikiHeader5 Title - hi def link wikiHeader6 Title + hi def link VimwikiHeader1 Title + hi def link VimwikiHeader2 Title + hi def link VimwikiHeader3 Title + hi def link VimwikiHeader4 Title + hi def link VimwikiHeader5 Title + hi def link VimwikiHeader6 Title endif -hi def wikiBold term=bold cterm=bold gui=bold -hi def wikiItalic term=italic cterm=italic gui=italic -hi def wikiBoldItalic term=bold cterm=bold gui=bold,italic -hi def link wikiItalicBold wikiBoldItalic +hi def VimwikiBold term=bold cterm=bold gui=bold +hi def VimwikiItalic term=italic cterm=italic gui=italic +hi def VimwikiBoldItalic term=bold cterm=bold gui=bold,italic +hi def link VimwikiItalicBold VimwikiBoldItalic -hi def link wikiCode PreProc -hi def link wikiWord Underlined -hi def link wikiNoExistsWord Error +hi def link VimwikiCode PreProc +hi def link VimwikiWord Underlined +hi def link VimwikiNoExistsWord Error -hi def link wikiPre PreProc -hi def link wikiLink Underlined -hi def link wikiList Statement -" hi def link wikiList Identifier -hi def link wikiCheckBox wikiList -hi def link wikiCheckBoxDone Comment -hi def link wikiTable PreProc -hi def link wikiEmoticons Character -hi def link wikiDelText Constant -hi def link wikiSuperScript Number -hi def link wikiSubScript Number -hi def link wikiTodo Todo -hi def link wikiComment Comment +hi def link VimwikiPre SpecialComment +hi def link VimwikiLink Underlined +hi def link VimwikiList Function +hi def link VimwikiCheckBox VimwikiList +hi def link VimwikiCheckBoxDone Comment +hi def link VimwikiTable PreProc +hi def link VimwikiEmoticons Character +hi def link VimwikiDelText Constant +hi def link VimwikiSuperScript Number +hi def link VimwikiSubScript Number +hi def link VimwikiTodo Todo +hi def link VimwikiComment Comment +"}}} let b:current_syntax="vimwiki" + +" EMBEDDED syntax setup "{{{ +let nested = VimwikiGet('nested_syntaxes') +if !empty(nested) + for [hl_syntax, vim_syntax] in items(nested) + call vimwiki#nested_syntax(vim_syntax, + \ '^{{{\%(.*[[:blank:][:punct:]]\)\?'. + \ hl_syntax.'\%([[:blank:][:punct:]].*\)\?', + \ '^}}}', 'VimwikiPre') + endfor +endif +"}}} syntax\vimwiki_default.vim [[[1 76 " Vimwiki syntax file @@ -269,7 +282,7 @@ let g:vimwiki_rxListDefine = '^\%(;\|:\)\s' let g:vimwiki_rxPreStart = '
'
 let g:vimwiki_rxPreEnd = '<\/pre>'
 ftplugin\vimwiki.vim	[[[1
-277
+286
 " Vimwiki filetype plugin file
 " Author: Maxim Kim 
 " Home: http://code.google.com/p/vimwiki/
@@ -304,13 +317,17 @@ setlocal isfname-=[,]
 " COMMENTS: autocreate list items {{{
 " for list items, and list items with checkboxes
 if VimwikiGet('syntax') == 'default'
-  setl comments=b:\ *\ [\ ],b:\ *[\ ],b:\ *\ [],b:\ *[],b:\ *\ [x],b:\ *[x]
-  setl comments+=b:\ #\ [\ ],b:\ #[\ ],b:\ #\ [],b:\ #[],b:\ #\ [x],b:\ #[x]
+  exe 'setl comments=b:\ *\ ['.escape(g:vimwiki_listsyms[0], ' ').
+        \ '],b:\ *\ ['.g:vimwiki_listsyms[4].']'
+  exe 'setl comments+=b:\ #\ ['.escape(g:vimwiki_listsyms[0], ' ').
+        \ '],b:\ #\ ['.g:vimwiki_listsyms[4].']'
   setl comments+=b:\ *,b:\ #
   setl formatlistpat=^\\s\\+[*#]\\s*
 else
-  setl comments=n:*\ [\ ],n:*[\ ],n:*\ [],n:*[],n:*\ [x],n:*[x]
-  setl comments+=n:#\ [\ ],n:#[\ ],n:#\ [],n:#[],n:#\ [x],n:#[x]
+  exe 'setl comments=n:*\ ['.escape(g:vimwiki_listsyms[0], ' ').
+        \ '],n:*\ ['.g:vimwiki_listsyms[4].']'
+  exe 'setl comments+=n:#\ ['.escape(g:vimwiki_listsyms[0], ' ').
+        \ '],n:#\ ['.g:vimwiki_listsyms[4].']'
   setl comments+=n:*,n:#
 endif
 setlocal formatoptions=tnro
@@ -319,8 +336,9 @@ setlocal formatoptions=tnro
 " FOLDING for headers and list items using expr fold method. {{{
 if g:vimwiki_folding == 1
   setlocal fdm=expr
+  setlocal foldexpr=VimwikiFoldLevel(v:lnum)
+  setlocal foldtext=VimwikiFoldText()
 endif
-setlocal foldexpr=VimwikiFoldLevel(v:lnum)
 
 function! VimwikiFoldLevel(lnum) "{{{
   let line = getline(a:lnum)
@@ -439,7 +457,6 @@ function! s:get_li_level_last(lnum) "{{{
   endif
 endfunction "}}}
 
-setlocal foldtext=VimwikiFoldText()
 function! VimwikiFoldText() "{{{
   let line = getline(v:foldstart)
   return line.' ['.(v:foldend - v:foldstart).'] '
@@ -463,7 +480,11 @@ command! -buffer VimwikiGoBackWord call vimwiki#WikiGoBackWord()
 command! -buffer VimwikiSplitWord call vimwiki#WikiFollowWord('split')
 command! -buffer VimwikiVSplitWord call vimwiki#WikiFollowWord('vsplit')
 
-command! -buffer VimwikiToggleListItem call vimwiki_lst#ToggleListItem()
+command! -buffer -range VimwikiToggleListItem call vimwiki_lst#ToggleListItem(, )
+
+exe 'command! -buffer -nargs=* Search vimgrep  '.
+      \ VimwikiGet('path').'**/*'.VimwikiGet('ext')
+
 " COMMANDS }}}
 
 " KEYBINDINGS {{{
@@ -526,6 +547,7 @@ noremap