1 *viki.txt* Viki - A Pseudo Local Wiki Tool
4 Thomas Link (samul AT web de)
7 ================================================================================
11 This plugin adds wiki-like hypertext capabilities to Vim. You can use viki as
12 a "minor" mode (i.e., as an add-on to any other mode) or as a full-fledged
13 wiki mode. There is also an add-on plugin for "wikifying" latex documents by
14 turning some latex commands into wiki names. If viki is properly configured,
15 activating a reference to an image, a webpage etc. will view that resource in
18 From http://sourceforge.net/projects/deplate/ you can download a ruby based
19 tool to convert viki markup to LaTeX, HTML, or DocBook. On its homepage
20 (http://deplate.sf.net) you can read a more detailled specification of the
24 Just type |:VikiMinorMode| and all wiki names and URLs will be highlighted.
25 When the cursor is over a wiki name, you can press <c-cr> to jump to (or
26 create) the referred page. Pressing <LocalLeader>vb brings you back to the
27 original document. Alternatively, you can use <m-leftmouse> and <m-rightmouse>
28 to jump back and forth. (NOTE: In minor mode, it's possible that viki words
29 and URLs are not highlighted when they are included in some syntactic
33 In full mode, viki becomes a personal wiki
34 (http://c2.com/cgi/wiki?PersonalWiki). Set 'filetype' to viki or execute
35 |:VikiMode|. The full wiki mode is like the minor mode but with folding
36 support, syntax highlighting (for headings, lists, tables, textstyles etc.),
37 and additional key bindings (i.e., you can press <c-tab> or <s-c-tab> to move
38 the cursor to the next/previous viki name).
40 BUT HEY, WHAT IS A WIKI ANYWAY:
41 Among the vast amount of possible definitions, I prefer this one, which is my
42 own anyway :-): a wiki is a simple way of creating hypertexts. In its basic
43 form creating a hyperlink is as easy as writing a word in CamelCase (although
44 this sometimes turn out to be more annoying than useful) or by a rather
45 minimalist markup -- in the case of viki, this would be [[destination]] or
48 You begin by creating a directory where your wiki files should go to and by
49 creating a wiki index -- a master file that contains references to sub-pages.
50 After a while you end up with many small, tightly interlinked files/notes.
52 Wikis also come with a rather subtle markup. Here is a simple comparison of
53 two examples of LaTeX and viki markup so that you get the idea of what it
56 LaTeX: \section{Title}
62 And some wikis provide tools for translating this markup to other formats
63 (like viki does in the form of the "deplate" program, which can translate viki
64 markup to LaTeX, HTML, and Docbook). Unfortunately, about every wiki has its
68 ================================================================================
72 Extract viki.zip to your local vimfiles directory (see also
73 |add-global-plugin|) so that you get: >
75 (Linux etc.) $HOME/.vim/
76 (Windows) $VIM/vimfiles/
77 compiler/ doc/ etc/ ftplugin/ plugin/ syntax/
79 These directories are used for installing user-specific plugins. It's possible
80 that these directories already exist and are populated with other plugins --
81 in which case you probably already knew this. ;-)
83 Uninstalling viki requires deleting the files from the viki archive by hand.
84 Alternatively, you can feed the file etc/Viki.lst to rm: >
87 rm -i `cat etc/Viki.lst`
89 Viki will be automatically loaded when starting vim. In case you have vim
90 already running and don't want to restart it, you can also type: >
92 :runtime plugin/viki.vim
97 :helptags $HOME/.vim/doc
100 :helptags $VIM/vimfiles/doc
102 Viki doesn't set the viki filetype for you. How you set the filetype is up to
103 you to decide. Basically, there are two possibilities: based on a suffix or
104 based on the location. See below for examples.
107 Customization: *viki-customization*
108 It's probably a good idea to check the values of the following variables:
110 - |g:vikiUpperCharacters| and |g:vikiLowerCharacters|; for the most
111 commonly used foreign language characters in a Western European
112 context set these variables to something like (this refers to the
113 characters allowed in simple viki names and in anchors; for East Asian
114 languages you probably prefer to use quoted viki names anyway): >
116 " this is in iso-latin-1
117 let g:vikiLowerCharacters = "a-zäöüßáàéèíìóòçñ"
118 let g:vikiUpperCharacters = "A-ZÄÖÜ"
120 - |g:vikiUseParentSuffix| (see also |viki-names|); I personally prefer
123 let g:vikiUseParentSuffix = 1
125 - |vikiNameTypes| (see |viki-names|): control which type of viki names you
126 want to use (this allows you to turn off, e.g., simple viki names)
128 You might also need to configure some external programs (use the variables
129 g:vikiOpenUrlWith_{PROTOCOL} and g:vikiOpenFileWith_{SUFFIX}) like in this
132 let g:vikiOpenUrlWith_mailto = 'thunderbird -compose %{URL}'
133 let g:vikiOpenFileWith_html = "silent !firefox %{FILE}"
134 let g:vikiOpenFileWith_ANY = "silent !start %{FILE}"
136 This way, if you had, e.g., pdftotext (from the xpdf distribution) installed,
137 you could make viki to open references to pdf files right in VIM: >
140 if !exists("b:convertedPDF")
141 exec "cd ". expand("%:p:h")
142 exec "%!pdftotext ". expand("%:t") ." -"
145 setlocal noswapfile buftype=nowrite
146 let b:convertedPDF = 1
149 let g:vikiOpenFileWith_pdf = 'call VikiOpenLink("%{FILE}", "", 1)|silent call ConvertPDF()'
151 Later on, you probably want to define some intervikis. A |interviki| is a
152 shortcut to a different viki directory/namespace, so that you have to care
153 less about page names: >
155 call VikiDefine('SCI', $HOME."/Projects/Sci/Ideas", ".txt")
157 This could then be accessed as SCI::ThisIdea, which would refer to the file
158 "~/Projects/Sci/Ideas/ThisIdea.txt".
160 VikiDefine also defines a command (:SCI in this example) that opens a wiki's
161 index file (an optional 4th argument or "${g:vikiIndex}.${suffix}").
163 In order to use the LaTeX enabled viki variant, add this to your |vimrc| file: >
165 au FileType tex let b:vikiFamily="LaTeX"
167 In order to automatically set |deplate| as the compiler for viki files: >
169 " we want to allow deplate to execute ruby code and external helper
171 let g:deplatePrg = "deplate -x -X "
172 au FileType viki compiler deplate
174 Some users might want to automatically set the filetype to viki depening on
175 the file extension. This can be done using |:autocmd|: >
177 let g:vikiNameSuffix=".viki"
178 autocmd! BufRead,BufNewFile *.viki set filetype=viki
180 You can also use |:autocmd| to set the filetype depending on the path: >
182 autocmd! BufRead,BufNewFile $HOME/MyWiki/* set filetype=viki
184 If the variables b:getVikiLink or b:getExtVikiLink exist, their values are
185 used as _function_ names for returning the current viki name's definition. A
186 viki definition is a "multvalue" (see multvals.vim, vimscript #171) of the
187 three elements name, destination, anchor with g:vikiDefSep as the separator.
189 If the variables b:editVikiPage or b:createVikiPage exist, their values are
190 interpreted as _command_ names for editing readable or creating new wiki
193 For a better highlighting of viki files, also check out these variables:
195 - |g:vikiTypewriterFont| (see |viki-textstyles|)
196 - |g:vikiHeadingFont| (see |viki-headings|)
197 - |g:vikiHyperLinkColor|
198 - |g:vikiInexistentColor|
200 *viki-indent-disable*
201 In order to disable the indentation plugin, define the variable g:vikiNoIndent
202 and set it to whatever you want.
205 ===============================================================================
209 - multvals.vim (vimscript #171, >= 3.8.0)
212 Optional Enhancements~
214 - genutils.vim (vimscript #197 for saving back references; but see
216 - imaps.vim (vimscript #244 or #475 for |:VimQuote|)
217 - kpsewhich (not a vim plugin :-) for LaTeX support
220 ================================================================================
224 A viki name is either:
227 1. Simple wiki names -- these refer to files in the same directory as the
230 a. a word in CamelCase
234 NOTE: A simple viki name may include characters from
235 |g:vikiUpperCharacters| and |g:vikiLowerCharacters|.
237 b. some text between "[-" and "-]"
241 NOTE: "[--]" refers to the current file.
243 NOTE: Anyways, the characters []:*&?<>/|\" are not allowed in
244 names as they usually cause trouble when included in file names.
247 c. an "inter wiki" name, where the first part (in upper-case letters)
248 is a shortcut to some other viki, so that you have to care less about
252 OTHERVIKI::VikiName#there
253 OTHERVIKI::[-some name-]
254 OTHERVIKI::[-some name-]#there
256 E.g., if you had two intervikis defined, say SCI and COMP, you
257 could the refer to their pages as in: >
259 Couldn't SCI::ThisIdeaOfMine be combined with COMP::ThisIdeaOfMine?
261 NOTE: You can define intervikis with the VikiDefine command: >
263 VikiDefine OTHERVIKI /home/t/Wiki .vik
265 < Then OTHERVIKI::VikiName points to the file "/home/t/Wiki/VikiName.vik".
267 NOTE: Set the string variable g:vikiInter{NAME}_suffix (see
268 |curly-braces-names|) in order to override the settings of
269 |b:vikiNameSuffix| and |g:vikiUseParentSuffix| for references to
272 NOTE: If the variable |b:vikiNameSuffix| is defined, it will be added to
273 simple wiki names so that the simple wiki name "OtherFile" refers to
274 "OtherFile.suffix" -- e.g. for interlinking LaTeX-files.
275 Alternatively, you can set |g:vikiUseParentSuffix| to non-zero in order
276 to make viki always append the "parent" file's suffix to the
279 *viki-extended-names*
280 2. an extended wiki name of the form:
283 [[OTHERVIKI::destination]]
284 [[destination][name]]
285 [[destination#anchor][name]]
289 NOTE: The destination name is taken literally, i.e. variables like
290 |g:vikiUseParentSuffix| or |b:vikiNameSuffix| have no effect.
292 NOTE: Opening extended wiki names referring to files with suffixes
293 matching one of |vikiSpecialFiles| (e.g. [[test.jpg]]) can be
294 delegated to the operating system -- see |VikiOpenSpecialFile()|. The
295 same is true for names matching |vikiSpecialProtocols|, which will be
296 opened with |VikiOpenSpecialProtocol()|.
298 NOTE: In extended wiki names, destination path is relative to the
299 document's current directory if it doesn't match
300 "^\(\/\|[a-z]:\|[a-z]\+://\)". I.e. [[../test]] refers to the
301 directory parent to the document's directory. A tilde at the beginning
302 will be replaced with $HOME.
306 It is assumed that these URLs should be opened with an external
307 program; this behaviour can be changed by redefining the function
308 |VikiOpenSpecialProtocol()|.
310 Adding #[a-z0-9]\+ to the wiki name denotes a reference to a specific anchor.
311 Examples for wiki names referring to an anchor: >
314 [[anyplace/filename.txt#there]]
315 [[anyplace/filename.txt#there][Filename]]
317 A anchor is marked as "^".b:commentStart."\?#[a-z0-9]\+" in the destination
318 file. If |b:commentStart| is not defined, the EnhancedCommentify-variables or
319 |&commentstring| will be used instead. Examples ('|' = beginning of line):
321 - LaTeX file, b:commentStart is set to "%"
324 - C file, |&commentstring| is set to "/*%s*/"
326 - Text file, b:commentStart is undefined
329 NOTE: If "#" is the comment character (as in ruby), a space should follow the
330 comment character in order to distinguish comments from anchors.
332 NOTE: In "full" viki mode (when invoked via VikiMode) comments are marked
333 with "%" by default (see g:vikiCommentStart). An anchor has thus to be
334 written as in the LaTeX example.
336 NOTE: |deplate| attaches an anchor to the previous element (e.g. |viki-tables|).
339 ================================================================================
343 The pseudo markup is to some degree compatible with emacs-wiki, which in turn
344 is to some degree compatible with some other wiki -- i.e., it's compatible
345 enough to edit and work with files in emacs-wiki markup, but in some aspects
346 it's more restrictive. Unfortunately, as there is currently no
347 html-translator/exporter for this markup, it's quite useless for the moment.
348 But it looks nice on the screen.
357 NOTE: Headings can span more than one line by putting a backslash ('\') at
360 NOTE: If |g:vikiHeadingFont| is defined, the heading will be set in this
379 NOTE: "@" (unordered lists) and "#" (ordered lists) are the preferred markers.
383 Descriptions: (indented)~
390 emacs-planer compatible mode: >
393 #A2 x Less important task (done)
394 #A2 90% Less important task (mostly completed)
395 #B2 2005-10-30 Less important task with deadline
396 #B2 x2005-10-25 Less important task (completed)
398 You can switch category, priority, and date: >
401 #2A x Less important task (done)
403 #2005-10-30 2A Important task
404 #2005-11-11 1A Most important task
405 #x2005-10-30 3A Less important task (done)
410 || Head || Category ||
415 NOTE: Rows can span more than one line by putting a backslash ('\') at the end
421 <-, ->, <=, =>, <~, ~>, <->, <=>, <~>, !=, ~~, ..., --, ==
433 NOTE: See also |g:vikiMarkupEndsWithNewline|.
438 There are two markup styles which are selected on the basis of
439 |vikiTextStyles|. 2 is the default now.
441 If |vikiTextStyles| is 2, the markup is like this: >
443 __emphasized__, ''typewriter''
445 If |vikiTextStyles| is 1, the markup is like this: >
447 *bold*, **continuous bold**
448 /italic/, //continuous italic//
449 _underlined_, __continuous underline__
450 =typewriter=, ==continuous typewriter==
452 < NOTE: There must not by a whitespace after the opening mark.
454 NOTE: For the word styles, there must be a non-word character (|/\W|)
455 before the opening mark, i.e. a/b/c will be highlighted as normal text --
456 it won't be highlighted. You could use the continuous markup for putting
457 the "b" in the example in italic.
459 NOTE: If |g:vikiTypewriterFont| is defined, this font will be used to
460 highlight text in typewriter style.
462 NOTE: See also |g:vikiMarkupEndsWithNewline|.
466 Comments (whole lines)~
472 #Type [OPTIONS] <<EndOfRegion
476 For a list of supported regions see the |deplate| documentation.
479 *viki-sharp-commands*
481 #COMMAND [OPTIONS]: ARGS
483 OPTIONS have the form
484 - OPTION! ... set option to true
486 - the characters "!" and "=" have to be escaped with a backslash
488 Commands are applied only if the option "fmt" isn't given or if it matches the
491 Short list of available COMMANDS "COMMAND" (see also |deplate|):
492 - INC: INCLUDED FILENAME
493 - FIG [here!|top!|bottom!]: FILENAME
494 - CAP [above!|below!]: TEXT
498 - DATE: [TEXT|now|today]
500 - LIST [page!]: [contents|tables|figures|index]
503 It depends on the formatter if these options have any effect.
504 - DOC ... document options
505 - OPT ... element options (applies to the previous element)
510 Curly braces should be escaped with a backslash (i.e., \{ and \}), as they
511 usually mark macros: >
513 {MACRO [OPTIONS]: ARGS...}
515 Short list of available macros (see also |deplate|):
517 - inserts a footnote as defined by in a Fn or Footnote region.
518 - output depends on the formatter
520 Foo bar{fn: x} foo bar.
526 - output depends on the formatter
527 - {date: [format string|now|today]}
528 - the format string uses ruby's strftime method.
529 - {ins: LITERALLY INSERTED TEXT}
530 - Example: {ins fmt=html: <<}
532 - access document options, e.g. {opt: author}
534 - access element (paragraph, table etc.) options
535 - {ruby [alt=ALTERNATIVE OUTPUT]: RUBY CODE}
536 - if the evaluation of ruby code is disabled, the text given in the
537 alt option or an empty string will be inserted
538 - a sequence of ruby commands must be separated by semicolons
541 - fmt=FORMATTER, nofmt=UNMATCHED FORMATTER
543 NOTE: Macros cannot cross paragraph borders, i.e., they must not contain empty
544 lines. Using newlines in a macro argument is useless, as the macro text will
545 be collapsed to one single line.
550 - A backslash at the end of the line should make a pattern include the
552 - In general, a backslash should be an escape character that prevents the
553 vikification of the following character.
554 - A backslash should itself be escaped by a backslash.
556 \_nounderline_, \NoVikiName
559 ================================================================================
563 <c-cr> ... |VikiMaybeFollowLink()|: Usually only works when the cursor is over
564 a wiki syntax group -- if the second argument is 1 it tries to interpret the
565 text under the cursor as a wiki name anyway.
567 <LocalLeader>vf ... Open in window
568 <LocalLeader>vs ... Open in a new window
569 <LocalLeader>vv ... Open in a new window but split vertically
570 - see also |vikiSplit|
572 <LocalLeader>v1 - <LocalLeader>v4 ... Open in window 1-4
574 <LocalLeader>ve ... |:VikiEdit| edit a viki page
576 <LocalLeader>vb ... |VikiGoBack()|
577 <LocalLeader>vq ... |:VikiQuote| mark selected text a quoted viki name
579 <LocalLeader>vd ... |:VikiMarkInexistent| in the whole document
580 <LocalLeader>vp ... |:VikiMarkInexistent| in the current paragraph
582 If |g:vikiMapMouse| is true then these mappings are active, too:
583 <m-leftmouse> ... |VikiMaybeFollowLink()|
584 <m-leftmouse> ... |VikiGoBack()| (always jumps to the last known entry point)
587 Additional Key Binding In Full Viki Mode
589 <c-tab>, <LocalLeader>vn ... |:VikiFindNext|
590 <s-c-tab>, <LocalLeader>vN ... |:VikiFindPrev|
593 ================================================================================
599 NOTE: Be aware that we cannot highlight a reference if the text is embedded
600 in syntax group that doesn't allow inclusion of arbitrary syntax elemtents.
603 - VikiMode (do additional highlighting)
604 Basically the same as: >
608 *:VikiFindNext* *:VikiFindPrev*
609 - VikiFindNext, VikiFindPrev (find the next/previous viki name or URL)
611 *:VikiMarkInexistent*
612 *:VikiMarkInexistentInParagraph*
613 - VikiMarkInexistent, VikiMarkInexistentInParagraph
614 Update the highlighting of links to inexistent files. VikiMarkInexistent
615 can take a range as argument.
617 - VikiQuote *:VikiQuote*
618 Mark selected text as a quoted simple viki name, i.e., enclose it in
621 - VikiEdit[!] NAME *:VikiEdit*
622 Edit the wiki page called NAME. If the NAME is '*', the |viki-homepage| will
623 be opened. This is a convenient way to edit any wiki page from vim's command
624 line. If you call :VikiEdit! (with bang), the homepage will be opened first,
625 so that the homepage's customizations (and not the current buffer's one) are
626 in effect. There are a few gotchas:
628 1. Viki doesn't define a default directory for wiki pages. Thus a wiki page
629 will be looked for in the directory of the current buffer -- whatever this
630 is -- and the customizations of this buffer are in effect. You can
631 circumvent this problem by using |interviki| names or define a
632 |viki-homepage| and call :VikiEdit! with a bang.
634 2. Viki relies on some buffer local variables to be set. As customizability
635 is one viki's main design goal (although, one might want to discuss whether
636 I overdid it), there are no global settings that would define what a valid
637 viki name is supposed to look like. As a consequence, if you disabled a
638 certain type of wiki name in the current buffer, you won't be able to edit a
639 wiki page of this type. E.g.: If the current buffer contains a LaTeX file,
640 |vikiFamily| is most likely set to "LaTeX" (see |viki-latex|). For the LaTeX
641 family, e.g., CamelCase and interwiki names are disabled. Consequently, you
642 can't do, e.g., ":VikiEdit IDEAS::WikiPage". Again, you can circumvent this
643 problem by defining a |viki-homepage| and call :VikiEdit! with a bang.
645 - VikiHome *:VikiHome*
646 Open the |viki-homepage|.
648 - VikiDefine NAME BASE ?SUFFIX *:VikiDefine*
651 ================================================================================
655 - VikiMinorMode(state) *VikiMinorMode()*
656 - VikiMode(state) *VikiMode()*
658 +/-1 ... Minor mode (negative number ~ don't complain)
659 +/-2 ... Full mode (negative number ~ don't complain)
661 - VikiMaybeFollowLink(oldmap, ignoreSyntax) *VikiMaybeFollowLink()*
662 oldmap: If there isn't a viki link under the cursor:
665 whatever ... return whatever
666 ignoreSyntax: If there isn't a viki syntax group under the cursor:
667 0 ... no viki name found
668 1 ... look if there is a viki name under cursor anyways
670 - VikiFindAnchor(anchor) *VikiFindAnchor()*
672 - VikiGoBack() *VikiGoBack()*
673 Viki keeps record about the "source" files from where a viki page was
674 entered. Calling this function jumps back to the "source" file (if only one
675 such back reference is known) or let's you select from a list of "source"
676 files. The information is stored in buffer variables -- i.e., it gets lost
677 after closing the buffer. Care was taken to reduce information clutter,
678 which is why the number of possible back references per "source" file was
681 - VikiOpenSpecialFile(filename) *VikiOpenSpecialFile()*
682 Handles filenames that match |vikiSpecialFiles|.
683 If g:vikiOpenFileWith_{SUFFIX} is defined, it contains a command
684 definition for opending files of this type. "%{FILE}" is replaced with the
685 file name ("%%" = "%") and the resulting string is executed. Example: >
687 let g:vikiOpenFileWith_html = '!firefox %{FILE}'
689 < The contents of variable g:vikiOpenFileWith_ANY will be used as fallback
690 command. Under Windows, g:vikiOpenFileWith_ANY defaults to "silent !cmd /c
692 All suffixes are translated to lower case.
694 - VikiOpenSpecialProtocol(url) *VikiOpenSpecialProtocol()*
695 Handles filenames that match |vikiSpecialProtocols|.
696 If g:vikiOpenUrlWith_{PROTOCOL} is defined, it contains a command definition
697 for opending urls of this type. "%{URL}" is replaced with the url ("%%" =
698 "%") and the resulting string is executed. Example: >
700 let g:vikiOpenUrlWith_mailto = '!thunderbird -compose %{URL}'
702 < The contents of variable g:vikiOpenUrlWith_ANY will be used as fallback
703 command. Under Windows, g:vikiOpenUrlWith_ANY defaults to "silent
704 !rundll32 url.dll ...".
705 All protocol names are translated to lower case.
707 - VikiDefineMarkup(mode) *VikiDefineMarkup()*
709 - VikiDefineHighlighting(mode) *VikiDefineHighlighting()*
712 ================================================================================
716 Homepage: *viki-homepage*
719 An absolute filename that is the general viki homepage (see also
720 |:VikiEdit| and |:VikiHome|).
722 Simple Viki Names [2]: *viki-vars-simple-names*
723 *g:vikiLowerCharacters*
724 *g:vikiUpperCharacters*
725 - g:vikiLowerCharacters, g:vikiUpperCharacters, b:vikiLowerCharacters,
726 b:vikiUpperCharacters
727 These default to "a-z" and "A-Z" respectively; "international" users
728 should set these variables in their |vimrc| file to fit their needs
732 - b:vikiSimpleNameRx, b:vikiSimpleNameSimpleRx[1]
733 - b:vikiSimpleNameNameIdx, b:vikiSimpleNameDestIdx, b:vikiSimpleNameAnchorIdx
735 Extended Viki Names [2]: *viki-vars-ext-names*
736 - b:vikiExtendedNameRx, b:vikiExtendedNameSimpleRx[1]
737 - b:vikiExtendedNameNameIdx, b:vikiExtendedNameDestIdx,
738 b:vikiExtendedNameAnchorIdx
740 URLs [2]: *viki-vars-urls*
741 - b:vikiUrlRx, b:vikiUrlSimpleRx[1]
742 - b:vikiUrlNameIdx, b:vikiUrlDestIdx, b:vikiUrlAnchorIdx
744 NOTE: [1] The same as *Rx variables but with less groups.
745 NOTE: [2] These variables are defined by |VikiSetupBuffer()|.
747 - b:vikiAnchorRx *b:vikiAnchorRx*
748 If this variable exists, the string "%{ANCHOR}" will be replaced with the
749 search text. The expression has to conform to the very nomagic |/\V|
752 - g:vikiFreeMarker *g:vikiFreeMarker*
753 If true and an explicitly marked anchor isn't found, search for the anchor
754 text as such. This search will be case-insensitive. deplate won't be able
755 to deal with such pseudo-references, of course.
760 - g:vikiSpecialFiles, b:vikiSpecialFiles *vikiSpecialFiles*
761 Default value: jpg\|gif\|bmp\|pdf\|dvi\|ps
762 A list of extensions for files that should be opened with
763 |VikiOpenSpecialFile()|.
765 - g:vikiSpecialProtocols, b:vikiSpecialProtocols *vikiSpecialProtocols*
766 Default value: https\?\|ftps\?
767 A list of protocolls that should be opened with
768 |VikiOpenSpecialProtocol()|.
770 - g:vikiUseParentSuffix *g:vikiUseParentSuffix*
772 If true, always append the "parent" file's suffix to the destination file
773 name. I.e. if the current file is "ThisIdea.txt" the the viki name
774 "OtherIdea" will refer to the file "OtherIdea.txt".
776 - g:vikiNameSuffix b:vikiNameSuffix *vikiNameSuffix* *b:vikiNameSuffix*
778 Append suffix to the destination file name.
783 - g:vikiTextStyles, b:vikiTextStyles *vikiTextStyles*
785 Defines the markup of |viki-textstyles| like emphasized or code.
787 - g:vikiCommentStart *g:vikiCommentStart*
789 Defines the prefix of comments when in "full" viki mode.
791 - b:vikiCommentStart *b:vikiCommentStart*
792 In minor mode this variable is set to either:
795 - matchstr(&commentstring, "^\\zs.*\\ze%s")
796 In "full" viki mode it's set to |g:vikiCommentStart|.
798 - g:vikiTypewriterFont *g:vikiTypewriterFont*
799 See |viki-textstyles|.
801 - g:vikiHeadingFont *g:vikiHeadingFont*
804 - g:vikiHyperLinkColor *g:vikiHyperLinkColor*
805 Default: DarkBlue or LightBlue (depending on 'background')
806 The color of hyperlinks, viki names etc.
808 - g:vikiInexistentColor *g:vikiInexistentColor*
810 The color of links to inexistent files.
812 - g:vikiFamily, b:vikiFamily *vikiFamily*
813 By defining this variable, family specific functions will be called for:
814 - VikiSetupBuffer{b:vikiFamily}(state)
815 - VikiDefineMarkup{b:vikiFamily}(state)
816 - VikiDefineHighlighting{b:vikiFamily}(state)
817 - VikiCompleteSimpleNameDef{b:vikiFamily}(def)
818 - VikiCompleteExtendedNameDef{b:vikiFamily}(def)
819 - VikiFindAnchor{b:vikiFamily}(anchor)
820 If one of these functions is undefined for a "viki family", then the
821 default one is called.
823 Apart from the default behaviour the following families are defined:
824 - LaTeX (see |viki-latex|)
825 - AnyWord (see |viki-any-word|)
830 - g:vikiMapMouse *g:vikiMapMouse*
831 See |viki-key-bindings|.
833 - b:vikiSplit, g:vikiSplit *vikiSplit*
834 -1 ... open all links in a new windows
835 -2 ... open all links in a new windows but split vertically
836 Any positive number ... open always in this window
838 - b:vikiNameTypes, g:vikiNameTypes *vikiNameTypes*
839 Default value: "csSeui"
840 s ... Simple viki name
842 S ... simple, quoted viki name
844 e ... Extended viki name
846 Disable certain types of viki names globally or for a single buffer.
847 (experimental, doesn't fully work yet)
849 - g:vikiSaveHistory *g:vikiSaveHistory*
851 If genutils.vim is installed, the history data will be saved in
852 |viminfo-file|. Like most of this plugin, this feature is _experimental_
853 and is turned off by default.
855 - g:vikiExplorer *g:vikiExplorer*
857 If a viki name points to a directory, we use this command for viewing the
860 - g:vikiMarkInexistent *g:vikiMarkInexistent*
862 If non-zero, highligh links to existent or inexistent files in different
865 - b:vikiInverseFold *b:vikiInverseFold*
867 If set, the section headings' levels are folded in reversed order so that
868 |b:vikiMaxFoldLevel| corresponds to the top level and 1 to the lowest
869 level. This is useful when maintaining a file with a fixed structure where
870 the important things happen in subsections while the top sections change
873 - b:vikiMaxFoldLevel *b:vikiMaxFoldLevel*
875 When using |b:vikiInverseFold|, a heading of level b:vikiMaxFoldLevel
876 corresponds to level 1, b:vikiMaxFoldLevel - 1 to level 2,
877 b:vikiMaxFoldLevel - 2 to level 3 ... and a top heading to level
878 b:vikiMaxFoldLevel. I.e., if you set |foldlevel| to 1, you will see only
879 the text at level b:vikiMaxFoldLevel.
881 - g:vikiFolds *g:vikiFolds*
883 Define which elements should be folded:
885 H :: Headings (but inverse folding)
888 - b:vikiNoSimpleNames *b:vikiNoSimpleNames*
890 If non-nil, simple viki names are disabled.
892 - b:vikiDisableType *b:vikiDisableType*
893 Disable certain viki name types (see |vikiNameTypes|).
894 E.g., in order to disable CamelCase names only, set this variable to 'c'.
896 - g:vikiHide *g:vikiHide*
898 If a dirty buffers gets hidden, vim usually complains. This can be
899 tiresome -- depending on your editing habits. When this variable is set to
900 "hide", vim won't complain. If you set it to "update", a viki buffer will
901 be automatically updated before editing a different file. If you leave
902 this empty (""), the default behaviour is in effect. See also |hidden|.
905 ================================================================================
909 Viki.vim defines several new highlight groups. Precaution is taken to select
910 different colours depending on the background, but colour schemes are ignored.
911 The colors are tested using color scheme with a white background.
929 ================================================================================
933 The compile plugin simply defines |deplate| as the current file's |makeprg|.
934 It also provides basic support for |deplate|'s error messages.
936 The compiler plugin provides a command for setting compiler options:
938 - DeplateSetCompiler [FLAGS]
940 E.g. when using the lvimrc plugin, you could put something like this into the
941 current directorie's .lvimrc-file for putting the output into a dedicated
944 DeplateSetCompiler -d ../html
947 ================================================================================
948 *viki-latex* *vikiLatex*
951 The archiv includes an experimental add-on for using LaTeX commands as simple
952 wiki names. Among the commands that are to some degree used as hyperlinks or
955 - \viki[anchor]{name}
962 - \label (as anchors)
963 - \ref (in the current file only)
965 Limitations: There must not be spaces between between the leading backslash,
966 the command name, and its arguments. A command must not span several lines.
968 Simple viki names (including |interviki|, CamelCase, and quoted viki names)
969 are disabled -- as they wouldn't be of much use in a LaTeX document anyway.
970 (Well, as a matter of fact they aren't disabled but LaTeX commands are defined
971 as simple viki names.)
973 This plugin also highlights a hypothetical \viki[anchor]{name} command, which
974 could be defined as: \newcommand{\viki}[2][]{#2}
976 If b:vikiFamily is set to "LaTeX", then calling |:VikiMinorMode| will use
977 these commands instead of normal viki names. This change can be made permanent
978 by adding this line to your |vimrc| file: >
980 au FileType tex let b:vikiFamily="LaTeX"
982 *:VikiMinorModeLaTeX*
983 LaTeX support is switched on with the command :VikiMinorModeLaTeX. This
984 command sets b:vikiFamily to "LaTeX" and calls |:VikiMinorMode|. This
985 command relies on the external kpsewhich tool, which has to be installed on
988 *vikiLatex-UserCommands*
989 You can extend the list of supported commands by listing your commands in
990 g:vikiLaTeXUserCommands and by defining a corresponding function called
991 VikiLaTeX_{YourCommand}(args, opts). VikiLaTeX assumes that a command looks
992 like this: \latexcommand[opts]{args}. This function should return a string
993 that defines the variable dest (=destination file) as well as, optionally,
994 anchor and name -- see |:return| for an explanation of how this works. A
995 simple minded example: >
997 let g:vikiLaTeXUserCommands = 'other\|self'
999 fun! VikiLaTeX_other(args, opts)
1000 return 'let dest="'.a:args.'.tex" | let anchor="'.a:opts.'"'
1003 fun! VikiLaTeX_self(args, opts)
1004 return 'let dest="'.g:vikiSelfRef.'" | let anchor="'.a:opts.'"'
1008 ================================================================================
1012 If b:vikiFamily or g:vikiFamily is set to "AnyWord", then any word becomes a
1013 potential viki link.
1015 This feature conflicts with the highlighting of links to inexistent files.
1016 Links to inexistent files are displayed as normal text.
1019 ================================================================================
1023 The bibtex ftplugin defines record labels as anchors. Thus, if make an
1024 |interviki| definition point to your bib files you can refer to bib entries as
1025 viki names. Example: >
1027 let g:vikiInterBIB = $HOME ."/local/share/texmf/bibtex/bib/tml"
1028 let g:vikiInterBIB_suffix = ".bib"
1030 Then, activating the following viki name
1031 BIB::[-monos-]#rec02
1032 would open the file monos.bib and search for the record rec02.
1035 ================================================================================
1039 For ctags support (e.g. in conjunction with taglist) add this to your .ctags
1040 file (this assumes that *.txt files are in viki mode; you have to adjust the
1041 file suffix if you choose a different suffix): >
1044 --langmap=deplate:.txt
1045 --regex-deplate=/^(\*+ .+)/\1/s,structure/
1046 --regex-deplate=/^(#[a-z][a-z0-9]+)/\1/s,structure/
1047 --regex-deplate=/\[\[[^\]]+\]\[([^\]]+)\]\]/\1/r,reference/
1048 --regex-deplate=/\[\[([^\]]+)\]\]/\1/r,reference/
1049 --regex-deplate=/([A-Z][a-z]+([A-Z][a-z]+)+)/\1/r,reference/
1050 --regex-deplate=/([a-z]+:\/\/[A-Za-z0-9.:%?=&_~@\/|-]+)/\1/u,url/
1052 For use with taglist, the variable "tlist_viki_settings" is already set for
1056 ================================================================================
1060 deplate is a ruby script/library that converts viki markup to:
1067 Download the latest version from http://sourceforge.net/projects/deplate/.
1069 deplate's markup is not 100% identical with the standard viki mode's one.
1070 E.g., it doesn't support underline, italic markup. deplate sometimes failes
1071 with cryptic error messages and it doesn't always give the results one would
1072 expect. On the other hand, it features inclusion of LaTeX snippets, footnotes,
1073 references, an autogenerated index etc.
1077 (the following is adapted from latex-suite.txt)
1079 vim:foldexpr=getline(v\:lnum-2)=~"=\\\\{80,}"?"a1"\:(getline(v\:lnum+1)=~"=\\\\{80,}"?"s1"\:"=")
1080 vim:foldtext=v\:folddashes.substitute(getline(v\:foldstart),"\\\\s*\\\\*.*","","")