Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Version 4.01

- Escape special character when loading "autoload/viki/enc_{&enc}.vim"- Support for xdg- Register 3gp as special file- viki#SetAnchorMarks(): Hide errors- :EditWrapper(): Fix slashes on windows- g:vikiIndentedPriorityLists: if 0, allow priority lists not to be indented- s:EditWrapper(): Correct filenames only if g:vikiDirSeparator == '&#039- s:UpdateHeadings(): Use silent! when searching for headersMD5 checksum: 918f9422bc3678ccd8c0eb71abad6f6b
  • Loading branch information...
commit 341ea6815c0d317bb7380461ac9ff01b0a5d378c 1 parent 2e79eef
@tomtom tomtom authored committed
View
24 autoload/viki.vim
@@ -3,11 +3,11 @@
" @Website: http://www.vim.org/account/profile.php?user_id=4037
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2007-03-25.
-" @Last Change: 2012-02-19.
-" @Revision: 0.909
+" @Last Change: 2012-03-23.
+" @Revision: 0.918
-exec 'runtime! autoload/viki/enc_'. &enc .'.vim'
+exec 'runtime! autoload/viki/enc_'. substitute(&enc, '[\/<>*+&:?]', '_', 'g') .'.vim'
""" General {{{1
@@ -89,6 +89,7 @@ if !exists("g:vikiSpecialFiles") "{{{2
" Can also be buffer-local.
" :read: let g:vikiSpecialFiles = [...] "{{{2
let g:vikiSpecialFiles = [
+ \ '3gp',
\ 'aac',
\ 'aif',
\ 'aiff',
@@ -516,9 +517,11 @@ if !exists("g:vikiOpenFileWith_ANY")
let g:vikiOpenFileWith_ANY = "exec 'silent ! start \"\" '. shellescape('%{FILE}')"
elseif has("mac")
let g:vikiOpenFileWith_ANY = "exec 'silent !open '. shellescape('%{FILE}')"
+ elseif exists('$XDG_CURRENT_DESKTOP') && !empty($XDG_CURRENT_DESKTOP)
+ let g:vikiOpenFileWith_ANY = "exec 'silent !xdg-open '. shellescape('%{FILE}')"
elseif $GNOME_DESKTOP_SESSION_ID != "" || $DESKTOP_SESSION == 'gnome'
let g:vikiOpenFileWith_ANY = "exec 'silent !gnome-open '. shellescape('%{FILE}')"
- elseif $KDEDIR != ""
+ elseif exists("$KDEDIR") && !empty($KDEDIR)
let g:vikiOpenFileWith_ANY = "exec 'silent !kfmclient exec '. shellescape('%{FILE}')"
endif
endif
@@ -613,6 +616,8 @@ if !exists("g:vikiOpenUrlWith_ANY")
let g:vikiOpenUrlWith_ANY = "exec 'silent ! RunDll32.EXE URL.DLL,FileProtocolHandler '. shellescape('%{URL}', 1)"
elseif has("mac")
let g:vikiOpenUrlWith_ANY = "exec 'silent !open '. escape('%{URL}', ' &!%')"
+ elseif exists('$XDG_CURRENT_DESKTOP') && !empty($XDG_CURRENT_DESKTOP)
+ let g:vikiOpenFileWith_ANY = "exec 'silent !xdg-open '. shellescape('%{URL}')"
elseif $GNOME_DESKTOP_SESSION_ID != ""
let g:vikiOpenUrlWith_ANY = "exec 'silent !gnome-open '. shellescape('%{URL}')"
elseif $KDEDIR != ""
@@ -713,6 +718,14 @@ endf
function! s:EditWrapper(cmd, fname) "{{{3
" TLogVAR a:cmd, a:fname
let fname = escape(simplify(a:fname), ' %#')
+ if g:vikiDirSeparator == '\' && fname !~ '^\w\+://'
+ let fname = substitute(fname, '/', '\\', 'g')
+ " TLogVAR fname
+ endif
+ if a:cmd =~ '^\(silent\s\+\)\?!'
+ let fname = shellescape(fname)
+ " TLogVAR fname
+ endif
" let fname = escape(simplify(a:fname), '%#')
if a:cmd =~ g:vikiNoWrapper
" TLogDBG a:cmd .' '. fname
@@ -1671,8 +1684,7 @@ function! viki#SetAnchorMarks() "{{{3
" TLogVAR pos
let sr = @/
let anchorRx = viki#GetAnchorRx('m\zs\[a-zA-Z]\ze\s\*\$')
- " TLogVAR anchorRx
- " exec 'silent keepjumps g /'. anchorRx .'/exec "norm! m". substitute(getline("."), anchorRx, ''\2'', "")'
+ " TLogVAR anchorRx
exec 'silent! keepjumps g /'. anchorRx .'/exec "norm! m". matchstr(getline("."), anchorRx)'
let @/ = sr
" TLogVAR pos
View
15 doc/viki.txt
@@ -342,10 +342,11 @@ A viki name is either:
4. Hyperwords (not supported by deplate)
Hyperwords are defined in either ./.vikiWords or
- &rtp[0]/vikiWords.txt each word in a line in the form "word
- destination" (lines beginning with '%' are ignored). These
- words are automatically highlighted. Depending on your setting
- of |vikiNameTypes|, viki may try to make hyperwords out of the
+ &rtp[0]/vikiWords.txt each word in a line in the form
+ "word<tab>destination", where <tab> is the tab character (code
+ 9). Lines beginning with '%' are ignored. These words are
+ automatically highlighted. Depending on your setting of
+ |vikiNameTypes|, viki may try to make hyperwords out of the
filenames in the current buffer's directory. I.e. if
|vikiNameSuffix| is '.viki' and there is a file 'example.viki'
in the same directory as the current buffer's file, then each
@@ -869,6 +870,7 @@ Contents~
g:vikiSaveHistory ................... |g:vikiSaveHistory|
g:vikiAutoupdateFiles ............... |g:vikiAutoupdateFiles|
g:vikiFoldLevel ..................... |g:vikiFoldLevel|
+ g:vikiIndentedPriorityLists ......... |g:vikiIndentedPriorityLists|
b:vikiNoSimpleNames ................. |b:vikiNoSimpleNames|
b:vikiDisableType ................... |b:vikiDisableType|
VikiMakeName ........................ |VikiMakeName()|
@@ -1119,6 +1121,11 @@ g:vikiFoldLevel (default: 5)
If > 0, set the 'foldlevel' of viki files to this value. (This is
only useful if 'foldlevel' still has the default value of 0.)
+ *g:vikiIndentedPriorityLists*
+g:vikiIndentedPriorityLists (default: 1)
+ If true, priority lists must be indented by at least one
+ whitespace character.
+
*b:vikiNoSimpleNames*
b:vikiNoSimpleNames (default: 0)
If non-nil, simple viki names are disabled.
View
6 ftplugin/viki.vim
@@ -2,8 +2,8 @@
" @Author: Tom Link (micathom AT gmail com?subject=vim)
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 12-Jän-2004.
-" @Last Change: 2012-02-19.
-" @Revision: 487
+" @Last Change: 2012-03-25.
+" @Revision: 488
if exists("b:did_ftplugin") "{{{2
finish
@@ -189,7 +189,7 @@ function! s:UpdateHeadings() "{{{3
let b:viki_headings = {}
let pos = getpos('.')
try
- g/^\*\+\s/let b:viki_headings[line('.')] = matchend(getline('.'), '^\*\+\s')
+ silent! g/^\*\+\s/let b:viki_headings[line('.')] = matchend(getline('.'), '^\*\+\s')
finally
call setpos('.', pos)
endtry
View
21 plugin/viki.vim
@@ -2,8 +2,8 @@
" @Author: Tom Link (micathom AT gmail com?subject=vim)
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 08-Dec-2003.
-" @Last Change: 2012-02-18.
-" @Revision: 2737
+" @Last Change: 2012-03-25.
+" @Revision: 2740
"
" GetLatestVimScripts: 861 1 viki.vim
"
@@ -20,15 +20,6 @@
" Optional Enhancements:
" - imaps.vim (vimscript #244 or #475 for |:VimQuote|)
" - kpsewhich (not a vim plugin :-) for vikiLaTeX
-"
-" TODO: File names containing # (the # is interpreted as URL component)
-" TODO: Per Interviki simple name patterns
-" TODO: Allow Wiki links like ::Word or even ::word (not in minor mode
-" due possible conflict with various programming languages?)
-" TODO: :VikiRename command: rename links/files (requires a
-" cross-plattform grep or similar; or one could a global register)
-" TODO: don't know how to deal with viki names that span several lines
-" (e.g. in LaTeX mode)
if &cp || exists("loaded_viki")
finish
@@ -40,7 +31,7 @@ if !exists('g:loaded_tlib') || g:loaded_tlib < 39
finish
endif
endif
-let loaded_viki = 400
+let loaded_viki = 401
if !exists("tlist_viki_settings")
@@ -109,6 +100,12 @@ if !exists('g:vikiFoldLevel')
let g:vikiFoldLevel = 5 "{{{2
endif
+if !exists('g:vikiIndentedPriorityLists')
+ " If true, priority lists must be indented by at least one
+ " whitespace character.
+ let g:vikiIndentedPriorityLists = 1 "{{{2
+endif
+
" -1 ... open all links in a new windows
" -2 ... open all links in a new windows but split vertically
View
22 syntax/viki.vim
@@ -2,8 +2,8 @@
" @Author: Tom Link (micathom AT gmail com?subject=vim)
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 30-Dez-2003.
-" @Last Change: 2012-02-17.
-" @Revision: 0.1012
+" @Last Change: 2012-03-13.
+" @Revision: 0.1018
if version < 600
syntax clear
@@ -221,17 +221,13 @@ syn match vikiTag /\(\s\+\(:[^[:punct:][:space:]]\+\)\+\)\+/ contained contained
syn match vikiContact /\s\+@[^[:punct:][:space:]]\+/ contained containedin=vikiPriorityListTodoGen,vikiPriorityListTodoGenInLine nextgroup=vikiContact
-syn match vikiPriorityListTodoGen /^[[:blank:]]\+\zs#\(T: \+.\{-}\u.\{-}:\|\d*\u\d*\(\s\+\(_\|\([0-9%-]\+\|\.\.\)\{1,3}\)\)\?\)\(\s\+\(:[^[:punct:][:space:]]\+\)\+\)*\(\s\+@[^[:punct:][:space:]]\+\)*\ze[[:punct:][:space:]]/ contains=vikiContact,vikiTag,@vikiPriorityListTodo,@vikiText
-" syn match vikiPriorityListTodoGenInLine /#\(T: \+.\{-}\u.\{-}:\|\d*\u\d*\)\(\s\+\(:[^[:punct:][:space:]]\+\)\+\)*\(\s\+@[^[:punct:][:space:]]\+\)*\ze[[:punct:][:space:]]/ contains=vikiContact,vikiTag,vikiPriorityListTodoA,vikiPriorityListTodoB,vikiPriorityListTodoC,vikiPriorityListTodoD,vikiPriorityListTodoE,vikiPriorityListTodoF,vikiPriorityListTodo0,@vikiText contained
-
-syn match vikiPriorityListDoneGen /^[[:blank:]]\+\zs#\(T: \+x\([0-9%-]\+\)\?.\{-}\u.\{-}:\|\(T: \+\)\?\d*\u\d* \+x[0-9%-]*\):\? .*/
-syn match vikiPriorityListDoneX /^[[:blank:]]\+\zs#X\d\?\s.*/
-" syn match vikiPriorityListDoneA /^[[:blank:]]\+\zs#\(T: \+x\([0-9%-]\+\)\?.\{-}A.\{-}:\|\(T: \+\)\?\d*A\d* \+x[0-9%-]*\):\? .*/
-" syn match vikiPriorityListDoneB /^[[:blank:]]\+\zs#\(T: \+x\([0-9%-]\+\)\?.\{-}B.\{-}:\|\(T: \+\)\?\d*B\d* \+x[0-9%-]*\):\? .*/
-" syn match vikiPriorityListDoneC /^[[:blank:]]\+\zs#\(T: \+x\([0-9%-]\+\)\?.\{-}C.\{-}:\|\(T: \+\)\?\d*C\d* \+x[0-9%-]*\):\? .*/
-" syn match vikiPriorityListDoneD /^[[:blank:]]\+\zs#\(T: \+x\([0-9%-]\+\)\?.\{-}D.\{-}:\|\(T: \+\)\?\d*D\d* \+x[0-9%-]*\):\? .*/
-" syn match vikiPriorityListDoneE /^[[:blank:]]\+\zs#\(T: \+x\([0-9%-]\+\)\?.\{-}E.\{-}:\|\(T: \+\)\?\d*E\d* \+x[0-9%-]*\):\? .*/
-" syn match vikiPriorityListDoneF /^[[:blank:]]\+\zs#\(T: \+x\([0-9%-]\+\)\?.\{-}F.\{-}:\|\(T: \+\)\?\d*F\d* \+x[0-9%-]*\):\? .*/
+
+let s:plquant = g:vikiIndentedPriorityLists ? '\+' : '*'
+exec 'syn match vikiPriorityListTodoGen /^[[:blank:]]'. s:plquant .'\zs#\(T: \+.\{-}\u.\{-}:\|\d*\u\d*\(\s\+\(_\|\([0-9%-]\+\|\.\.\)\{1,3}\)\)\?\)\(\s\+\(:[^[:punct:][:space:]]\+\)\+\)*\(\s\+@[^[:punct:][:space:]]\+\)*\ze[[:punct:][:space:]]/ contains=vikiContact,vikiTag,@vikiPriorityListTodo,@vikiText'
+exec 'syn match vikiPriorityListDoneGen /^[[:blank:]]'. s:plquant .'\zs#\(T: \+x\([0-9%-]\+\)\?.\{-}\u.\{-}:\|\(T: \+\)\?\d*\u\d* \+x[0-9%-]*\):\? .*/'
+exec 'syn match vikiPriorityListDoneX /^[[:blank:]]'. s:plquant .'\zs#X\d\?\s.*/'
+unlet s:plquant
+
syntax sync minlines=2
" syntax sync maxlines=50
Please sign in to comment.
Something went wrong with that request. Please try again.