Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Version 3.20

- Use syn-conceal if available- viki#SetAnchorMarks(): call QuickfixsignsSet('', ['marks']): specify "marks"- Register docx, pptx, xlsx as special extensions- viki_viki#SetupBuffer: Allow brackets in extended viki links- compiler/deplate: Space was not escaped (thanks to E Peron)- don't set fold* if vikiFoldMethodVersion<1- .gitignore- Don't check for has('vim_starting')- Moved s:MatchList() to autoload/viki.vim- New: viki#SelectListItem(), viki#ShiftListItem(), viki#MoveListItem()- Use vimdedoc.rb to generate the help file from source- Enable {fn} macros as hyperlinks- VikiDefine: define interviki commands with command!- Duplicate help tags (fix #2)- vnoremap <buffer> <expr> ii for viki#SelectListItem('.')- VikiFoldLevel(): Always check if vikiFolds == ""- #Files region: allow optional "head" argument- Configurable option for how to handle malformed viki names- Make sure g:VIKIBACKREFS is a dictionary- New VikiFoldLevel version 8: headings only, uses cached info about heading levels for speed-up- Enable VikiFoldLevel() v8 to fold list items- Enable VikiFoldLevel() v8 to inversely fold headings (H)- Remove support for multiple folding methods (g:vikiFoldMethodVersion)MD5 checksum: 18b8b9837ebb7451d56a90ccfc1de854
  • Loading branch information...
