Permalink
Browse files

Version 3.0

- VikiFolds() rev4: The text body is set to max heading level + 1 in
order to avoid lookups and thus speed-up the code.
- g:vikiPromote: Don't set viki minor modes for any files opened via
viki, unless this variable is set
- Added support for 'l' vikiFolds to the default fold expression.
- Added support for the {ref} macro (the referenced label has to be in
the same file though)
- INCOMPATIBLE CHANGE: Moved most function to autoload/viki.vim; moved
support for deplate/viki markup to vikiDeplate.vim.
- The argument of the VikiMode() has changed. (But this function
shouldn't be used anyway.)
- With g:vikiFoldMethodVersion=4 (the default), the text body is at the
level of the heading. This uses "=" for the body, which can be a problem
on slow machines. With g:vikiFoldMethodVersion=5, the body is below the
lowest heading, which can cause other problem.
- :VikiEditInVim ... edit special files in vim
- Set the default value for g:vikiCacheInexistent in order not to
surprise users with the abundance of cached data.
- Require tlib 0.15
- Use tlib#progressbar
- Improved (poor-man's) tex/math syntax highlighting
- Removed norm! commands form s:MarkInexistent().
- FIX: Wrong value for b:vikiSimpleNameAnchorIdx when simple viki names
weren't disabled.
- Optionally use hookcursormoved (vimscript #2037) for improved detection of hyperlinks to
inexistent sources. If this plugin causes difficulties, please tell me
and temporarily remove it.
- Use matchlist() instead of substitute(), which could speed things up a
little.
  • Loading branch information...
1 parent ade2a0e commit c81cfc47ce2a5a9cc5cd67b9fe343ab99d3987bb @tomtom tomtom committed with Oct 4, 2007
View
Oops, something went wrong.
@@ -1,27 +1,25 @@
" vikiAnyWord.vim
-" @Author: Thomas Link (mailto:samul@web.de?subject=vim-vikiAnyWord)
+" @Author: Thomas Link (mailto:micathom AT gmail com?subject=vim-vikiAnyWord)
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 04-Apr-2005.
-" @Last Change: 16-Feb-2006.
-" @Revision: 0.14
+" @Last Change: 2007-10-04.
+" @Revision: 0.30
-if &cp || exists("loaded_vikianyword")
+if &cp || exists('loaded_viki_anyword')
finish
endif
-let loaded_vikianyword = 1
+let loaded_viki_anyword = 1
"""" Any Word {{{1
-fun! VikiMinorModeAnyWord (state) "{{{3
- let b:vikiFamily = 'AnyWord'
- call VikiMinorMode(a:state)
+function! viki_anyword#MinorMode(state) "{{{3
+ let b:vikiFamily = 'anyword'
+ call viki_viki#MinorMode(a:state)
endfun
-command! VikiMinorModeAnyWord call VikiMinorModeAnyWord(1)
-command! VikiMinorModeMaybeAnyWord call VikiMinorModeAnyWord(-1)
+command! VikiMinorModeAnyWord call viki_anyword#MinorMode(1)
-fun! VikiSetupBufferAnyWord(state, ...) "{{{3
- echom "DBG VikiSetupBufferAnyWord"
+function! viki_anyword#SetupBuffer(state, ...) "{{{3
let dontSetup = a:0 > 0 ? a:1 : ''
- call VikiSetupBuffer(a:state, dontSetup)
+ call viki_viki#SetupBuffer(a:state, dontSetup)
if b:vikiNameTypes =~? "s" && !(dontSetup =~? "s")
if b:vikiNameTypes =~# "S" && !(dontSetup =~# "S")
let simpleWikiName = b:vikiSimpleNameQuoteBeg
@@ -64,7 +62,7 @@ fun! VikiSetupBufferAnyWord(state, ...) "{{{3
let b:vikiMarkInexistent = 2
endf
-fun! VikiDefineMarkupAnyWord(state) "{{{3
+function! viki_anyword#DefineMarkup(state) "{{{3
if b:vikiNameTypes =~? "s" && b:vikiSimpleNameRx != ""
exe "syn match vikiRevLink /" . b:vikiSimpleNameRx . "/"
endif
@@ -76,9 +74,9 @@ fun! VikiDefineMarkupAnyWord(state) "{{{3
endif
endfun
-fun! VikiDefineHighlightingAnyWord(state, ...) "{{{3
+function! viki_anyword#DefineHighlighting(state, ...) "{{{3
let dontSetup = a:0 > 0 ? a:1 : ''
- call VikiDefineHighlighting(a:state)
+ call viki_viki#DefineHighlighting(a:state)
if version < 508
command! -nargs=+ VikiHiLink hi link <args>
else
@@ -88,10 +86,10 @@ fun! VikiDefineHighlightingAnyWord(state, ...) "{{{3
delcommand VikiHiLink
endf
-fun! VikiFindAnyWord(flag, ...) "{{{3
- let rx = VikiRxFromCollection(b:vikiNamesOk)
+function! viki_anyword#Find(flag, ...) "{{{3
+ let rx = viki#RxFromCollection(b:vikiNamesOk)
let i = a:0 >= 1 ? a:1 : 0
- call VikiFind(a:flag, i, rx)
+ call viki#Find(a:flag, i, rx)
endfun
@@ -1,19 +1,19 @@
" vikiLatex.vim -- viki add-on for LaTeX
-" @Author: Thomas Link (samul AT web.de)
+" @Author: Thomas Link (micathom AT gmail com?subject=vim)
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 28-Jän-2004.
-" @Last Change: 2007-06-07.
-" @Revision: 0.178
+" @Last Change: 2007-10-04.
+" @Revision: 0.194
-if &cp || exists("s:loaded_vikiLatex")
+if &cp || exists('loaded_viki_latex')
finish
endif
-let s:loaded_vikiLatex = 1
+let loaded_viki_latex = 1
-fun! VikiSetupBufferLaTeX(state, ...)
+function! viki_latex#SetupBuffer(state, ...)
let noMatch = ""
let b:vikiNameSuffix = '.tex'
- call VikiSetupBuffer(a:state, "sSic")
+ call viki_viki#SetupBuffer(a:state, "sSic")
let b:vikiAnchorRx = '\\label{%{ANCHOR}}'
let b:vikiNameTypes = substitute(b:vikiNameTypes, '\C[Sicx]', "", "g")
let b:vikiLaTeXCommands = 'viki\|include\|input\|usepackage\|psfig\|includegraphics\|bibliography\|ref'
@@ -39,7 +39,7 @@ fun! VikiSetupBufferLaTeX(state, ...)
endif
endf
-fun! VikiLatexCheckFilename(filename, ...)
+function! viki_latex#CheckFilename(filename, ...)
if a:filename != ""
""" search in the current directory
let i = 1
@@ -67,8 +67,8 @@ fun! VikiLatexCheckFilename(filename, ...)
endfun
-fun! VikiCompleteSimpleNameDefLaTeX(def)
- exec VikiSplitDef(a:def)
+function! viki_latex#CompleteSimpleNameDef(def)
+ exec viki#SplitDef(a:def)
if v_name == g:vikiDefNil
throw "Viki: Malformed command (no name): ". string(a:def)
endif
@@ -77,36 +77,31 @@ fun! VikiCompleteSimpleNameDefLaTeX(def)
let useSuffix = g:vikiDefSep
if v_name == "input"
- let v_dest = VikiLatexCheckFilename(v_dest, "", ".tex", ".sty")
+ let v_dest = viki_latex#CheckFilename(v_dest, "", ".tex", ".sty")
elseif v_name == "usepackage"
- let v_dest = VikiLatexCheckFilename(v_dest, ".sty")
+ let v_dest = viki_latex#CheckFilename(v_dest, ".sty")
elseif v_name == "include"
- let v_dest = VikiLatexCheckFilename(v_dest, ".tex")
+ let v_dest = viki_latex#CheckFilename(v_dest, ".tex")
elseif v_name == "viki"
- let v_dest = VikiLatexCheckFilename(v_dest, ".tex")
+ let v_dest = viki_latex#CheckFilename(v_dest, ".tex")
let v_anchor = opts
elseif v_name == "psfig"
let f == matchstr(v_dest, "figure=\zs.\{-}\ze[,}]")
- let v_dest = VikiLatexCheckFilename(v_dest, "")
+ let v_dest = viki_latex#CheckFilename(v_dest, "")
elseif v_name == "includegraphics"
- let v_dest = VikiLatexCheckFilename(v_dest, "",
+ let v_dest = viki_latex#CheckFilename(v_dest, "",
\ ".eps", ".ps", ".pdf", ".png", ".jpeg", ".jpg", ".gif", ".wmf")
elseif v_name == "bibliography"
if !exists('b:vikiMarkingInexistent')
let bibs = split(v_dest, ",")
- let n = tlib#InputList('si', "Select Bibliography", bibs)
- if n > 0
- let f = bibs[n - 1]
- let v_dest = VikiLatexCheckFilename(f, ".bib")
- else
- let v_dest = ""
- endif
+ let f = tlib#input#List('s', "Select Bibliography", bibs)
+ let v_dest = empty(f) ? '' : viki_latex#CheckFilename(f, ".bib")
endif
elseif v_name == "ref"
let v_anchor = v_dest
let v_dest = g:vikiSelfRef
elseif exists("*VikiLaTeX_".v_name)
- exe VikiLaTeX_{v_name}(v_dest, opts)
+ exec VikiLaTeX_{v_name}(v_dest, opts)
else
throw "Viki LaTeX: unsupported command: ". v_name
endif
@@ -116,16 +111,16 @@ fun! VikiCompleteSimpleNameDefLaTeX(def)
throw "Viki LaTeX: can't find: ". v_name ." ". string(a:def)
endif
else
- return VikiMakeDef(v_name, v_dest, v_anchor, v_part, 'simple')
+ return viki#MakeDef(v_name, v_dest, v_anchor, v_part, 'simple')
endif
endfun
-fun! VikiMinorModeLaTeX(state)
- let b:vikiFamily = "LaTeX"
- call VikiMinorMode(a:state)
+function! viki_latex#MinorMode(state)
+ let b:vikiFamily = "latex"
+ call viki_viki#MinorMode(a:state)
endf
-command! VikiMinorModeLaTeX call VikiMinorModeLaTeX(1)
+command! VikiMinorModeLaTeX call viki_latex#MinorMode(1)
" au FileType tex let b:vikiFamily="LaTeX"
" vim: ff=unix
Oops, something went wrong.

0 comments on commit c81cfc4

Please sign in to comment.