Version 0.3.2
FIXED: Renaming - error if complex wiki word contains %. FIXED: Syntax highlighting for preformatted text . Sync option added. FIXED: smartCR bug fix.
This commit is contained in:
parent
c0582997a3
commit
dfd2470208
@ -3,8 +3,8 @@
|
|||||||
" Author: Maxim Kim (habamax at gmail dot com)
|
" Author: Maxim Kim (habamax at gmail dot com)
|
||||||
" Home: http://code.google.com/p/vimwiki/
|
" Home: http://code.google.com/p/vimwiki/
|
||||||
" Filenames: *.wiki
|
" Filenames: *.wiki
|
||||||
" Last Change: (16.05.2008 14:28)
|
" Last Change: (16.05.2008 18:29)
|
||||||
" Version: 0.3.1
|
" Version: 0.3.2
|
||||||
|
|
||||||
|
|
||||||
if exists("loaded_vimwiki") || &cp
|
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_word = '\<'.g:vimwiki_word1.'\>\|'.g:vimwiki_word2
|
||||||
let s:wiki_badsymbols = '[<>|?*/\:"]'
|
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'
|
execute 'autocmd! BufNewFile,BufReadPost,BufEnter *'.g:vimwiki_ext.' set ft=vimwiki'
|
||||||
|
|
||||||
|
|
||||||
@ -62,6 +59,10 @@ function! s:msg(message)"{{{
|
|||||||
echohl None
|
echohl None
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
|
||||||
|
function! s:editfile(command, filename)
|
||||||
|
execute a:command.' '.escape(a:filename, '% ')
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:SearchWord(wikiRx,cmd)"{{{
|
function! s:SearchWord(wikiRx,cmd)"{{{
|
||||||
let hl = &hls
|
let hl = &hls
|
||||||
let lasts = @/
|
let lasts = @/
|
||||||
@ -153,10 +154,12 @@ function! WikiFollowWord(split)"{{{
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
if s:WikiIsLinkToNonWikiFile(word)
|
if s:WikiIsLinkToNonWikiFile(word)
|
||||||
execute cmd.word
|
" execute cmd.word
|
||||||
|
call s:editfile(cmd, word)
|
||||||
else
|
else
|
||||||
call insert(g:vimwiki_history, [expand('%:p'), col('.')])
|
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
|
endif
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
|
||||||
@ -197,7 +200,11 @@ function! WikiNewLine() "{{{
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" delete <space>
|
" delete <space>
|
||||||
execute 'normal x'
|
if getline('.') =~ '^\s\+$'
|
||||||
|
execute 'normal x'
|
||||||
|
else
|
||||||
|
execute 'normal X'
|
||||||
|
endif
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
|
||||||
"" file system funcs
|
"" file system funcs
|
||||||
@ -270,7 +277,8 @@ function! WikiRenameWord() "{{{
|
|||||||
try
|
try
|
||||||
call rename(expand('%'), newFileName)
|
call rename(expand('%'), newFileName)
|
||||||
bd
|
bd
|
||||||
execute 'e '.newFileName
|
"function call doesn't work
|
||||||
|
call s:editfile('e', newFileName)
|
||||||
catch /.*/
|
catch /.*/
|
||||||
call s:msg('Cannot rename "'.expand('%:r').'" to "'.newFileName.'"')
|
call s:msg('Cannot rename "'.expand('%:r').'" to "'.newFileName.'"')
|
||||||
return
|
return
|
||||||
@ -333,4 +341,15 @@ endfunction"}}}
|
|||||||
|
|
||||||
" Functions }}}
|
" Functions }}}
|
||||||
|
|
||||||
|
"" Commands {{{
|
||||||
|
command WikiRenameWord call WikiRenameWord()
|
||||||
|
command WikiDeleteWord call WikiDeleteWord()
|
||||||
|
command WikiGoHome call WikiGoHome()
|
||||||
|
command WikiGoBackWord call WikiGoBackWord()
|
||||||
|
command -nargs=1 WikiFollowWord call WikiFollowWord(<f-args>)
|
||||||
|
command WikiNextWord call WikiNextWord()
|
||||||
|
command WikiPrevWord call WikiPrevWord()
|
||||||
|
|
||||||
|
"" Commands }}}
|
||||||
|
|
||||||
nmap <silent><unique> <Leader>ww :call WikiGoHome()<CR>
|
nmap <silent><unique> <Leader>ww :call WikiGoHome()<CR>
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
" Author: Maxim Kim (habamax at gmail dot com)
|
" Author: Maxim Kim (habamax at gmail dot com)
|
||||||
" Home: http://code.google.com/p/vimwiki/
|
" Home: http://code.google.com/p/vimwiki/
|
||||||
" Filenames: *.wiki
|
" Filenames: *.wiki
|
||||||
" Last Change: (16.05.2008 14:28)
|
" Last Change: (16.05.2008 17:14)
|
||||||
" Version: 0.3.1
|
" Version: 0.3.2
|
||||||
|
|
||||||
" Quit if syntax file is already loaded
|
" Quit if syntax file is already loaded
|
||||||
if version < 600
|
if version < 600
|
||||||
@ -83,6 +83,7 @@ syntax match wikiTodo /\(TODO:\|DONE:\|FIXME:\|FIXED:\)/
|
|||||||
syntax match wikiPre /^\s\+[^[:blank:]*#].*$/
|
syntax match wikiPre /^\s\+[^[:blank:]*#].*$/
|
||||||
|
|
||||||
syntax region wikiPre start=/^{{{\s*$/ end=/^}}}\s*$/
|
syntax region wikiPre start=/^{{{\s*$/ end=/^}}}\s*$/
|
||||||
|
syntax sync match wikiPreSync grouphere wikiPre /^{{{\s*$/
|
||||||
|
|
||||||
" Link FlexWiki syntax items to colors
|
" Link FlexWiki syntax items to colors
|
||||||
hi def link wikiH1 Title
|
hi def link wikiH1 Title
|
||||||
|
Loading…
Reference in New Issue
Block a user