Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Version 1.6.3

- file type URLs (file://) are now treated like special files
- indent: if g:vikiIndentDesc is '::', align a definition's description to the
first non-blank position after the '::' separator
- b:vikiDisableType
- Put AnyWord-related stuff into a file of its own.
- indentation for notices (!!!, ??? etc.)
- When creating a new file by following a link, the desired window number was ignored
- (VikiOpenSpecialFile) Escape blanks in the filename
- Set &include and &define (ftplugin)
- Set g:vikiFolds to '' to avoid using Headings for folds (which may cause a
major slowdown on slower machines)
- renamed <SID>DecodeFileUrl(dest) to VikiDecomposeUrl()
- fixed problem with table highlighting
  • Loading branch information...
commit 8243b04f5bd4269cce7fed7d013985e43ac32012 1 parent 79ed8cf
Tom Link authored October 01, 2005 vim-scripts committed November 13, 2010
8  doc/viki.txt
@@ -834,6 +834,14 @@ Etc:
834 834
     b:vikiMaxFoldLevel. I.e., if you set |foldlevel| to 1, you will see only 
835 835
     the text at level b:vikiMaxFoldLevel.
836 836
 
  837
+- b:vikiNoSimpleNames                               *b:vikiNoSimpleNames*
  838
+    Default: 0
  839
+    If non-nil, simple viki names are disabled.
  840
+
  841
+- b:vikiDisableType                                 *b:vikiDisableType*
  842
+    Disable certain viki name types (see |vikiNameTypes|).
  843
+    E.g., in order to disable CamelCase names only, set this variable to 'c'.
  844
+
837 845
 
838 846
 ================================================================================
839 847
                                                     *viki-highlight*
1  etc/Viki.lst
@@ -5,5 +5,6 @@
5 5
 ./ftplugin/viki.vim
6 6
 ./indent/viki.vim
7 7
 ./plugin/viki.vim
  8
+./plugin/vikiAnyWord.vim
8 9
 ./plugin/vikiLatex.vim
9 10
 ./syntax/viki.vim
54  ftplugin/viki.vim
@@ -2,8 +2,12 @@
2 2
 " @Author:      Thomas Link (samul AT web.de)
3 3
 " @License:     GPL (see http://www.gnu.org/licenses/gpl.txt)
4 4
 " @Created:     12-Jän-2004.
5  
-" @Last Change: 26-Jän-2005.
6  
-" @Revision: 34
  5
+" @Last Change: 01-Okt-2005.
  6
+" @Revision: 89
  7
+
  8
+if !g:vikiEnabled
  9
+    finish
  10
+endif
7 11
 
8 12
 if exists("b:did_ftplugin")
9 13
   finish
@@ -26,30 +30,44 @@ exe "setlocal comments=:". b:vikiCommentStart
26 30
 setlocal foldmethod=expr
27 31
 setlocal foldexpr=VikiFoldLevel(v:lnum)
28 32
 setlocal expandtab
  33
+setlocal iskeyword+=#
  34
+
  35
+let &include='\(^\s*#INC.\{-}\(\sfile=\|:\)\)'
  36
+" let &include='\(^\s*#INC.\{-}\(\sfile=\|:\)\|\[\[\)'
  37
+" set includeexpr=substitute(v:fname,'\].*$','','')
  38
+
  39
+let &define='^\s*\(#Def.\{-}id=\|#\(Fn\|Footnote\).\{-}\(:\|id=\)\|#VAR.\{-}\s\)'
29 40
 
30 41
 fun! VikiFoldLevel(lnum)
31  
-    " let head = matchend(getline(a:lnum), '\V\^'. escape(b:vikiHeadingStart, '\') .'\ze\s\+')
32  
-    let head = matchend(getline(a:lnum), '\V\^'. b:vikiHeadingStart .'\+\ze\s\+')
33  
-    if head > 0
34  
-        if b:vikiInverseFold
35  
-            if b:vikiMaxFoldLevel > head
36  
-                return ">". (b:vikiMaxFoldLevel - head)
  42
+    if stridx(g:vikiFolds, 'h') >= 0
  43
+        let head = <SID>MatchHead(a:lnum)
  44
+        if head > 0
  45
+            if b:vikiInverseFold
  46
+                if b:vikiMaxFoldLevel > head
  47
+                    return ">". (b:vikiMaxFoldLevel - head)
  48
+                else
  49
+                    return ">0"
  50
+                end
37 51
             else
38  
-                return ">0"
39  
-            end
40  
-        else
41  
-            return ">". head
  52
+                return ">". head
  53
+            endif
42 54
         endif
43  
-    else
44  
-        " return foldlevel(a:lnum - 1)
45 55
         return "="
46 56
     endif
  57
+    return 0
47 58
 endfun
48 59
 
49  
-if !hasmapto(":VikiFind")
50  
-    nnoremap <buffer> <c-tab>   :VikiFindNext<cr>
51  
-    nnoremap <buffer> <c-s-tab> :VikiFindPrev<cr>
52  
-endif
  60
+fun! <SID>MatchHead(lnum)
  61
+    " let head = matchend(getline(a:lnum), '\V\^'. escape(b:vikiHeadingStart, '\') .'\ze\s\+')
  62
+    return matchend(getline(a:lnum), '\V\^'. b:vikiHeadingStart .'\+\ze\s\+')
  63
+endf
  64
+
  65
+" if !hasmapto(":VikiFind")
  66
+"     nnoremap <buffer> <c-tab>   :VikiFindNext<cr>
  67
+"     nnoremap <buffer> <LocalLeader>vn :VikiFindNext<cr>
  68
+"     nnoremap <buffer> <c-s-tab> :VikiFindPrev<cr>
  69
+"     nnoremap <buffer> <LocalLeader>vN :VikiFindPrev<cr>
  70
+" endif
53 71
 
54 72
 " compiler deplate
55 73
 
55  indent/viki.vim
@@ -3,14 +3,21 @@
3 3
 " @Website:     http://members.a1.net/t.link/
4 4
 " @License:     GPL (see http://www.gnu.org/licenses/gpl.txt)
5 5
 " @Created:     16-Jän-2004.
6  
-" @Last Change: 05-Feb-2005.
7  
-" @Revision: 0.189
  6
+" @Last Change: 01-Okt-2005.
  7
+" @Revision: 0.216
  8
+
  9
+if !g:vikiEnabled
  10
+    finish
  11
+endif
8 12
 
9 13
 if exists("b:did_indent") || exists("g:vikiNoIndent")
10 14
     finish
11 15
 endif
12 16
 let b:did_indent = 1
13 17
 
  18
+" Possible values: 'sw', '::'
  19
+if !exists("g:vikiIndentDesc") | let g:vikiIndentDesc = 'sw' | endif "{{{2
  20
+
14 21
 setlocal indentexpr=VikiGetIndent()
15 22
 setlocal indentkeys&
16 23
 setlocal indentkeys=0=#\ ,0=?\ ,0=<*>\ ,0=-\ ,0=+\ ,0=@\ ,=::\ ,!^F,o,O,e
@@ -35,12 +42,18 @@ fun! VikiGetIndent()
35 42
     
36 43
     let cnum  = v:lnum
37 44
     let cind  = indent(cnum)
  45
+    let cline = getline(cnum)
38 46
     
39 47
     " Do not change indentation in regions
40 48
     if VikiIsInRegion(cnum)
41 49
         return cind
42 50
     endif
43 51
     
  52
+    let cHeading = matchend(cline, '^\*\+\s\+')
  53
+    if cHeading >= 0
  54
+        return 0
  55
+    endif
  56
+        
44 57
     let pnum   = v:lnum - 1
45 58
     let pind   = indent(pnum)
46 59
     
@@ -49,21 +62,16 @@ fun! VikiGetIndent()
49 62
     
50 63
     if plCont >= 0
51 64
         let plHeading = matchend(pline, '^\*\+\s\+')
52  
-        if plHeading >= 0
53  
-            " echo "DBG continuation plHeading=". plHeading
54  
-            return plHeading
55  
-        else
56  
-            " echo "DBG continuation pind=". pind
  65
+        " if plHeading >= 0
  66
+        "     " echo "DBG continuation plHeading=". plHeading
  67
+        "     return plHeading
  68
+        " else
  69
+        "     " echo "DBG continuation pind=". pind
57 70
             return pind
58  
-        endif
  71
+        " endif
59 72
     end
60 73
     
61 74
     if cind > 0
62  
-        let listRx = '^\s\+\([-+*#?@]\|[0-9#]\+\.\|[a-zA-Z?]\.\)\s'
63  
-        let descRx = '^\s\+.\{-1,}\s::\s'
64  
-        
65  
-        let cline = getline(cnum) " current line
66  
-        
67 75
         " Do not change indentation of:
68 76
         "   - commented lines
69 77
         "   - headings
@@ -72,17 +80,26 @@ fun! VikiGetIndent()
72 80
             return ind
73 81
         endif
74 82
 
75  
-
  83
+        let markRx = '^\s\+\([#?!+]\)\1\{2,2}\s\+'
  84
+        let listRx = '^\s\+\([-+*#?@]\|[0-9#]\+\.\|[a-zA-Z?]\.\)\s\+'
  85
+        let descRx = '^\s\+.\{-1,}\s::\s\+'
  86
+        
  87
+        let clMark = matchend(cline, markRx)
76 88
         let clList = matchend(cline, listRx)
77 89
         let clDesc = matchend(cline, descRx)
78  
-        let cln    = clList >= 0 ? clList : clDesc
  90
+        " let cln    = clList >= 0 ? clList : clDesc
79 91
 
80  
-        if clList >= 0 || clDesc >= 0
  92
+        if clList >= 0 || clDesc >= 0 || clMark >= 0
81 93
             let spaceEnd = matchend(cline, '^\s\+')
82 94
             let rv = (spaceEnd / &sw) * &sw
83 95
             " echom "DBG clList=". clList ." clDesc=". clDesc
84 96
             return rv
85 97
         else
  98
+            let plMark = matchend(pline, markRx)
  99
+            if plMark >= 0
  100
+                return plMark
  101
+            endif
  102
+            
86 103
             let plList = matchend(pline, listRx)
87 104
             " echom "DBG plList=". plList ." plDesc=". plDesc
88 105
             if plList >= 0
@@ -93,7 +110,11 @@ fun! VikiGetIndent()
93 110
             let plDesc = matchend(pline, descRx)
94 111
             if plDesc >= 0
95 112
                 " echom "DBG plDesc ". pind + (&sw / 2)
96  
-                return pind + (&sw / 2)
  113
+                if plDesc >= 0 && g:vikiIndentDesc == '::'
  114
+                    return plDesc
  115
+                else
  116
+                    return pind + (&sw / 2)
  117
+                endif
97 118
             endif
98 119
 
99 120
             if cind < ind
466  plugin/viki.vim
@@ -2,8 +2,8 @@
2 2
 " @Author:      Thomas Link (samul AT web.de)
3 3
 " @License:     GPL (see http://www.gnu.org/licenses/gpl.txt)
4 4
 " @Created:     08-Dec-2003.
5  
-" @Last Change: 05-Feb-2005.
6  
-" @Revision: 1.6.1.4
  5
+" @Last Change: 01-Okt-2005.
  6
+" @Revision: 1.6.3.101
7 7
 "
8 8
 " vimscript #861
9 9
 "
@@ -22,17 +22,25 @@
22 22
 " - imaps.vim (vimscript #244 or #475 for |:VimQuote|)
23 23
 " - kpsewhich (not a vim plugin :-) for vikiLaTeX
24 24
 "
  25
+" TODO:
  26
+" - VikiRename: rename links/files
  27
+" - don't know how to deal with viki names that span several lines (e.g. 
  28
+"   in LaTeX mode)
  29
+"   
25 30
 " Change Log: (See bottom of file)
26 31
 " 
27 32
 
28 33
 if &cp || exists("loaded_viki") "{{{2
29 34
     finish
30 35
 endif
  36
+if !exists('loaded_multvals')
  37
+    runtime plugin/multvals.vim
  38
+endif
31 39
 if !exists("loaded_multvals") || loaded_multvals < 308
32 40
     echoerr "Viki.vim requires multvals.vim >= 308"
33 41
     finish
34 42
 endif
35  
-let loaded_viki = 105
  43
+let loaded_viki = 106
36 44
 
37 45
 let g:vikiDefNil  = ''
38 46
 let g:vikiDefSep  = "\n"
@@ -40,6 +48,8 @@ let g:vikiDefSep  = "\n"
40 48
 let s:vikiSelfEsc = '\'
41 49
 let g:vikiSelfRef = '.'
42 50
 
  51
+let g:vikiEnabled = 1
  52
+
43 53
 if !exists("tlist_viki_settings") "{{{2
44 54
     let tlist_viki_settings="deplate;s:structure"
45 55
 endif
@@ -53,7 +63,7 @@ if !exists("g:vikiUpperCharacters") "{{{2
53 63
 endif
54 64
 
55 65
 if !exists("g:vikiSpecialProtocols") "{{{2
56  
-    let g:vikiSpecialProtocols = 'https\?\|ftps\?\|nntp\|mailto\|mailbox'
  66
+    let g:vikiSpecialProtocols = 'https\?\|ftps\?\|nntp\|mailto\|mailbox\|file'
57 67
 endif
58 68
 
59 69
 if !exists("g:vikiSpecialProtocolsExceptions") "{{{2
@@ -62,7 +72,7 @@ endif
62 72
 
63 73
 if !exists("g:vikiSpecialFiles") "{{{2
64 74
     " try to put image suffixes first
65  
-    let g:vikiSpecialFiles = 'jpg\|gif\|bmp\|eps\|png\|jpeg\|wmf\|pdf\|ps\|dvi'
  75
+    let g:vikiSpecialFiles = 'jpg\|gif\|bmp\|eps\|png\|jpeg\|wmf\|pdf\|ps\|dvi\|doc\|xls\|html'
66 76
 endif
67 77
 
68 78
 if !exists("g:vikiSpecialFilesExceptions") "{{{2
@@ -99,30 +109,39 @@ if !exists("g:vikiMapKeys")          | let g:vikiMapKeys = ").,;:!?\"'" | endif
99 109
 if !exists("g:vikiFamily")           | let g:vikiFamily = ""            | endif "{{{2
100 110
 if !exists("g:vikiDirSeparator")     | let g:vikiDirSeparator = "/"     | endif "{{{2
101 111
 if !exists("g:vikiTextstylesVer")    | let g:vikiTextstylesVer = 2      | endif "{{{2
  112
+if !exists("g:vikiBasicSyntax")      | let g:vikiBasicSyntax = 0        | endif "{{{2
  113
+if !exists("g:vikiFolds")            | let g:vikiFolds = 'h'            | endif "{{{2
102 114
 
103 115
 if !exists("g:vikiMapFunctionality") "{{{2
104 116
     " f ... follow link
105 117
     " i ... check for inexistant
106 118
     " q ... quote
107 119
     " b ... go back
108  
-    let g:vikiMapFunctionality = "fiqb"
  120
+    let g:vikiMapFunctionality = "fiqbF"
109 121
 endif
110 122
 
111  
-if !exists("g:vikiOpenFileWith_ANY") && has("win32") "{{{2
112  
-    let g:vikiOpenFileWith_ANY = "silent !cmd /c start %{FILE}"
  123
+if !exists("g:vikiOpenFileWith_ANY") "{{{2
  124
+    if has("win32")
  125
+        let g:vikiOpenFileWith_ANY = "silent !cmd /c start %{FILE}"
  126
+    elseif $GNOME_DESKTOP_SESSION_ID != ""
  127
+        let g:vikiOpenFileWith_ANY = "silent !gnome-open %{FILE}"
  128
+    elseif $KDEDIR != ""
  129
+        let g:vikiOpenFileWith_ANY = "silent !kfmclient exec %{FILE}"
  130
+    endif
113 131
 endif
114 132
 
115 133
 if !exists("*VikiOpenSpecialFile") "{{{2
116 134
     fun! VikiOpenSpecialFile(file) "{{{3
117 135
         let proto = tolower(matchstr(a:file, '\c\.\zs[a-z]\+$'))
118  
-        let prot  = "g:vikiOpenFileWith_". proto
119  
-        let protp = exists(prot)
120  
-        if !protp
121  
-            let prot  = "g:vikiOpenFileWith_ANY"
122  
-            let protp = exists(prot)
  136
+        if exists("g:vikiOpenFileWith_". proto)
  137
+            let prot = g:vikiOpenFileWith_{proto}
  138
+        elseif exists('g:vikiOpenFileWith_ANY')
  139
+            let prot = g:vikiOpenFileWith_ANY
  140
+        else
  141
+            let prot = ''
123 142
         endif
124  
-        if protp
125  
-            exec 'let openFile = VikiSubstituteArgs('.prot.', "FILE", a:file)'
  143
+        if prot != ''
  144
+            let openFile = VikiSubstituteArgs(prot, "FILE", escape(a:file, ' '))
126 145
             exec openFile
127 146
         else
128 147
             throw "Viki: Please define g:vikiOpenFileWith_". proto ." or g:vikiOpenFileWith_ANY!"
@@ -133,7 +152,7 @@ endif
133 152
 if !exists("g:vikiOpenUrlWith_mailbox") "{{{2
134 153
     let g:vikiOpenUrlWith_mailbox="call VikiOpenMailbox('%{URL}')"
135 154
     fun! VikiOpenMailbox(url) "{{{3
136  
-        exec <SID>DecodeFileUrl(strpart(a:url, 10))
  155
+        exec VikiDecomposeUrl(strpart(a:url, 10))
137 156
         let idx = matchstr(args, 'number=\zs\d\+$')
138 157
         if filereadable(filename)
139 158
             call VikiOpenLink(filename, "", 0, "go ".idx)
@@ -143,10 +162,28 @@ if !exists("g:vikiOpenUrlWith_mailbox") "{{{2
143 162
     endfun
144 163
 endif
145 164
 
  165
+" Possible values: special*, query, normal
  166
+if !exists("g:vikiUrlFileAs") | let g:vikiUrlFileAs = 'special' | endif "{{{2
  167
+
146 168
 if !exists("g:vikiOpenUrlWith_file") "{{{2
147 169
     let g:vikiOpenUrlWith_file="call VikiOpenFileUrl('%{URL}')"
148 170
     fun! VikiOpenFileUrl(url) "{{{3
149  
-        exec <SID>DecodeFileUrl(strpart(a:url, 6))
  171
+        if VikiIsSpecialFile(a:url)
  172
+            if g:vikiUrlFileAs == 'special'
  173
+                let as_special = 1
  174
+            elseif g:vikiUrlFileAs == 'query'
  175
+                echo a:url
  176
+                let as_special = input('Treat URL as special file? (Y/n) ')
  177
+                let as_special = (as_special[0] !=? 'n')
  178
+            else
  179
+                let as_special = 0
  180
+            endif
  181
+            if as_special
  182
+                call VikiOpenSpecialFile(a:url)
  183
+                return
  184
+            endif
  185
+        endif
  186
+        exec VikiDecomposeUrl(strpart(a:url, 7))
150 187
         if filereadable(filename)
151 188
             call VikiOpenLink(filename, anchor)
152 189
         else
@@ -155,9 +192,13 @@ if !exists("g:vikiOpenUrlWith_file") "{{{2
155 192
     endfun
156 193
 endif
157 194
 
158  
-if !exists("g:vikiOpenUrlWith_ANY")
159  
-    if has("win32") "{{{2
  195
+if !exists("g:vikiOpenUrlWith_ANY") "{{{2
  196
+    if has("win32")
160 197
         let g:vikiOpenUrlWith_ANY = "silent !rundll32 url.dll,FileProtocolHandler %{URL}"
  198
+    elseif $GNOME_DESKTOP_SESSION_ID != ""
  199
+        let g:vikiOpenUrlWith_ANY = "silent !gnome-open %{URL}"
  200
+    elseif $KDEDIR != ""
  201
+        let g:vikiOpenUrlWith_ANY = "silent !kfmclient exec %{URL}"
161 202
     endif
162 203
 endif
163 204
 
@@ -210,7 +251,8 @@ command! VikiFindNext call VikiDispatchOnFamily("VikiFind", "")
210 251
 command! VikiFindPrev call VikiDispatchOnFamily("VikiFind", "b")
211 252
 
212 253
 fun! <SID>IsSupportedType(type)
213  
-    return stridx(b:vikiNameTypes, a:type) >= 0 
  254
+    " return stridx(b:vikiNameTypes, a:type) >= 0
  255
+    return b:vikiNameTypes =~# '['. a:type .']'
214 256
 endf
215 257
 
216 258
 fun! <SID>VikiRxFromCollection(coll)
@@ -329,7 +371,6 @@ fun! <SID>VikiMarkInexistent(line1, line2, ...)
329 371
         if b:vikiMarkInexistent == 1
330 372
             exe 'syntax clear '. b:vikiInexistentHighlight
331 373
             let rx = <SID>VikiRxFromCollection(b:vikiNamesNull)
332  
-            " call inputdialog("DBG: ". maxcol ." ". rx)
333 374
             if rx != ""
334 375
                 exe 'syntax match '. b:vikiInexistentHighlight .' /'. rx .'/'
335 376
             endif
@@ -355,17 +396,21 @@ command! VikiMarkInexistentInParagraph '{,'}VikiMarkInexistent
355 396
 command! VikiMarkInexistentInParagraphQuick exec "'{,'}VikiMarkInexistent -1 1"
