Permalink
Browse files

Version 1.3

- basic ctags support (see |viki-tags|)
- mini-ftplugin for bibtex files (use record labels as anchors)
- added mapping <LocalLeader><c-cr>: follow link in other window (if any)
- disabled the highlighting of italic char styles (i.e., /text/)
- the ftplugin doesn't set deplate as the compiler; renamed the compiler plugin to deplate
- fix: VikiFoldLevel()
  • Loading branch information...
1 parent 35d05ce commit b357c6c3e145a9a81a97009a45cddbe4c466b847 @tomtom tomtom committed with Aug 6, 2004
Showing with 283 additions and 145 deletions.
  1. +36 −0 compiler/deplate.vim
  2. +0 −28 compiler/viki.vim
  3. +113 −19 doc/viki.txt
  4. +10 −0 ftplugin/bib/viki.vim
  5. +14 −3 ftplugin/viki.vim
  6. +87 −77 plugin/viki.vim
  7. +23 −18 syntax/viki.vim
View
@@ -0,0 +1,36 @@
+" viki.vim
+" @Author: Thomas Link (samul AT web.de)
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 25-Apr-2004.
+" @Last Change: 20-Mai-2004.
+" @Revision: 0.28
+"
+" Description:
+" Use deplate as the "compiler" for viki files.
+"
+
+let g:current_compiler="deplate"
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+fun! DeplateSetCompiler(options)
+ if exists("b:deplatePrg")
+ exec "setlocal makeprg=".escape(b:deplatePrg ." ". a:options, " ")."\\ $*\\ %"
+ elseif exists("g:deplatePrg")
+ exec "setlocal makeprg=".escape(g:deplatePrg ." ". a:options, " ")."\\ $*\\ %"
+ else
+ exec "setlocal makeprg=deplate ".escape(a:options, " ")."\\ $*\\ %"
+ " setlocal makeprg=deplate\ $*\ %
+ endif
+endfun
+command! -nargs=* DeplateSetCompiler call DeplateSetCompiler(<q-args>)
+
+DeplateSetCompiler
+
+setlocal errorformat=%f\ %l:%m,%f\ %l-%*\\d:%m
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim: ff=unix
View
@@ -1,28 +0,0 @@
-" viki.vim
-" @Author: Thomas Link (samul AT web.de)
-" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
-" @Created: 25-Apr-2004.
-" @Last Change: 02-Mai-2004.
-" @Revision: 0.20
-"
-" Description:
-" Use deplate as the "compiler" for viki files.
-"
-
-let g:current_compiler="viki"
-
-let s:cpo_save = &cpo
-set cpo&vim
-
-if exists("g:deplatePrg")
- exec "setlocal makeprg=".escape(g:deplatePrg, " ")."\\ $*\\ %"
-else
- setlocal makeprg=deplate\ $*\ %
-endif
-
-setlocal errorformat=%f\ %l:%m,%f\ %l-%*\\d:%m
-
-let &cpo = s:cpo_save
-unlet s:cpo_save
-
-" vim: ff=unix
View
@@ -8,15 +8,30 @@
*viki-description*
Description~
-This plugin adds wiki-like hypertext capabilities to any document. Just
-type |:VikiMinorMode| and all wiki names will be highlighted. If you press
-<c-cr> when the cursor is over a wiki name, you jump to (or create) the
-referred page.
-
-When invoked as a "minor" mode, viki is just an addon to other filetypes. If
-you want to write a viki-only document, set |'filetype'| to "viki". The "full"
-mode provides folding support, additional highlighting for headings, lists,
-tables, textstyles etc.
+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.
+
+From http://sourceforge.net/projects/deplate/ you can download a ruby based
+tool to convert viki markup to html or latex. On its homepage
+(http://deplate.sf.net) you can read a more detailled specification of the
+markup.
+
+MINOR WIKI MODE:
+Just type |:VikiMinorMode| and all wiki names and URLs will be highlighted.
+When the cursor is over a wiki name, you can press <c-cr> to jump to (or
+create) the referred page. Pressing <LocalLeader>vb brings you back to the
+original document. Alternatively, you can use <m-leftmouse> and <m-rightmouse>
+to jump back and forth.
+
+FULL WIKI MODE:
+Set 'filetype' to viki or execute |:VikiMode|. 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).
================================================================================
@@ -28,14 +43,41 @@ and run |:helptags| on that directory.
Customization: *viki-customization*
It's probably a good idea to check the values of the following variables:
- - |g:vikiTypewriterFont| (see |viki-textstyles|)
- - |g:vikiHeadingFont| (see |viki-headings|)
- - |g:vikiUpperCharacters| and |g:vikiLowerCharacters|
-as well as:
- - |g:vikiUseParentSuffix| (see |viki-names|)
+
+ - |g:vikiUpperCharacters| and |g:vikiLowerCharacters|; for German
+ character set these variables to something like: >
+
+ " this is in iso-latin-1
+ let g:vikiLowerCharacters = "a-z��������������"
+ let g:vikiUpperCharacters = "A-Z���"
+<
+ - |g:vikiUseParentSuffix| (see |viki-names|); I personally prefer this to
+ be ON >
+
+ let g:vikiUseParentSuffix = 1
+<
- |vikiNameTypes|
-Additionally, you can use the following variables to change viki's behaviour:
+Also, you might need to configure some external programs like in this example:
+>
+ let g:vikiOpenUrlWith_mailto = 'thunderbird -compose %{URL}'
+ let g:vikiOpenFileWith_ANY = "silent !start %{FILE}"
+
+Later on, you might also like to define some intervikis: >
+
+ let g:vikiInterSCI = $HOME ."/Projects/Sci/Ideas"
+ let g:vikiInterSCI_suffix = ".txt"
+
+In order to use the LaTeX enabled viki variant, add this to your .vimrc file: >
+
+ au FileType tex let b:vikiFamily="LaTeX"
+
+In order to automatically set |deplate| as the compiler for viki files: >
+
+ " we want to allow deplate to execute ruby code and external helper
+ " application
+ let g:deplatePrg = "deplate -x -X "
+ au FileType viki compiler deplate
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
@@ -46,6 +88,11 @@ If the variables b:editVikiPage or b:createVikiPage exist, their values are
interpreted as _command_ names for editing readable or creating new wiki
pages.
+For a better highlighting of viki files, also check out these two variables:
+
+ - |g:vikiTypewriterFont| (see |viki-textstyles|)
+ - |g:vikiHeadingFont| (see |viki-headings|)
+
===============================================================================
*viki-requirements*
@@ -326,7 +373,7 @@ Short list of available macros (see also |deplate|):
- Example: >
Foo bar{fn: x} foo bar.
- #Fn x <<EOF
+ #Fn: x <<EOF
Bla bla.
EOF
< - {cite: ID}
@@ -360,7 +407,7 @@ Backslashes~
vikification of the following character.
- A backslash should itself be escaped by a backslash.
-\_nounderline_, No\Viki\Name
+\_nounderline_, \NoVikiName
================================================================================
@@ -597,6 +644,16 @@ Viki Compile~
The compile plugin simply defines |deplate| as the current file's |makeprg|.
It also provides basic support for |deplate|'s error messages.
+The compiler plugin provides a command for setting compiler options:
+
+ - DeplateSetCompiler [FLAGS]
+
+E.g. when using the lvimrc plugin, you could put something like this into the
+current directorie's .lvimrc-file for putting the output into a dedicated
+directory: >
+
+ DeplateSetCompiler -d ../html
+
================================================================================
*viki-latex* *vikiLatex*
@@ -606,7 +663,7 @@ The archiv includes an experimental add-on for using LaTeX commands as simple
wiki names. Among the commands that are to some degree used as hyperlinks or
anchors:
- - \viki[anchor]{name]
+ - \viki[anchor]{name}
- \input
- \include
- \usepackage
@@ -656,6 +713,43 @@ simple minded example: >
endfun
+================================================================================
+ *viki-bibtex*
+Viki BibTeX~
+
+The bibtex ftplugin defines record labels as anchors. Thus, if make an
+interviki definition point to your bib files you can refer to bib entries as
+viki names. Example: >
+
+ let g:vikiInterBIB = $HOME ."/local/share/texmf/bibtex/bib/tml"
+ let g:vikiInterBIB_suffix = ".bib"
+
+ Then, activating the following viki name
+ BIB::[-monos-]#rec02
+ would open the file monos.bib and search for the record rec02.
+
+
+================================================================================
+ *viki-tags*
+Ctags~
+
+For ctags support (e.g. in conjunction with taglist) add this to your .ctags
+file (this assumes that *.txt files are in viki mode or modify the file suffix
+if necessary): >
+
+ --langdef=deplate
+ --langmap=deplate:.txt
+ --regex-deplate=/^(\*+ .+)/\1/s,structure/
+ --regex-deplate=/^(#[a-z][a-z0-9]+)/\1/s,structure/
+ --regex-deplate=/\[\[[^\]]+\]\[([^\]]+)\]\]/\1/r,reference/
+ --regex-deplate=/\[\[([^\]]+)\]\]/\1/r,reference/
+ --regex-deplate=/([A-Z][a-z]+([A-Z][a-z]+)+)/\1/r,reference/
+ --regex-deplate=/([a-z]+:\/\/[A-Za-z0-9.:%?=&_~@\/|-]+)/\1/u,url/
+
+For use with taglist, the variable "tlist_viki_settings" is already set for
+you -- references are not displayed by default.
+
+
================================================================================
*deplate*
Deplate~
@@ -678,6 +772,6 @@ references, an autogenerated index etc.
--
(the following is adapted from latex-suite.txt)
-vim:ft=help:fdm=expr:tw=78:ff=unix
+vim:ft=help: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*\\\\*.*","","")
View
@@ -0,0 +1,10 @@
+" viki.vim -- Make adaptions for bibtex
+" @Author: Thomas Link (samul AT web.de)
+" @Website: http://members.a1.net/t.link/
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 28-Jul-2004.
+" @Last Change: 28-Jul-2004.
+" @Revision: 0.7
+
+let b:vikiAnchorRx = '\^\c\s\*@\[a-z]\+\s\*{\s\*%{ANCHOR}\s\*,\.\*\$'
+
View
@@ -2,8 +2,8 @@
" @Author: Thomas Link (samul AT web.de)
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 12-Jän-2004.
-" @Last Change: 02-Mai-2004.
-" @Revision: 10
+" @Last Change: 17-Mai-2004.
+" @Revision: 13
if exists("b:did_ftplugin")
finish
@@ -19,12 +19,23 @@ exe "setlocal comments=:". b:vikiCommentStart
setlocal foldmethod=expr
setlocal foldexpr=VikiFoldLevel(v:lnum)
+fun! VikiFoldLevel(lnum)
+ " let head = matchend(getline(a:lnum), '\V\^'. escape(b:vikiHeadingStart, '\') .'\ze\s\+')
+ let head = matchend(getline(a:lnum), '\V\^'. b:vikiHeadingStart .'\+\ze\s\+')
+ if head > 0
+ return ">". head
+ else
+ " return foldlevel(a:lnum - 1)
+ return "="
+ endif
+endfun
+
if !hasmapto(":VikiFind")
nnoremap <buffer> <c-tab> :VikiFindNext<cr>
nnoremap <buffer> <c-s-tab> :VikiFindPrev<cr>
endif
-compiler viki
+" compiler viki
let b:vikiEnabled = 2
Oops, something went wrong.

0 comments on commit b357c6c

Please sign in to comment.