Permalink
Browse files

Version 1.5.2

- changed default markup of textstyles: __emphasize__, ''code''; the
previous markup can be re-enabled by setting g:vikiTextstylesVer to 1)
- fixed problem with VikiQuote
- on follow-link, check for yet unsaved buffers too
  • Loading branch information...
1 parent 5d77ef9 commit bd67407089460f93f912065ecefbf5fda5ed3818 @tomtom tomtom committed with Oct 26, 2004
Showing with 162 additions and 71 deletions.
  1. +52 −10 doc/viki.txt
  2. +9 −0 etc/Viki.lst
  3. +5 −3 ftplugin/viki.vim
  4. +26 −13 indent/viki.vim
  5. +39 −26 plugin/viki.vim
  6. +31 −19 syntax/viki.vim
View
@@ -42,8 +42,37 @@ the cursor to the next/previous viki name).
*viki-installation*
Installation~
-Extract viki.zip to your local vimfiles directory ($VIM/vimfiles/ or ~/.vim)
-and run |:helptags| on that directory.
+Extract viki.zip to your local vimfiles directory (see also
+|add-global-plugin|) so that you get: >
+
+ (Linux etc.) $HOME/.vim/
+ (Windows) $VIM/vimviles/
+ compiler/ doc/ etc/ ftplugin/ plugin/ syntax/
+
+These directories are used for installing user-specific plugins. It's possible
+that these directories already exist and are populated with other plugins --
+in which case you probably already knew this. ;-)
+
+Uninstalling viki requires deleting the files from the viki archive by hand.
+Alternatively, you can feed the file etc/Viki.lst to rm: >
+
+ cd $HOME/.vim/
+ rm -i `cat etc/Viki.lst`
+
+Viki will be automatically loaded when starting vim. In case you have vim
+already running and don't want to restart it, you can also type: >
+
+ :runtime plugin/viki.vim
+
+Then run >
+
+(Linux etc.) >
+ :helptags $HOME/.vim/doc
+
+(Windows) >
+ :helptags $VIM/vimfiles/doc
+
+
Customization: *viki-customization*
It's probably a good idea to check the values of the following variables:
@@ -84,7 +113,7 @@ less about page names: >
This could then be accessed as SCI::ThisIdea, which would refer to the file
"~/Projects/Sci/Ideas/ThisIdea.txt".
-In order to use the LaTeX enabled viki variant, add this to your .vimrc file: >
+In order to use the LaTeX enabled viki variant, add this to your |vimrc| file: >
au FileType tex let b:vikiFamily="LaTeX"
@@ -338,12 +367,21 @@ Strings~
*viki-textstyles*
Textstyles~
-*bold*, **continuous bold**
-/italic/, //continuous italic//
-_underlined_, __continuous underline__
-=typewriter=, ==continuous typewriter==
+There are two markup styles which are selected on the basis of
+|vikiTextStyles|. 2 is the default now.
+
+If |vikiTextStyles| is 2, the markup is like this: >
- NOTE: There must not by a whitespace after the opening mark.
+ __emphasized__, ''typewriter''
+
+If |vikiTextStyles| is 1, the markup is like this: >
+
+ *bold*, **continuous bold**
+ /italic/, //continuous italic//
+ _underlined_, __continuous underline__
+ =typewriter=, ==continuous typewriter==
+
+< NOTE: There must not by a whitespace after the opening mark.
NOTE: For the word styles, there must be a non-word character (|/\W|)
before the opening mark, i.e. a/b/c will be highlighted as normal text --
@@ -583,7 +621,7 @@ Simple Viki Names [2]: *viki-vars-simple-names*
- g:vikiLowerCharacters, g:vikiUpperCharacters, b:vikiLowerCharacters,
b:vikiUpperCharacters
These default to "a-z" and "A-Z" respectively; "international" users
- should set these variables in their vimrc file to fit their needs
+ should set these variables in their |vimrc| file to fit their needs
- b:vikiAnchorMarker
@@ -633,6 +671,10 @@ File handling:
Markup:
+- g:vikiTextStyles, b:vikiTextStyles *vikiTextStyles*
+ Default: 2
+ Defines the markup of |viki-textstyles| like emphasized or code.
+
- g:vikiCommentStart *g:vikiCommentStart*
Default value: %
Defines the prefix of comments when in "full" viki mode.
@@ -783,7 +825,7 @@ could be defined as: \newcommand{\viki}[2][]{#2}
If b:vikiFamily is set to "LaTeX", then calling |:VikiMinorMode| will use
these commands instead of normal viki names. This change can be made permanent
-by adding this line to your vimrc file: >
+by adding this line to your |vimrc| file: >
au FileType tex let b:vikiFamily="LaTeX"
<
View
@@ -0,0 +1,9 @@
+./compiler/deplate.vim
+./doc/viki.txt
+./etc/Viki.lst
+./ftplugin/bib/viki.vim
+./ftplugin/viki.vim
+./indent/viki.vim
+./plugin/viki.vim
+./plugin/vikiLatex.vim
+./syntax/viki.vim
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: 10-Sep-2004.
-" @Revision: 23
+" @Last Change: 13-Okt-2004.
+" @Revision: 25
if exists("b:did_ftplugin")
finish
@@ -13,11 +13,13 @@ let b:did_ftplugin = 1
let b:vikiCommentStart = "%"
let b:vikiCommentEnd = ""
-exe "setlocal commentstring=". b:vikiCommentStart ."%s". b:vikiCommentEnd
+exe "setlocal commentstring=". substitute(b:vikiCommentStart, "%", "%%", "g")
+ \ ."%s". substitute(b:vikiCommentEnd, "%", "%%", "g")
exe "setlocal comments=:". b:vikiCommentStart
setlocal foldmethod=expr
setlocal foldexpr=VikiFoldLevel(v:lnum)
+setlocal expandtab
fun! VikiFoldLevel(lnum)
" let head = matchend(getline(a:lnum), '\V\^'. escape(b:vikiHeadingStart, '\') .'\ze\s\+')
View
@@ -3,8 +3,8 @@
" @Website: http://members.a1.net/t.link/
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 16-Jän-2004.
-" @Last Change: 27-Sep-2004.
-" @Revision: 0.158
+" @Last Change: 20-Okt-2004.
+" @Revision: 0.174
if exists("b:did_indent") || exists("g:vikiNoIndent")
finish
@@ -46,54 +46,67 @@ fun! VikiGetIndent()
return cind
endif
+ let pnum = v:lnum - 1
+ let pind = indent(pnum)
+
+ let pline = getline(pnum) " last line
+ let plCont = matchend(pline, '\\$')
+
+ if plCont >= 0
+ let plHeading = matchend(pline, '^\*\+\s\+')
+ if plHeading >= 0
+ " echo "DBG ". plHeading
+ return plHeading
+ else
+ " echo "DBG ". pind
+ return pind
+ endif
+ end
+
if cind > 0
let listRx = '^\s\+\([-+*#?@]\|[0-9#]\+\.\|[a-zA-Z?]\.\)\s'
let descRx = '^\s\+.\{-1,}\s::\s'
let cline = getline(cnum) " current line
- let pnum = v:lnum - 1
- let pind = indent(pnum)
-
let clList = matchend(cline, listRx)
let clDesc = matchend(cline, descRx)
let cln = clList >= 0 ? clList : clDesc
- " echom "DBG clList=". clList ." clDesc=". clDesc ." cind=". cind ." ". " pind=".pind." ".cline
-
if clList >= 0 || clDesc >= 0
let spaceEnd = matchend(cline, '^\s\+')
let rv = (spaceEnd / &sw) * &sw
return rv
else
- let pline = getline(pnum) " last line
let plList = matchend(pline, listRx)
- let plDesc = matchend(pline, descRx)
" echom "DBG plList=". plList ." plDesc=". plDesc
-
if plList >= 0
- " echom "DBG Return ". plList
+ " echom "DBG plList ". plList ." ". pline
return plList
endif
+ let plDesc = matchend(pline, descRx)
if plDesc >= 0
- " echom "DBG Return ". pind + (&sw / 2)
+ " echom "DBG plDesc ". pind + (&sw / 2)
return pind + (&sw / 2)
endif
if cind < ind
let rv = (cind / &sw) * &sw
+ " echom "DBG cind < ind ". rv
return rv
elseif cind >= ind
if cind % &sw == 0
+ " echom "DBG cind % &sw ". cind
return cind
else
+ " echom "DBG cind >= ind ". ind
return ind
end
endif
endif
endif
- return cind
+ return ind
endfun
View
@@ -2,8 +2,8 @@
" @Author: Thomas Link (samul AT web.de)
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 08-Dec-2003.
-" @Last Change: 27-Sep-2004.
-" @Revision: 1.5.1.622
+" @Last Change: 21-Okt-2004.
+" @Revision: 1.5.2.22
"
" vimscript #861
"
@@ -84,18 +84,19 @@ if !exists("g:vikiInexistentColor")
endif
endif
-if !exists("g:vikiMapMouse") | let g:vikiMapMouse = 1 | endif "{{{2
-if !exists("g:vikiUseParentSuffix") | let g:vikiUseParentSuffix = 0 | endif "{{{2
-if !exists("g:vikiNameSuffix") | let g:vikiNameSuffix = "" | endif "{{{2
-if !exists("g:vikiAnchorMarker") | let g:vikiAnchorMarker = "#" | endif "{{{2
-if !exists("g:vikiNameTypes") | let g:vikiNameTypes = "csSeui" | endif "{{{2
-if !exists("g:vikiSaveHistory") | let g:vikiSaveHistory = 0 | endif "{{{2
-if !exists("g:vikiExplorer") | let g:vikiExplorer = "Sexplore" | endif "{{{2
-if !exists("g:vikiMarkInexistent") | let g:vikiMarkInexistent = 1 | endif "{{{2
-if !exists("g:vikiMapInexistent") | let g:vikiMapInexistent = 1 | endif "{{{2
-if !exists("g:vikiMapKeys") | let g:vikiMapKeys = ").,;:!?\"'" | endif "{{{2
-if !exists("g:vikiFamily") | let g:vikiFamily = "" | endif "{{{2
-if !exists("g:vikiDirSeparator") | let g:vikiDirSeparator = "/" | endif "{{{2
+if !exists("g:vikiMapMouse") | let g:vikiMapMouse = 1 | endif "{{{2
+if !exists("g:vikiUseParentSuffix") | let g:vikiUseParentSuffix = 0 | endif "{{{2
+if !exists("g:vikiNameSuffix") | let g:vikiNameSuffix = "" | endif "{{{2
+if !exists("g:vikiAnchorMarker") | let g:vikiAnchorMarker = "#" | endif "{{{2
+if !exists("g:vikiNameTypes") | let g:vikiNameTypes = "csSeui" | endif "{{{2
+if !exists("g:vikiSaveHistory") | let g:vikiSaveHistory = 0 | endif "{{{2
+if !exists("g:vikiExplorer") | let g:vikiExplorer = "Sexplore" | endif "{{{2
+if !exists("g:vikiMarkInexistent") | let g:vikiMarkInexistent = 1 | endif "{{{2
+if !exists("g:vikiMapInexistent") | let g:vikiMapInexistent = 1 | endif "{{{2
+if !exists("g:vikiMapKeys") | let g:vikiMapKeys = ").,;:!?\"'" | endif "{{{2
+if !exists("g:vikiFamily") | let g:vikiFamily = "" | endif "{{{2
+if !exists("g:vikiDirSeparator") | let g:vikiDirSeparator = "/" | endif "{{{2
+if !exists("g:vikiTextstylesVer") | let g:vikiTextstylesVer = 2 | endif "{{{2
if !exists("g:vikiOpenFileWith_ANY") && has("win32") "{{{2
let g:vikiOpenFileWith_ANY = "silent !cmd /c start %{FILE}"
@@ -232,15 +233,18 @@ fun! <SID>VikiMarkInexistent(line1, line2, ...)
if line(".") == 1 && line("$") == max
let b:vikiNamesNull = ""
let b:vikiNamesOk = ""
- let sl = &statusline
- let &statusline="Viki: checking line ". min ."-". max
- redrawstatus
else
- let sl = ""
if !exists("b:vikiNamesNull") | let b:vikiNamesNull = "" | endif
if !exists("b:vikiNamesOk") | let b:vikiNamesOk = "" | endif
endif
+ let feedback = (max - min) > 5
+ if feedback
+ let sl = &statusline
+ let &statusline="Viki: checking line ". min ."-". max
+ redrawstatus
+ endif
+
if line(".") == 1
norm! G$
else
@@ -274,7 +278,7 @@ fun! <SID>VikiMarkInexistent(line1, line2, ...)
else
let check = 0
endif
- if check && dest != g:vikiSelfRef && !isdirectory(dest)
+ if check && dest != "" && dest != g:vikiSelfRef && !isdirectory(dest)
if filereadable(dest)
" let b:vikiNamesNull = MvRemoveElementAll(b:vikiNamesNull, "\n", partx)
" let b:vikiNamesOk = MvPushToFront(b:vikiNamesOk, "\n", partx)
@@ -306,7 +310,7 @@ fun! <SID>VikiMarkInexistent(line1, line2, ...)
endif
endif
exe "norm! ". li ."G". vco ."|"
- if sl != ""
+ if feedback
let &statusline=sl
endif
endfun
@@ -391,6 +395,7 @@ fun! VikiSetupBuffer(state, ...) "{{{3
call VikiSetBufferVar("vikiSpecialProtocols")
call VikiSetBufferVar("vikiSpecialProtocolsExceptions")
call VikiSetBufferVar("vikiMarkInexistent")
+ call VikiSetBufferVar("vikiTextstylesVer")
if a:state =~ '1$'
call VikiSetBufferVar("vikiCommentStart",
@@ -462,9 +467,9 @@ fun! VikiSetupBuffer(state, ...) "{{{3
if b:vikiNameTypes =~# "e" && !(dontSetup =~# "e")
let b:vikiExtendedNameRx = '\[\[\(\('.b:vikiSpecialProtocols.'\)://[^]]\+\|[^]#]\+\)\?'.
- \ '\(#\('. b:vikiAnchorNameRx .'\)\)\?\]\(\[\([^]#]\+\)\]\)\?[!~\-]*\]'
+ \ '\(#\('. b:vikiAnchorNameRx .'\)\)\?\]\(\[\([^]]\+\)\]\)\?[!~\-]*\]'
let b:vikiExtendedNameSimpleRx = '\[\[\('. b:vikiSpecialProtocols .'://[^]]\+\|[^]#]\+\)\?'.
- \ '\(#'. b:vikiAnchorNameRx .'\)\?\]\(\[[^]#]\+\]\)\?[!~\-]*\]'
+ \ '\(#'. b:vikiAnchorNameRx .'\)\?\]\(\[[^]]\+\]\)\?[!~\-]*\]'
let b:vikiExtendedNameNameIdx = 6
let b:vikiExtendedNameDestIdx = 1
let b:vikiExtendedNameAnchorIdx = 4
@@ -575,8 +580,8 @@ fun! VikiMapKeys(state)
endif
endif
if !hasmapto("VikiQuote") && exists("*VEnclose")
- vmap <buffer> <silent> <LocalLeader>vq :VikiQuote<cr>:VikiMarknexistentInLineQuick<cr>
- nmap <buffer> <silent> <LocalLeader>vq viw:VikiQuote<cr>:VikiMarkInexistentInLineQuick<cr>
+ vnoremap <buffer> <silent> <LocalLeader>vq :VikiQuote<cr><esc>:VikiMarkInexistentInLineQuick<cr>v
+ nnoremap <buffer> <silent> <LocalLeader>vq viw:VikiQuote<cr><esc>:VikiMarkInexistentInLineQuick<cr>
endif
if !hasmapto("VikiGoBack")
nnoremap <buffer> <silent> <LocalLeader>vb :call VikiGoBack()<cr>
@@ -708,7 +713,7 @@ endfun
fun! <SID>VikiSelectBackRef(...) "{{{3
if exists("b:VikiBackFile") && exists("b:VikiBackLine") && exists("b:VikiBackCol")
- if a:0 >= 1 && a:1 > 0
+ if a:0 >= 1 && a:1 >= 0
let s = a:1
else
let s = VikiSelect(b:VikiBackFile, g:vikiDefSep, "Select Back Reference")
@@ -914,6 +919,8 @@ fun! <SID>VikiFollowLink(def, ...) "{{{3
call VikiOpenSpecialFile(dest)
elseif filereadable(dest) "reference to a local, already existing file
call <SID>VikiOpenLink(dest, anchor, 0, "", winNr)
+ elseif bufexists(dest)
+ exec "buffer ". dest
elseif isdirectory(dest)
exe g:vikiExplorer ." ". dest
else
@@ -1264,12 +1271,18 @@ ________________________________________________________________________________
* To Do
+- handle commands and macros: #INCLUDE, #IMG, #WITH, {ref}, {label}
- don't know how to deal with viki names spanning several lines
-- Recheck the key binding of c-cr
- ...
* Change Log
+1.5.2
+- changed default markup of textstyles: __emphasize__, ''code''; the
+previous markup can be re-enabled by setting g:vikiTextstylesVer to 1)
+- fixed problem with VikiQuote
+- on follow link check for yet unsaved buffers too
+
1.5.1
- depends on multvals >= 3.8.0
- new viki family "AnyWord" (see |viki-any-word|), which turns any word into a
Oops, something went wrong.

0 comments on commit bd67407

Please sign in to comment.