356 397
 command! VikiMarkInexistentInLine .,.VikiMarkInexistent
357 398
 command! VikiMarkInexistentInLineQuick exec ".,.VikiMarkInexistent ". col(".") ." 1"
  399
+" command! VikiMarkInexistentInLineQuicker if &modified | exec ".,.VikiMarkInexistent ". col(".") ." 1" | endif
358 400
 
359 401
 fun! VikiCheckInexistent()
360  
-    if &ft == "viki" && g:vikiMarkInexistent && exists("b:vikiCheckInexistent") && b:vikiCheckInexistent > 0
361  
-        " echom "DBG VikiCheckInexistent() co=". virtcol(".") ." li=". line(".") ." b:vikiCheckInexistent=".b:vikiCheckInexistent 
  402
+    if g:vikiEnabled && &ft == "viki" && g:vikiMarkInexistent && exists("b:vikiCheckInexistent") && b:vikiCheckInexistent > 0
  403
+        " call inputdialog('b:vikiCheckInexistent: '. b:vikiCheckInexistent)
362 404
         call <SID>VikiMarkInexistent(b:vikiCheckInexistent, b:vikiCheckInexistent)
363 405
         " VikiMarkInexistent
364 406
         " VikiMarkInexistentInParagraph
365 407
     endif