commit 32c53a51dd4c7284b8bff4a4282d7bfd2d57baf9 1 parent 5308d47
@tomtom tomtom authored committed
View
21 README
@@ -1,7 +1,9 @@
This is a mirror of http://www.vim.org/scripts/script.php?script_id=861
VIKI Forum (questions, feature requests): http://sourceforge.net/projects/deplate/forums/forum/700962
-Bug tracker: http://sourceforge.net/tracker/?group_id=108085&atid=649488
+Bug tracker: https://github.com/tomtom/viki_vim/issues
+Markup: http://deplate.sourceforge.net/Markup.html (http://deplate.sourceforge.net/markup.txt)
+Demo: http://vimsomnia.blogspot.com/2010/11/vikitasks-viki-demonstration-personal.html
QUICKSTART
This plugin adds wiki-like hypertext capabilities to Vim. You can use viki as a "minor" mode (i.e., as an add-on to any other mode) or as a full-fledged wiki mode. There is also an add-on plugin for "wikifying" latex documents by turning some latex commands into wiki names. If viki is properly configured, activating a reference to an image, a webpage etc. will view that resource in an external viewer.
@@ -14,23 +16,18 @@ Use the hypertext facility with any filetype. Just type :VikiMinorMode and all w
FULL WIKI MODE:
-In full mode, viki becomes a personal wiki (http://c2.com/cgi/wiki?PersonalWiki) -- some sort of lo-fi database of notes and all sorts of information. Set 'filetype' to viki. The full wiki mode is like the minor mode but with folding support, syntax highlighting (for headings, lists, tables, textstyles etc.), and additional key bindings (i.e., you can press <c-tab> or <s-c-tab> to move the cursor to the next/previous viki name). You can bind viki mode to some file extension by adding a line like the following to some configuration file (see :help ftdetect or so):
-
- au BufRead,BufNewFile *.viki set ft=viki
+In full mode, viki becomes a personal wiki (http://c2.com/cgi/wiki?PersonalWiki). The full wiki mode included syntax highlighting (for headings, lists, tables, textstyles etc.), folding support, and additional key bindings (i.e., you can press <c-tab> or <s-c-tab> to move the cursor to the next/previous viki name). By default, the viki filetype is enabled for all files with a .viki suffix. The viki markup is explained at http://deplate.sourceforge.net/Markup.html (http://deplate.sourceforge.net/markup.txt)
WIKIS:
-In case you missed out on wikis, a wiki is a simple way of creating hypertexts. In its very basic form creating a hyperlink is as easy as writing a word in CamelCase or by enclosing a word in brackets--as in [[destination]] or [-destination-]. URLs are automatically recognized as hyperlinks. You usually begin with creating a directory where your wiki files should go to and by creating a wiki index--a master file that contains references to sub-pages. After a while you end up with many small, tightly interlinked files/notes. There is also some basic support for basic markup like emphasized text, headings and the like. In the case of Viki/deplate, this markup would compare to, e.g., LaTeX markup as follows:
-
- LaTeX: \section{Title}
- Viki: * Title
-
- LaTeX: \emph{text}
- Viki: __text__
+In case you missed out on wikis, a wiki is a simple way of creating hypertexts. In its very basic form creating a hyperlink is as easy as writing a word in CamelCase or by enclosing a word in brackets--as in [[destination]] or [-destination-]. A wiki is a simple tool to organize ideas, notes etc. See http://en.wikipedia.org/wiki/Wiki for details.
RELATED PLUGIN:
- vikitasks (vimscript #2894) :: Search viki files for tasks and display them in a list
+- vikitasks (vimscript #2894): Distributed TODO lists
+- hookcursormoved (vimscript #2037): Enhanced detection of hyperlinks to inexistent destinations.
+- vxfold (vimscript #3004) by Marko Mahnič: Provides org-mode like fold cycling
+- VOoM (vimscript #2657): A two-pane outliner with support for viki
Also available via git
View
710 autoload/viki.vim
@@ -3,10 +3,8 @@
" @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: 2010-09-14.
-" @Revision: 0.679
-
-" call tlog#Log('Load: '. expand('<sfile>')) " vimtlib-sfile
+" @Last Change: 2011-12-29.
+" @Revision: 0.863
""" General {{{1
@@ -21,17 +19,39 @@ let g:vikiDefSep = "\n"
" document. This is likely to go away.
let g:vikiSelfRef = '.'
-" A simple viki name is made from a series of upper and lower characters
-" (i.e. CamelCase-names). These two variables define what is considered as
-" upper and lower-case characters. We don't rely on the builtin
-" functionality for this.
-if !exists("g:vikiUpperCharacters") "{{{2
- let g:vikiUpperCharacters = "A-Z"
+
+" :doc:
+" Simple Viki Names [2]: *viki-vars-simple-names*
+
+if !exists("g:vikiUpperCharacters")
+ " A simple viki name is made from a series of upper and lower characters
+ " (i.e. CamelCase-names). These two variables define what is considered as
+ " upper and lower-case characters. We don't rely on the builtin
+ " functionality for this.
+ let g:vikiUpperCharacters = "A-Z" "{{{2
endif
-if !exists("g:vikiLowerCharacters") "{{{2
- let g:vikiLowerCharacters = "a-z"
+if !exists("g:vikiLowerCharacters")
+ let g:vikiLowerCharacters = "a-z" "{{{2
endif
+" :doc:
+" Extended Viki Names [2]: *viki-vars-ext-names*
+" - b:vikiExtendedNameRx, b:vikiExtendedNameSimpleRx[1]
+" - b:vikiExtendedNameNameIdx, b:vikiExtendedNameDestIdx,
+" b:vikiExtendedNameAnchorIdx
+"
+" URLs [2]: *viki-vars-urls*
+" - b:vikiUrlRx, b:vikiUrlSimpleRx[1]
+" - b:vikiUrlNameIdx, b:vikiUrlDestIdx, b:vikiUrlAnchorIdx
+"
+" NOTE: [1] The same as *Rx variables but with less groups.
+" NOTE: [2] These variables are defined by |VikiSetupBuffer()|.
+"
+" - b:vikiAnchorRx *b:vikiAnchorRx*
+" If this variable exists, the string "%{ANCHOR}" will be replaced with the
+" search text. The expression has to conform to the very nomagic |/\V|
+" syntax.
+
" Characters allowed in anchors
" Defaults to:
" [b:vikiLowerCharacters][b:vikiLowerCharacters + b:vikiUpperCharacters + '_0-9]*
@@ -43,19 +63,26 @@ if !exists('g:vikiUrlRestRx')
let g:vikiUrlRestRx = '['. g:vikiLowerCharacters . g:vikiUpperCharacters .'0-9?%_=&+-]*' "{{{2
endif
+if !exists('g:viki#error_malformed_names')
+ " If true, throw an error on malformed viki names.
+ let g:viki#error_malformed_names = 0 "{{{2
+endif
-" URLs matching these protocols are handled by VikiOpenSpecialProtocol()
-if !exists("g:vikiSpecialProtocols") "{{{2
- let g:vikiSpecialProtocols = 'https\?\|ftps\?\|nntp\|mailto\|mailbox\|file'
+if !exists("g:vikiSpecialProtocols")
+ " URLs matching these protocols are handled by |VikiOpenSpecialProtocol()|.
+ " Can also be buffer-local.
+ let g:vikiSpecialProtocols = 'https\?\|ftps\?\|nntp\|mailto\|mailbox\|file' "{{{2
endif
-" Exceptions from g:vikiSpecialProtocols
-if !exists("g:vikiSpecialProtocolsExceptions") "{{{2
- let g:vikiSpecialProtocolsExceptions = ""
+if !exists("g:vikiSpecialProtocolsExceptions")
+ " Exceptions from g:vikiSpecialProtocols
+ let g:vikiSpecialProtocolsExceptions = "" "{{{2
endif
if !exists("g:vikiSpecialFiles") "{{{2
- " Files matching these suffixes are handled by viki#OpenSpecialFile()
+ " Files matching these suffixes are handled by |viki#OpenSpecialFile()|.
+ " Can also be buffer-local.
+ " :read: let g:vikiSpecialFiles = [...] "{{{2
let g:vikiSpecialFiles = [
\ 'aac',
\ 'aif',
@@ -65,6 +92,7 @@ if !exists("g:vikiSpecialFiles") "{{{2
\ 'bmp',
\ 'dia',
\ 'doc',
+ \ 'docx',
\ 'dvi',
\ 'eml',
\ 'eps',
@@ -88,6 +116,7 @@ if !exists("g:vikiSpecialFiles") "{{{2
\ 'pdf',
\ 'png',
\ 'ppt',
+ \ 'pptx',
\ 'ps',
\ 'rtf',
\ 'voc',
@@ -97,137 +126,210 @@ if !exists("g:vikiSpecialFiles") "{{{2
\ 'wmv',
\ 'xhtml',
\ 'xls',
+ \ 'xlsx',
\ 'xmind',
\ ]
endif
-" Exceptions from g:vikiSpecialFiles
-if !exists("g:vikiSpecialFilesExceptions") "{{{2
- let g:vikiSpecialFilesExceptions = ""
+if !exists("g:vikiSpecialFilesExceptions")
+ " Exceptions from g:vikiSpecialFiles
+ let g:vikiSpecialFilesExceptions = "" "{{{2
endif
-if !exists('g:viki_highlight_hyperlink_light') "{{{2
- " let g:viki_highlight_hyperlink_light = 'term=bold,underline cterm=bold,underline gui=bold,underline ctermfg=DarkBlue guifg=DarkBlue'
- let g:viki_highlight_hyperlink_light = 'term=underline cterm=underline gui=underline ctermfg=DarkBlue guifg=DarkBlue'
+if !exists('g:viki_highlight_hyperlink_light')
+ let g:viki_highlight_hyperlink_light = 'term=underline cterm=underline gui=underline ctermfg=DarkBlue guifg=DarkBlue' "{{{2
endif
-if !exists('g:viki_highlight_hyperlink_dark') "{{{2
- " let g:viki_highlight_hyperlink_dark = 'term=bold,underline cterm=bold,underline gui=bold,underline ctermfg=DarkBlue guifg=LightBlue'
- let g:viki_highlight_hyperlink_dark = 'term=underline cterm=underline gui=underline ctermfg=LightBlue guifg=#bfbfff'
+if !exists('g:viki_highlight_hyperlink_dark')
+ let g:viki_highlight_hyperlink_dark = 'term=underline cterm=underline gui=underline ctermfg=LightBlue guifg=#bfbfff' "{{{2
endif
-if !exists('g:viki_highlight_inexistent_light') "{{{2
- " let g:viki_highlight_inexistent_light = 'term=bold,underline cterm=bold,underline gui=bold,underline ctermfg=DarkRed guifg=DarkRed'
- let g:viki_highlight_inexistent_light = 'term=underline cterm=underline gui=underline ctermfg=DarkRed guifg=DarkRed'
+if !exists('g:viki_highlight_inexistent_light')
+ let g:viki_highlight_inexistent_light = 'term=underline cterm=underline gui=underline ctermfg=DarkRed guifg=DarkRed' "{{{2
endif
-if !exists('g:viki_highlight_inexistent_dark') "{{{2
- " let g:viki_highlight_inexistent_dark = 'term=bold,underline cterm=bold,underline gui=bold,underline ctermfg=Red guifg=Red'
- let g:viki_highlight_inexistent_dark = 'term=underline cterm=underline gui=underline ctermfg=Red guifg=Red'
+if !exists('g:viki_highlight_inexistent_dark')
+ let g:viki_highlight_inexistent_dark = 'term=underline cterm=underline gui=underline ctermfg=Red guifg=Red' "{{{2
endif
-" If set to true, any files loaded by viki will become viki enabled (in
-" minor mode); this was the default behaviour in earlier versions
-if !exists('g:vikiPromote') "{{{2
- let g:vikiPromote = 0
+if !exists('g:vikiPromote')
+ " If set to true, any files loaded by viki will become viki enabled (in
+ " minor mode); this was the default behaviour in earlier versions
+ let g:vikiPromote = 0 "{{{2
endif
-" If non-nil, use the parent document's suffix.
-if !exists("g:vikiUseParentSuffix") | let g:vikiUseParentSuffix = 0 | endif "{{{2
+if !exists("g:vikiUseParentSuffix")
+ " If non-nil, use the parent document's suffix.
+ " If true, always append the "parent" file's suffix to the
+ " destination file name. I.e. if the current file is "ThisIdea.txt"
+ " the the viki name "OtherIdea" will refer to the file
+ " "OtherIdea.txt".
+ let g:vikiUseParentSuffix = 0 "{{{2
+endif
-" Prefix for anchors
-if !exists("g:vikiAnchorMarker") | let g:vikiAnchorMarker = "#" | endif "{{{2
+if !exists("g:vikiAnchorMarker")
+ " Prefix for anchors
+ let g:vikiAnchorMarker = "#" "{{{2
+endif
-" If non-nil, search anchors anywhere in the text too (without special
-" markup)
-if !exists("g:vikiFreeMarker") | let g:vikiFreeMarker = 0 | endif "{{{2
+if !exists("g:vikiFreeMarker")
+ " If true and an explicitly marked anchor isn't found, search for the anchor
+ " text as such. This search will be case-insensitive. deplate won't be able
+ " to deal with such pseudo-references, of course.
+ let g:vikiFreeMarker = 0 "{{{2
+endif
-if !exists('g:vikiPostFindAnchor') "{{{2
- let g:vikiPostFindAnchor = 'norm! zz'
+if !exists('g:vikiPostFindAnchor')
+ let g:vikiPostFindAnchor = 'norm! zz' "{{{2
endif
-" List of enabled viki name types
-" c ... Camel case
-" s ... Simple names
-" S ... Quoted simple names
-" e ... Extended names
-" u ... URLs
-" i ... Intervikis
-" x ... Commands
-" w ... "hyperwords"
-" f ... Filenames as "hyperwords"
-if !exists("g:vikiNameTypes") | let g:vikiNameTypes = "csSeuixwf" | endif "{{{2
-
-" Which directory explorer to use to edit directories
-if !exists("g:vikiExplorer") | let g:vikiExplorer = "Sexplore" | endif "{{{2
-" if !exists("g:vikiExplorer") | let g:vikiExplorer = "split" | endif "{{{2
-" if !exists("g:vikiExplorer") | let g:vikiExplorer = "edit" | endif "{{{2
-"
-" If hide or update: use the respective command when leaving a buffer
-if !exists("g:vikiHide") | let g:vikiHide = '' | endif "{{{2
+if !exists("g:vikiNameTypes")
+ " Disable certain types of viki names globally or for a single buffer.
+ " (experimental, doesn't fully work yet)
+ " List of enabled viki name types:
+ " s ... Simple viki name
+ " c ... CamelCase
+ " S ... simple, quoted viki name
+ " i ... |interviki|
+ " w ... Hyperwords
+ " f ... file-bases hyperwords
+ " e ... Extended viki name
+ " u ... URL
+ " x ... Directives (some commands, regions ...)
+ let g:vikiNameTypes = "csSeuixwf" "{{{2
+endif
-" Don't use g:vikiHide for commands matching this rx
-if !exists("g:vikiNoWrapper") | let g:vikiNoWrapper = '\cexplore' | endif "{{{2
+if !exists("g:vikiExplorer")
+ " Which directory explorer to use to edit directories
+ let g:vikiExplorer = "Sexplore" "{{{2
+endif
-" Cache information about a document's inexistent names
-if !exists("g:vikiCacheInexistent") | let g:vikiCacheInexistent = 0 | endif "{{{2
+if !exists("g:vikiHide")
+ " If hide or update: use the respective command when leaving a buffer
+ " If a dirty buffers gets hidden, vim usually complains. This can be
+ " tiresome -- depending on your editing habits. When this variable is set to
+ " "hide", vim won't complain. If you set it to "update", a viki buffer will
+ " be automatically updated before editing a different file. If you leave
+ " this empty (""), the default behaviour is in effect. See also |hidden|.
+ let g:vikiHide = '' "{{{2
+endif
-" If non-nil, map keys that trigger the evaluation of inexistent names
-if !exists("g:vikiMapInexistent") | let g:vikiMapInexistent = 1 | endif "{{{2
+if !exists("g:vikiNoWrapper")
+ " Don't use g:vikiHide for commands matching this rx
+ let g:vikiNoWrapper = '\cexplore' "{{{2
+endif
-" Map these keys for g:vikiMapInexistent to LineQuick
-if !exists("g:vikiMapKeys") | let g:vikiMapKeys = "]).,;:!?\"' " | endif "{{{2
+if !exists("g:vikiCacheInexistent")
+ " Cache information about a document's inexistent names
+ " If non-zero, save patterns for |g:vikiMarkInexistent| for later
+ " re-use using |tlib#cache#Filename()|. You might want to delete old
+ " files from the |g:tlib_cache| directory from time to time.
+ let g:vikiCacheInexistent = 0 "{{{2
+endif
-" Map these keys for g:vikiMapInexistent to ParagraphVisible
-if !exists("g:vikiMapQParaKeys") | let g:vikiMapQParaKeys = "\n" | endif "{{{2
+if !exists("g:vikiMapInexistent")
+ " If non-nil, map keys that trigger the evaluation of inexistent names
+ let g:vikiMapInexistent = 1 "{{{2
+endif
-" Install hooks for these conditions (requires hookcursormoved to be
-" installed)
-" "linechange" could cause some slowdown.
-if !exists("g:vikiHCM") "{{{2
- let g:vikiHCM = ['syntaxleave_oneline']
+if !exists("g:vikiMapKeys")
+ " Map these keys for g:vikiMapInexistent to LineQuick
+ let g:vikiMapKeys = "]).,;:!?\"' " "{{{2
endif
-" Check the viki name before inserting this character
-if !exists("g:vikiMapBeforeKeys") | let g:vikiMapBeforeKeys = ']' | endif "{{{2
+if !exists("g:vikiMapQParaKeys")
+ " Map these keys for g:vikiMapInexistent to ParagraphVisible
+ let g:vikiMapQParaKeys = "\n" "{{{2
+endif
-" Some functions a gathered in families/classes. See vikiLatex.vim for
-" an example.
-if !exists("g:vikiFamily") | let g:vikiFamily = "" | endif "{{{2
+if !exists("g:vikiHCM")
+ " Install hooks for these conditions (requires hookcursormoved to be
+ " installed)
+ " "linechange" could cause some slowdown.
+ let g:vikiHCM = ['syntaxleave_oneline'] "{{{2
+endif
-" The directory separator
-if !exists("g:vikiDirSeparator") | let g:vikiDirSeparator = "/" | endif "{{{2
+if !exists("g:vikiMapBeforeKeys")
+ " Check the viki name before inserting this character
+ let g:vikiMapBeforeKeys = ']' "{{{2
+endif
-" The version of Deplate markup
-if !exists("g:vikiTextstylesVer") | let g:vikiTextstylesVer = 2 | endif "{{{2
+if !exists("g:vikiFamily")
+ " Some functions a gathered in families/classes. See vikiLatex.vim for
+ " an example.
+ " By defining this variable, family specific functions will be called for:
+ " - viki#{b:vikiFamily}#SetupBuffer(state)
+ " - viki#{b:vikiFamily}#DefineMarkup(state)
+ " - viki#{b:vikiFamily}#DefineHighlighting(state)
+ " - viki#{b:vikiFamily}#CompleteSimpleNameDef(def)
+ " - viki#{b:vikiFamily}#CompleteExtendedNameDef(def)
+ " - viki#{b:vikiFamily}#FindAnchor(anchor)
+ " If one of these functions is undefined for a "viki family", then the
+ " default one is called.
+ "
+ " Apart from the default behaviour the following families are defined:
+ " - latex (see |viki-latex|)
+ " - anyword (see |viki-anyword|)
+ let g:vikiFamily = "" "{{{2
+endif
-" The default viki page (as absolute filename)
-if !exists("g:vikiHomePage") | let g:vikiHomePage = '' | endif "{{{2
+if !exists("g:vikiDirSeparator")
+ " The directory separator
+ let g:vikiDirSeparator = "/" "{{{2
+endif
-" How often the feedback is changed when marking inexisting links
-if !exists("g:vikiFeedbackMin") | let g:vikiFeedbackMin = &lines | endif "{{{2
+if !exists("g:vikiTextstylesVer")
+ " The version of Deplate markup.
+ " Defines the markup of |viki-textstyles| like emphasized or code.
+ let g:vikiTextstylesVer = 2 "{{{2
+endif
-" The map leader for most viki key maps.
-if !exists("g:vikiMapLeader") | let g:vikiMapLeader = '<LocalLeader>v' | endif "{{{2
+if !exists("g:vikiHomePage")
+ " The default viki page (as absolute filename).
+ " An absolute filename that is the general viki homepage (see also
+ " |:VikiEdit| and |:VikiHome|).
+ let g:vikiHomePage = '' "{{{2
+endif
-" If non-nil, anchors like #mX are turned into vim marks
-if !exists("g:vikiAutoMarks") | let g:vikiAutoMarks = 1 | endif "{{{2
+if !exists("g:vikiFeedbackMin")
+ " How often the feedback is changed when marking inexisting links
+ let g:vikiFeedbackMin = &lines "{{{2
+endif
+
+if !exists("g:vikiMapLeader")
+ " The map leader for most viki key maps.
+ let g:vikiMapLeader = '<LocalLeader>v' "{{{2
+endif
-" The variable that keeps back-links information
-if !exists("g:VIKIBACKREFS") | let g:VIKIBACKREFS = {} | endif "{{{2
+if !exists("g:vikiAutoMarks")
+ " If non-nil, anchors like #mX are turned into vim marks
+ let g:vikiAutoMarks = 1 "{{{2
+endif
+
+if !exists("g:VIKIBACKREFS")
+ " The variable that keeps back-links information
+ let g:VIKIBACKREFS = {} "{{{2
+endif
-" An expression that evaluates to the number of lines that should be
-" included in the balloon tooltop text if &ballonexpr is set to
-" viki#Balloon().
-if !exists("g:vikiBalloonLines") | let g:vikiBalloonLines = '&lines / 3' | endif "{{{2
+if !exists("g:vikiBalloonLines")
+ " An expression that evaluates to the number of lines that should be
+ " included in the balloon tooltop text if &ballonexpr is set to
+ " viki#Balloon().
+ let g:vikiBalloonLines = '&lines / 3' "{{{2
+endif
-" If true, show some line of the target file in a balloon tooltip
-" window.
-if !exists("g:vikiBalloon") | let g:vikiBalloon = 1 | endif "{{{2
+if !exists("g:vikiBalloon")
+ " If true, show some line of the target file in a balloon tooltip
+ " window.
+ let g:vikiBalloon = 1 "{{{2
+endif
-if !exists("g:vikiBalloonEncoding") | let g:vikiBalloonEncoding = &enc | endif "{{{2
+if !exists("g:vikiBalloonEncoding")
+ let g:vikiBalloonEncoding = &enc "{{{2
+endif
-" A list of files that contain special viki names
-if v:version >= 700 && !exists("g:vikiHyperWordsFiles") "{{{2
+if v:version >= 700 && !exists("g:vikiHyperWordsFiles")
+ " A list of files that contain special viki names
+ " :read: let g:vikiHyperWordsFiles = [...] "{{{2
let g:vikiHyperWordsFiles = [
\ get(split(&rtp, ','), 0).'/vikiWords.txt',
\ './.vikiWords',
@@ -235,8 +337,8 @@ if v:version >= 700 && !exists("g:vikiHyperWordsFiles") "{{{2
endif
-" Define which keys to map
-if !exists("g:vikiMapFunctionality") "{{{2
+if !exists("g:vikiMapFunctionality")
+ " Define which keys to map
" b ... go back
" c ... follow link (c-cr)
" e ... edit
@@ -250,12 +352,19 @@ if !exists("g:vikiMapFunctionality") "{{{2
" tF ... tab as find
" Files ... #Files related
" let g:vikiMapFunctionality = 'mf mb tF c q e i I Files'
- let g:vikiMapFunctionality = 'ALL'
+ let g:vikiMapFunctionality = 'ALL' "{{{2
endif
-" Define which keys to map in minor mode (invoked via :VikiMinorMode)
-if !exists("g:vikiMapFunctionalityMinor") "{{{2
- " let g:vikiMapFunctionalityMinor = 'f b p mf mb tF c q e i'
- let g:vikiMapFunctionalityMinor = 'f b p mf mb tF c q e'
+
+if !exists("g:vikiMapFunctionalityMinor")
+ " Define which keys to map in minor mode (invoked via :VikiMinorMode)
+ let g:vikiMapFunctionalityMinor = 'f b p mf mb tF c q e' "{{{2
+endif
+
+if !exists('g:viki#files_head_rx')
+ " If a "head" argument is passed to the #Files region, the retrieved
+ " lines will be preprocessed by removing text matching this
+ " expression.
+ let g:viki#files_head_rx = '^\(\*\s\+\)' "{{{2
endif
let g:viki#quit = 0
@@ -270,18 +379,22 @@ let s:hookcursormoved_oldpos = []
""" Commands {{{1
+" Find the next viki name or URL
command! -count VikiFindNext call viki#DispatchOnFamily('Find', '', '', <count>)
+" Find the previous viki name or URL
command! -count VikiFindPrev call viki#DispatchOnFamily('Find', '', 'b', <count>)
-" command! -nargs=* -range=% VikiMarkInexistent
-" \ call VikiSaveCursorPosition()
-" \ | call <SID>VikiMarkInexistent(<line1>, <line2>, <f-args>)
-" \ | call VikiRestoreCursorPosition()
-" \ | call <SID>ResetSavedCursorPosition()
+
+" Update the highlighting of links to inexistent files.
+" VikiMarkInexistent can take a range as argument.
command! -nargs=* -range=% VikiMarkInexistent call viki#MarkInexistentInRange(<line1>, <line2>)
-" this requires imaps to be installed
-command! -range VikiQuote :call VEnclose("[-", "-]", "[-", "-]")
+if exists(':VEnclose')
+ " Mark selected text as a quoted simple viki name, i.e., enclose it in
+ " [- and -].
+ " This command requires imaps to be installed.
+ command! -range VikiQuote :call VEnclose("[-", "-]", "[-", "-]")
+endif
command! -narg=? VikiGoBack call viki#GoBack(<f-args>)
@@ -289,6 +402,33 @@ command! VikiJump call viki#MaybeFollowLink(0,1)
command! VikiIndex :call viki#Index()
+" :display: VikiEdit[!] NAME
+" Edit the wiki page called NAME. If the NAME is '*', the |viki-homepage| will
+" be opened. This is a convenient way to edit any wiki page from vim's command
+" line. If you call :VikiEdit! (with bang), the homepage will be opened first,
+" so that the homepage's customizations (and not the current buffer's one) are
+" in effect. There are a few gotchas:
+"
+" 1. Viki doesn't define a default directory for wiki pages. Thus a wiki page
+" will be looked for in the directory of the current buffer --
+" whatever this is -- and the customizations of this buffer are in
+" effect. You can circumvent this problem by using |interviki|
+" names or define a |viki-homepage| and call :VikiEdit! with a
+" bang.
+"
+" 2. Viki relies on some buffer local variables to be set. As customizability
+" is one viki's main design goal (although, one might want to
+" discuss whether I overdid it), there are no global settings that
+" would define what a valid viki name is supposed to look like. As
+" a consequence, if you disabled a certain type of wiki name in the
+" current buffer, you won't be able to edit a wiki page of this
+" type. E.g.: If the current buffer contains a LaTeX file,
+" |vikiFamily| is most likely set to "LaTeX" (see |viki-latex|).
+" For the LaTeX family, e.g., CamelCase and interwiki names are
+" disabled. Consequently, you can't do, e.g., >
+" :VikiEdit IDEAS::WikiPage
+"< Again, you can circumvent this problem by defining a
+" |viki-homepage| and call :VikiEdit! with a bang.
command! -nargs=1 -bang -complete=customlist,viki#EditComplete VikiEdit :call viki#Edit(<q-args>, !empty("<bang>"))
command! -nargs=1 -bang -complete=customlist,viki#EditComplete VikiEditTab :call viki#Edit(<q-args>, !empty("<bang>"), 'tab')
command! -nargs=1 -bang -complete=customlist,viki#EditComplete VikiEditInWin1 :call viki#Edit(<q-args>, !empty("<bang>"), 1)
@@ -296,12 +436,24 @@ command! -nargs=1 -bang -complete=customlist,viki#EditComplete VikiEditInWin2 :c
command! -nargs=1 -bang -complete=customlist,viki#EditComplete VikiEditInWin3 :call viki#Edit(<q-args>, !empty("<bang>"), 3)
command! -nargs=1 -bang -complete=customlist,viki#EditComplete VikiEditInWin4 :call viki#Edit(<q-args>, !empty("<bang>"), 4)
+" Update the current |viki-files| #Files region under the cursor.
command! VikiFilesUpdate call viki#FilesUpdate()
+
+" Update all |viki-files| #Files regions in the current buffer.
command! VikiFilesUpdateAll call viki#FilesUpdateAll()
command! -nargs=* -bang -complete=command VikiFileExec call viki#FilesExec(<q-args>, '<bang>', 1)
+" |:execute| a vim command after doing some replacements with the command
+" string. For each formatted string the command is issued only once --
+" i.e. you can work easily with the directories. If no special formatting
+" string is contained, the preformatted filename is appended to the command.
+" %{FILE} ... filename
+" %{FFILE} ... preformatted filename (with '#%\ ' escaped)
+" %{DIR} ... file's directory
command! -nargs=* -bang -complete=command VikiFilesExec call viki#FilesExec(<q-args>, '<bang>')
+" |:execute| VikiCmd_{VIKI_COMMAND_NAME} FILENAME
command! -nargs=* -bang VikiFilesCmd call viki#FilesCmd(<q-args>, '<bang>')
+" |:call| VikiCmd_{FUNCTION_NAME}(FILENAME)
command! -nargs=* -bang VikiFilesCall call viki#FilesCall(<q-args>, '<bang>')
@@ -310,7 +462,6 @@ command! -nargs=* -bang VikiFilesCall call viki#FilesCall(<q-args>, '<bang>')
" This is mostly a legacy function. Using set ft=viki should work too.
-" Set filetype=viki
function! viki#Mode(...) "{{{3
TVarArg 'family'
" if exists('b:vikiEnabled')
@@ -331,7 +482,7 @@ endf
" Special file handlers {{{1
-if !exists('g:vikiOpenFileWith_ws') && exists(':WsOpen') "{{{2
+if !exists('g:vikiOpenFileWith_ws') && exists(':WsOpen')
function! VikiOpenAsWorkspace(file)
exec 'WsOpen '. escape(a:file, ' &!%')
exec 'lcd '. escape(fnamemodify(a:file, ':p:h'), ' &!%')
@@ -344,9 +495,9 @@ if type(g:vikiSpecialFiles) != 3
endif
" TAssert IsList(g:vikiSpecialFiles)
-if !exists("g:vikiOpenFileWith_ANY") "{{{2
+if !exists("g:vikiOpenFileWith_ANY")
if exists('g:netrw_browsex_viewer')
- let g:vikiOpenFileWith_ANY = "exec 'silent !'. g:netrw_browsex_viewer .' '. shellescape('%{FILE}')"
+ let g:vikiOpenFileWith_ANY = "exec 'silent !'. g:netrw_browsex_viewer .' '. shellescape('%{FILE}')" "{{{2
elseif has("win32") || has("win16") || has("win64")
let g:vikiOpenFileWith_ANY = "exec 'silent ! start \"\" '. shellescape('%{FILE}')"
elseif has("mac")
@@ -358,7 +509,18 @@ if !exists("g:vikiOpenFileWith_ANY") "{{{2
endif
endif
-if !exists('*VikiOpenSpecialFile') "{{{2
+if !exists('*VikiOpenSpecialFile')
+ " Handles filenames that match |vikiSpecialFiles|.
+ " If g:vikiOpenFileWith_{SUFFIX} is defined, it contains a command
+ " definition for opending files of this type. "%{FILE}" is replaced with the
+ " file name ("%%" = "%") and the resulting string is executed. Example: >
+ "
+ " let g:vikiOpenFileWith_html = '!firefox %{FILE}'
+ "
+ " The contents of variable g:vikiOpenFileWith_ANY will be used as fallback
+ " command. Under Windows, g:vikiOpenFileWith_ANY defaults to "silent !cmd /c
+ " start".
+ " All suffixes are translated to lower case.
function! VikiOpenSpecialFile(file) "{{{3
" TLogVAR a:file
" let proto = tolower(matchstr(a:file, '\c\.\zs[a-z]\+$'))
@@ -383,8 +545,8 @@ endif
" Special protocol handlers {{{1
-if !exists('g:vikiOpenUrlWith_mailbox') "{{{2
- let g:vikiOpenUrlWith_mailbox="call VikiOpenMailbox('%{URL}')"
+if !exists('g:vikiOpenUrlWith_mailbox')
+ let g:vikiOpenUrlWith_mailbox = "call VikiOpenMailbox('%{URL}')" "{{{2
function! VikiOpenMailbox(url) "{{{3
exec viki#DecomposeUrl(strpart(a:url, 10))
let idx = matchstr(args, 'number=\zs\d\+$')
@@ -396,11 +558,13 @@ if !exists('g:vikiOpenUrlWith_mailbox') "{{{2
endf
endif
-" Possible values: special*, query, normal
-if !exists("g:vikiUrlFileAs") | let g:vikiUrlFileAs = 'special' | endif "{{{2
+if !exists("g:vikiUrlFileAs")
+ " Possible values: special*, query, normal
+ let g:vikiUrlFileAs = 'special' "{{{2
+endif
-if !exists("g:vikiOpenUrlWith_file") "{{{2
- let g:vikiOpenUrlWith_file="call VikiOpenFileUrl('%{URL}')"
+if !exists("g:vikiOpenUrlWith_file")
+ let g:vikiOpenUrlWith_file = "call VikiOpenFileUrl('%{URL}')" "{{{2
function! VikiOpenFileUrl(url) "{{{3
" TLogVAR url
if viki#IsSpecialFile(a:url)
@@ -428,7 +592,7 @@ if !exists("g:vikiOpenUrlWith_file") "{{{2
endf
endif
-if !exists("g:vikiOpenUrlWith_ANY") "{{{2
+if !exists("g:vikiOpenUrlWith_ANY")
" let g:vikiOpenUrlWith_ANY = "exec 'silent !". g:netrw_browsex_viewer ." '. escape('%{URL}', ' &!%')"
if has("win32")
" let g:vikiOpenUrlWith_ANY = "exec 'silent !rundll32 url.dll,FileProtocolHandler '. shellescape('%{URL}')"
@@ -442,7 +606,18 @@ if !exists("g:vikiOpenUrlWith_ANY") "{{{2
endif
endif
-if !exists("*VikiOpenSpecialProtocol") "{{{2
+if !exists("*VikiOpenSpecialProtocol")
+ " Handles filenames that match |vikiSpecialProtocols|.
+ " If g:vikiOpenUrlWith_{PROTOCOL} is defined, it contains a command definition
+ " for opending urls of this type. "%{URL}" is replaced with the url ("%%" =
+ " "%") and the resulting string is executed. Example: >
+ "
+ " let g:vikiOpenUrlWith_mailto = '!thunderbird -compose %{URL}'
+ "
+ " The contents of variable g:vikiOpenUrlWith_ANY will be used as fallback
+ " command. Under Windows, g:vikiOpenUrlWith_ANY defaults to "silent
+ " !rundll32 url.dll ...".
+ " All protocol names are translated to lower case.
function! VikiOpenSpecialProtocol(url) "{{{3
" TLogVAR a:url
" TLogVAR a:url
@@ -830,8 +1005,11 @@ if v:version == 700 && !has('patch8')
let &lazyredraw = lr
return ''
endf
+
else
- function! viki#MarkInexistentInElement(elt) "{{{3
+
+ " :nodoc:
+ function! viki#MarkInexistentInElement(elt)
if exists('b:vikiEnabled') && b:vikiEnabled <= 1
finish
endif
@@ -851,6 +1029,7 @@ else
let &lazyredraw = lr
endtry
endf
+
endif
@@ -1216,7 +1395,6 @@ function! viki#RestoreCursorPosition(...) "{{{3
endf
" Save the cursor position
-" TODO: adapt for vim7
function! viki#SaveCursorPosition() "{{{3
let ve = &virtualedit
set virtualedit=all
@@ -1319,6 +1497,10 @@ endf
" Retrieve information for back references
function! s:GetBackRef()
if g:vikiSaveHistory
+ if type(g:VIKIBACKREFS) != 4
+ unlet g:VIKIBACKREFS
+ let g:VIKIBACKREFS = {}
+ endif
let id = expand('%:p')
if empty(id)
return []
@@ -1336,7 +1518,9 @@ function! s:GetBackRef()
endif
endf
-" Jump to the parent buffer (or go back in history)
+" Jump to the parent buffer (or go back in history).
+" If b:vikiParent is defined, open this viki name, otherwise use
+" |viki#GoBack()|.
function! viki#GoParent() "{{{3
if exists('b:vikiParent')
call viki#Edit(b:vikiParent)
@@ -1345,7 +1529,14 @@ function! viki#GoParent() "{{{3
endif
endf
-" Go back in history
+" Go back in history.
+" Viki keeps record about the "source" files from where a viki page was
+" entered. Calling this function jumps back to the "source" file (if only
+" one such back reference is known) or let's you select from a list of
+" "source" files. The information is stored in buffer variables -- i.e.,
+" it gets lost after closing the buffer. Care was taken to reduce
+" information clutter, which is why the number of possible back references
+" per "source" file was limited to one.
function! viki#GoBack(...) "{{{3
let s = (a:0 >= 1) ? a:1 : -1
let br = s:SelectBackRef(s)
@@ -1396,9 +1587,9 @@ function! viki#SubstituteArgs(str, ...) "{{{3
return rv
endf
-" Handle special anchors in extented viki names
-" Example: [[index#l=10]]
-if !exists('*VikiAnchor_l') "{{{2
+if !exists('*VikiAnchor_l')
+ " Handle special anchors in extented viki names
+ " Example: [[index#l=10]]
function! VikiAnchor_l(arg) "{{{3
if a:arg =~ '^\d\+$'
exec a:arg
@@ -1406,23 +1597,23 @@ if !exists('*VikiAnchor_l') "{{{2
endf
endif
-" Example: [[index#line=10]]
-if !exists('*VikiAnchor_line') "{{{2
+if !exists('*VikiAnchor_line')
+ " Example: [[index#line=10]]
function! VikiAnchor_line(arg) "{{{3
call VikiAnchor_l(a:arg)
endf
endif
-" Example: [[index#rx=foo]]
-if !exists('*VikiAnchor_rx') "{{{2
+if !exists('*VikiAnchor_rx')
+ " Example: [[index#rx=foo]]
function! VikiAnchor_rx(arg) "{{{3
let arg = escape(s:StripBackslash(a:arg), '/')
exec 'keepjumps norm! gg/'. arg .'
'
endf
endif
-
-" Example: [[index#vim=/foo]]
+
+if !exists('*VikiAnchor_vim')
" Example: [[index#vim=/foo]]
function! VikiAnchor_vim(arg) "{{{3
exec s:StripBackslash(a:arg)
@@ -1460,7 +1651,7 @@ function! viki#SetAnchorMarks() "{{{3
" TLogVAR pos
" call setpos('.', pos)
call winrestview(view)
- if exists('*QuickfixsignsSet')
+ if exists('*QuickfixsignsSet')
call QuickfixsignsSet('', ['marks'])
endif
endf
@@ -1746,7 +1937,6 @@ function! s:GuessInterViki(def) "{{{3
endif
endf
-" Somewhat pointless legacy function
" Somewhat pointless legacy function
function! s:MakeVikiDefPart(txt) "{{{3
if a:txt == ''
@@ -1755,7 +1945,6 @@ function! s:MakeVikiDefPart(txt) "{{{3
return a:txt
endif
endf
-
" Return a structure or whatever describing a viki name/link
function! viki#MakeDef(v_name, v_dest, v_anchor, v_part, v_type) "{{{3
@@ -1764,7 +1953,6 @@ function! viki#MakeDef(v_name, v_dest, v_anchor, v_part, v_type) "{{{3
return arr
endf
-" Legacy function: Today we would use dictionaries for this
" Legacy function: Today we would use dictionaries for this
" Return vimscript code that defines a set of variables on the basis of a
" viki name definition
@@ -1784,21 +1972,6 @@ function! viki#SplitDef(def) "{{{3
endif
return rv
endf
-
-" Get a viki name's/link's name, destination, or anchor
-" function! s:GetVikiNamePart(txt, erx, idx, errorMsg) "{{{3
-" if a:idx
-" " let rv = substitute(a:txt, '^\C'. a:erx ."$", '\'.a:idx, "")
-" let rv = matchlist(a:txt, '^\C'. a:erx ."$")[a:idx]
-" if rv == ''
-" return g:vikiDefNil
-" else
-" return rv
-" endif
-" else
-" return g:vikiDefNil
-" endif
-" endf
function! s:ExtractMatch(match, idx, default) "{{{3
if a:idx > 0
@@ -1807,6 +1980,17 @@ function! s:ExtractMatch(match, idx, default) "{{{3
return a:default
endif
endf
+
+function! viki#MalformedName(msg) "{{{3
+ let msg = "Viki: Malformed viki name: ". a:msg
+ if g:viki#error_malformed_names
+ throw msg
+ else
+ echohl WarningMsg
+ echom msg
+ echohl NONE
+ endif
+endf
" If txt matches a viki name typed as defined by compound return a
" structure defining this viki name.
@@ -1842,7 +2026,8 @@ function! viki#LinkDefinition(txt, col, compound, ignoreSyntax, type) "{{{3
return viki#MakeDef(name, dest, anchor, part, a:type)
elseif a:ignoreSyntax
return []
- else
+ else
+ call viki#MalformedName("v_name: " . a:txt . " (". erx .")")
return []
endif
else
@@ -2161,9 +2346,16 @@ function! viki#GetLink(ignoreSyntax, ...) "{{{3
endif
return []
endf
+
" :display: viki#MaybeFollowLink(oldmap, ignoreSyntax, ?winNr=0)
" Follow a viki name if any or complain about not having found a valid
-" viki name under the cursor.
+" viki name under the cursor.
+" oldmap: If there isn't a viki link under the cursor:
+" "" ... throw error
+" 1 ... return \<c-cr>
+" whatever ... return whatever
+" ignoreSyntax: If there isn't a viki syntax group under the cursor:
+" 0 ... no viki name found
" 1 ... look if there is a viki name under cursor anyways
function! viki#MaybeFollowLink(oldmap, ignoreSyntax, ...) "{{{3
let winNr = a:0 >= 1 ? a:1 : 0
@@ -2204,8 +2396,8 @@ function! viki#HomePage(...) "{{{3
endif
endf
+
" :display: viki#Edit(name, ?ìgnoreSpecial=0, ?winNr=0)
-" Edit a vikiname
" Edit a vikiname
function! viki#Edit(name, ...) "{{{3
TVarArg ['ignoreSpecial', 0], ['winNr', 0]
@@ -2336,7 +2528,7 @@ function! s:EditCompleteMapAgent1(val, sfx, iv, rx) "{{{3
return a:iv .'::'. rv
endif
endf
-
+
" Command line completion of |:VikiEdit|
function! viki#EditComplete(ArgLead, CmdLine, CursorPos) "{{{3
" TLogVAR a:ArgLead, a:CmdLine, a:CursorPos
@@ -2419,8 +2611,7 @@ fun! viki#FindNextRegion(name) "{{{3
let rx = s:GetRegionStartRx(a:name)
return search(rx, 'We')
endf
-
-
+
" Indentation
fun! viki#GetIndent()
let lr = &lazyredraw
@@ -2564,7 +2755,9 @@ function! viki#ExecExternal(cmd) "{{{3
endif
endf
-
+
+" :doc:
+" #Files related stuff
fun! viki#FilesUpdateAll() "{{{3
" let p = getpos('.')
@@ -2705,7 +2898,8 @@ fun! viki#DirListing(lhs, lhb, indent) "{{{3
" call sort(ls, 's:SortDirsFirst')
" endif
" endif
- let list = split(get(args, 'list', ''), ',\s*')
+ let list = split(get(args, 'list', ''), ',\s*')
+ let head = 0 + get(args, 'head', '0')
call map(ls, 'a:indent.s:GetFileEntry(v:val, list, head)')
let @t = join(ls, "\<c-j>") ."\<c-j>"
exec 'norm! '. a:lhb .'G"tP'
@@ -2716,11 +2910,7 @@ fun! viki#DirListing(lhs, lhb, indent) "{{{3
endtry
endif
endf
-
-" fun! VikiGetDirListing_ls(files)
-" return a:files
-" endf
-
+
fun! s:GetFileEntry(file, list, head) "{{{3
" let prefix = substitute(a:file, '[^/]', '', 'g')
" let prefix = substitute(prefix, '/', repeat(' ', &shiftwidth), 'g')
@@ -2760,9 +2950,16 @@ fun! s:GetFileEntry(file, list) "{{{3
" endif
if !empty(attr)
call add(f, ' {'. join(attr, '|') .'}')
- endif
- let c = get(s:savedComments, a:file, '')
- if !empty(c)
+ endif
+ if a:head > 0
+ let lines = readfile(a:file, '', a:head)
+ let lines = filter(lines, 'v:val =~ ''\S''')
+ let lines = map(lines, 'substitute(v:val, g:viki#files_head_rx, "", "g")')
+ call add(f, ' -- '. join(lines, '|'))
+ else
+ let c = get(s:savedComments, a:file, '')
+ if !empty(c)
+ call add(f, c)
endif
endif
return join(f, '')
@@ -2917,3 +3114,146 @@ function! viki#Balloon() "{{{3
endif
return ''
endf
+
+
+function! viki#MatchList(lnum) "{{{3
+ let rx = '^[[:blank:]]\+\ze\(#[A-Z]\d\?\|#\d[A-Z]\?\|[-+*#?@]\|[0-9#]\+\.\|[a-zA-Z?]\.\|.\{-1,}[[:blank:]]::\)[[:blank:]]'
+ return matchend(getline(a:lnum), rx)
+endf
+
+
+" *viki-text-objects* *ii*
+" Create a new text-object ii that works on a inner list item. Once the
+" maps are enabled, users may, e.g., visually select an item in a list
+" by typing vii. See |viki#SelectListItem()| for a definition of what is
+" considered a list item.
+"
+" The maps are local to the current buffer. Add this line to your
+" |vimrc| file in order to enable the ii text-object for all viki
+" buffers:>
+" au FileType viki call viki#MapListItemTextObject()
+function! viki#MapListItemTextObject() "{{{3
+ " vnoremap <buffer> ii :<c-u>silent! call viki#SelectListItem('.')<cr>
+ vnoremap <buffer> <expr> ii <SID>ListItemTextObject()
+ omap <buffer> ii :normal Vii<cr>
+endf
+
+
+function! s:ListItemTextObject() "{{{3
+ if indent('.') == 0
+ return "ip"
+ else
+ return ":\<c-u>silent! call viki#SelectListItem('.')\<cr>"
+ endif
+endf
+
+
+" Visually select the list item at line lnum.
+" A list item also contains all its child items. E.g. in a list like:>
+"
+" 1. Venenatis diam dignissim dui. Praesent risus.
+" 2. Tincidunt facilisis, est nisi pellentesque ligula.
+" a. Adipiscing dui non quam.
+" b. Duis posuere tortor.
+" 3. Massa lorem, dignissim at, vehicula et.
+"
+" If the cursor is placed on item #2, this function also selects the
+" items a and b.
+function! viki#SelectListItem(lnum) "{{{3
+ let lnum = line(a:lnum)
+ if lnum == 0
+ let lnum = a:lnum
+ endif
+ let lbeg = lnum
+ let item_indent = -1
+ " TLogVAR lbeg, indent(lbeg)
+ while lbeg > 1 && indent(lbeg) > 0
+ " TLogVAR lbeg
+ let item_indent = viki#MatchList(lbeg)
+ if item_indent > 0
+ break
+ endif
+ let lbeg -= 1
+ endwh
+ " TLogVAR item_indent
+ if item_indent > 0
+ let lend = lnum
+ let lmax = line('$')
+ " TLogVAR lend, lmax
+ while lend < lmax && indent(lend + 1) > item_indent
+ " TLogVAR lend
+ let lend += 1
+ endwh
+ exec printf('norm! %dggV%dgg', lbeg, lend)
+ return item_indent
+ else
+ return -1
+ endif
+endf
+
+
+" :doc:
+" The following two functions can be used with the tinymode plugin to
+" move around list items.
+"
+" Example configuration: >
+"
+" call tinymode#EnterMap("listitem_move", "gl")
+" call tinymode#ModeMsg("listitem_move", "Move list item: h/j/k/l")
+" call tinymode#Map("listitem_move", "h", "silent call viki#ShiftListItem('<')")
+" call tinymode#Map("listitem_move", "l", "silent call viki#ShiftListItem('>')")
+" call tinymode#Map("listitem_move", "j", "silent call viki#MoveListItem('down')")
+" call tinymode#Map("listitem_move", "k", "silent call viki#MoveListItem('up')")
+
+
+function! viki#ShiftListItem(direction) "{{{3
+ call viki#SelectListItem('.')
+ exec 'norm!' a:direction
+endf
+
+
+function! viki#MoveListItem(direction) "{{{3
+ let t = @t
+ try
+ let item_indent = viki#SelectListItem('.')
+ if item_indent > 0
+ " TLogVAR 1, line('.')
+ norm! "td
+ let lnum = line('.')
+ if a:direction == 'up'
+ let lmove = -1
+ let lnum -= 1
+ else
+ let lmove = 1
+ endif
+ let lmax = line('$')
+ while lnum > 0 && lnum <= lmax && (indent(lnum) > item_indent || getline(lnum) !~ '\S')
+ let lnum += lmove
+ endwh
+ if lnum == 0 || lnum > lmax
+ norm! u
+ else
+ exec lnum
+ if viki#SelectListItem('.') > 0
+ " TLogVAR 2, line('.')
+ exec "norm! \<Esc>"
+ if a:direction == 'up'
+ exec line("'<")
+ " TLogVAR 3, line('.')
+ norm! "tP
+ else
+ exec line("'>")
+ " TLogVAR 3, line('.')
+ norm! "tp
+ endif
+ " TLogVAR 4, line('.')
+ else
+ norm! u
+ endif
+ endif
+ endif
+ finally
+ let @t = t
+ endtry
+endf
+
View
2  autoload/viki_latex.vim
@@ -1,7 +1,7 @@
" vikiLatex.vim -- viki add-on for LaTeX
" @Author: Tom Link (micathom AT gmail com?subject=vim)
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
-" @Created: 28-Jän-2004.
+" @Created: 28-Jän-2004.
" @Last Change: 2010-01-03.
" @Revision: 0.198
View
42 autoload/viki_viki.vim
@@ -3,12 +3,8 @@
" @Website: http://www.vim.org/account/profile.php?user_id=4037
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2007-09-03.
-" @Last Change: 2010-09-13.
-" @Revision: 0.0.129
-
-let s:save_cpo = &cpo
-set cpo&vim
-" call tlog#Log('Load: '. expand('<sfile>')) " vimtlib-sfile
+" @Last Change: 2011-12-04.
+" @Revision: 0.0.145
""" viki/deplate {{{1
@@ -151,7 +147,7 @@ function! viki_viki#SetupBuffer(state, ...) "{{{3
if viki#IsSupportedType("x") && !(dontSetup =~# "x")
" let vikicmd = '['. b:vikiUpperCharacters .']\w*'
let vikicmd = '\(IMG\|Img\|INC\%[LUDE]\)\>'
- let vikimacros = '\(img\|ref\)\>'
+ let vikimacros = '\(img\|ref\|fn\)\>'
let b:vikiCmdRx = '\({'. vikimacros .'\|#'. vikicmd .'\)\(.\{-}\):\s*\(.\{-}\)\($\|}\)'
let b:vikiCmdSimpleRx = '\({'. vikimacros .'\|#'. vikicmd .'\).\{-}\($\|}\)'
let b:vikiCmdNameIdx = 1
@@ -171,12 +167,14 @@ function! viki_viki#SetupBuffer(state, ...) "{{{3
if viki#IsSupportedType("e") && !(dontSetup =~# "e")
let b:vikiExtendedNameRx =
- \ '\[\[\(\('.b:vikiSpecialProtocols.'\)://[^]]\+\|[^]#]\+\)\?'.
- \ '\(#\([^]]*\)\)\?\]\(\[\([^]]\+\)\]\)\?\([!~*$\-]*\)\]'
+ \ '\[\[\(\('.b:vikiSpecialProtocols.'\)://[^]]\+\|.\{-}\)\?'.
+ \ '\(#\(.\{-}\)\)\?\]\(\[\([^]]\+\)\]\)\?\([!~*$\-]*\)\]'
" \ '\(#\('. b:vikiAnchorNameRx .'\)\)\?\]\(\[\([^]]\+\)\]\)\?[!~*\-]*\]'
+ " \ '\[\[\(\('.b:vikiSpecialProtocols.'\)://[^]]\+\|[^]#]\+\)\?'.
let b:vikiExtendedNameSimpleRx =
- \ '\[\[\('. b:vikiSpecialProtocols .'://[^]]\+\|[^]#]\+\)\?'.
- \ '\(#[^]]*\)\?\]\(\[[^]]\+\]\)\?[!~*$\-]*\]'
+ \ '\[\[\('. b:vikiSpecialProtocols .'://[^]]\+\|.\{-}\)\?'.
+ \ '\(#.\{-}\)\?\]\(\[[^]]\+\]\)\?[!~*$\-]*\]'
+ " \ '\[\[\('. b:vikiSpecialProtocols .'://[^]]\+\|[^]#]\+\)\?'.
" \ '\(#'. b:vikiAnchorNameRx .'\)\?\]\(\[[^]]\+\]\)\?[!~*\-]*\]'
let b:vikiExtendedNameNameIdx = 6
let b:vikiExtendedNameModIdx = 7
@@ -402,14 +400,19 @@ function! viki_viki#FindAnchor(anchor) "{{{3
if a:anchor == g:vikiDefNil || a:anchor == ''
return
endif
- let mode = matchstr(a:anchor, '^\(l\(ine\)\?\|rx\|vim\)\ze=')
+ let mode = matchstr(a:anchor, '^\(l\(ine\)\?\|rx\|vim\|fn\)\ze=')
if exists('*VikiAnchor_'. mode)
let arg = matchstr(a:anchor, '=\zs.\+$')
call VikiAnchor_{mode}(arg)
else
let co = col('.')
let li = line('.')
- let anchorRx = viki#GetAnchorRx(a:anchor)
+ if a:anchor =~ '^fn='
+ let anchorv = escape(matchstr(a:anchor, '^fn=\zs.*'), '\')
+ let anchorRx = printf('^\V\C\s\*#\(Footnote\|Fn\)\.\{-}\(\sid=%s\>\|:\s\+%s\s\+<<\(\u\+\)\?\$\)', anchorv, anchorv)
+ else
+ let anchorRx = viki#GetAnchorRx(a:anchor)
+ endif
" TLogVAR anchorRx
keepjumps go
let found = search(anchorRx, 'Wc')
@@ -431,7 +434,7 @@ function! viki_viki#CompleteExtendedNameDef(def) "{{{3
exec viki#SplitDef(a:def)
if v_dest == g:vikiDefNil
if v_anchor == g:vikiDefNil
- throw "Viki: Malformed extended viki name (no destination): ". string(a:def)
+ call viki#MalformedName("extended name (no destination): ". string(a:def))
else
let v_dest = g:vikiSelfRef
endif
@@ -496,6 +499,10 @@ function! viki_viki#CompleteCmdDef(def) "{{{3
endif
elseif v_name =~ "^#INC"
" <+TODO+> Search path?
+ elseif v_name =~ '^{fn\>'
+ let v_anchor = 'fn=' . v_dest
+ let v_name = g:vikiSelfRef
+ let v_dest = g:vikiSelfRef
elseif v_name =~ '^{ref\>'
let v_anchor = v_dest
let v_name = g:vikiSelfRef
@@ -519,11 +526,11 @@ function! viki_viki#CompleteSimpleNameDef(def) "{{{3
" TLogVAR a:def
exec viki#SplitDef(a:def)
if v_name == g:vikiDefNil
- throw "Viki: Malformed simple viki name (no name): ". string(a:def)
+ call viki#MalformedName("simple name (no name): ". string(a:def))
endif
if !(v_dest == g:vikiDefNil)
- throw "Viki: Malformed simple viki name (destination=".v_dest."): ". string(a:def)
+ call viki#MalformedName("simple name (destination=".v_dest."): ". string(a:def))
endif
" TLogVAR v_name
@@ -594,6 +601,3 @@ function! viki_viki#Find(flag, ...) "{{{3
endif
endf
-
-let &cpo = s:save_cpo
-unlet s:save_cpo
View
10 compiler/deplate.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: 25-Apr-2004.
-" @Last Change: 2009-02-15.
-" @Revision: 0.43
+" @Last Change: 2011-01-12.
+" @Revision: 0.46
"
" Description:
" Use deplate as the "compiler" for viki files.
@@ -23,11 +23,11 @@ set cpo&vim
fun! DeplateCompilerSet(options)
if exists("b:deplatePrg")
- exec "CompilerSet makeprg=".escape(b:deplatePrg ." ". a:options, " ")."\\ $*\\ %"
+ exec 'CompilerSet makeprg='.escape(b:deplatePrg .' '. a:options, ' ').'\ $*\ %'
elseif exists("g:deplatePrg")
- exec "CompilerSet makeprg=".escape(g:deplatePrg ." ". a:options, " ")."\\ $*\\ %"
+ exec 'CompilerSet makeprg='.escape(g:deplatePrg .' '. a:options, ' ').'\ $*\ %'
else
- exec "CompilerSet makeprg=deplate ".escape(a:options, " ")."\\ $*\\ %"
+ exec 'CompilerSet makeprg=deplate\ '.escape(a:options, " ").'\ $*\ %'
" CompilerSet makeprg=deplate\ $*\ %
endif
endf
View
1,678 doc/viki.txt
@@ -1,5 +1,5 @@
-*viki.txt* Viki - A Pseudo Local Wiki Tool
- Thomas Link (micathom AT gmail com?subject=vim)
+*viki.txt* A personal wiki for vim
+ Author: Tom Link, micathom at gmail com
This plugin adds wiki-like hypertext capabilities to Vim. You can use viki as
a "minor" mode (i.e., as an add-on to any other mode) or as a full-fledged
@@ -57,22 +57,45 @@ And some wikis provide tools for translating this markup to other formats
markup to LaTeX, HTML, and Docbook). Unfortunately, about every wiki has its
own markup.
+ *viki-support*
+VIKI Forum (questions, feature requests):
+http://sourceforge.net/projects/deplate/forums/forum/700962
-================================================================================
- *viki-installation*
-Installation~
+Bug tracker:
+http://sourceforge.net/tracker/?group_id=108085&atid=649488
-Edit the vba file and type: >
+Demo:
+http://vimsomnia.blogspot.com/2010/11/vikitasks-viki-demonstration-personal.html
+
+
+-----------------------------------------------------------------------
+Install~
+
+In order to install the vba, open the vba file in VIM and type: >
:so %
-See :help vimball for details. If you have difficulties or use vim 7.0,
-please make sure, you have the current version of vimball (vimscript
-#1502) installed.
+See :help vimball for details.
This script requires tlib (vimscript #1863) to be installed.
-Viki requires: >
+Also available via git: http://github.com/tomtom/viki_vim/
+
+ *viki-requirements*
+Requirements:
+- tlib (vimscript #1863)
+
+ *viki-related-plugins*
+Optional enhancements:
+- hookcursormoved (vimscript #2037): Enhanced detection of hyperlinks to inexistent destinations.
+- vxfold (vimscript #3004): Provides org-mode like fold cycling
+- VOoM (vimscript #2657): A two-pane outliner with support for viki
+- kpsewhich (not a vim plugin :-) for LaTeX support
+
+
+Post-Install~
+
+Viki requires the following minimal lines to be added to |vimrc|: >
:set nocompatible
:filetype plugin indent on
@@ -144,19 +167,17 @@ less about page names.
There are two ways to define an interviki:
- *VikiDefine()*
- 1. Use VikiDefine(name, prefix, ?suffix="*", ?index="Index.${suffix}")
+ 1. Use |VikiDefine()|: >
call VikiDefine('SCI', $HOME."/Projects/Sci/Ideas", ".txt")
- This command will automatically define a menu for each interviki
+< This command will automatically define a menu for each interviki
(unless g:vikiMenuPrefix is empty) and it will also define a command
with the name of the interviki that can be used to quickly access viki
files from the vim command line.
- *g:viki_intervikis*
- 2. Use g:viki_intervikis (a dictionary). The values can be either a list
- (arguments for |VikiDefine()|) or a string.
+ 2. Use |g:viki_intervikis| (a dictionary). The values can be either a list
+ (arguments for |VikiDefine()|) or a string. >
let g:viki_intervikis['SCI'] = [$HOME."/Projects/Sci/Ideas", ".txt"]
let g:viki_intervikis['PROJ'] = $HOME."/Projects"
@@ -215,8 +236,7 @@ You can also use |:autocmd| to set the filetype depending on the path: >
If the variables b:getVikiLink or b:getExtVikiLink exist, their values are
used as _function_ names for returning the current viki name's definition. A
-viki definition is an array of the three elements name, destination, anchor
-with g:vikiDefSep as the separator.
+viki definition is an array of the three elements name, destination, anchor.
If the variables b:editVikiPage or b:createVikiPage exist, their values are
interpreted as _command_ names for editing readable or creating new wiki
@@ -234,17 +254,7 @@ In order to disable the indentation plugin, define the variable g:vikiNoIndent
and set it to whatever you want.
-===============================================================================
- *viki-requirements*
-Optional Enhancements~
-
-- genutils.vim (vimscript #197 for saving back references; but see
- |g:vikiSaveHistory|)
-- imaps.vim (vimscript #244 or #475 for |:VimQuote|)
-- kpsewhich (not a vim plugin :-) for LaTeX support
-
-
-================================================================================
+-----------------------------------------------------------------------
*viki-names*
Viki Names~
@@ -375,7 +385,7 @@ written as in the LaTeX example.
NOTE: |deplate| attaches an anchor to the previous element (e.g. |viki-tables|).
-================================================================================
+-----------------------------------------------------------------------
*viki-markup*
Pseudo Markup~
@@ -602,7 +612,7 @@ Backslashes~
\_nounderline_, \NoVikiName
-================================================================================
+-----------------------------------------------------------------------
*viki-key-bindings*
Default Key Binding~
@@ -638,349 +648,6 @@ Additional Key Binding In Full Viki Mode
<c-tab>, <LocalLeader>vn ... |:VikiFindNext|
<s-c-tab>, <LocalLeader>vN ... |:VikiFindPrev|
-
-
-================================================================================
- *viki-commands*
-Commands~
-
- *:VikiMinorMode*
-- VikiMinorMode
- NOTE: Be aware that we cannot highlight a reference if the text is embedded
- in syntax group that doesn't allow inclusion of arbitrary syntax elemtents.
-
- *:VikiMode*
-- VikiMode (do additional highlighting)
- Basically the same as: >
- set ft=viki
-< The main difference between these two is that VikiMode unlets
- b:did_ftplugin to make sure that the ftplugin gets loaded.
-
- *:VikiFind*
- *:VikiFindNext* *:VikiFindPrev*
-- VikiFindNext, VikiFindPrev (find the next/previous viki name or URL)
-
- *:VikiMarkInexistent*
- *:VikiMarkInexistentInParagraph*
-- VikiMarkInexistent, VikiMarkInexistentInParagraph
- Update the highlighting of links to inexistent files. VikiMarkInexistent
- can take a range as argument.
-
-- VikiQuote *:VikiQuote*
- Mark selected text as a quoted simple viki name, i.e., enclose it in
- [- and -].
-
-- VikiEdit[!] NAME *:VikiEdit*
- Edit the wiki page called NAME. If the NAME is '*', the |viki-homepage| will
- be opened. This is a convenient way to edit any wiki page from vim's command
- line. If you call :VikiEdit! (with bang), the homepage will be opened first,
- so that the homepage's customizations (and not the current buffer's one) are
- in effect. There are a few gotchas:
-
- 1. Viki doesn't define a default directory for wiki pages. Thus a wiki page
- will be looked for in the directory of the current buffer -- whatever this
- is -- and the customizations of this buffer are in effect. You can
- circumvent this problem by using |interviki| names or define a
- |viki-homepage| and call :VikiEdit! with a bang.
-
- 2. Viki relies on some buffer local variables to be set. As customizability
- is one viki's main design goal (although, one might want to discuss whether
- I overdid it), there are no global settings that would define what a valid
- viki name is supposed to look like. As a consequence, if you disabled a
- certain type of wiki name in the current buffer, you won't be able to edit a
- wiki page of this type. E.g.: If the current buffer contains a LaTeX file,
- |vikiFamily| is most likely set to "LaTeX" (see |viki-latex|). For the LaTeX
- family, e.g., CamelCase and interwiki names are disabled. Consequently, you
- can't do, e.g., ":VikiEdit IDEAS::WikiPage". Again, you can circumvent this
- problem by defining a |viki-homepage| and call :VikiEdit! with a bang.
-
-- VikiHome *:VikiHome*
- Open the |viki-homepage|.
-
-- VikiDefine NAME BASE ?SUFFIX *:VikiDefine*
- Define an interviki. See also |VikiDefine()|.
-
-================================================================================
- *viki-functions*
-Functions~
-
-- VikiMinorMode(state) *VikiMinorMode()*
-
-- VikiMode(family) *VikiMode()*
-
-- viki#MaybeFollowLink(oldmap, ignoreSyntax) *viki#MaybeFollowLink()*
- oldmap: If there isn't a viki link under the cursor:
- "" ... throw error
- 1 ... return \<c-cr>
- whatever ... return whatever
- ignoreSyntax: If there isn't a viki syntax group under the cursor:
- 0 ... no viki name found
- 1 ... look if there is a viki name under cursor anyways
-
-- viki#FindAnchor(anchor) *viki#FindAnchor()*
-
- *b:vikiParent*
-- viki#GoParent() *viki#GoParent()*
- If b:vikiParent is defined, open this viki name, otherwise use
- |viki#GoBack()|.
-
-- viki#GoBack() *viki#GoBack()*
- Viki keeps record about the "source" files from where a viki page was
- entered. Calling this function jumps back to the "source" file (if only
- one such back reference is known) or let's you select from a list of
- "source" files. The information is stored in buffer variables -- i.e., it
- gets lost after closing the buffer. Care was taken to reduce information
- clutter, which is why the number of possible back references per "source"
- file was limited to one.
-
-- VikiOpenSpecialFile(filename) *VikiOpenSpecialFile()*
- Handles filenames that match |vikiSpecialFiles|.
- If g:vikiOpenFileWith_{SUFFIX} is defined, it contains a command
- definition for opending files of this type. "%{FILE}" is replaced with the
- file name ("%%" = "%") and the resulting string is executed. Example: >
-
- let g:vikiOpenFileWith_html = '!firefox %{FILE}'
-
-< The contents of variable g:vikiOpenFileWith_ANY will be used as fallback
- command. Under Windows, g:vikiOpenFileWith_ANY defaults to "silent !cmd /c
- start".
- All suffixes are translated to lower case.
-
-- VikiOpenSpecialProtocol(url) *VikiOpenSpecialProtocol()*
- Handles filenames that match |vikiSpecialProtocols|.
- If g:vikiOpenUrlWith_{PROTOCOL} is defined, it contains a command definition
- for opending urls of this type. "%{URL}" is replaced with the url ("%%" =
- "%") and the resulting string is executed. Example: >
-
- let g:vikiOpenUrlWith_mailto = '!thunderbird -compose %{URL}'
-
-< The contents of variable g:vikiOpenUrlWith_ANY will be used as fallback
- command. Under Windows, g:vikiOpenUrlWith_ANY defaults to "silent
- !rundll32 url.dll ...".
- All protocol names are translated to lower case.
-
-
-================================================================================
- *viki-variables*
-Variables~
-
-Homepage: *viki-homepage*
- *g:vikiHomePage*
-- g:vikiHomePage:
- An absolute filename that is the general viki homepage (see also
- |:VikiEdit| and |:VikiHome|).
-
-Simple Viki Names [2]: *viki-vars-simple-names*
- *g:vikiLowerCharacters*
- *g:vikiUpperCharacters*
-- g:vikiLowerCharacters, g:vikiUpperCharacters, b:vikiLowerCharacters,
- b:vikiUpperCharacters
- These default to "a-z" and "A-Z" respectively; "international" users
- should set these variables in their |vimrc| file to fit their needs
-
-- b:vikiAnchorMarker
-
-- b:vikiSimpleNameRx, b:vikiSimpleNameSimpleRx[1]
-- b:vikiSimpleNameNameIdx, b:vikiSimpleNameDestIdx, b:vikiSimpleNameAnchorIdx
-
-Extended Viki Names [2]: *viki-vars-ext-names*
-- b:vikiExtendedNameRx, b:vikiExtendedNameSimpleRx[1]
-- b:vikiExtendedNameNameIdx, b:vikiExtendedNameDestIdx,
- b:vikiExtendedNameAnchorIdx
-
-URLs [2]: *viki-vars-urls*
-- b:vikiUrlRx, b:vikiUrlSimpleRx[1]
-- b:vikiUrlNameIdx, b:vikiUrlDestIdx, b:vikiUrlAnchorIdx
-
-NOTE: [1] The same as *Rx variables but with less groups.
-NOTE: [2] These variables are defined by |VikiSetupBuffer()|.
-
-- b:vikiAnchorRx *b:vikiAnchorRx*
- If this variable exists, the string "%{ANCHOR}" will be replaced with the
- search text. The expression has to conform to the very nomagic |/\V|
- syntax.
-
-- g:vikiFreeMarker *g:vikiFreeMarker*
- If true and an explicitly marked anchor isn't found, search for the anchor
- text as such. This search will be case-insensitive. deplate won't be able
- to deal with such pseudo-references, of course.
-
-
-File handling:
-
-- g:vikiSpecialFiles, b:vikiSpecialFiles *vikiSpecialFiles*
- Default value: jpg\|gif\|bmp\|pdf\|dvi\|ps
- A list of extensions for files that should be opened with
- |VikiOpenSpecialFile()|.
-
-- g:vikiSpecialProtocols, b:vikiSpecialProtocols *vikiSpecialProtocols*
- Default value: https\?\|ftps\?
- A list of protocolls that should be opened with
- |VikiOpenSpecialProtocol()|.
-
-- g:vikiUseParentSuffix *g:vikiUseParentSuffix*
- Default value: 0
- If true, always append the "parent" file's suffix to the destination file
- name. I.e. if the current file is "ThisIdea.txt" the the viki name
- "OtherIdea" will refer to the file "OtherIdea.txt".
-
-- g:vikiNameSuffix b:vikiNameSuffix *vikiNameSuffix* *b:vikiNameSuffix*
- Default value: ""
- Append suffix to the destination file name.
-
-
-Markup:
-
-- g:vikiTextStyles, b:vikiTextStyles *vikiTextStyles*
- Default: 2
- Defines the markup of |viki-textstyles| like emphasized or code.
-
-- g:vikiCommentStart *g:vikiCommentStart*
- Default value: %
- Defines the prefix of comments when in "full" viki mode.
-
-- b:vikiCommentStart *b:vikiCommentStart*
- In minor mode this variable is set to either:
- - b:commentStart
- - b:ECcommentOpen
- - matchstr(&commentstring, "^\\zs.*\\ze%s")
- In "full" viki mode it's set to |g:vikiCommentStart|.
-
-- g:vikiTypewriterFont *g:vikiTypewriterFont*
- See |viki-textstyles|.
-
-- g:vikiHeadingFont *g:vikiHeadingFont*
- See |viki-headings|.
-
-- g:vikiHyperLinkColor *g:vikiHyperLinkColor*
- Default: DarkBlue or LightBlue (depending on 'background')
- The color of hyperlinks, viki names etc.
-
-- g:vikiInexistentColor *g:vikiInexistentColor*
- Default: Red
- The color of links to inexistent files.
-
-- g:vikiFamily, b:vikiFamily *vikiFamily*
- By defining this variable, family specific functions will be called for:
- - viki#{b:vikiFamily}#SetupBuffer(state)
- - viki#{b:vikiFamily}#DefineMarkup(state)
- - viki#{b:vikiFamily}#DefineHighlighting(state)
- - viki#{b:vikiFamily}#CompleteSimpleNameDef(def)
- - viki#{b:vikiFamily}#CompleteExtendedNameDef(def)
- - viki#{b:vikiFamily}#FindAnchor(anchor)
- If one of these functions is undefined for a "viki family", then the
- default one is called.
-
- Apart from the default behaviour the following families are defined:
- - latex (see |viki-latex|)
- - anyword (see |viki-anyword|)
-
-
-Etc:
-
-- g:vikiMapMouse *g:vikiMapMouse*
- See |viki-key-bindings|.
-
-- b:vikiSplit, g:vikiSplit *vikiSplit*
- -1 ... open all links in a new windows
- -2 ... open all links in a new windows but split vertically
- Any positive number ... open always in this window
-
-- b:vikiNameTypes, g:vikiNameTypes *vikiNameTypes*
- Default value: "csSeuixwf"
- s ... Simple viki name
- c ... CamelCase
- S ... simple, quoted viki name
- i ... |interviki|
- w ... Hyperwords
- f ... file-bases hyperwords
- e ... Extended viki name
- u ... URL
- x ... Directives (some commands, regions ...)
- Disable certain types of viki names globally or for a single buffer.
- (experimental, doesn't fully work yet)
-
-- g:vikiSaveHistory *g:vikiSaveHistory*
- Default value: 0
- If genutils.vim is installed, the history data will be saved in
- |viminfo-file|. Like most of this plugin, this feature is _experimental_
- and is turned off by default.
-
-- g:vikiExplorer *g:vikiExplorer*
- Default: "Sexplore"
- If a viki name points to a directory, we use this command for viewing the
- directory contents.
-
-- g:vikiMarkInexistent *g:vikiMarkInexistent*
- Default: 1
- If non-zero, highligh links to existent or inexistent files in different
- colours.
-
-- g:vikiCacheInexistent *g:vikiCacheInexistent*
- Default: 0
- If non-zero, save patterns for |g:vikiMarkInexistent| for later re-use
- using |tlib#cache#Filename()|. You might want to delete old files from the
- |g:tlib_cache| directory from time to time.
-
-- b:vikiInverseFold *b:vikiInverseFold*
- Default: 0 == OFF
- If set, the section headings' levels are folded in reversed order so that
- |b:vikiMaxFoldLevel| corresponds to the top level and 1 to the lowest
- level. This is useful when maintaining a file with a fixed structure where
- the important things happen in subsections while the top sections change
- little.
-
-- b:vikiMaxFoldLevel *b:vikiMaxFoldLevel*
- Default: 5
- When using |b:vikiInverseFold|, a heading of level b:vikiMaxFoldLevel
- corresponds to level 1, b:vikiMaxFoldLevel - 1 to level 2,
- b:vikiMaxFoldLevel - 2 to level 3 ... and a top heading to level
- b:vikiMaxFoldLevel. I.e., if you set |foldlevel| to 1, you will see only
- the text at level b:vikiMaxFoldLevel.
-
-- g:vikiFoldBodyLevel, b:vikiFoldBodyLevel *vikiFoldBodyLevel*
- Default: 4
- If set to 0, the "b" mode in |vikiFolds| will set the body level depending
- on the headings used in the current buffer. Otherwise
- g:vikiHeadingMaxLevel + 1 will be used.
-
-- g:vikiFolds, b:vikiFolds *vikiFolds*
- Default: hl
- Define which elements should be folded:
- h :: Heading
- H :: Headings (but inverse folding)
- l :: Lists
- b :: The body has max heading level + 1. This is slightly faster
- than the other version as vim never has to scan the text; but
- the behaviour may vary depending on the sequence of headings if
- |vikiFoldBodyLevel| is set to 0.
- s :: ???
-
-- g:vikiFoldMethodVersion *g:vikiFoldMethodVersion*
- Viki supports several methods (1..7) for defining folds. If you find that
- text entry is slowed down it is probably due to the chosen fold method.
- You could try to use another method (see ../ftplugin/viki.vim for
- alternative methods) or check out this vim tip:
- http://vim.wikia.com/wiki/Keep_folds_closed_while_inserting_text
-
-- b:vikiNoSimpleNames *b:vikiNoSimpleNames*
- Default: 0
- If non-nil, simple viki names are disabled.
-
-- b:vikiDisableType *b:vikiDisableType*
- Disable certain viki name types (see |vikiNameTypes|).
- E.g., in order to disable CamelCase names only, set this variable to 'c'.
-
-- g:vikiHide *g:vikiHide*
- Default: ''
- If a dirty buffers gets hidden, vim usually complains. This can be
- tiresome -- depending on your editing habits. When this variable is set to
- "hide", vim won't complain. If you set it to "update", a viki buffer will
- be automatically updated before editing a different file. If you leave
- this empty (""), the default behaviour is in effect. See also |hidden|.
-
-
-================================================================================
*viki-highlight*
Highlighting~
@@ -1004,11 +671,12 @@ The colors are tested using color scheme with a white background.
- vikiCommand
-================================================================================
+-----------------------------------------------------------------------
*viki-files*
Files Region~
-Viki knows a special #Files region.
+Viki knows a special #Files region that allows users to quickly generate
+catalogs for viki files in a directory.
Example: >
#Files glob=lib/** types=f <<
@@ -1023,39 +691,14 @@ Example: >
The filenames are stored as extended viki names. Each line can take a comment
that is restored upon automatic update.
-There are a few special commands to deal with this region.
-
- *:VikiFilesUpdate*
-:VikiFilesUpdate
- - Update the current #Files region under the cursor.
-
- *:VikiFilesUpdateAll*
-:VikiFilesUpdateAll
- - Update all #Files region in the current buffer.
+If a "head" argument is passed to the #Files region, the first N lines will be
+shown after the reference.
+There are a few special commands to deal with this region.
If in the following commands a "!" is added, the command works only on files
in the same directory or a subdirectory as the file on the current line.
- *:VikiFilesExec*
-:VikiFilesExec[!] FORMAT_STRING
- - |:execute| a vim command after doing some replacements with the command
- string. For each formatted string the command is issued only once --
- i.e. you can work easily with the directories. If no special formatting
- string is contained, the preformatted filename is appended to the command.
- %{FILE} ... filename
- %{FFILE} ... preformatted filename (with '#%\ ' escaped)
- %{DIR} ... file's directory
-
- *:VikiFilesCmd*
-:VikiFilesCmd[!] VIKI_COMMAND_NAME
- - |:execute| VikiCmd_{VIKI_COMMAND_NAME} FILENAME
-
- *:VikiFilesCall*
-:VikiFilesCall[!] FUNCTION_NAME
- - |:call| VikiCmd_{FUNCTION_NAME}(FILENAME)
-
-
Default Key Binding~
<LocalLeader>vu ... :VikiFilesUpdate
<LocalLeader>vU ... :VikiFilesUpdateAll
@@ -1067,7 +710,7 @@ Example: >
the same directory or a subdirectory of the current file under the cursor.
-================================================================================
+-----------------------------------------------------------------------
*viki-compile*
Viki Compile~
@@ -1085,7 +728,7 @@ directory: >
DeplateSetCompiler -d ../html
-================================================================================
+-----------------------------------------------------------------------
*viki-latex* *vikiLatex*
Viki LaTeX~
@@ -1120,8 +763,7 @@ by adding this line to your |vimrc| file: >
au FileType tex let b:vikiFamily="latex"
<
- *:VikiMinorModeLaTeX*
-LaTeX support is switched on with the command :VikiMinorModeLaTeX. This
+LaTeX support is switched on with the command |:VikiMinorModeLaTeX|. This
command sets b:vikiFamily to "latex" and calls |:VikiMinorMode|. This
command relies on the external kpsewhich tool, which has to be installed on
your computer.
@@ -1146,7 +788,7 @@ simple minded example: >
endfun
-================================================================================
+-----------------------------------------------------------------------
*viki-anyword*
Viki Any Word~
@@ -1157,7 +799,7 @@ This feature conflicts with the highlighting of links to inexistent files.
Links to inexistent files are displayed as normal text.
-================================================================================
+-----------------------------------------------------------------------
*viki-bibtex*
Viki BibTeX~
@@ -1172,7 +814,7 @@ viki names. Example: >
would open the file monos.bib and search for the record rec02.
-================================================================================
+-----------------------------------------------------------------------
*viki-tags*
Ctags~
@@ -1193,7 +835,7 @@ For use with taglist, the variable "tlist_viki_settings" is already set for
you.
-================================================================================
+-----------------------------------------------------------------------
*deplate*
Deplate~
@@ -1213,8 +855,1210 @@ expect. On the other hand, it features inclusion of LaTeX snippets, footnotes,
references, an autogenerated index etc.
---
-(the following is adapted from latex-suite.txt)
-vim:fdm=expr:tw=78
-vim:foldexpr=getline(v\:lnum-2)=~"=\\\\{80,}"?"a1"\:(getline(v\:lnum+1)=~"=\\\\{80,}"?"s1"\:"=")
-vim:foldtext=v\:folddashes.substitute(getline(v\:foldstart),"\\\\s*\\\\*.*","","")
+-----------------------------------------------------------------------
+========================================================================
+Contents~
+
+ tlist_viki_settings ................. |tlist_viki_settings|
+ g:vikiMenuPrefix .................... |g:vikiMenuPrefix|
+ g:vikiMenuLevel ..................... |g:vikiMenuLevel|
+ g:vikiFancyHeadings ................. |g:vikiFancyHeadings|
+ g:vikiMarkInexistent ................ |g:vikiMarkInexistent|
+ g:vikiHighlightMath ................. |g:vikiHighlightMath|
+ g:vikiNameSuffix .................... |g:vikiNameSuffix|
+ g:vikiIndex ......................... |g:vikiIndex|
+ g:viki_intervikis ................... |g:viki_intervikis|
+ g:vikiSaveHistory ................... |g:vikiSaveHistory|
+ b:vikiNoSimpleNames ................. |b:vikiNoSimpleNames|
+ b:vikiDisableType ................... |b:vikiDisableType|
+ VikiMakeName ........................ |VikiMakeName()|
+ VikiDefine .......................... |VikiDefine()|
+ :VikiDefine ......................... |:VikiDefine|
+ :VikiMinorMode ...................... |:VikiMinorMode|
+ :VikiMinorModeMaybe ................. |:VikiMinorModeMaybe|
+ :VikiMinorModeViki .................. |:VikiMinorModeViki|
+ :VikiMinorModeLaTeX ................. |:VikiMinorModeLaTeX|
+ :VikiMinorModeAnyWord ............... |:VikiMinorModeAnyWord|
+ :VikiMode ........................... |:VikiMode|
+ :VikiModeMaybe ...................... |:VikiModeMaybe|
+ :VikiBrowse ......................... |:VikiBrowse|
+ :VikiHome ........................... |:VikiHome|
+ :VIKI ............................... |:VIKI|
+ g:vikiUpperCharacters ............... |g:vikiUpperCharacters|
+ g:vikiLowerCharacters ............... |g:vikiLowerCharacters|
+ g:vikiAnchorNameRx .................. |g:vikiAnchorNameRx|
+ g:vikiUrlRestRx ..................... |g:vikiUrlRestRx|
+ g:viki#error_malformed_names ........ |g:viki#error_malformed_names|
+ g:vikiSpecialProtocols .............. |g:vikiSpecialProtocols|
+ g:vikiSpecialProtocolsExceptions .... |g:vikiSpecialProtocolsExceptions|
+ g:vikiSpecialFiles .................. |g:vikiSpecialFiles|
+ g:vikiSpecialFilesExceptions ........ |g:vikiSpecialFilesExceptions|
+ g:viki_highlight_hyperlink_light .... |g:viki_highlight_hyperlink_light|
+ g:viki_highlight_hyperlink_dark ..... |g:viki_highlight_hyperlink_dark|
+ g:viki_highlight_inexistent_light ... |g:viki_highlight_inexistent_light|
+ g:viki_highlight_inexistent_dark .... |g:viki_highlight_inexistent_dark|
+ g:vikiPromote ....................... |g:vikiPromote|
+ g:vikiUseParentSuffix ............... |g:vikiUseParentSuffix|
+ g:vikiAnchorMarker .................. |g:vikiAnchorMarker|
+ g:vikiFreeMarker .................... |g:vikiFreeMarker|
+ g:vikiPostFindAnchor ................ |g:vikiPostFindAnchor|
+ g:vikiNameTypes ..................... |g:vikiNameTypes|
+ g:vikiExplorer ...................... |g:vikiExplorer|
+ g:vikiHide .......................... |g:vikiHide|
+ g:vikiNoWrapper ..................... |g:vikiNoWrapper|
+ g:vikiCacheInexistent ............... |g:vikiCacheInexistent|
+ g:vikiMapInexistent ................. |g:vikiMapInexistent|
+ g:vikiMapKeys ....................... |g:vikiMapKeys|
+ g:vikiMapQParaKeys .................. |g:vikiMapQParaKeys|
+ g:vikiHCM ........................... |g:vikiHCM|
+ g:vikiMapBeforeKeys ................. |g:vikiMapBeforeKeys|
+ g:vikiFamily ........................ |g:vikiFamily|
+ g:vikiDirSeparator .................. |g:vikiDirSeparator|
+ g:vikiTextstylesVer ................. |g:vikiTextstylesVer|
+ g:vikiHomePage ...................... |g:vikiHomePage|
+ g:vikiFeedbackMin ................... |g:vikiFeedbackMin|
+ g:vikiMapLeader ..................... |g:vikiMapLeader|
+ g:vikiAutoMarks ..................... |g:vikiAutoMarks|
+ g:VIKIBACKREFS ...................... |g:VIKIBACKREFS|
+ g:vikiBalloonLines .................. |g:vikiBalloonLines|
+ g:vikiBalloon ....................... |g:vikiBalloon|
+ g:vikiBalloonEncoding ............... |g:vikiBalloonEncoding|
+ g:vikiHyperWordsFiles ............... |g:vikiHyperWordsFiles|
+ g:vikiMapFunctionality .............. |g:vikiMapFunctionality|
+ g:vikiMapFunctionalityMinor ......... |g:vikiMapFunctionalityMinor|
+ g:viki#files_head_rx ................ |g:viki#files_head_rx|
+ :VikiFindNext ....................... |:VikiFindNext|
+ :VikiFindPrev ....................... |:VikiFindPrev|
+ :VikiMarkInexistent ................. |:VikiMarkInexistent|
+ :VikiQuote .......................... |:VikiQuote|
+ :VikiGoBack ......................... |:VikiGoBack|
+ :VikiJump ........................... |:VikiJump|
+ :VikiIndex .......................... |:VikiIndex|
+ :VikiEdit ........................... |:VikiEdit|
+ :VikiEditTab ........................ |:VikiEditTab|
+ :VikiEditInWin1 ..................... |:VikiEditInWin1|
+ :VikiEditInWin2 ..................... |:VikiEditInWin2|
+ :VikiEditInWin3 ..................... |:VikiEditInWin3|
+ :VikiEditInWin4 ..................... |:VikiEditInWin4|
+ :VikiFilesUpdate .................... |:VikiFilesUpdate|
+ :VikiFilesUpdateAll ................. |:VikiFilesUpdateAll|
+ :VikiFileExec ....................... |:VikiFileExec|
+ :VikiFilesExec ...................... |:VikiFilesExec|
+ :VikiFilesCmd ....................... |:VikiFilesCmd|
+ :VikiFilesCall ...................... |:VikiFilesCall|
+ viki#Mode ........................... |viki#Mode()|
+ VikiOpenAsWorkspace ................. |VikiOpenAsWorkspace()|
+ g:vikiOpenFileWith_ANY .............. |g:vikiOpenFileWith_ANY|
+ VikiOpenSpecialFile ................. |VikiOpenSpecialFile()|
+ g:vikiOpenUrlWith_mailbox ........... |g:vikiOpenUrlWith_mailbox|
+ VikiOpenMailbox ..................... |VikiOpenMailbox()|
+ g:vikiUrlFileAs ..................... |g:vikiUrlFileAs|
+ g:vikiOpenUrlWith_file .............. |g:vikiOpenUrlWith_file|
+ VikiOpenFileUrl ..................... |VikiOpenFileUrl()|
+ VikiOpenSpecialProtocol ............. |VikiOpenSpecialProtocol()|
+ viki#GetInterVikis .................. |viki#GetInterVikis()|
+ viki#GetSimpleRx4SimpleWikiName ..... |viki#GetSimpleRx4SimpleWikiName()|
+ viki#CanonicFilename ................ |viki#CanonicFilename()|
+ viki#FindRx ......................... |viki#FindRx()|
+ viki#FindPrevHeading ................ |viki#FindPrevHeading()|
+ viki#FindNextHeading ................ |viki#FindNextHeading()|
+ viki#IsSupportedType ................ |viki#IsSupportedType()|
+ viki#RxFromCollection ............... |viki#RxFromCollection()|
+ viki#HighlightInexistent ............ |viki#HighlightInexistent()|
+ viki#MarkInexistentInElement ........ |viki#MarkInexistentInElement()|
+ viki#ExprMarkInexistentInElement .... |viki#ExprMarkInexistentInElement()|
+ viki#MarkInexistentInRange .......... |viki#MarkInexistentInRange()|
+ viki#MarkInexistentInitial .......... |viki#MarkInexistentInitial()|
+ viki#SaveCache ...................... |viki#SaveCache()|
+ viki#CheckInexistent ................ |viki#CheckInexistent()|
+ viki#SetBufferVar ................... |viki#SetBufferVar()|
+ viki#DispatchOnFamily ............... |viki#DispatchOnFamily()|
+ viki#IsHyperWord .................... |viki#IsHyperWord()|
+ viki#HyperWordValue ................. |viki#HyperWordValue()|
+ viki#CollectFileWords ............... |viki#CollectFileWords()|
+ viki#CollectHyperWords .............. |viki#CollectHyperWords()|
+ viki#MapMarkInexistent .............. |viki#MapMarkInexistent()|
+ viki#HookCheckPreviousPosition ...... |viki#HookCheckPreviousPosition()|
+ viki#RestoreCursorPosition .......... |viki#RestoreCursorPosition()|
+ viki#SaveCursorPosition ............. |viki#SaveCursorPosition()|
+ viki#DebugCursorPosition ............ |viki#DebugCursorPosition()|
+ viki#MapFunctionality ............... |viki#MapFunctionality()|
+ viki#MinorModeReset ................. |viki#MinorModeReset()|
+ viki#IsInRegion ..................... |viki#IsInRegion()|
+ viki#GoParent ....................... |viki#GoParent()|
+ viki#GoBack ......................... |viki#GoBack()|
+ viki#SubstituteArgs ................. |viki#SubstituteArgs()|
+ VikiAnchor_l ........................ |VikiAnchor_l()|
+ VikiAnchor_line ..................... |VikiAnchor_line()|
+ VikiAnchor_rx ....................... |VikiAnchor_rx()|
+ VikiAnchor_vim ...................... |VikiAnchor_vim()|
+ viki#GetAnchorRx .................... |viki#GetAnchorRx()|
+ viki#SetAnchorMarks ................. |viki#SetAnchorMarks()|
+ viki#GetWinNr ....................... |viki#GetWinNr()|
+ viki#SetWindow ...................... |viki#SetWindow()|
+ viki#OpenLink ....................... |viki#OpenLink()|
+ viki#Family ......................... |viki#Family()|
+ viki#DecomposeUrl ................... |viki#DecomposeUrl()|
+ viki#GetSpecialFilesSuffixes ........ |viki#GetSpecialFilesSuffixes()|
+ viki#GetSpecialFilesSuffixesRx ...... |viki#GetSpecialFilesSuffixesRx()|
+ viki#IsSpecialFile .................. |viki#IsSpecialFile()|
+ viki#IsSpecialProtocol .............. |viki#IsSpecialProtocol()|
+ viki#IsSpecial ...................... |viki#IsSpecial()|
+ viki#MakeUrl ........................ |viki#MakeUrl()|
+ viki#MakeDef ........................ |viki#MakeDef()|
+ viki#SplitDef ....................... |viki#SplitDef()|
+ viki#MalformedName .................. |viki#MalformedName()|
+ viki#LinkDefinition ................. |viki#LinkDefinition()|
+ viki#WithSuffix ..................... |viki#WithSuffix()|
+ viki#ExpandSimpleName ............... |viki#ExpandSimpleName()|
+ viki#IsInterViki .................... |viki#IsInterViki()|
+ viki#InterVikiName .................. |viki#InterVikiName()|
+ viki#InterVikiPart .................. |viki#InterVikiPart()|
+ viki#InterVikiDest .................. |viki#InterVikiDest()|
+ viki#InterVikiSuffix ................ |viki#InterVikiSuffix()|
+ viki#ExtendedModifier ............... |viki#ExtendedModifier()|
+ viki#FindFileWithSuffix ............. |viki#FindFileWithSuffix()|
+ viki#GetLink ........................ |viki#GetLink()|
+ viki#MaybeFollowLink ................ |viki#MaybeFollowLink()|
+ viki#InterEditArg ................... |viki#InterEditArg()|
+ viki#HomePage ....................... |viki#HomePage()|
+ viki#Edit ........................... |viki#Edit()|
+ viki#Browse ......................... |viki#Browse()|
+ viki#BrowseComplete ................. |viki#BrowseComplete()|
+ viki#EditComplete ................... |viki#EditComplete()|
+ viki#Index .......................... |viki#Index()|
+ viki#FindNextRegion ................. |viki#FindNextRegion()|
+ viki#GetIndent ...................... |viki#GetIndent()|
+ viki#ExecExternal ................... |viki#ExecExternal()|
+ viki#FilesUpdateAll ................. |viki#FilesUpdateAll()|
+ viki#FilesExec ...................... |viki#FilesExec()|
+ viki#FilesCmd ....................... |viki#FilesCmd()|
+ viki#FilesCall ...................... |viki#FilesCall()|
+ viki#FilesUpdate .................... |viki#FilesUpdate()|
+ viki#DirListing ..................... |viki#DirListing()|
+ viki#FilesGetFilename ............... |viki#FilesGetFilename()|
+ viki#FilesGetComment ................ |viki#FilesGetComment()|
+ viki#Balloon ........................ |viki#Balloon()|
+ viki#MatchList ...................... |viki#MatchList()|
+ viki#MapListItemTextObject .......... |viki#MapListItemTextObject()|
+ v_<expr> ............................ |v_<expr>|
+ o_ii ................................ |o_ii|
+ viki#SelectListItem ................. |viki#SelectListItem()|
+ viki#ShiftListItem .................. |viki#ShiftListItem()|
+ viki#MoveListItem ................... |viki#MoveListItem()|
+ b:vikiCommentStart .................. |b:vikiCommentStart|
+ b:vikiCommentEnd .................... |b:vikiCommentEnd|
+ b:vikiHeadingMaxLevel ............... |b:vikiHeadingMaxLevel|
+ b:vikiMaxFoldLevel .................. |b:vikiMaxFoldLevel|
+ b:vikiInverseFold ................... |b:vikiInverseFold|
+ g:vikiFoldBodyLevel ................. |g:vikiFoldBodyLevel|
+ g:vikiFolds ......................... |g:vikiFolds|
+ [[ .................................. |[[|
+ ][ .................................. |][|
+ ]] .................................. |]]|
+ [] .................................. |[]|
+ VikiFoldText ........................ |VikiFoldText()|
+ VikiFoldLevel ....................... |VikiFoldLevel()|
+
+
+========================================================================
+plugin/viki.vim~
+
+ *tlist_viki_settings*
+tlist_viki_settings (default: "deplate;s:structure")
+ Support for the taglist plugin.
+
+ *g:vikiMenuPrefix*
+g:vikiMenuPrefix (default: "Plugin.Viki.")
+ The prefix for the menu of intervikis. Set to '' in order to remove the
+ menu.
+
+ *g:vikiMenuLevel*
+g:vikiMenuLevel (default: 1)
+ Make submenus for N letters of the interviki names.
+
+ *g:vikiFancyHeadings*
+g:vikiFancyHeadings (default: 0)
+ If non-nil, display headings of different levels in different colors
+
+ *g:vikiMarkInexistent*
+g:vikiMarkInexistent (default: 1)
+ If non-zero, highligh links to existent or inexistent files in
+ different colours.
+
+ *g:vikiHighlightMath*
+g:vikiHighlightMath (default: '')
+
+ *g:vikiNameSuffix*
+g:vikiNameSuffix (default: "")
+ Default file suffix (including the optional period, e.g. '.txt' or
+ '.viki').
+ Can also be buffer-local.
+
+ *g:vikiIndex*
+g:vikiIndex (default: 'index')
+ The default filename for an interviki's index name
+
+ *g:viki_intervikis*
+g:viki_intervikis (default: {})
+ Definition of intervikis. (This variable won't be evaluated until
+ autoload/viki.vim is loaded).
+
+ *g:vikiSaveHistory*
+g:vikiSaveHistory (default: 0)
+ If non-nil, cache back-links information
+
+ *b:vikiNoSimpleNames*
+b:vikiNoSimpleNames (default: 0)
+ If non-nil, simple viki names are disabled.
+
+ *b:vikiDisableType*
+b:vikiDisableType (default: "")
+ Disable certain viki name types (see |vikiNameTypes|).
+ E.g., in order to disable CamelCase names only, set this variable to 'c'.
+
+ *VikiMakeName()*
+VikiMakeName(iviki, name, ...)
+ Return a viki name for a vikiname on a specified interviki
+ VikiMakeName(iviki, name, ?quote=1)
+
+ *VikiDefine()*
+VikiDefine(name, prefix, ...)
+ Define an interviki name
+ VikiDefine(name, prefix, ?suffix="*", ?index="Index.${suffix}")
+ suffix == "*" -> g:vikiNameSuffix
+
+ *:VikiDefine*
+VikiDefine NAME BASE ?SUFFIX
+ Define an interviki. See also |VikiDefine()|.
+
+ *:VikiMinorMode*
+:VikiMinorMode
+ NOTE: Be aware that we cannot highlight a reference if the text is embedded
+ in syntax group that doesn't allow inclusion of arbitrary syntax elemtents.
+
+ *:VikiMinorModeMaybe*
+:VikiMinorModeMaybe
+
+ *:VikiMinorModeViki*
+:VikiMinorModeViki
+
+ *:VikiMinorModeLaTeX*
+:VikiMinorModeLaTeX
+
+ *:VikiMinorModeAnyWord*
+:VikiMinorModeAnyWord
+
+ *:VikiMode*
+:VikiMode
+ Basically the same as: >
+ set ft=viki
+< The main difference between these two is that VikiMode unlets
+ b:did_ftplugin to make sure that the ftplugin gets loaded.
+
+ *:VikiModeMaybe*
+:VikiModeMaybe
+
+ *:VikiBrowse*
+:VikiBrowse
+
+ *:VikiHome*
+:VikiHome
+ Open the |viki-homepage|.
+
+ *:VIKI*
+:VIKI
+ Open the |viki-homepage|.
+
+
+========================================================================
+autoload/viki.vim~
+
+
+Simple Viki Names [2]: *viki-vars-simple-names*
+
+ *g:vikiUpperCharacters*
+g:vikiUpperCharacters (default: "A-Z")
+ A simple viki name is made from a series of upper and lower characters
+ (i.e. CamelCase-names). These two variables define what is considered as
+ upper and lower-case characters. We don't rely on the builtin
+ functionality for this.
+
+ *g:vikiLowerCharacters*
+g:vikiLowerCharacters (default: "a-z")
+
+
+Extended Viki Names [2]: *viki-vars-ext-names*
+- b:vikiExtendedNameRx, b:vikiExtendedNameSimpleRx[1]
+- b:vikiExtendedNameNameIdx, b:vikiExtendedNameDestIdx,
+ b:vikiExtendedNameAnchorIdx
+
+URLs [2]: *viki-vars-urls*
+- b:vikiUrlRx, b:vikiUrlSimpleRx[1]
+- b:vikiUrlNameIdx, b:vikiUrlDestIdx, b:vikiUrlAnchorIdx
+
+NOTE: [1] The same as *Rx variables but with less groups.
+NOTE: [2] These variables are defined by |VikiSetupBuffer()|.
+
+- b:vikiAnchorRx *b:vikiAnchorRx*
+ If this variable exists, the string "%{ANCHOR}" will be replaced with the
+ search text. The expression has to conform to the very nomagic |/\V|
+ syntax.
+
+ *g:vikiAnchorNameRx*
+g:vikiAnchorNameRx (default: '')
+ Characters allowed in anchors
+ Defaults to:
+ [b:vikiLowerCharacters][b:vikiLowerCharacters + b:vikiUpperCharacters + '_0-9]*
+
+ *g:vikiUrlRestRx*
+g:vikiUrlRestRx (default: '['. g:vikiLowerCharacters . g:vikiUpperCharacters .'0-9?%_=&+-]*')
+
+ *g:viki#error_malformed_names*
+g:viki#error_malformed_names (default: 0)
+ If true, throw an error on malformed viki names.
+
+ *g:vikiSpecialProtocols*
+g:vikiSpecialProtocols (default: 'https\?\|ftps\?\|nntp\|mailto\|mailbox\|file')
+ URLs matching these protocols are handled by |VikiOpenSpecialProtocol()|.
+ Can also be buffer-local.
+
+ *g:vikiSpecialProtocolsExceptions*
+g:vikiSpecialProtocolsExceptions (default: "")
+ Exceptions from g:vikiSpecialProtocols
+
+ *g:vikiSpecialFiles*
+g:vikiSpecialFiles (default: [...])
+ Files matching these suffixes are handled by |viki#OpenSpecialFile()|.
+ Can also be buffer-local.
+
+ *g:vikiSpecialFilesExceptions*
+g:vikiSpecialFilesExceptions (default: "")
+ Exceptions from g:vikiSpecialFiles
+
+ *g:viki_highlight_hyperlink_light*
+g:viki_highlight_hyperlink_light (default: 'term=underline cterm=underline gui=underline ctermfg=DarkBlue guifg=DarkBlue')
+
+ *g:viki_highlight_hyperlink_dark*
+g:viki_highlight_hyperlink_dark (default: 'term=underline cterm=underline gui=underline ctermfg=LightBlue guifg=#bfbfff')
+
+ *g:viki_highlight_inexistent_light*
+g:viki_highlight_inexistent_light (default: 'term=underline cterm=underline gui=underline ctermfg=DarkRed guifg=DarkRed')
+
+ *g:viki_highlight_inexistent_dark*
+g:viki_highlight_inexistent_dark (default: 'term=underline cterm=underline gui=underline ctermfg=Red guifg=Red')
+
+ *g:vikiPromote*
+g:vikiPromote (default: 0)
+ If set to true, any files loaded by viki will become viki enabled (in
+ minor mode); this was the default behaviour in earlier versions
+
+ *g:vikiUseParentSuffix*
+g:vikiUseParentSuffix (default: 0)
+ If non-nil, use the parent document's suffix.
+ If true, always append the "parent" file's suffix to the
+ destination file name. I.e. if the current file is "ThisIdea.txt"
+ the the viki name "OtherIdea" will refer to the file
+ "OtherIdea.txt".
+
+ *g:vikiAnchorMarker*
+g:vikiAnchorMarker (default: "#")
+ Prefix for anchors
+
+ *g:vikiFreeMarker*
+g:vikiFreeMarker (default: 0)
+ If true and a