Permalink
Browse files

Version 0.5

  * DONE: vimwiki default markup to HTML conversion improved.
  * DONE: Added basic `GoogleWiki` and `MediaWiki` markup languages.
  * DONE: Chinese `[[complex wiki words]]`.
  • Loading branch information...
1 parent 03a25a7 commit cac83654026e6fcefefd3361414c9f5a7f779bc1 @habamax habamax committed with Sep 15, 2008
Showing with 641 additions and 458 deletions.
  1. +0 −86 ftplugin/vimwiki.vim
  2. +0 −59 plugin/vimwiki.vim
  3. +0 −121 syntax/vimwiki.vim
  4. +641 −192 autoload/vimwiki.vim → vimwiki_0_5.vba
View
@@ -1,86 +0,0 @@
-" Vim filetype plugin file
-" Language: Wiki
-" Author: Maxim Kim (habamax at gmail dot com)
-" Home: http://code.google.com/p/vimwiki/
-" Filenames: *.wiki
-" Last Change: (02.06.2008 12:58)
-" Version: 0.4
-
-if exists("b:did_ftplugin")
- finish
-endif
-
-let b:did_ftplugin = 1 " Don't load another plugin for this buffer
-
-
-"" Defaults
-""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-
-" Reset the following options to undo this plugin.
-let b:undo_ftplugin = "setl tw< wrap< lbr< fenc< ff< sua< isf< awa< com< fo<"
-
-setlocal textwidth=0
-setlocal wrap
-setlocal linebreak
-setlocal fileencoding=utf-8
-setlocal fileformat=unix
-setlocal autowriteall
-" for gf
-execute 'setlocal suffixesadd='.g:vimwiki_ext
-setlocal isfname-=[,]
-
-if g:vimwiki_smartCR>=2
- setlocal comments=b:*,b:#
- setlocal formatoptions=ctnqro
-endif
-
-"" keybindings {{{
-""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-nmap <buffer> <Up> gk
-nmap <buffer> k gk
-vmap <buffer> <Up> gk
-vmap <buffer> k gk
-
-nmap <buffer> <Down> gj
-nmap <buffer> j gj
-vmap <buffer> <Down> gj
-vmap <buffer> j gj
-
-imap <buffer> <Down> <C-o>gj
-imap <buffer> <Up> <C-o>gk
-
-nmap <silent><buffer> <CR> :call vimwiki#WikiFollowWord('nosplit')<CR>
-nmap <silent><buffer> <S-CR> :call vimwiki#WikiFollowWord('split')<CR>
-nmap <silent><buffer> <C-CR> :call vimwiki#WikiFollowWord('vsplit')<CR>
-
-nmap <buffer> <S-LeftMouse> <NOP>
-nmap <buffer> <C-LeftMouse> <NOP>
-noremap <silent><buffer> <2-LeftMouse> :call vimwiki#WikiFollowWord('nosplit')<CR>
-noremap <silent><buffer> <S-2-LeftMouse> <LeftMouse>:call vimwiki#WikiFollowWord('split')<CR>
-noremap <silent><buffer> <C-2-LeftMouse> <LeftMouse>:call vimwiki#WikiFollowWord('vsplit')<CR>
-
-nmap <silent><buffer> <BS> :call vimwiki#WikiGoBackWord()<CR>
-"<BS> mapping doesn't work in vim console
-nmap <silent><buffer> <C-h> :call vimwiki#WikiGoBackWord()<CR>
-nmap <silent><buffer> <RightMouse><LeftMouse> :call vimwiki#WikiGoBackWord()<CR>
-
-nmap <silent><buffer> <TAB> :call vimwiki#WikiNextWord()<CR>
-nmap <silent><buffer> <S-TAB> :call vimwiki#WikiPrevWord()<CR>
-
-nmap <silent><buffer> <Leader>wd :call vimwiki#WikiDeleteWord()<CR>
-nmap <silent><buffer> <Leader>wr :call vimwiki#WikiRenameWord()<CR>
-
-if g:vimwiki_smartCR==1
- inoremap <silent><buffer><CR> <CR><Space><C-O>:call vimwiki#WikiNewLine('checkup')<CR>
- noremap <silent><buffer>o o<Space><C-O>:call vimwiki#WikiNewLine('checkup')<CR>
- noremap <silent><buffer>O O<Space><C-O>:call vimwiki#WikiNewLine('checkdown')<CR>
-endif
-" keybindings }}}
-
-"" commands {{{2
-" command! -nargs=1 Wiki2HTML call WikiExportHTML(expand(<f-args>))
-command! Wiki2HTML call vimwiki#Wiki2HTML(g:vimwiki_home_html, expand('%'))
-command! WikiAll2HTML call vimwiki#WikiAll2HTML(g:vimwiki_home_html)
-
-"" commands 2}}}
-
View
@@ -1,59 +0,0 @@
-" VimWiki plugin file
-" Language: Wiki
-" Author: Maxim Kim (habamax at gmail dot com)
-" Home: http://code.google.com/p/vimwiki/
-" Filenames: *.wiki
-" Last Change: (02.06.2008 12:57)
-" Version: 0.4
-
-
-if exists("loaded_vimwiki") || &cp
- finish
-endif
-let loaded_vimwiki = 1
-
-let s:save_cpo = &cpo
-set cpo&vim
-
-
-function! s:default(varname,value)
- if !exists('g:vimwiki_'.a:varname)
- let g:vimwiki_{a:varname} = a:value
- endif
-endfunction
-
-"" Could be redefined by users
-call s:default('home',"")
-call s:default('index',"index")
-call s:default('ext','.wiki')
-call s:default('upper','A-ZА-Я')
-call s:default('lower','a-zа-я')
-call s:default('maxhi','1')
-call s:default('other','0-9_')
-call s:default('smartCR',1)
-call s:default('stripsym','_')
-call s:default('home_html',g:vimwiki_home."html/")
-" call s:default('addheading','1')
-
-call s:default('history',[])
-
-let upp = g:vimwiki_upper
-let low = g:vimwiki_lower
-let oth = g:vimwiki_other
-let nup = low.oth
-let nlo = upp.oth
-let any = upp.nup
-
-let g:vimwiki_word1 = '\C\<['.upp.']['.nlo.']*['.low.']['.nup.']*['.upp.']['.any.']*\>'
-let g:vimwiki_word2 = '\[\[['.upp.low.oth.'[:punct:][:space:]]\{-}\]\]'
-
-"" TODO: common regexps for syntax hiliting
-"" regexps
-call s:default('rxWeblink', '\("[^"(]\+\((\([^)]\+\))\)\?":\)\?\(https\?\|ftp\|gopher\|telnet\|file\|notes\|ms-help\):\(\(\(//\)\|\(\\\\\)\)\+[A-Za-z0-9:#@%/;$~_?+-=.&\-\\\\]*\)')
-call s:default('rxWikiWord', g:vimwiki_word1.'\|'.g:vimwiki_word2)
-call s:default('rxCode', '`.\{-}`')
-
-execute 'autocmd! BufNewFile,BufReadPost,BufEnter *'.g:vimwiki_ext.' set ft=vimwiki'
-
-nmap <silent><unique> <Leader>ww :call vimwiki#WikiGoHome()<CR>
-nmap <silent><unique> <Leader>wh :execute "edit ".g:vimwiki_home."."<CR>
View
@@ -1,121 +0,0 @@
-" Vim syntax file
-" Language: Wiki
-" Author: Maxim Kim (habamax at gmail dot com)
-" Home: http://code.google.com/p/vimwiki/
-" Filenames: *.wiki
-" Last Change: (02.06.2008 12:58)
-" Version: 0.4
-
-" Quit if syntax file is already loaded
-if version < 600
- syntax clear
-elseif exists("b:current_syntax")
- finish
-endif
-
-"" use max highlighting - could be quite slow if there are too many wikifiles
-if g:vimwiki_maxhi
- " Every WikiWord is nonexistent
- execute 'syntax match wikiNoExistsWord /'.g:vimwiki_word1.'/'
- execute 'syntax match wikiNoExistsWord /'.g:vimwiki_word2.'/'
- " till we find them in g:vimwiki_home
- call vimwiki#WikiHighlightWords()
-else
- " A WikiWord (unqualifiedWikiName)
- execute 'syntax match wikiWord /'.g:vimwiki_word1.'/'
- " A [[bracketed wiki word]]
- execute 'syntax match wikiWord /'.g:vimwiki_word2.'/'
-endif
-
-
-" text: "this is a link (optional tooltip)":http://www.microsoft.com
-" TODO: check URL syntax against RFC
-syntax match wikiLink `\("[^"(]\+\((\([^)]\+\))\)\?":\)\?\(https\?\|ftp\|gopher\|telnet\|file\|notes\|ms-help\):\(\(\(//\)\|\(\\\\\)\)\+[A-Za-z0-9:#@%/;$~_?+-=.&\-\\\\]*\)`
-
-" text: *strong*
-" syntax match wikiBold /\(^\|\W\)\zs\*\([^ ].\{-}\)\*/
-" syntax match wikiBold /\(^\|\W\)\zs\*.\{-}\*/
-syntax match wikiBold /\*.\{-}\*/
-
-" text: _emphasis_
-syntax match wikiItalic /_.\{-}_/
-
-" text: `code`
-syntax match wikiCode /`.\{-}`/
-
-" text: ~~deleted text~~
-syntax match wikiDelText /\~\{2}.\{-}\~\{2}/
-
-" text: ^superscript^
-syntax match wikiSuperScript /\^.\{-}\^/
-
-" text: ,,subscript,,
-syntax match wikiSubScript /,,.\{-},,/
-
-" Emoticons: must come after the Textilisms, as later rules take precedence
-" over earlier ones. This match is an approximation for the ~70 distinct
-" patterns that FlexWiki knows.
-syntax match wikiEmoticons /\((.)\|:[()|$@]\|:-[DOPS()\]|$@]\|;)\|:'(\)/
-
-" Aggregate all the regular text highlighting into wikiText
-syntax cluster wikiText contains=wikiItalic,wikiBold,wikiCode,wikiDelText,wikiSuperScript,wikiSubScript,wikiLink,wikiWord,wikiEmoticons
-
-" Header levels, 1-6
-syntax match wikiH1 /\(^!\{1}.*$\|^\s*=\{1}.*=\{1}\s*$\)/
-syntax match wikiH2 /\(^!\{2}.*$\|^\s*=\{2}.*=\{2}\s*$\)/
-syntax match wikiH3 /\(^!\{3}.*$\|^\s*=\{3}.*=\{3}\s*$\)/
-syntax match wikiH4 /\(^!\{4}.*$\|^\s*=\{4}.*=\{4}\s*$\)/
-syntax match wikiH5 /\(^!\{5}.*$\|^\s*=\{5}.*=\{5}\s*$\)/
-syntax match wikiH6 /\(^!\{6}.*$\|^\s*=\{6}.*=\{6}\s*$\)/
-
-" <hr>, horizontal rule
-syntax match wikiHR /^----.*$/
-
-" Tables. Each line starts and ends with '||'; each cell is separated by '||'
-syntax match wikiTable /||/
-
-" Bulleted list items start with whitespace(s), then '*'
-" syntax match wikiList /^\s\+\(\*\|[1-9]\+0*\.\).*$/ contains=@wikiText
-" highlight only bullets and digits.
-syntax match wikiList /^\s\+\(\*\|[1-9]\+0*\.\|#\)/
-
-syntax match wikiTodo /\(TODO:\|DONE:\|FIXME:\|FIXED:\)/
-
-" Treat all other lines that start with spaces as PRE-formatted text.
-syntax match wikiPre /^\s\+[^[:blank:]*#].*$/
-
-syntax region wikiPre start=/^{{{\s*$/ end=/^}}}\s*$/
-syntax sync match wikiPreSync grouphere wikiPre /^{{{\s*$/
-
-" Link FlexWiki syntax items to colors
-hi def link wikiH1 Title
-hi def link wikiH2 wikiH1
-hi def link wikiH3 wikiH2
-hi def link wikiH4 wikiH3
-hi def link wikiH5 wikiH4
-hi def link wikiH6 wikiH5
-hi def link wikiHR wikiH6
-
-hi def wikiBold term=bold cterm=bold gui=bold
-hi def wikiItalic term=italic cterm=italic gui=italic
-
-hi def link wikiCode PreProc
-hi def link wikiWord Underlined
-hi def link wikiNoExistsWord Error
-
-hi def link wikiEscape Todo
-hi def link wikiPre PreProc
-hi def link wikiLink Underlined
-hi def link wikiList Type
-hi def link wikiTable Type
-hi def link wikiEmoticons Constant
-hi def link wikiDelText Comment
-hi def link wikiInsText Constant
-hi def link wikiSuperScript Constant
-hi def link wikiSubScript Constant
-hi def link wikiCitation Constant
-hi def link wikiTodo Todo
-
-let b:current_syntax="vimwiki"
-
-" vim:tw=0:
Oops, something went wrong.

0 comments on commit cac8365

Please sign in to comment.