366 408
 endfun
367 409
 
  410
+" autocmd VimLeavePre * let g:vikiMarkInexistent = 0
  411
+autocmd VimLeavePre * let g:vikiEnabled = 0
368 412
 autocmd BufWinEnter * call VikiCheckInexistent()
  413
+" autocmd CursorHold * if &ft == 'viki' && g:vikiMarkInexistent | VikiMarkInexistentInLineQuicker | endif
369 414
 
370 415
 fun! VikiSetBufferVar(name, ...) "{{{3
371 416
     if !exists("b:".a:name)
@@ -422,6 +467,10 @@ fun! VikiDispatchOnFamily(fn, ...) "{{{3
422 467
 endfun
423 468
 
424 469
 fun! VikiSetupBuffer(state, ...) "{{{3
  470
+    if !g:vikiEnabled
  471
+        return
  472
+    endif
  473
+
425 474
     let dontSetup = a:0 > 0 ? a:1 : ""
426 475
     " let noMatch = '\%0l' "match nothing
427 476
     let noMatch = ""
@@ -429,6 +478,9 @@ fun! VikiSetupBuffer(state, ...) "{{{3
429 478
     if exists("b:vikiNoSimpleNames") && b:vikiNoSimpleNames
430 479
         let b:vikiNameTypes = substitute(b:vikiNameTypes, '\Cs', '', 'g')
431 480
     endif
  481
+    if exists("b:vikiDisableType") && b:vikiDisableType != ""
  482
+        let b:vikiNameTypes = substitute(b:vikiNameTypes, '\C'. b:vikiDisableType, '', 'g')
  483
+    endif
432 484
 
433 485
     call VikiSetBufferVar("vikiAnchorMarker")
434 486
     call VikiSetBufferVar("vikiSpecialProtocols")
@@ -455,15 +507,15 @@ fun! VikiSetupBuffer(state, ...) "{{{3
455 507
     let b:vikiAnchorNameRx         = '['. g:vikiLowerCharacters .']['. 
456 508
                 \ g:vikiLowerCharacters . g:vikiUpperCharacters .'_0-9]\+'
457 509
     
458  
-    if b:vikiNameTypes =~? "s" && !(dontSetup =~? "s")
459  
-        if b:vikiNameTypes =~# "S" && !(dontSetup =~# "S")
  510
+    if <SID>IsSupportedType("sSc") && !(dontSetup =~? "s")
  511
