diff --git a/plugin/vimwiki.vim b/plugin/vimwiki.vim index 2ee4e52..bb6ecee 100644 --- a/plugin/vimwiki.vim +++ b/plugin/vimwiki.vim @@ -3,8 +3,8 @@ " Author: Maxim Kim (habamax at gmail dot com) " Home: http://code.google.com/p/vimwiki/ " Filenames: *.wiki -" Last Change: (16.05.2008 14:28) -" Version: 0.3.1 +" Last Change: (16.05.2008 18:29) +" Version: 0.3.2 if exists("loaded_vimwiki") || &cp @@ -48,9 +48,6 @@ let g:vimwiki_word2 = '\[\[['.upp.low.oth.'[:punct:][:space:]]\{-}\]\]' let s:wiki_word = '\<'.g:vimwiki_word1.'\>\|'.g:vimwiki_word2 let s:wiki_badsymbols = '[<>|?*/\:"]' -"" need it to rename -let s:wiki_current_word = g:vimwiki_index - execute 'autocmd! BufNewFile,BufReadPost,BufEnter *'.g:vimwiki_ext.' set ft=vimwiki' @@ -62,6 +59,10 @@ function! s:msg(message)"{{{ echohl None endfunction"}}} +function! s:editfile(command, filename) + execute a:command.' '.escape(a:filename, '% ') +endfunction + function! s:SearchWord(wikiRx,cmd)"{{{ let hl = &hls let lasts = @/ @@ -153,10 +154,12 @@ function! WikiFollowWord(split)"{{{ return endif if s:WikiIsLinkToNonWikiFile(word) - execute cmd.word + " execute cmd.word + call s:editfile(cmd, word) else call insert(g:vimwiki_history, [expand('%:p'), col('.')]) - execute cmd.g:vimwiki_home.word.g:vimwiki_ext + call s:editfile(cmd, g:vimwiki_home.word.g:vimwiki_ext) + " execute cmd.g:vimwiki_home.word.g:vimwiki_ext endif endfunction"}}} @@ -197,7 +200,11 @@ function! WikiNewLine() "{{{ endif " delete - execute 'normal x' + if getline('.') =~ '^\s\+$' + execute 'normal x' + else + execute 'normal X' + endif endfunction "}}} "" file system funcs @@ -270,7 +277,8 @@ function! WikiRenameWord() "{{{ try call rename(expand('%'), newFileName) bd - execute 'e '.newFileName + "function call doesn't work + call s:editfile('e', newFileName) catch /.*/ call s:msg('Cannot rename "'.expand('%:r').'" to "'.newFileName.'"') return @@ -333,4 +341,15 @@ endfunction"}}} " Functions }}} +"" Commands {{{ +command WikiRenameWord call WikiRenameWord() +command WikiDeleteWord call WikiDeleteWord() +command WikiGoHome call WikiGoHome() +command WikiGoBackWord call WikiGoBackWord() +command -nargs=1 WikiFollowWord call WikiFollowWord() +command WikiNextWord call WikiNextWord() +command WikiPrevWord call WikiPrevWord() + +"" Commands }}} + nmap ww :call WikiGoHome() diff --git a/syntax/vimwiki.vim b/syntax/vimwiki.vim index 20210ba..11bb3d9 100644 --- a/syntax/vimwiki.vim +++ b/syntax/vimwiki.vim @@ -3,8 +3,8 @@ " Author: Maxim Kim (habamax at gmail dot com) " Home: http://code.google.com/p/vimwiki/ " Filenames: *.wiki -" Last Change: (16.05.2008 14:28) -" Version: 0.3.1 +" Last Change: (16.05.2008 17:14) +" Version: 0.3.2 " Quit if syntax file is already loaded if version < 600 @@ -83,6 +83,7 @@ syntax match wikiTodo /\(TODO:\|DONE:\|FIXME:\|FIXED:\)/ syntax match wikiPre /^\s\+[^[:blank:]*#].*$/ syntax region wikiPre start=/^{{{\s*$/ end=/^}}}\s*$/ +syntax sync match wikiPreSync grouphere wikiPre /^{{{\s*$/ " Link FlexWiki syntax items to colors hi def link wikiH1 Title