+        if <SID>IsSupportedType("S") && !(dontSetup =~# "S")
460 512
             let quotedVikiName = b:vikiSimpleNameQuoteBeg 
461 513
                         \ .'['. b:vikiSimpleNameQuoteChars .']'
462 514
                         \ .'\{-}'. b:vikiSimpleNameQuoteEnd
463 515
         else
464 516
             let quotedVikiName = ""
465 517
         endif
466  
-        if b:vikiNameTypes =~# "s" && !(dontSetup =~# "s")
  518
+        if <SID>IsSupportedType("c") && !(dontSetup =~# "c")
467 519
             let simpleWikiName = '\<['. g:vikiUpperCharacters .']['. g:vikiLowerCharacters
468 520
                         \ .']\+\(['. g:vikiUpperCharacters.']['.g:vikiLowerCharacters
469 521
                         \ .'0-9]\+\)\+\>'
@@ -494,12 +546,12 @@ fun! VikiSetupBuffer(state, ...) "{{{3
494 546
         let b:vikiSimpleNameAnchorIdx = 0
495 547
     endif
496 548
    
497  
-    if b:vikiNameTypes =~# "u" && !(dontSetup =~# "u")
498  
-        let urlChars = 'A-Za-z0-9.:%?=&_~@$/|-'
  549
+    if <SID>IsSupportedType("u") && !(dontSetup =~# "u")
  550
+        let urlChars = 'A-Za-z0-9.,:%?=&_~@$/|+-'
499 551
         let b:vikiUrlRx = '\<\(\('.b:vikiSpecialProtocols.'\):['. urlChars .']\+\)'.
500  
-                    \ '\(#\([A-Za-z0-9]\+\)\>\)\?'
  552
+                    \ '\(#\([A-Za-z0-9]*\)\)\?'
501 553
         let b:vikiUrlSimpleRx = '\<\('. b:vikiSpecialProtocols .'\):['. urlChars .']\+'.
502  
-                    \ '\(#[A-Za-z0-9]\+\>\)\?'
  554
+                    \ '\(#[A-Za-z0-9]*\)\?'
503 555
         let b:vikiUrlNameIdx   = 0
504 556
         let b:vikiUrlDestIdx   = 1
505 557
         let b:vikiUrlAnchorIdx = 4
@@ -515,7 +567,7 @@ fun! VikiSetupBuffer(state, ...) "{{{3
515 567
         let b:vikiUrlAnchorIdx = 0
516 568
     endif
517 569
    
518  
-    if b:vikiNameTypes =~# "x" && !(dontSetup =~# "x")
  570
+    if <SID>IsSupportedType("x") && !(dontSetup =~# "x")
519 571
         let b:vikiCmdRx        = '\({\S\+\|#['. g:vikiUpperCharacters .']\w*\)\(.\{-}\):\s*\(.\{-}\)\($\|}\)'
520 572
         let b:vikiCmdSimpleRx  = '\({\S\+\|#['. g:vikiUpperCharacters .']\w*\).\{-}\($\|}\)'
521 573
         let b:vikiCmdNameIdx   = 1
@@ -533,11 +585,11 @@ fun! VikiSetupBuffer(state, ...) "{{{3
533 585
         let b:vikiCmdAnchorIdx = 0
534 586
     endif
535 587
     
536  
-    if b:vikiNameTypes =~# "e" && !(dontSetup =~# "e")
  588
+    if <SID>IsSupportedType("e") && !(dontSetup =~# "e")
537 589
         let b:vikiExtendedNameRx = '\[\[\(\('.b:vikiSpecialProtocols.'\)://[^]]\+\|[^]#]\+\)\?'.
538  
-                    \ '\(#\('. b:vikiAnchorNameRx .'\)\)\?\]\(\[\([^]]\+\)\]\)\?[!~\-]*\]'
  590
+                    \ '\(#\('. b:vikiAnchorNameRx .'\)\)\?\]\(\[\([^]]\+\)\]\)\?[!~*\-]*\]'
539 591
         let b:vikiExtendedNameSimpleRx = '\[\[\('. b:vikiSpecialProtocols .'://[^]]\+\|[^]#]\+\)\?'.
540  
-                    \ '\(#'. b:vikiAnchorNameRx .'\)\?\]\(\[[^]]\+\]\)\?[!~\-]*\]'
  592
+                    \ '\(#'. b:vikiAnchorNameRx .'\)\?\]\(\[[^]]\+\]\)\?[!~*\-]*\]'
541 593
         let b:vikiExtendedNameNameIdx   = 6
542 594
         let b:vikiExtendedNameDestIdx   = 1
543 595
         let b:vikiExtendedNameAnchorIdx = 4
@@ -557,13 +609,13 @@ fun! VikiSetupBuffer(state, ...) "{{{3
557 609
 endfun
558 610
 
559 611
 fun! VikiDefineMarkup(state) "{{{3
560  
-    if b:vikiNameTypes =~? "s" && b:vikiSimpleNameRx != ""
  612
+    if <SID>IsSupportedType("sS") && b:vikiSimpleNameRx != ""
561 613
         exe "syntax match vikiLink /" . b:vikiSimpleNameRx . "/"
562 614
     endif
563  
-    if b:vikiNameTypes =~# "e" && b:vikiExtendedNameRx != ""
564  
-        exe "syntax match vikiExtendedLink '" . b:vikiExtendedNameRx . "'"
  615
+    if <SID>IsSupportedType("e") && b:vikiExtendedNameRx != ""
  616
+        exe "syntax match vikiExtendedLink '" . b:vikiExtendedNameRx . "' skipnl"
565 617
     endif
566  
-    if b:vikiNameTypes =~# "u" && b:vikiUrlRx != ""
  618
+    if <SID>IsSupportedType("u") && b:vikiUrlRx != ""
567 619
         exe "syntax match vikiURL /" . b:vikiUrlRx . "/"
568 620
     endif
569 621
 endfun
@@ -580,17 +632,17 @@ fun! VikiDefineHighlighting(state) "{{{3
580 632
     exe "hi vikiHyperLink term=bold,underline cterm=bold,underline gui=bold,underline". 
581 633
                 \ " ctermbg=". g:vikiHyperLinkColor ." guifg=". g:vikiHyperLinkColor
582 634
 
583  
-    if b:vikiNameTypes =~? "s"
  635
+    if <SID>IsSupportedType("sS")
584 636
         VikiHiLink vikiLink vikiHyperLink
585 637
         VikiHiLink vikiOkLink vikiHyperLink
586 638
         VikiHiLink vikiRevLink Normal
587 639
     endif
588  
-    if b:vikiNameTypes =~# "e"
  640
+    if <SID>IsSupportedType("e")
589 641
         VikiHiLink vikiExtendedLink vikiHyperLink
590 642
         VikiHiLink vikiExtendedOkLink vikiHyperLink
591 643
         VikiHiLink vikiRevExtendedLink Normal
592 644
     endif
593  
-    if b:vikiNameTypes =~# "u"
  645
+    if <SID>IsSupportedType("u")
594 646
         VikiHiLink vikiURL vikiHyperLink
595 647
     endif
596 648
     delcommand VikiHiLink
@@ -614,7 +666,7 @@ fun! VikiMapKeys(state)
614 666
     else
615 667
         let mf = g:vikiMapFunctionality
616 668
     endif
617  
-    if mf =~ 'f' && !hasmapto("VikiMaybeFollowLink")
  669
+    if mf =~# 'f' && !hasmapto("VikiMaybeFollowLink")
618 670
         "nnoremap <buffer> <c-cr> "=VikiMaybeFollowLink("",1)<cr>p
619 671
         "inoremap <buffer> <c-cr> <c-r>=VikiMaybeFollowLink("",1)<cr>
620 672
         "nmap <buffer> <c-cr> "=VikiMaybeFollowLink(1,1)<cr>p
@@ -625,6 +677,7 @@ fun! VikiMapKeys(state)
625 677
         "inoremap <buffer> <c-cr> <c-r>=VikiMaybeFollowLink(0)<cr>
626 678
         nnoremap <buffer> <silent> <c-cr> :call VikiMaybeFollowLink(0,1)<cr>
627 679
         inoremap <buffer> <silent> <c-cr> <c-o>:call VikiMaybeFollowLink(0,1)<cr>
  680
+        nnoremap <buffer> <silent> <LocalLeader>vf :call VikiMaybeFollowLink(0,1)<cr>
628 681
         nnoremap <buffer> <silent> <LocalLeader><c-cr> :call VikiMaybeFollowLink(0,1,-1)<cr>
629 682
         nnoremap <buffer> <silent> <LocalLeader>vs :call VikiMaybeFollowLink(0,1,-1)<cr>
630 683
         nnoremap <buffer> <silent> <LocalLeader>vv :call VikiMaybeFollowLink(0,1,-2)<cr>
@@ -639,7 +692,7 @@ fun! VikiMapKeys(state)
639 692
         "nnoremap <buffer> <s-c-cr> :call VikiMaybeFollowLink(0,1)<cr>
640 693
         "inoremap <buffer> <s-c-cr> <c-o><c-cr>
641 694
     endif
642  
-    if mf =~ 'i' && !hasmapto("VikiMarkInexistent")
  695
+    if mf =~# 'i' && !hasmapto("VikiMarkInexistent")
643 696
         noremap <buffer> <silent> <LocalLeader>vd :VikiMarkInexistent<cr>
644 697
         noremap <buffer> <silent> <LocalLeader>vp :VikiMarkInexistentInParagraph<cr>
645 698
         if g:vikiMapInexistent
@@ -656,21 +709,31 @@ fun! VikiMapKeys(state)
656 709
             " call <SID>MapMarkInexistent("<cr>", "Paragraph", "
", 0)
657 710
         endif
658 711
     endif
659  
-    if mf =~ 'q' && !hasmapto("VikiQuote") && exists("*VEnclose")
  712
+    if mf =~# 'q' && !hasmapto("VikiQuote") && exists("*VEnclose")
660 713
         vnoremap <buffer> <silent> <LocalLeader>vq :VikiQuote<cr><esc>:VikiMarkInexistentInLineQuick<cr>
661 714
         nnoremap <buffer> <silent> <LocalLeader>vq viw:VikiQuote<cr><esc>:VikiMarkInexistentInLineQuick<cr>
  715
+        inoremap <buffer> <silent> <LocalLeader>vq <esc>viw:VikiQuote<cr><esc>:VikiMarkInexistentInLineQuick<cr>i
662 716
     endif
663  
-    if mf =~ 'b' && !hasmapto("VikiGoBack")
  717
+    if mf =~# 'b' && !hasmapto("VikiGoBack")
664 718
         nnoremap <buffer> <silent> <LocalLeader>vb :call VikiGoBack()<cr>
665 719
         if g:vikiMapMouse
666 720
             nnoremap <buffer> <silent> <m-rightmouse> <leftmouse>:call VikiGoBack(0)<cr>
667 721
             inoremap <buffer> <silent> <m-rightmouse> <leftmouse><c-o>:call VikiGoBack(0)<cr>
668 722
         endif
669 723
     endif
  724
+    if mf =~# 'F' && !hasmapto(":VikiFind")
  725
+        nnoremap <buffer> <silent> <c-tab>   :VikiFindNext<cr>
  726
+        nnoremap <buffer> <silent> <LocalLeader>vn :VikiFindNext<cr>
  727
+        nnoremap <buffer> <silent> <c-s-tab> :VikiFindPrev<cr>
  728
+        nnoremap <buffer> <silent> <LocalLeader>vN :VikiFindPrev<cr>
  729
+    endif
670 730
 endf
671 731
 
672 732
 "state ... 0,  +/-1, +/-2
673 733
 fun! VikiMinorMode(state) "{{{3
  734
+    if !g:vikiEnabled
  735
+        return 0
  736
+    endif
674 737
     if exists("b:vikiEnabled") && b:vikiEnabled
675 738
         if a:state == 0
676 739
             throw "Viki can't be disabled (not yet)."
@@ -951,7 +1014,7 @@ fun! <SID>HowManyWindows()
951 1014
     return i - 1
952 1015
 endf
953 1016
 
954  
-fun! <SID>DecodeFileUrl(dest) "{{{3
  1017
+fun! VikiDecomposeUrl(dest) "{{{3
955 1018
     let dest = substitute(a:dest, '^\c/*\([a-z]\)|', '\1:', "")
956 1019
     let rv = ""
957 1020
     let i  = 0
@@ -987,6 +1050,13 @@ fun! <SID>GetSpecialFilesSuffixes() "{{{3
987 1050
     endif
988 1051
 endf
989 1052
 
  1053
+fun! VikiIsSpecialFile(dest) "{{{3
  1054
+    let vikiSpecialFiles = <SID>GetSpecialFilesSuffixes()
  1055
+    return (a:dest =~ '\.\('. vikiSpecialFiles .'\)$' &&
  1056
+                \ (g:vikiSpecialFilesExceptions == "" ||
  1057
+                \ !(a:dest =~ g:vikiSpecialFilesExceptions)))
  1058
+endf
  1059
+
990 1060
 fun! <SID>VikiFollowLink(def, ...) "{{{3
991 1061
     let winNr  = a:0 >= 1 ? a:1 : 0
992 1062
     let name   = MvElementAt(a:def, g:vikiDefSep, 0)
@@ -1002,10 +1072,7 @@ fun! <SID>VikiFollowLink(def, ...) "{{{3
1002 1072
                     \ !(dest =~ b:vikiSpecialProtocolsExceptions))
1003 1073
             call VikiOpenSpecialProtocol(dest)
1004 1074
         else
1005  
-            let vikiSpecialFiles = <SID>GetSpecialFilesSuffixes()
1006  
-            if dest =~ '\.\('. vikiSpecialFiles .'\)$' &&
1007  
-                        \ (g:vikiSpecialFilesExceptions == "" ||
1008  
-                        \ !(dest =~ g:vikiSpecialFilesExceptions))
  1075
+            if VikiIsSpecialFile(dest)
1009 1076
                 call VikiOpenSpecialFile(dest)
1010 1077
             elseif filereadable(dest)                 "reference to a local, already existing file
1011 1078
                 call VikiOpenLink(dest, anchor, 0, "", winNr)
@@ -1017,7 +1084,7 @@ fun! <SID>VikiFollowLink(def, ...) "{{{3
1017 1084
                 let ok = input("File doesn't exists. Create '".dest."'? (Y/n) ", "y")
1018 1085
                 if ok != "" && ok != "n"
1019 1086
                     let b:vikiCheckInexistent = line(".")
1020  
-                    call VikiOpenLink(dest, anchor, 1)
  1087
+                    call VikiOpenLink(dest, anchor, 1, '', winNr)
1021 1088
                 endif
1022 1089
             endif
1023 1090
         endif
@@ -1065,7 +1132,7 @@ fun! VikiLinkDefinition(txt, col, compound, ignoreSyntax) "{{{3
1065 1132
     if erx != ""
1066 1133
         let ebeg = -1
1067 1134
         let cont = match(a:txt, erx, 0)
1068  
-        while (0 <= cont) && (cont <= a:col)
  1135
+        while (ebeg >= 0 || (0 <= cont) && (cont <= a:col))
1069 1136
             let contn = matchend(a:txt, erx, cont)
1070 1137
             if (cont <= a:col) && (a:col < contn)
1071 1138
                 let ebeg = match(a:txt, erx, cont)
@@ -1124,7 +1191,7 @@ fun! VikiCompleteSimpleNameDef(def) "{{{3
1124 1191
     endif
1125 1192
     
1126 1193
     let useSuffix = g:vikiDefSep
1127  
-    if b:vikiNameTypes =~# "i" && name =~# s:InterVikiRx
  1194
+    if <SID>IsSupportedType("i") && name =~# s:InterVikiRx
1128 1195
         let ow = substitute(name, s:InterVikiRx, '\1', "")
1129 1196
         exec <SID>VikiLetVar("dest", "vikiInter".ow)
1130 1197
         if exists("dest")
@@ -1138,13 +1205,13 @@ fun! VikiCompleteSimpleNameDef(def) "{{{3
1138 1205
         let dest = expand("%:p:h")
1139 1206
     endif
1140 1207
 
1141  
-    if b:vikiNameTypes =~# "S"
  1208
+    if <SID>IsSupportedType("S")
1142 1209
         if name =~ b:vikiQuotedSelfRef
1143 1210
             let name  = g:vikiSelfRef
1144 1211
         elseif name =~ b:vikiQuotedRef
1145 1212
             let name = matchstr(name, "^". b:vikiSimpleNameQuoteBeg .'\zs.\+\ze'. b:vikiSimpleNameQuoteEnd ."$")
1146 1213
         endif
1147  
-    elseif !(b:vikiNameTypes =~# "c")
  1214
+    elseif !<SID>IsSupportedType("c")
1148 1215
         throw "Viki: CamelCase names not allowed"
1149 1216
     endif
1150 1217
     
@@ -1274,7 +1341,7 @@ fun! VikiGetLink(oldmap, ignoreSyntax, ...) "{{{3
1274 1341
         let txt = getline(".")
1275 1342
         let col = col(".") - 1
1276 1343
     endif
1277  
-    if (tryAll || vikiType == 1) && stridx(b:vikiNameTypes, "s") >= 0
  1344
+    if (tryAll || vikiType == 1) && <SID>IsSupportedType("s")
1278 1345
         if exists("b:getVikiLink")
1279 1346
             exe "let def = " . b:getVikiLink."()"
1280 1347
         else
@@ -1284,7 +1351,7 @@ fun! VikiGetLink(oldmap, ignoreSyntax, ...) "{{{3
1284 1351
             return VikiDispatchOnFamily("VikiCompleteSimpleNameDef", def)
1285 1352
         endif
1286 1353
     endif
1287  
-    if (tryAll || vikiType == 2) && stridx(b:vikiNameTypes, "e") >= 0
  1354
+    if (tryAll || vikiType == 2) && <SID>IsSupportedType("e")
1288 1355
         if exists("b:getExtVikiLink")
1289 1356
             exe "let def = " . b:getExtVikiLink."()"
1290 1357
         else
@@ -1294,7 +1361,7 @@ fun! VikiGetLink(oldmap, ignoreSyntax, ...) "{{{3
1294 1361
             return VikiDispatchOnFamily("VikiCompleteExtendedNameDef", def)
1295 1362
         endif
1296 1363
     endif
1297  
-    if (tryAll || vikiType == 3) && stridx(b:vikiNameTypes, "u") >= 0
  1364
+    if (tryAll || vikiType == 3) && <SID>IsSupportedType("u")
1298 1365
         if exists("b:getURLViki")
1299 1366
             exe "let def = " . b:getURLViki . "()"
1300 1367
         else
@@ -1304,7 +1371,7 @@ fun! VikiGetLink(oldmap, ignoreSyntax, ...) "{{{3
1304 1371
             return VikiDispatchOnFamily("VikiCompleteExtendedNameDef", def)
1305 1372
         endif
1306 1373
     endif
1307  
-    if (tryAll || vikiType == 4) && stridx(b:vikiNameTypes, "x") >= 0
  1374
+    if (tryAll || vikiType == 4) && <SID>IsSupportedType("x")
1308 1375
         if exists("b:getCmdViki")
1309 1376
             exe "let def = " . b:getCmdViki . "()"
1310 1377
         else
@@ -1327,6 +1394,7 @@ fun! VikiMaybeFollowLink(oldmap, ignoreSyntax, ...) "{{{3
1327 1394
         return <SID>VikiLinkNotFoundEtc(a:oldmap, a:ignoreSyntax)
1328 1395
     endif
1329 1396
 endfun
  1397
+command! VikiJump call VikiMaybeFollowLink(0,1)
1330 1398
 
1331 1399
 fun! VikiEdit(name, ...) "{{{3
1332 1400
     let winNr = a:0 >= 1 ? a:1 : 0
@@ -1346,105 +1414,98 @@ endfun
1346 1414
 
1347 1415
 command! -nargs=1 VikiEdit :call VikiEdit(<q-args>)
1348 1416
 
  1417
+finish "{{{1
  1418
+_____________________________________________________________________________________
1349 1419
 
1350  
-"""" Any Word {{{1
1351  
-fun! VikiMinorModeAnyWord (state) "{{{3
1352  
-    let b:vikiFamily = "AnyWord"
1353  
-    call VikiMinorMode(a:state)
1354  
-endfun
1355  
-command! VikiMinorModeAnyWord call VikiMinorModeAnyWord(1)
1356  
-command! VikiMinorModeMaybeAnyWord call VikiMinorModeAnyWord(-1)
1357  
-
1358  
-fun! VikiSetupBufferAnyWord(state, ...) "{{{3
1359  
-    let dontSetup = a:0 > 0 ? a:1 : ""
1360  
-    call VikiSetupBuffer(a:state, dontSetup)
1361  
-    if b:vikiNameTypes =~? "s" && !(dontSetup =~? "s")
1362  
-        if b:vikiNameTypes =~# "S" && !(dontSetup =~# "S")
1363  
-            let simpleWikiName = b:vikiSimpleNameQuoteBeg
1364  
-                        \ .'['. b:vikiSimpleNameQuoteChars .']'
1365  
-                        \ .'\{-}'. b:vikiSimpleNameQuoteEnd
1366  
-        else
1367  
-            let simpleWikiName = ""
1368  
-        endif
1369  
-        if b:vikiNameTypes =~# "s" && !(dontSetup =~# "s")
1370  
-            let simple = '\<['. g:vikiUpperCharacters .']['. g:vikiLowerCharacters
1371  
-                        \ .']\+\(['. g:vikiUpperCharacters.']['.g:vikiLowerCharacters
1372  
-                        \ .'0-9]\+\)\+\>'
1373  
-            if simpleWikiName != ""
1374  
-                let simpleWikiName = simpleWikiName .'\|'. simple
1375  
-            else
1376  
-                let simpleWikiName = simple
1377  
-            endif
1378  
-        endif
1379  
-        let anyword = '\<['. b:vikiSimpleNameQuoteChars .' ]\+\>'
1380  
-        if simpleWikiName != ""
1381  
-            let simpleWikiName = simpleWikiName .'\|'. anyword
1382  
-        else
1383  
-            let simpleWikiName = anyword
1384  
-        endif
1385  
-        let b:vikiSimpleNameRx = '\C\(\(\<['. g:vikiUpperCharacters .']\+::\)\?'
1386  
-                    \ .'\('. simpleWikiName .'\)\)'
1387  
-                    \ .'\(#\('. b:vikiAnchorNameRx .'\)\>\)\?'
1388  
-        let b:vikiSimpleNameSimpleRx = '\C\(\<['.g:vikiUpperCharacters.']\+::\)\?'
1389  
-                    \ .'\('. simpleWikiName .'\)'
1390  
-                    \ .'\(#'. b:vikiAnchorNameRx .'\>\)\?'
1391  
-        let b:vikiSimpleNameNameIdx   = 1
1392  
-        let b:vikiSimpleNameDestIdx   = 0
1393  
-        let b:vikiSimpleNameAnchorIdx = 6
1394  
-        let b:vikiSimpleNameCompound = 'let erx="'. escape(b:vikiSimpleNameRx, '\"')
1395  
-                    \ .'" | let nameIdx='. b:vikiSimpleNameNameIdx
1396  
-                    \ .' | let destIdx='. b:vikiSimpleNameDestIdx
1397  
-                    \ .' | let anchorIdx='. b:vikiSimpleNameAnchorIdx
1398  
-    endif
1399  
-    let b:vikiInexistentHighlight = "vikiAnyWordInexistentLink"
1400  
-    let b:vikiMarkInexistent = 2
1401  
-endf
1402  
-
1403  
-fun! VikiDefineMarkupAnyWord(state) "{{{3
1404  
-    if b:vikiNameTypes =~? "s" && b:vikiSimpleNameRx != ""
1405  
-        exe "syn match vikiRevLink /" . b:vikiSimpleNameRx . "/"
1406  
-    endif
1407  
-    if b:vikiNameTypes =~# "e" && b:vikiExtendedNameRx != ""
1408  
-        exe "syn match vikiRevExtendedLink '" . b:vikiExtendedNameRx . "'"
1409  
-    endif
1410  
-    if b:vikiNameTypes =~# "u" && b:vikiUrlRx != ""
1411  
-        exe "syn match vikiURL /" . b:vikiUrlRx . "/"
1412  
-    endif
1413  
-endfun
  1420
+* Change Log
  1421
+1.0
  1422
+- Extended names: For compatibility reasons with other wikis, the anchor is 
  1423
+now in the reference part.
  1424
+- For compatibility reasons with other wikis, prepending an anchor with 
  1425
+b:commentStart is optional.
  1426
+- g:vikiUseParentSuffix
  1427
+- Renamed variables & functions (basically s/Wiki/Viki/g)
  1428
+- added a ftplugin stub, moved the description to a help file
  1429
+- "[--]" is reference to current file
  1430
+- Folding support (at section level)
  1431
+- Intervikis
  1432
+- More highlighting
  1433
+- g:vikiFamily, b:vikiFamily
  1434
+- VikiGoBack() (persistent history data)
  1435
+- rudimentary LaTeX support ("soft" viki names)
1414 1436
 
1415  
-fun! VikiDefineHighlightingAnyWord(state, ...) "{{{3
1416  
-    let dontSetup = a:0 > 0 ? a:1 : ""
1417  
-    call VikiDefineHighlighting(a:state)
  1437
+1.1
  1438
+- g:vikiExplorer (for viewing directories)
  1439
+- preliminary support for "soft" anchors (b:vikiAnchorRx)
  1440
+- improved VikiOpenSpecialProtocol(url); g:vikiOpenUrlWith_{PROTOCOL}, 
  1441
+g:vikiOpenUrlWith_ANY
  1442
+- improved VikiOpenSpecialFile(file); g:vikiOpenFileWith_{SUFFIX}, 
  1443
+g:vikiOpenFileWith_ANY
  1444
+- anchors may contain upper characters (but must begin with a lower char)
  1445
+- some support for Mozilla ThunderBird mailbox-URLs (this requires spaces to 
  1446
+be encoded as %20)
  1447
+- changed g:vikiDefSep to '‡‡‡'
1418 1448
 
1419  
-    if version < 508
1420  
-        command! -nargs=+ VikiHiLink hi link <args>
1421  
-    else
1422  
-        command! -nargs=+ VikiHiLink hi def link <args>
1423  
-    endif
1424  
-    exec "VikiHiLink ". b:vikiInexistentHighlight ." Normal"
1425  
-    delcommand VikiHiLink
1426  
-endf
  1449
+1.2
  1450
+- syntax file: fix nested regexp problem
  1451
+- deplate: conversion to html/latex; download from 
  1452
+http://sourceforge.net/projects/deplate/
  1453
+- made syntax a little bit more restrictive (*WORD* now matches /\*\w+\*/ 
  1454
+instead of /\*\S+\*/)
  1455
+- interviki definitions can now be buffer local variables, too
  1456
+- fixed <SID>DecodeFileUrl(dest)
  1457
+- some kind of compiler plugin (uses deplate)
  1458
+- removed g/b:vikiMarkupEndsWithNewline variable
  1459
+- saved all files in unix format (thanks to Grant Bowman for the hint)
  1460
+- removed international characters from g:vikiLowerCharacters and 
  1461
+g:vikiUpperCharacters because of difficulties with different encodings (thanks 
  1462
+to Grant Bowman for pointing out this problem); non-english-speaking users have 
  1463
+to set these variables in their vimrc file
1427 1464
 
1428  
-fun! VikiFindAnyWord(flag) "{{{3
1429  
-    let rx = <SID>VikiRxFromCollection(b:vikiNamesOk)
1430  
-    if rx != ""
1431  
-        call search(rx, a:flag)
1432  
-    endif
1433  
-endfun
  1465
+1.3
  1466
+- basic ctags support (see |viki-tags|)
  1467
+- mini-ftplugin for bibtex files (use record labels as anchors)
  1468
+- added mapping <LocalLeader><c-cr>: follow link in other window (if any)
  1469
+- disabled the highlighting of italic char styles (i.e., /text/)
  1470
+- the ftplugin doesn't set deplate as the compiler; renamed the compiler plugin to deplate
  1471
+- syntax: sync minlines=50
  1472
+- fix: VikiFoldLevel()
1434 1473
 
  1474
+1.3.1
  1475
+- fixed bug when VikiBack was called without a definitiv back-reference
  1476
+- fixed problems with latin-1 characters
1435 1477
 
1436  
-finish "{{{1
1437  
-_____________________________________________________________________________________
  1478
+1.4
  1479
+- fixed problem with table highlighting that could cause vim to hang
  1480
+- it is now possible to selectivly disable simple or quoted viki names
  1481
+- indent plugin
1438 1482
 
1439  
-* To Do
1440  
-- don't know how to deal with viki names that span several lines
1441  
-- ...
  1483
+1.5
  1484
+- distinguish between links to existing and non-existing files
  1485
+- added key bindings <LL>vs (split) and <LL>vv (split vertically)
  1486
+- added key bindings <LL>v1 through to <LL>v4: open the viki link under cursor 
  1487
+in the windows 1 to 4
  1488
+- handle variables g:vikiSplit, b:vikiSplit
  1489
+- don't indent regions
  1490
+- regions can be indented
  1491
+- When a file doesn't exist, ESC or "n" aborts creation
1442 1492
 
  1493
+1.5.1
  1494
+- depends on multvals >= 3.8.0
  1495
+- new viki family "AnyWord" (see |viki-any-word|), which turns any word into a 
  1496
+potential viki link
  1497
+- <LocalLeader>vq, VikiQuote: mark selected text as a quoted viki name 
  1498
+(requires imaps.vim, vimscript #244 or vimscript #475)
  1499
+- check for null links when pressing <space>, <cr>, ], and some other keys 
  1500
+(defined in g:vikiMapKeys)
  1501
+- a global suffix for viki files can be defined by g:vikiNameSuffix
  1502
+- fix syntax problem when checking for links to inexistent files
1443 1503
 
1444  
-* Change Log
1445  
-1.6.1
1446  
-- removed forgotten debug message
1447  
-- fixed indentation bug
  1504
+1.5.2
  1505
+- changed default markup of textstyles: __emphasize__, ''code''; the 
  1506
+previous markup can be re-enabled by setting g:vikiTextstylesVer to 1)
  1507
+- fixed problem with VikiQuote
  1508
+- on follow link check for yet unsaved buffers too
1448 1509
 
1449 1510
 1.6
1450 1511
 - b:vikiInverseFold: Inverse folding of subsections
@@ -1462,93 +1523,26 @@ integrate viki with other plugins
1462 1523
 - fixed typo in b:VikiEnabled, which should be b:vikiEnabled (thanks to Ned 
1463 1524
 Konz)
1464 1525
 
1465  
-1.5.2
1466  
-- changed default markup of textstyles: __emphasize__, ''code''; the 
1467  
-previous markup can be re-enabled by setting g:vikiTextstylesVer to 1)
1468  
-- fixed problem with VikiQuote
1469  
-- on follow link check for yet unsaved buffers too
1470  
-
1471  
-1.5.1
1472  
-- depends on multvals >= 3.8.0
1473  
-- new viki family "AnyWord" (see |viki-any-word|), which turns any word into a 
1474  
-potential viki link
1475  
-- <LocalLeader>vq, VikiQuote: mark selected text as a quoted viki name 
1476  
-(requires imaps.vim, vimscript #244 or vimscript #475)
1477  
-- check for null links when pressing <space>, <cr>, ], and some other keys 
1478  
-(defined in g:vikiMapKeys)
1479  
-- a global suffix for viki files can be defined by g:vikiNameSuffix
1480  
-- fix syntax problem when checking for links to inexistent files
1481  
-
1482  
-1.5
1483  
-- distinguish between links to existing and non-existing files
1484  
-- added key bindings <LL>vs (split) and <LL>vv (split vertically)
1485  
-- added key bindings <LL>v1 through to <LL>v4: open the viki link 
1486  
-under cursor in the windows 1 to 4
1487  
-- handle variables g:vikiSplit, b:vikiSplit
1488  
-- don't indent regions
1489  
-- regions can be indented
1490  
-- When a file doesn't exist, ESC or "n" aborts creation
1491  
-
1492  
-1.4
1493  
-- fixed problem with table highlighting that could cause vim to hang
1494  
-- it is now possible to selectivly disable simple or quoted viki names
1495  
-- indent plugin
1496  
-
1497  
-1.3.1
1498  
-- fixed bug when VikiBack was called without a definitiv back-reference
1499  
-- fixed problems with latin-1 characters
1500  
-
1501  
-1.3
1502  
-- basic ctags support (see |viki-tags|)
1503  
-- mini-ftplugin for bibtex files (use record labels as anchors)
1504  
-- added mapping <LocalLeader><c-cr>: follow link in other window (if any)
1505  
-- disabled the highlighting of italic char styles (i.e., /text/)
1506  
-- the ftplugin doesn't set deplate as the compiler; renamed the compiler plugin to deplate
1507  
-- syntax: sync minlines=50
1508  
-- fix: VikiFoldLevel()
1509  
-
1510  
-1.2
1511  
-- syntax file: fix nested regexp problem
1512  
-- deplate: conversion to html/latex; download from 
1513  
-http://sourceforge.net/projects/deplate/
1514  
-- made syntax a little bit more restrictive (*WORD* now matches /\*\w+\*/ 
1515  
-instead of /\*\S+\*/)
1516  
-- interviki definitions can now be buffer local variables, too
1517  
-- fixed <SID>DecodeFileUrl(dest)
1518  
-- some kind of compiler plugin (uses deplate)
1519  
-- removed g/b:vikiMarkupEndsWithNewline variable
1520  
-- saved all files in unix format (thanks to Grant Bowman for the hint)
1521  
-- removed international characters from g:vikiLowerCharacters and 
1522  
-g:vikiUpperCharacters because of difficulties with different encodings (thanks 
1523  
-to Grant Bowman for pointing out this problem); non-english-speaking users have 
1524  
-to set these variables in their vimrc file
1525  
-
1526  
-1.1
1527  
-- g:vikiExplorer (for viewing directories)
1528  
-- preliminary support for "soft" anchors (b:vikiAnchorRx)
1529  
-- improved VikiOpenSpecialProtocol(url); g:vikiOpenUrlWith_{PROTOCOL}, 
1530  
-g:vikiOpenUrlWith_ANY
1531  
-- improved VikiOpenSpecialFile(file); g:vikiOpenFileWith_{SUFFIX}, 
1532  
-g:vikiOpenFileWith_ANY
1533  
-- anchors may contain upper characters (but must begin with a lower char)
1534  
-- some support for Mozilla ThunderBird mailbox-URLs (this requires spaces to 
1535  
-be encoded as %20)
1536  
-- changed g:vikiDefSep to '‡‡‡'
  1526
+1.6.1
  1527
+- removed forgotten debug message
  1528
+- fixed indentation bug
1537 1529
 
1538  
-1.0
1539  
-- Extended names: For compatibility reasons with other wikis, the anchor is 
1540  
-now in the reference part.
1541  
-- For compatibility reasons with other wikis, prepending an anchor with 
1542  
-b:commentStart is optional.
1543  
-- g:vikiUseParentSuffix
1544  
-- Renamed variables & functions (basically s/Wiki/Viki/g)
1545  
-- added a ftplugin stub, moved the description to a help file
1546  
-- "[--]" is reference to current file
1547  
-- Folding support (at section level)
1548  
-- Intervikis
1549  
-- More highlighting
1550  
-- g:vikiFamily, b:vikiFamily
1551  
-- VikiGoBack() (persistent history data)
1552  
-- rudimentary LaTeX support ("soft" viki names)
  1530
+1.6.2
  1531
+- b:vikiDisableType
  1532
+- Put AnyWord-related stuff into a file of its own.
  1533
+- indentation for notices (!!!, ??? etc.)
  1534
+
  1535
+1.6.3
  1536
+- When creating a new file by following a link, the desired window number was 
  1537
+ignored
  1538
+- (VikiOpenSpecialFile) Escape blanks in the filename
  1539
+- Set &include and &define (ftplugin)
  1540
+- Set g:vikiFolds to '' to avoid using Headings for folds (which may cause a 
  1541
+major slowdown on slower machines)
  1542
+- renamed <SID>DecodeFileUrl(dest) to VikiDecomposeUrl()
  1543
+- fixed problem with table highlighting
  1544
+- file type URLs (file://) are now treated like special files
  1545
+- indent: if g:vikiIndentDesc is '::', align a definition's description to the 
  1546
+first non-blank position after the '::' separator
1553 1547
 
1554 1548
 " vim: ff=unix
98  plugin/vikiAnyWord.vim
... ...
@@ -0,0 +1,98 @@
  1
+" vikiAnyWord.vim
  2
+" @Author:      Thomas Link (mailto:samul@web.de?subject=vim-vikiAnyWord)
  3
+" @License:     GPL (see http://www.gnu.org/licenses/gpl.txt)
  4
+" @Created:     04-Apr-2005.
  5
+" @Last Change: 04-Apr-2005.
  6
+" @Revision:    0.2
  7
+
  8
+if &cp || exists("loaded_vikianyword")
  9
+    finish
  10
+endif
  11
+let loaded_vikianyword = 1
  12
+
  13
+"""" Any Word {{{1
  14
+fun! VikiMinorModeAnyWord (state) "{{{3
  15
+    let b:vikiFamily = "AnyWord"
  16
+    call VikiMinorMode(a:state)
  17
+endfun
  18
+command! VikiMinorModeAnyWord call VikiMinorModeAnyWord(1)
  19
+command! VikiMinorModeMaybeAnyWord call VikiMinorModeAnyWord(-1)
  20
+
  21
+fun! VikiSetupBufferAnyWord(state, ...) "{{{3
  22
+    let dontSetup = a:0 > 0 ? a:1 : ""
  23
+    call VikiSetupBuffer(a:state, dontSetup)
  24
+    if b:vikiNameTypes =~? "s" && !(dontSetup =~? "s")
  25
+        if b:vikiNameTypes =~# "S" && !(dontSetup =~# "S")
  26
+            let simpleWikiName = b:vikiSimpleNameQuoteBeg
  27
+                        \ .'['. b:vikiSimpleNameQuoteChars .']'
  28
+                        \ .'\{-}'. b:vikiSimpleNameQuoteEnd
  29
+        else
  30
+            let simpleWikiName = ""
  31
+        endif
  32
+        if b:vikiNameTypes =~# "s" && !(dontSetup =~# "s")
  33
+            let simple = '\<['. g:vikiUpperCharacters .']['. g:vikiLowerCharacters
  34
+                        \ .']\+\(['. g:vikiUpperCharacters.']['.g:vikiLowerCharacters
  35
+                        \ .'0-9]\+\)\+\>'
  36
+            if simpleWikiName != ""
  37
+                let simpleWikiName = simpleWikiName .'\|'. simple
  38
+            else
  39
+                let simpleWikiName = simple
  40
+            endif
  41
+        endif
  42
+        let anyword = '\<['. b:vikiSimpleNameQuoteChars .' ]\+\>'
  43
+        if simpleWikiName != ""
  44
+            let simpleWikiName = simpleWikiName .'\|'. anyword
  45
+        else
  46
+            let simpleWikiName = anyword
  47
+        endif
  48
+        let b:vikiSimpleNameRx = '\C\(\(\<['. g:vikiUpperCharacters .']\+::\)\?'
  49
+                    \ .'\('. simpleWikiName .'\)\)'
  50
+                    \ .'\(#\('. b:vikiAnchorNameRx .'\)\>\)\?'
  51
+        let b:vikiSimpleNameSimpleRx = '\C\(\<['.g:vikiUpperCharacters.']\+::\)\?'
  52
+                    \ .'\('. simpleWikiName .'\)'
  53
+                    \ .'\(#'. b:vikiAnchorNameRx .'\>\)\?'
  54
+        let b:vikiSimpleNameNameIdx   = 1
  55
+        let b:vikiSimpleNameDestIdx   = 0
  56
+        let b:vikiSimpleNameAnchorIdx = 6
  57
+        let b:vikiSimpleNameCompound = 'let erx="'. escape(b:vikiSimpleNameRx, '\"')
  58
+                    \ .'" | let nameIdx='. b:vikiSimpleNameNameIdx
  59
+                    \ .' | let destIdx='. b:vikiSimpleNameDestIdx
  60
+                    \ .' | let anchorIdx='. b:vikiSimpleNameAnchorIdx
  61
+    endif
  62
+    let b:vikiInexistentHighlight = "vikiAnyWordInexistentLink"
  63
+    let b:vikiMarkInexistent = 2
  64
+endf
  65
+
  66
+fun! VikiDefineMarkupAnyWord(state) "{{{3
  67
+    if b:vikiNameTypes =~? "s" && b:vikiSimpleNameRx != ""
  68
+        exe "syn match vikiRevLink /" . b:vikiSimpleNameRx . "/"
  69
+    endif
  70
+    if b:vikiNameTypes =~# "e" && b:vikiExtendedNameRx != ""
  71
+        exe "syn match vikiRevExtendedLink '" . b:vikiExtendedNameRx . "'"
  72
+    endif
  73
+    if b:vikiNameTypes =~# "u" && b:vikiUrlRx != ""
  74
+        exe "syn match vikiURL /" . b:vikiUrlRx . "/"
  75
+    endif
  76
+endfun
  77
+
  78
+fun! VikiDefineHighlightingAnyWord(state, ...) "{{{3
  79
+    let dontSetup = a:0 > 0 ? a:1 : ""
  80
+    call VikiDefineHighlighting(a:state)
  81
+
  82
+    if version < 508
  83
+        command! -nargs=+ VikiHiLink hi link <args>
  84
+    else
  85
+        command! -nargs=+ VikiHiLink hi def link <args>
  86
+    endif
  87
+    exec "VikiHiLink ". b:vikiInexistentHighlight ." Normal"
  88
+    delcommand VikiHiLink
  89
+endf
  90
+
  91
+fun! VikiFindAnyWord(flag) "{{{3
  92
+    let rx = <SID>VikiRxFromCollection(b:vikiNamesOk)
  93
+    if rx != ""
  94
+        call search(rx, a:flag)
  95
+    endif
  96
+endfun
  97
+
  98
+
7  plugin/vikiLatex.vim
@@ -2,8 +2,8 @@
2 2
 " @Author:      Thomas Link (samul AT web.de)
3 3
 " @License:     GPL (see http://www.gnu.org/licenses/gpl.txt)
4 4
 " @Created:     28-Jän-2004.
5  
-" @Last Change: 22-Jän-2005.
6  
-" @Revision:    0.146
  5
+" @Last Change: 01-Jun-2005.
  6
+" @Revision:    0.148
7 7
 
8 8
 if &cp || exists("s:loaded_vikiLatex")
9 9
     finish
@@ -39,6 +39,7 @@ fun! VikiSetupBufferLaTeX(state, ...)
39 39
 endfun
40 40
 
41 41
 fun! VikiLatexCheckFilename(filename, ...)
  42
+    echom "DBG: ". a:filename
42 43
     if a:filename != ""
43 44
         """ search in the current directory
44 45
         let i = 1
@@ -109,7 +110,7 @@ fun! VikiCompleteSimpleNameDefLaTeX(def)
109 110
     endif
110 111
     
111 112
     if dest == ""
112  
-        throw "Viki LaTeX: can't find: ". cmd
  113
+        throw "Viki LaTeX: can't find: ". cmd ." ". a:def
113 114
     else
114