diff --git a/.gitignore b/.gitignore index 3f5c740..f24d760 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ tractools +bundle/ ftplugin/python/ .VimballRecord .netrwhist diff --git a/.vimrc b/.vimrc index 42eba6f..035964e 100644 --- a/.vimrc +++ b/.vimrc @@ -1,174 +1,75 @@ -set lazyredraw +set nocompatible -" vimwiki location -let g:vimwiki_list = [{'path': '~/Dropbox/Wiki/'}] - -" reload chrome's active tab with leader-r -map r :silent !osascript -e "tell application \"Google Chrome\" to tell the active tab of its first window to reload" +" begin vundle filetype off -call pathogen#runtime_append_all_bundles() -call pathogen#helptags() -filetype plugin indent on - -set noeol - -let php_folding = 0 -let php_strict_blocks = 0 -let php_large_file = 800 - -"let g:syntastic_javascript_jsl_conf = "-ambigious_newline -inc_dec_within_stmt" -let g:syntastic_auto_loc_list = 2 -let g:syntastic_check_on_open = 1 - -" custom shortcuts use "," not "\" -- it's easier to reach! -let mapleader = "," - -if has("win32") || has("win64") - " open current file in explorer - :map e :silent !explorer /select,%:p -endif - -set nocompatible " don't bother with vi compatibility - -let g:loaded_delimitMate = 1 " disabled for now -let g:pyflakes_builtins = ['sentinel', 'Sentinel', '_', 'N_', 'Null'] -let g:VCSCommandSplit = 'vertical' - -command! KillPydevComments :%s/\s*#@UnresolvedImport\s*//g - -" make Q format text instead of entering Ex mode -map Q gq +set rtp+=~/.vim/bundle/vundle/ +call vundle#rc() -" for mistyping :w as :W -command! W :w - -command! CdFile :cd %:h " change directories to the current file's directory - -" hides file types in directory listings -let g:netrw_list_hide='^\.svn/$,^\.settings/$,.*\.pyo$,.*\.pyc,.*\.obj' - -" Launches web browser with the given URL. -function! LaunchBrowser(url) - let startcmd = has("win32") || has("win64") ? "! start " : "! " - let endcmd = has("unix") ? "&" : "" - - " Escape characters that have special meaning in the :! command. - " let url = substitute(a:url, '!\|#\|%', '\\&', 'g') - - silent! execute startcmd url endcmd -endfunction +Bundle 'gmarik/vundle' +Bundle 'L9' +Bundle 'FuzzyFinder' +Bundle 'altercation/vim-colors-solarized' +Bundle 'scrooloose/syntastic' -" highlight SIP files like C++ -au BufNewFile,BufRead *.sip set filetype=cpp -au BufNewFile,BufRead *.pde set filetype=cpp -au BufNewFile,BufRead *.tenjin set filetype=html -au BufNewFile,BufRead *.as set filetype=javascript -au BufNewFile,BufRead *.less set filetype=less -au BufRead,BufNewFile *.go set filetype=go -au BufNewFile,BufRead *.as set filetype=actionscript -au BufRead,BufNewFile *.jst set filetype=html -au BufRead,BufNewFile *.hbs set filetype=html -au BufRead,BufNewFile *.html set filetype=php " read .html as PHP -au BufNewFile,BufRead *.frag,*.vert,*.fp,*.vp,*.glsl setf glsl - - -set nowrap " no wordwrap +filetype plugin indent on + +" end vundle -" don't write any temporary files +let mapleader="," +syntax on +set noeol +set hidden +set nowrap set nobackup set nowritebackup set noswapfile - -" check syntax more -autocmd BufEnter * :syntax sync fromstart - -if has("gui_running") - " make the default window size a bit bigger - set columns=110 - set lines=60 - - syntax enable - set background=dark - colorscheme solarized - set gfn=Consolas:h11 - - set guioptions-=m "remove the menu bar - set guioptions-=T "remove the tool bar - - set guioptions-=L " never show scrollbars - set guioptions-=R - - " highlight cursor line - set cursorline -endif " gui-running - -" In many terminal emulators the mouse works just fine, thus enable it. -if has('mouse') - set mouse=a -endif - -set showmatch "show matching brackets -set ignorecase "case insensitive matching -set smartcase " match case sensitive if there are uppercase letters -set textwidth=0 "don't wrap text -set scrolloff=5 "keep context while scrolling - -let python_highlight_all = 1 - -set autowrite " automatically save files when changing buffers - -set wildignore+=*.lib,*.dll,*.exe,*.o,*.obj,*.pyc,*.pyo,*.png,*.gif,*.jpg,*.jpeg,*.bmp,*.tiff " ignore filetypes for auto complete - -syntax on - -" set nohls " turn off search highlighting (set hls will bring it back) +set showmatch +set ignorecase +set autoindent +set smartcase +set textwidth=0 +set scrolloff=5 +set autowrite set nohlsearch -set nobackup -set nowritebackup - -set expandtab " enter spaces when tab is pressed: -set textwidth=0 " do not break lines when line length increases - -" use 4 spaces to represent a tab +set expandtab +set smartindent set tabstop=4 set softtabstop=4 +set shiftwidth=2 +set backspace=indent,eol,start +set incsearch +set ruler +set wildmenu +set clipboard+=unnamed -" Copy indent from current line when starting a new line. -set smartindent -set showmode -set autoindent - -" number of space to use for auto indent -" you can use >> or << keys to indent current line or selection -" in normal mode. -set shiftwidth=4 - -" automatically strip trailing whitespace from Python files -autocmd BufWritePre *.py normal m`:%s/\s\+$//e `` +set background=dark +let g:solarized_termtrans = 0 +colorscheme solarized -" auto indent after "def foo():" -autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class,with +if has('mouse') + set mouse=a +endif -set backspace=indent,eol,start " makes backspace key more powerful. -set incsearch " shows the match while typing -set ruler " show line and column number -set wildmenu " show some autocomplete options in status bar +command! W :w -" share clipboard with windows clipboard -set clipboard+=unnamed +" always move by virtual lines +nnoremap j gj +nnoremap k gk +vnoremap j gj +vnoremap k gk -set showmatch " highlight matching parens +set undodir=~/.vim/undodir +set undofile +set undolevels=100 "maximum number of changes that can be undone +set undoreload=100 "maximum number lines to save for undo on a buffer reload -" Convenient command to see the difference between the current buffer and the -" file it was loaded from, thus the changes you made. -" Only define it when not defined already. -if !exists(":DiffOrig") - command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis - \ | wincmd p | diffthis -endif +" FuzzyFinder +nnoremap f :FufFile **/ +nnoremap b :FufBuffer +nnoremap t :FufTag -" Use the ack.pl script on PATH to grep intelligently +" Ack function! Ack(args) let grepprg_bak=&grepprg set grepprg=ack\ -H\ --nocolor\ --nogroup @@ -177,76 +78,30 @@ function! Ack(args) let &grepprg=grepprg_bak endfunction -function! Mdgrep(args) - let grepprg_bak=&grepprg - set grepprg=mdgrep - execute "silent! lgrep " . a:args - botright lopen - let &grepprg=grepprg_bak -endfunction - command! -nargs=* -complete=file Ack call Ack() -command! -nargs=* -complete=file Mdgrep call Mdgrep() + +" Syntastic +let g:syntastic_python_checkers=['pyflakes'] " Use CTRL-S for saving, also in Insert mode noremap :update vnoremap :update inoremap :update -map :lnext -map :lprevious - -" commands - -" open current buffer in trac browser -map to :TracBrowser - -" open trac revision log for current buffer -map tl :TracLog - -map b :Bug - -" add a missing semicolon to the end of this line -map ; A; - -map m :w \| :silent make \| redraw! - -" Jump to any file in any subdirectory under the current -map j :e **/ - " a is equivalent to ":Ack [word at cursor]" map a :Ack -" Jump to the best file match for the word under the cursor -map J :e **/* - -" Ack (grep) for the word under the cursor. -:nnoremap g :Gstatus - " s replaces the word at the cursor :nnoremap s :%s/\<\>//g -" swap this word with the next -" noremap xn :s/\v(<\k*%#\k*>)(\_.{-})(<\k+>)/\3\2\1/ -noremap xp "_yiw:s/\(\%#\w\+\)\(\W\+\)\(\w\+\)/\3\2\1/ - -" A selects whole buffer -map A ggVG - " highlight spelling errors with a bright orange curly line if has("gui_running") highlight SpellBad term=underline gui=undercurl guisp=Orange endif -:nnoremap q :cn - " leader P copies full file path to clipboard map p :let @+=expand("%:p"):echo "copied" expand("%:p") -map r :!racket -i -t %:p -map w :set lbr wrap -map W :set nolbr nowrap - function! JSONPrettify() python << EOF import vim @@ -262,28 +117,3 @@ endfunction " format JSON nicely (via python's simplejson) command! JSONPrettify :call JSONPrettify() -" don't underline whitespace in between HTML tags -syn match htmlLinkWhite /\s\+/ contained containedin=htmlLink -hi default htmlLinkWhite term=NONE cterm=NONE gui=NONE - -" always move by virtual lines -nnoremap j gj -nnoremap k gk -vnoremap j gj -vnoremap k gk - -if filereadable("~/.vim-passwords.vimrc") - source ~/.vim-passwords.vimrc -endif - -set undodir=~/.vim/undodir -set undofile -set undolevels=50 "maximum number of changes that can be undone -set undoreload=50 "maximum number lines to save for undo on a buffer reload - -autocmd filetype scheme,racket setlocal tabstop=2 -autocmd filetype scheme,racket setlocal shiftwidth=2 - -autocmd filetype mkd setlocal spell wrap lbr - -autocmd filetype asm setlocal autoread diff --git a/Solarized Dark.itermcolors b/Solarized Dark.itermcolors new file mode 100644 index 0000000..ed31a4a --- /dev/null +++ b/Solarized Dark.itermcolors @@ -0,0 +1,213 @@ + + + + + Ansi 0 Color + + Blue Component + 0.19370138645172119 + Green Component + 0.15575926005840302 + Red Component + 0.0 + + Ansi 1 Color + + Blue Component + 0.14145714044570923 + Green Component + 0.10840655118227005 + Red Component + 0.81926977634429932 + + Ansi 10 Color + + Blue Component + 0.38298487663269043 + Green Component + 0.35665956139564514 + Red Component + 0.27671992778778076 + + Ansi 11 Color + + Blue Component + 0.43850564956665039 + Green Component + 0.40717673301696777 + Red Component + 0.32436618208885193 + + Ansi 12 Color + + Blue Component + 0.51685798168182373 + Green Component + 0.50962930917739868 + Red Component + 0.44058024883270264 + + Ansi 13 Color + + Blue Component + 0.72908437252044678 + Green Component + 0.33896297216415405 + Red Component + 0.34798634052276611 + + Ansi 14 Color + + Blue Component + 0.56363654136657715 + Green Component + 0.56485837697982788 + Red Component + 0.50599193572998047 + + Ansi 15 Color + + Blue Component + 0.86405980587005615 + Green Component + 0.95794391632080078 + Red Component + 0.98943418264389038 + + Ansi 2 Color + + Blue Component + 0.020208755508065224 + Green Component + 0.54115492105484009 + Red Component + 0.44977453351020813 + + Ansi 3 Color + + Blue Component + 0.023484811186790466 + Green Component + 0.46751424670219421 + Red Component + 0.64746475219726562 + + Ansi 4 Color + + Blue Component + 0.78231418132781982 + Green Component + 0.46265947818756104 + Red Component + 0.12754884362220764 + + Ansi 5 Color + + Blue Component + 0.43516635894775391 + Green Component + 0.10802463442087173 + Red Component + 0.77738940715789795 + + Ansi 6 Color + + Blue Component + 0.52502274513244629 + Green Component + 0.57082360982894897 + Red Component + 0.14679534733295441 + + Ansi 7 Color + + Blue Component + 0.79781103134155273 + Green Component + 0.89001238346099854 + Red Component + 0.91611063480377197 + + Ansi 8 Color + + Blue Component + 0.15170273184776306 + Green Component + 0.11783610284328461 + Red Component + 0.0 + + Ansi 9 Color + + Blue Component + 0.073530435562133789 + Green Component + 0.21325300633907318 + Red Component + 0.74176257848739624 + + Background Color + + Blue Component + 0.15170273184776306 + Green Component + 0.11783610284328461 + Red Component + 0.0 + + Bold Color + + Blue Component + 0.56363654136657715 + Green Component + 0.56485837697982788 + Red Component + 0.50599193572998047 + + Cursor Color + + Blue Component + 0.51685798168182373 + Green Component + 0.50962930917739868 + Red Component + 0.44058024883270264 + + Cursor Text Color + + Blue Component + 0.19370138645172119 + Green Component + 0.15575926005840302 + Red Component + 0.0 + + Foreground Color + + Blue Component + 0.51685798168182373 + Green Component + 0.50962930917739868 + Red Component + 0.44058024883270264 + + Selected Text Color + + Blue Component + 0.56363654136657715 + Green Component + 0.56485837697982788 + Red Component + 0.50599193572998047 + + Selection Color + + Blue Component + 0.19370138645172119 + Green Component + 0.15575926005840302 + Red Component + 0.0 + + + diff --git a/bundle/fugitive b/bundle/fugitive deleted file mode 160000 index affce71..0000000 --- a/bundle/fugitive +++ /dev/null @@ -1 +0,0 @@ -Subproject commit affce710e296f384585e7dbe3b2be4d9d04be49f diff --git a/bundle/glsl/syntax/glsl.vim b/bundle/glsl/syntax/glsl.vim deleted file mode 100644 index bd04b1e..0000000 --- a/bundle/glsl/syntax/glsl.vim +++ /dev/null @@ -1,265 +0,0 @@ -" Vim syntax file the OpenGL Shading Language -" Language: GLSL -" Author: Nathan Cournia -" Date: June 30, 2004 -" File Types: .frag .vert .glsl .fp .vp -" Version: 1.10.00 -" Notes: Adapted from c.vim - Bram Moolenaar -" Adapted from cg.vim - Kevin Bjorke - -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -" a bunch of useful keywords -syn keyword glslConditional if else -syn keyword glslStatement break return continue discard -syn keyword glslRepeat while for do -syn keyword glslTodo contained TODO FIXME XXX - -" glslCommentGroup allows adding matches for special things in comments -syn cluster glslCommentGroup contains=glslTodo - -"catch errors caused by wrong parenthesis and brackets -syn cluster glslParenGroup contains=glslParenError,glslIncluded,glslSpecial,glslCommentSkip,glslCommentString,glslComment2String,@glslCommentGroup,glslCommentStartError,glslUserCont,glslUserLabel,glslBitField,glslCommentSkip,glslOctalZero,glslCppOut,glslCppOut2,glslCppSkip,glslFormat,glslNumber,glslFloat,glslOctal,glslOctalError,glslNumbersCom -if exists("c_no_bracket_error") - syn region glslParen transparent start='(' end=')' contains=ALLBUT,@glslParenGroup,glslCppParen,glslCppString - " glslCppParen: same as glslParen but ends at end-of-line; used in glslDefine - syn region glslCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@glslParenGroup,glslParen,glslString - syn match glslParenError display ")" - syn match glslErrInParen display contained "[{}]" -else - syn region glslParen transparent start='(' end=')' contains=ALLBUT,@glslParenGroup,glslCppParen,glslErrInBracket,glslCppBracket,glslCppString - " glslCppParen: same as glslParen but ends at end-of-line; used in glslDefine - syn region glslCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@glslParenGroup,glslErrInBracket,glslParen,glslBracket,glslString - syn match glslParenError display "[\])]" - syn match glslErrInParen display contained "[\]{}]" - syn region glslBracket transparent start='\[' end=']' contains=ALLBUT,@glslParenGroup,glslErrInParen,glslCppParen,glslCppBracket,glslCppString - " glslCppBracket: same as glslParen but ends at end-of-line; used in glslDefine - syn region glslCppBracket transparent start='\[' skip='\\$' excludenl end=']' end='$' contained contains=ALLBUT,@glslParenGroup,glslErrInParen,glslParen,glslBracket,glslString - syn match glslErrInBracket display contained "[);{}]" -endif - -"integer number, or floating point number without a dot and with "f". -syn case ignore -syn match glslNumbers display transparent "\<\d\|\.\d" contains=glslNumber,glslFloat,glslOctalError,glslOctal -" Same, but without octal error (for comments) -syn match glslNumbersCom display contained transparent "\<\d\|\.\d" contains=glslNumber,glslFloat,glslOctal -syn match glslNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>" -"hex number -syn match glslNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>" -" Flag the first zero of an octal number as something special -syn match glslOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=glslOctalZero -syn match glslOctalZero display contained "\<0" -syn match glslFloat display contained "\d\+f" -"floating point number, with dot, optional exponent -syn match glslFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=" -"floating point number, starting with a dot, optional exponent -syn match glslFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>" -"floating point number, without dot, with exponent -syn match glslFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>" -" flag an octal number with wrong digits -syn match glslOctalError display contained "0\o*[89]\d*" -syn case match - -if exists("c_comment_strings") - " A comment can contain glslString, glslCharacter and glslNumber. - " But a "*/" inside a glslString in a glslComment DOES end the comment! So we - " need to use a special type of glslString: glslCommentString, which also ends on - " "*/", and sees a "*" at the start of the line as glslomment again. - " Unfortunately this doesn't very well work for // type of comments :-( - syntax match glslCommentSkip contained "^\s*\*\($\|\s\+\)" - syntax region glslCommentString contained start=+L\=\\\@" skip="\\$" end="$" end="//"me=s-1 contains=glslComment,glslCppString,glslCharacter,glslCppParen,glslParenError,glslNumbers,glslCommentError,glslSpaceError -syn match glslPreCondit display "^\s*#\s*\(else\|endif\)\>" -syn region glslCppOut start="^\s*#\s*if\s\+0\+\>" end=".\|$" contains=glslCppOut2 -syn region glslCppOut2 contained start="0" end="^\s*#\s*\(endif\>\|else\>\|elif\>\)" contains=glslSpaceError,glslCppSkip -syn region glslCppSkip contained start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*#\s*endif\>" contains=glslSpaceError,glslCppSkip -"syn match glslLineSkip "\\$" -syn cluster glslPreProglslGroup contains=glslPreCondit,glslIncluded,glslInclude,glslDefine,glslErrInParen,glslErrInBracket,glslUserLabel,glslSpecial,glslOctalZero,glslCppOut,glslCppOut2,glslCppSkip,glslFormat,glslNumber,glslFloat,glslOctal,glslOctalError,glslNumbersCom,glslString,glslCommentSkip,glslCommentString,glslComment2String,@glslCommentGroup,glslCommentStartError,glslParen,glslBracket,glslMulti -syn region glslDefine start="^\s*#\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=ALLBUT,@glslPreProglslGroup -syn region glslPreProc start="^\s*#\s*\(pragma\>\|line\>\|error\>\|version\>\|extension\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@glslPreProglslGroup - -" Highlight User Labels -syn cluster glslMultiGroup contains=glslIncluded,glslSpecial,glslCommentSkip,glslCommentString,glslComment2String,@glslCommentGroup,glslCommentStartError,glslUserCont,glslUserLabel,glslBitField,glslOctalZero,glslCppOut,glslCppOut2,glslCppSkip,glslFormat,glslNumber,glslFloat,glslOctal,glslOctalError,glslNumbersCom,glslCppParen,glslCppBracket,glslCppString -syn region glslMulti transparent start='?' skip='::' end=':' contains=ALLBUT,@glslMultiGroup -" Avoid matching foo::bar() in C++ by requiring that the next char is not ':' -syn cluster glslLabelGroup contains=glslUserLabel -syn match glslUserCont display "^\s*\I\i*\s*:$" contains=@glslLabelGroup -syn match glslUserCont display ";\s*\I\i*\s*:$" contains=@glslLabelGroup -syn match glslUserCont display "^\s*\I\i*\s*:[^:]"me=e-1 contains=@glslLabelGroup -syn match glslUserCont display ";\s*\I\i*\s*:[^:]"me=e-1 contains=@glslLabelGroup - -syn match glslUserLabel display "\I\i*" contained - -" Avoid recognizing most bitfields as labels -syn match glslBitField display "^\s*\I\i*\s*:\s*[1-9]"me=e-1 -syn match glslBitField display ";\s*\I\i*\s*:\s*[1-9]"me=e-1 - -syn keyword glslState gl_Position gl_PointSize gl_ClipVertex -syn keyword glslState gl_FragCoord gl_FrontFacing gl_FragColor gl_FragData gl_FragDepth - -" vertex attributes -syn keyword glslState gl_Color gl_SecondaryColor gl_Normal gl_Vertex gl_FogCoord -syn match glslState display "gl_MultiTexCoord\d\+" - -" varying variables -syn keyword glslState gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord - -" uniforms -syn keyword glslUniform gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_NormalMatrix gl_TextureMatrix -syn keyword glslUniform gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial -syn keyword glslUniform gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct -syn keyword glslUniform gl_FrontLightProduct gl_BackLightProduct glTextureEnvColor -syn keyword glslUniform gl_TextureEnvColor gl_Fog -syn match glslUniform display "gl_EyePlane[STRQ]" -syn match glslUniform display "gl_ObjectPlane[STRQ]" -syn keyword glslUniform gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse -syn keyword glslUniform gl_TextureMatrixInverse gl_ModelViewMatrixTranspose gl_ProjectionMatrixTranspose -syn keyword glslUniform gl_ModelViewProjectionMatrixTranspose gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose -syn keyword glslUniform gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose - -" uniform types -syn keyword glslType gl_DepthRangeParameters gl_PointParameters gl_MaterialParameters -syn keyword glslType gl_LightSourceParameters gl_LightModelParameters gl_LightModelProducts -syn keyword glslType gl_LightProducts gl_FogParameters - -" constants -syn keyword glslConstant gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs -syn keyword glslConstant gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits -syn keyword glslConstant gl_MaxCombinedTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents -syn keyword glslConstant gl_MaxDrawBuffers - -" swizzling -syn match glslSwizzle /\.[xyzw]\{1,4\}\>/ -syn match glslSwizzle /\.[rgba]\{1,4\}\>/ -syn match glslSwizzle /\.[stpq]\{1,4\}\>/ - -" built in functions -syn keyword glslFunc radians degrees sin cos tan asin acos atan pow exp2 log2 sqrt inversesqrt -syn keyword glslFunc abs sign floor ceil fract mod min max clamp mix step smoothstep -syn keyword glslFunc length distance dot cross normalize ftransform faceforward reflect -syn keyword glslFunc matrixcompmult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not -syn keyword glslFunc texture1D texture1DProj texture1DLod texture1DProjLod -syn keyword glslFunc texture2D texture2DProj texture2DLod texture2DProjLod -syn keyword glslFunc texture3D texture3DProj texture3DLod texture3DProjLod -syn keyword glslFunc textureCube textureCubeLod -syn keyword glslFunc shadow1D shadow1DProj shadow1DLod shadow1DProjLod -syn keyword glslFunc shadow2D shadow2DProj shadow2DLod shadow2DProjLod -syn keyword glslFunc dFdx dFdy fwidth noise1 noise2 noise3 noise4 -syn keyword glslFunc refract exp log - -" highlight unsupported keywords -syn keyword glslUnsupported asm -syn keyword glslUnsupported class union enum typedef template this packed -syn keyword glslUnsupported goto switch default -syn keyword glslUnsupported inline noinline volatile public static extern external interface -syn keyword glslUnsupported long short double half fixed unsigned -syn keyword glslUnsupported input output -syn keyword glslUnsupported hvec2 hvec3 hvec4 dvec2 dvec3 dvec4 fvec2 fvec3 fvec4 -syn keyword glslUnsupported sampler2DRect sampler3DRect sampler2DRectShadow -syn keyword glslUnsupported sizeof cast -syn keyword glslUnsupported namespace using - -"wtf? -"let b:c_minlines = 50 " #if 0 constructs can be long -"exec "syn sync ccomment glslComment minlines=" . b:c_minlines - -" Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_glsl_syn_inits") - if version < 508 - let did_glsl_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - HiLink glslFormat glslSpecial - HiLink glslCppString glslString - HiLink glslCommentL glslComment - HiLink glslCommentStart glslComment - HiLink glslLabel Label - HiLink glslUserLabel Label - HiLink glslConditional Conditional - HiLink glslRepeat Repeat - HiLink glslCharacter Character - HiLink glslSpecialCharacter glslSpecial - HiLink glslNumber Number - HiLink glslOctal Number - HiLink glslOctalZero PreProc " link this to Error if you want - HiLink glslFloat Float - HiLink glslOctalError glslError - HiLink glslParenError glslError - HiLink glslErrInParen glslError - HiLink glslErrInBracket glslError - HiLink glslCommentError glslError - HiLink glslCommentStartError glslError - HiLink glslSpaceError glslError - HiLink glslSpecialError glslError - HiLink glslOperator Operator - HiLink glslStructure Structure - HiLink glslStorageClass StorageClass - HiLink glslInclude Include - HiLink glslPreProc PreProc - HiLink glslDefine Macro - HiLink glslIncluded glslString - HiLink glslError Error - HiLink glslStatement Statement - HiLink glslPreCondit PreCondit - HiLink glslType Type - HiLink glslConstant Constant - HiLink glslCommentString glslString - HiLink glslComment2String glslString - HiLink glslCommentSkip glslComment - HiLink glslString String - HiLink glslComment Comment - HiLink glslSpecial SpecialChar - HiLink glslSwizzle SpecialChar - HiLink glslTodo Todo - HiLink glslCppSkip glslCppOut - HiLink glslCppOut2 glslCppOut - HiLink glslCppOut Comment - HiLink glslUniform glslType - HiLink glslState glslType - HiLink glslFunc glslStatement - HiLink glslUnsupported glslError - - delcommand HiLink -endif - -let b:current_syntax = "glsl" - -" vim: ts=8 diff --git a/bundle/mustache b/bundle/mustache deleted file mode 160000 index 9c11901..0000000 --- a/bundle/mustache +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9c119016faf2e3e6c9077cf8bb9a7df400c2c400 diff --git a/bundle/solarized b/bundle/solarized deleted file mode 160000 index 528a59f..0000000 --- a/bundle/solarized +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 528a59f26d12278698bb946f8fb82a63711eec21 diff --git a/bundle/syntastic b/bundle/syntastic deleted file mode 160000 index 253cfe3..0000000 --- a/bundle/syntastic +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 253cfe3e821902ee8b5f4d3df760d3384dee8fbc diff --git a/bundle/tlib_vim b/bundle/tlib_vim deleted file mode 160000 index 4396422..0000000 --- a/bundle/tlib_vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4396422cb8273446b7d11f382dec006744201e79 diff --git a/bundle/vim-addon-mw-utils b/bundle/vim-addon-mw-utils deleted file mode 160000 index a2676b4..0000000 --- a/bundle/vim-addon-mw-utils +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a2676b4225b8a370b9e7046c5fc2f5ad1155e590 diff --git a/bundle/vim-coffee-script/copying.md b/bundle/vim-coffee-script/copying.md deleted file mode 100644 index 8fc6954..0000000 --- a/bundle/vim-coffee-script/copying.md +++ /dev/null @@ -1,15 +0,0 @@ - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - Version 2, December 2004 - - Copyright (C) 2010 to 2011 Mick Koch - - Everyone is permitted to copy and distribute verbatim or modified - copies of this license document, and changing it is allowed as long - as the name is changed. - - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. You just DO WHAT THE FUCK YOU WANT TO. - - diff --git a/bundle/vim-coffee-script/ftdetect/coffee.vim b/bundle/vim-coffee-script/ftdetect/coffee.vim deleted file mode 100644 index e1c1314..0000000 --- a/bundle/vim-coffee-script/ftdetect/coffee.vim +++ /dev/null @@ -1,7 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Mick Koch -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - -autocmd BufNewFile,BufRead *.coffee set filetype=coffee -autocmd BufNewFile,BufRead *Cakefile set filetype=coffee diff --git a/bundle/vim-coffee-script/ftdetect/eco.vim b/bundle/vim-coffee-script/ftdetect/eco.vim deleted file mode 100644 index b420649..0000000 --- a/bundle/vim-coffee-script/ftdetect/eco.vim +++ /dev/null @@ -1 +0,0 @@ -autocmd BufNewFile,BufRead *.eco set filetype=eco diff --git a/bundle/vim-coffee-script/ftplugin/coffee.vim b/bundle/vim-coffee-script/ftplugin/coffee.vim deleted file mode 100644 index b80e527..0000000 --- a/bundle/vim-coffee-script/ftplugin/coffee.vim +++ /dev/null @@ -1,22 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Mick Koch -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - -if exists("b:did_ftplugin") - finish -endif - -let b:did_ftplugin = 1 - -setlocal formatoptions-=t formatoptions+=croql -setlocal comments=s:###,m:\ ,e:###,:# -setlocal commentstring=#\ %s - -" Compile some CoffeeScript. -command! -range=% CoffeeCompile ,:w !coffee -scb - -" Compile the current file on write. -if exists("coffee_compile_on_save") - autocmd BufWritePost,FileWritePost *.coffee silent !coffee -c & -endif diff --git a/bundle/vim-coffee-script/indent/coffee.vim b/bundle/vim-coffee-script/indent/coffee.vim deleted file mode 100644 index cec9dc4..0000000 --- a/bundle/vim-coffee-script/indent/coffee.vim +++ /dev/null @@ -1,205 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Mick Koch -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - -if exists("b:did_indent") - finish -endif - -let b:did_indent = 1 - -setlocal autoindent -setlocal indentexpr=GetCoffeeIndent(v:lnum) -" Make sure GetCoffeeIndent is run when these are typed so they can be -" indented or outdented. -setlocal indentkeys+=0],0),0.,=else,=when,=catch,=finally - -" Only define the function once. -if exists("*GetCoffeeIndent") - finish -endif - -" Join a list of regexps as branches. -function! s:RegexpJoin(regexps) - return join(a:regexps, '\|') -endfunction - -" Create a regexp group from a list of regexps. -function! s:RegexpGroup(...) - return '\%(' . s:RegexpJoin(a:000) . '\)' -endfunction - -" Outdent certain keywords and brackets. -let s:outdent = '^' -\ . s:RegexpGroup('else', 'when', 'catch', 'finally', ']', '}', ')') - -" Indent after certain keywords. -let s:indent_after_keywords = '^' -\ . s:RegexpGroup('if', 'unless', 'else', 'for', -\ 'while', 'until', 'loop', 'switch', -\ 'when', 'try', 'catch', 'finally', -\ 'class') -\ . '\>' - -" Indent after brackets, functions, and assignments. -let s:indent_after_literals = s:RegexpGroup('\[', '{', '(', '->', '=>', ':', '=') -\ . '$' - -" Combine the two regexps above. -let s:indent_after = s:RegexpJoin([s:indent_after_keywords, -\ s:indent_after_literals]) - -" Indent after operators at the end of lines. -let s:continuations = s:RegexpGroup('-\@', '=\@', '-\@' - -" Outdent after certain keywords. -let s:outdent_after = '^' -\ . s:RegexpGroup('return', 'break', 'continue', 'throw') -\ . '\>' - -" Don't outdent if the line contains one of these keywords (for cases like -" 'return if a is b', 'break unless a', etc.) -let s:dont_outdent_after = '\<' . s:RegexpGroup('if', 'unless') . '\>' - -" Check for a single-line statement (e.g., 'if a then b'), which doesn't need an -" indent afterwards. -function! s:IsSingleLineStatement(line) - " The 'then' keyword is usually a good hint. - return a:line =~ '\' -endfunction - -" Check for a single-line 'else' statement (e.g., 'else return a' but -" not 'else if a'), which doesn't need an indent afterwards. -function! s:IsSingleLineElse(line) - " Check if the line actually starts with 'else', then if the line contains - " anything other than 'else', then finally if the line is actually an 'else' - " statement rather than an 'else if' or 'else unless' statement. - return a:line =~ '^else\>' - \ && a:line !~ '^else$' - \ && a:line !~ '^else if\>' - \ && a:line !~ '^else unless\>' -endfunction - -" Check if a 'when' statement is the first in a switch block by searching the -" previous line for the 'switch' keyword. The first 'when' shouldn't be -" outdented. -function! s:IsFirstWhen(curline, prevline) - return a:curline =~ '^when\>' && a:prevline =~ '\' -endfunction - -" Check for a multi-line assignment like -" a = if b -" c -" else -" d -function! s:IsMultiLineAssignment(line) - return a:line =~ s:assignment_keywords -endfunction - -" Check if a line is a comment. -function! s:IsComment(line) - return a:line =~ '^#' -endfunction - -" Check if a line is a dot-access. -function! s:IsDotAccess(line) - return a:line =~ '^\.' -endfunction - -" Check if a line is a continuation. -function! s:IsContinuation(line) - return a:line =~ s:continuations -endfunction - -function! s:ShouldOutdent(curline, prevline) - return !s:IsSingleLineStatement(a:prevline) - \ && !s:IsFirstWhen(a:curline, a:prevline) - \ && a:prevline !~ s:outdent_after - \ && a:curline =~ s:outdent -endfunction - -function! s:ShouldIndent(curline, prevline) - return !s:IsDotAccess(a:prevline) && s:IsDotAccess(a:curline) -endfunction - -function! s:ShouldIndentAfter(prevline, prevprevline) - return !s:IsSingleLineStatement(a:prevline) - \ && !s:IsSingleLineElse(a:prevline) - \ && !s:IsComment(a:prevline) - \ - \ && (a:prevline =~ s:indent_after - \ || s:IsMultiLineAssignment(a:prevline) - \ - \ || (s:IsContinuation(a:prevline) - \ && !s:IsContinuation(a:prevprevline) - \ && a:prevprevline !~ s:indent_after_literals)) -endfunction - -function! s:ShouldOutdentAfter(prevline) - return (a:prevline !~ s:dont_outdent_after - \ || s:IsSingleLineStatement(a:prevline)) - \ && a:prevline =~ s:outdent_after -endfunction - -" Get the nearest previous non-blank line. -function! s:GetPrevLineNum(linenum) - return prevnonblank(a:linenum - 1) -endfunction - -" Get the contents of a line without leading whitespace. -function! s:GetTrimmedLine(linenum) - return substitute(substitute(getline(a:linenum), '^\s\+', '', ''), - \ '\s\+$', '', '') -endfunction - -function! GetCoffeeIndent(curlinenum) - let prevlinenum = s:GetPrevLineNum(a:curlinenum) - let prevprevlinenum = s:GetPrevLineNum(prevlinenum) - - " No indenting is needed at the start of a file. - if prevlinenum == 0 - return 0 - endif - - let curindent = indent(a:curlinenum) - let previndent = indent(prevlinenum) - - let curline = s:GetTrimmedLine(a:curlinenum) - let prevline = s:GetTrimmedLine(prevlinenum) - let prevprevline = s:GetTrimmedLine(prevprevlinenum) - - if s:ShouldIndent(curline, prevline) - return previndent + &shiftwidth - endif - - if s:ShouldOutdent(curline, prevline) - " Is the line already outdented? - if curindent < previndent - return curindent - else - return curindent - &shiftwidth - endif - endif - - if s:ShouldIndentAfter(prevline, prevprevline) - return previndent + &shiftwidth - endif - - if s:ShouldOutdentAfter(prevline) - return previndent - &shiftwidth - endif - - " No indenting or outdenting is needed - return curindent -endfunction diff --git a/bundle/vim-coffee-script/readme.md b/bundle/vim-coffee-script/readme.md deleted file mode 100644 index 0d4b330..0000000 --- a/bundle/vim-coffee-script/readme.md +++ /dev/null @@ -1,109 +0,0 @@ -This project adds [CoffeeScript] support to the vim editor. Currently, it -supports [almost][todo] all of CoffeeScript's syntax and indentation style. - -![Screenshot][screenshot] - -[CoffeeScript]: http://coffeescript.org -[todo]: http://github.com/kchmck/vim-coffee-script/blob/master/todo.md -[screenshot]: http://i.imgur.com/xbto8.png - -### Installing and using - -1. Install [pathogen] into `~/.vim/autoload/` and add the following line to your - `~/.vimrc`: - - call pathogen#runtime_append_all_bundles() - - Be aware that it must be added before any `filetype plugin indent on` - lines according to the install page: - - > Note that you need to invoke the pathogen functions before invoking - > "filetype plugin indent on" if you want it to load ftdetect files. On - > Debian (and probably other distros), the system vimrc does this early on, - > so you actually need to "filetype off" before "filetype plugin indent on" - > to force reloading. - -[pathogen]: http://www.vim.org/scripts/script.php?script_id=2332 - -2. Create, and change into, the `~/.vim/bundle/` directory: - - $ mkdir -p ~/.vim/bundle - $ cd ~/.vim/bundle - -3. Make a clone of the `vim-coffee-script` repository: - - $ git clone git://github.com/kchmck/vim-coffee-script.git - [...] - $ ls - vim-coffee-script/ - -That's it. Pathogen should handle the rest. Opening a file with a `.coffee` -extension or a `Cakefile` will load everything CoffeeScript. - -### Updating - -1. Change into the `~/.vim/bundle/vim-coffee-script/` directory: - - $ cd ~/.vim/bundle/vim-coffee-script - -2. Pull in the latest changes: - - $ git pull - -Everything will then be brought up to date. - -### Compiling a CoffeeScript Snippet - -The `CoffeeCompile` command can be used to peek at how the current file or a -snippet of CoffeeScript would be compiled to JavaScript. Calling `CoffeeCompile` -without a range compiles the entire file: - - ![CoffeeCompile](http://i.imgur.com/AZAAd.png) - -and shows an output like: - - ![Compiled](http://i.imgur.com/5Huj4.png) - -Calling `CoffeeCompile` with a range, like in visual mode, compiles the selected -snippet of CoffeeScript: - - ![CoffeeCompile Snippet](http://i.imgur.com/SKqCc.png) - -and shows an output like: - - ![Compiled Snippet](http://i.imgur.com/wkO4f.png) - -The command can also be mapped to a visual mode key for convenience: - - vmap KEY :CoffeeCompile - -### Customizing - -#### Compile the current file on write/save - -If you are using the NodeJS version of CoffeeScript, with the `coffee` command -in your `$PATH`, you can enable auto-compiling on file write/save like so: - - let coffee_compile_on_save = 1 - -This will compile the CoffeeScript to JavaScript. For example, -`/Users/brian/ZOMG.coffee` will compile to `/Users/brian/ZOMG.js`. - -#### Disable trailing whitespace error highlighting - -If having trailing whitespace highlighted as an error is a bit much, the -following line can be added to your `~/.vimrc` to disable it: - - let coffee_no_trailing_space_error = 1 - -#### Disable trailing semicolon error highlighting - -Likewise for the highlighting of trailing semicolons: - - let coffee_no_trailing_semicolon_error = 1 - -#### Disable future/reserved words error highlighting - -The same for reserved words: - - let coffee_no_reserved_words_error = 1 diff --git a/bundle/vim-coffee-script/syntax/coffee.vim b/bundle/vim-coffee-script/syntax/coffee.vim deleted file mode 100755 index c59a211..0000000 --- a/bundle/vim-coffee-script/syntax/coffee.vim +++ /dev/null @@ -1,175 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Mick Koch -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - -if exists("b:current_syntax") - finish -endif - -if version < 600 - syntax clear -endif - -let b:current_syntax = "coffee" - -" Highlight long strings. -syntax sync minlines=100 - -" CoffeeScript allows dollar signs in identifiers. -setlocal isident+=$ - -" These are 'matches' rather than 'keywords' because vim's highlighting priority -" for keywords (the highest) causes them to be wrongly highlighted when used as -" dot-properties. -syntax match coffeeStatement /\<\%(return\|break\|continue\|throw\)\>/ -highlight default link coffeeStatement Statement - -syntax match coffeeRepeat /\<\%(for\|while\|until\|loop\)\>/ -highlight default link coffeeRepeat Repeat - -syntax match coffeeConditional /\<\%(if\|else\|unless\|switch\|when\|then\)\>/ -highlight default link coffeeConditional Conditional - -syntax match coffeeException /\<\%(try\|catch\|finally\)\>/ -highlight default link coffeeException Exception - -syntax match coffeeOperator /\<\%(instanceof\|typeof\|delete\)\>/ -highlight default link coffeeOperator Operator - -syntax match coffeeKeyword /\<\%(new\|in\|of\|by\|and\|or\|not\|is\|isnt\|class\|extends\|super\|own\|do\)\>/ -highlight default link coffeeKeyword Keyword - -syntax match coffeeBoolean /\<\%(\%(true\|on\|yes\|false\|off\|no\)\)\>/ -highlight default link coffeeBoolean Boolean - -syntax match coffeeGlobal /\<\%(null\|undefined\)\>/ -highlight default link coffeeGlobal Type - -" Keywords reserved by the language -syntax cluster coffeeReserved contains=coffeeStatement,coffeeRepeat, -\ coffeeConditional,coffeeException, -\ coffeeOperator,coffeeKeyword, -\ coffeeBoolean,coffeeGlobal - -syntax match coffeeVar /\<\%(this\|prototype\|arguments\)\>/ -" Matches @-variables like @abc. -syntax match coffeeVar /@\%(\I\i*\)\?/ -highlight default link coffeeVar Type - -" Matches class-like names that start with a capital letter, like Array or -" Object. -syntax match coffeeObject /\<\u\w*\>/ -highlight default link coffeeObject Structure - -" Matches constant-like names in SCREAMING_CAPS. -syntax match coffeeConstant /\<\u[A-Z0-9_]\+\>/ -highlight default link coffeeConstant Constant - -" What can make up a variable name -syntax cluster coffeeIdentifier contains=coffeeVar,coffeeObject,coffeeConstant, -\ coffeePrototype - -syntax region coffeeString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=@coffeeInterpString -syntax region coffeeString start=/'/ skip=/\\\\\|\\'/ end=/'/ contains=@coffeeSimpleString -highlight default link coffeeString String - -syntax region coffeeAssignString start=/"/ skip=/\\\\\|\\"/ end=/"/ contained contains=@coffeeSimpleString -syntax region coffeeAssignString start=/'/ skip=/\\\\\|\\'/ end=/'/ contained contains=@coffeeSimpleString -highlight default link coffeeAssignString String - -" Matches numbers like -10, -10e8, -10E8, 10, 10e8, 10E8. -syntax match coffeeNumber /\i\@/ -highlight default link coffeeNumber Number - -" Matches floating-point numbers like -10.42e8, 10.42e-8. -syntax match coffeeFloat /\i\@>\|>>>\|&\||\|\^\)\?=\@\@!/ contained -highlight default link coffeeAssignSymbols SpecialChar - -syntax match coffeeAssignBrackets /\[.\+\]/ contained contains=TOP,coffeeAssign - -syntax match coffeeAssign /\%(++\|--\)\s*\%(@\|@\?\I\)\%(\i\|::\|\.\|?\|\[.\+\]\)*/ -\ contains=@coffeeIdentifier,coffeeAssignSymbols,coffeeAssignBrackets -syntax match coffeeAssign /\%(@\|@\?\I\)\%(\i\|::\|\.\|?\|\[.\+\]\)*\%(++\|--\|\s*\%(and\|or\|&&\|||\|?\|+\|-\|\/\|\*\|%\|<<\|>>\|>>>\|&\||\|\^\)\?=\@\@!\)/ -\ contains=@coffeeIdentifier,coffeeAssignSymbols,coffeeAssignBrackets - -" Displays an error for reserved words. -if !exists("coffee_no_reserved_words_error") - syntax match coffeeReservedError /\<\%(case\|default\|function\|var\|void\|with\|const\|let\|enum\|export\|import\|native\|__hasProp\|__extends\|__slice\|__bind\|__indexOf\)\>/ - highlight default link coffeeReservedError Error -endif - -syntax match coffeeAssign /@\?\I\i*\s*:\@\|=>/ -highlight default link coffeeFunction Function - -syntax keyword coffeeTodo TODO FIXME XXX contained -highlight default link coffeeTodo Todo - -syntax match coffeeComment /#.*/ contains=@Spell,coffeeTodo -syntax match coffeeComment /####\@!\_.\{-}###/ contains=@Spell,coffeeTodo -highlight default link coffeeComment Comment - -syntax region coffeeHereComment start=/#/ end=/\ze\/\/\// end=/$/ contained contains=@Spell,coffeeTodo -highlight default link coffeeHereComment coffeeComment - -syntax region coffeeEmbed start=/`/ skip=/\\\\\|\\`/ end=/`/ -highlight default link coffeeEmbed Special - -syntax region coffeeInterpolation matchgroup=coffeeInterpDelim -\ start=/\#{/ end=/}/ -\ contained contains=TOP -highlight default link coffeeInterpDelim Delimiter - -" Matches escape sequences like \000, \x00, \u0000, \n. -syntax match coffeeEscape /\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\./ contained -highlight default link coffeeEscape SpecialChar - -" What is in a non-interpolated string -syntax cluster coffeeSimpleString contains=@Spell,coffeeEscape -" What is in an interpolated string -syntax cluster coffeeInterpString contains=@coffeeSimpleString, -\ coffeeInterpolation - -syntax region coffeeRegExp start=/)\@/ contains=@coffeeTop containedin=ALLBUT,@ecoRegions keepend -syn region ecoExpression matchgroup=ecoDelimiter start=/<%[=\-]/ end=/%>/ contains=@coffeeTop containedin=ALLBUT,@ecoRegions keepend -syn region ecoComment matchgroup=ecoComment start=/<%#/ end=/%>/ contains=@coffeeTodo,@Spell containedin=ALLBUT,@ecoRegions keepend - -" eco features not in coffeescript proper -syn keyword ecoEnd end containedin=@ecoRegions -syn match ecoIndentColon /\s+\w+:/ containedin=@ecoRegions - -" Define the default highlighting. - -hi def link ecoDelimiter Delimiter -hi def link ecoComment Comment -hi def link ecoEnd coffeeConditional -hi def link ecoIndentColon None - -let b:current_syntax = 'eco' - -" vim: nowrap sw=2 sts=2 ts=8: diff --git a/bundle/vim-coffee-script/thanks.md b/bundle/vim-coffee-script/thanks.md deleted file mode 100644 index e9fdc5a..0000000 --- a/bundle/vim-coffee-script/thanks.md +++ /dev/null @@ -1,22 +0,0 @@ -Thanks to the following contributors: - - Brian Egan (3): - Adding compile functionality to the ftplugin. Must be enabled in .vimrc - Updating the readme with compilation instructions - Updating bad header in readme to make instructions easier to read - - Chris Hoffman (3): - Add new keywoards from, to, and do - Highlight the - in negative integers - Add here regex highlighting, increase fold level for here docs - - Jay Adkisson: - Support for eco templates - - Karl Guertin (1): - Cakefiles are coffeescript - - Simon Lipp (1): - Trailing spaces are not error on lines containing only spaces - -And thanks to anyone who files or has filed a bug report. diff --git a/bundle/vim-coffee-script/todo.md b/bundle/vim-coffee-script/todo.md deleted file mode 100644 index f45f2b6..0000000 --- a/bundle/vim-coffee-script/todo.md +++ /dev/null @@ -1,26 +0,0 @@ -# To do for full support - -- Destructuring assignments like: - - [a, b] = c - {a, b} = c - └──┴─ these should be highlighted as identifiers - -- Smart, lookback outdenting for cases like: - - a = { - b: -> - c - } - └─ bracket should be put here - -- Fix assignments with brackets in these cases: - - a[b] = c[d] - a[b -= c] = d - - and still highlight these correctly: - - a[b] = c - a[b[c]] = d - a[b[c] -= d] = e diff --git a/bundle/vim-markdown b/bundle/vim-markdown deleted file mode 160000 index f3f96fd..0000000 --- a/bundle/vim-markdown +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f3f96fd7c1bec0527de62415fd344e73994f1c47 diff --git a/bundle/vim-repeat b/bundle/vim-repeat deleted file mode 160000 index d75a544..0000000 --- a/bundle/vim-repeat +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d75a544b786710705f0db0d8d8fd66ca4a5a7239 diff --git a/bundle/vim-snipmate b/bundle/vim-snipmate deleted file mode 160000 index 4cef3fc..0000000 --- a/bundle/vim-snipmate +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4cef3fca6969155698cda224acfb0843c2d6c6b4 diff --git a/bundle/vim-surround b/bundle/vim-surround deleted file mode 160000 index 489a1e8..0000000 --- a/bundle/vim-surround +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 489a1e8c676ad47dd358dbf883bfaf492148d38b diff --git a/bundle/vimroom b/bundle/vimroom deleted file mode 160000 index 4c3a5e6..0000000 --- a/bundle/vimroom +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4c3a5e6ad16d2b8277154cc40d6c28616bfd9ede diff --git a/colors/wombat.vim b/colors/wombat.vim deleted file mode 100644 index 75b6a7b..0000000 --- a/colors/wombat.vim +++ /dev/null @@ -1,50 +0,0 @@ -" Maintainer: Lars H. Nielsen (dengmao@gmail.com) -" Last Change: January 22 2007 - -set background=dark - -hi clear - -if exists("syntax_on") - syntax reset -endif - -let colors_name = "wombat" - - -" Vim >= 7.0 specific colors -if version >= 700 - hi CursorLine guibg=#2d2d2d - hi CursorColumn guibg=#2d2d2d - hi MatchParen guifg=#f6f3e8 guibg=#857b6f gui=bold - hi Pmenu guifg=#f6f3e8 guibg=#444444 - hi PmenuSel guifg=#000000 guibg=#cae682 -endif - -" General colors -hi Cursor guifg=NONE guibg=#656565 gui=none -hi Normal guifg=#f6f3e8 guibg=#242424 gui=none -hi Search guifg=#f6f3e8 guibg=#343434 gui=none -hi NonText guifg=#808080 guibg=#303030 gui=none -hi LineNr guifg=#857b6f guibg=#000000 gui=none -hi StatusLine guifg=#f6f3e8 guibg=#444444 gui=italic -hi StatusLineNC guifg=#857b6f guibg=#444444 gui=none -hi VertSplit guifg=#444444 guibg=#444444 gui=none -hi Folded guibg=#384048 guifg=#a0a8b0 gui=none -hi Title guifg=#f6f3e8 guibg=NONE gui=bold -hi Visual guifg=#f6f3e8 guibg=#444444 gui=none -hi SpecialKey guifg=#808080 guibg=#343434 gui=none - -" Syntax highlighting -hi Comment guifg=#99968b gui=italic -hi Todo guifg=#8f8f8f gui=italic -hi Constant guifg=#e5786d gui=none -hi String guifg=#95e454 gui=italic -hi Identifier guifg=#cae682 gui=none -hi Function guifg=#cae682 gui=none -hi Type guifg=#cae682 gui=none -hi Statement guifg=#8ac6f2 gui=none -hi Keyword guifg=#8ac6f2 gui=none -hi PreProc guifg=#e5786d gui=none -hi Number guifg=#e5786d gui=none -hi Special guifg=#e7f6da gui=none diff --git a/doc/NERD_tree.txt b/doc/NERD_tree.txt deleted file mode 100644 index 5e6c109..0000000 --- a/doc/NERD_tree.txt +++ /dev/null @@ -1,1227 +0,0 @@ -*NERD_tree.txt* A tree explorer plugin that owns your momma! - - - - omg its ... ~ - - ________ ________ _ ____________ ____ __________ ____________~ - /_ __/ / / / ____/ / | / / ____/ __ \/ __ \ /_ __/ __ \/ ____/ ____/~ - / / / /_/ / __/ / |/ / __/ / /_/ / / / / / / / /_/ / __/ / __/ ~ - / / / __ / /___ / /| / /___/ _, _/ /_/ / / / / _, _/ /___/ /___ ~ - /_/ /_/ /_/_____/ /_/ |_/_____/_/ |_/_____/ /_/ /_/ |_/_____/_____/ ~ - - - Reference Manual~ - - - - -============================================================================== -CONTENTS *NERDTree-contents* - - 1.Intro...................................|NERDTree| - 2.Functionality provided..................|NERDTreeFunctionality| - 2.1 Global commands...................|NERDTreeGlobalCommands| - 2.2 Bookmarks.........................|NERDTreeBookmarks| - 2.2.1 The bookmark table..........|NERDTreeBookmarkTable| - 2.2.2 Bookmark commands...........|NERDTreeBookmarkCommands| - 2.2.3 Invalid bookmarks...........|NERDTreeInvalidBookmarks| - 2.3 NERD tree mappings................|NERDTreeMappings| - 2.4 The filesystem menu...............|NERDTreeFilesysMenu| - 3.Options.................................|NERDTreeOptions| - 3.1 Option summary....................|NERDTreeOptionSummary| - 3.2 Option details....................|NERDTreeOptionDetails| - 4.Public functions........................|NERDTreePublicFunctions| - 5.TODO list...............................|NERDTreeTodo| - 6.The Author..............................|NERDTreeAuthor| - 7.Changelog...............................|NERDTreeChangelog| - 8.Credits.................................|NERDTreeCredits| - 9.License.................................|NERDTreeLicense| - -============================================================================== -1. Intro *NERDTree* - -What is this "NERD tree"?? - -The NERD tree allows you to explore your filesystem and to open files and -directories. It presents the filesystem to you in the form of a tree which you -manipulate with the keyboard and/or mouse. It also allows you to perform -simple filesystem operations. - -The following features and functionality are provided by the NERD tree: - * Files and directories are displayed in a hierarchical tree structure - * Different highlighting is provided for the following types of nodes: - * files - * directories - * sym-links - * windows .lnk files - * read-only files - * executable files - * Many (customisable) mappings are provided to manipulate the tree: - * Mappings to open/close/explore directory nodes - * Mappings to open files in new/existing windows/tabs - * Mappings to change the current root of the tree - * Mappings to navigate around the tree - * ... - * Directories and files can be bookmarked. - * Most NERD tree navigation can also be done with the mouse - * Dynamic customisation of tree content - * custom file filters to prevent e.g. vim backup files being displayed - * optional displaying of hidden files (. files) - * files can be "turned off" so that only directories are displayed - * A textual filesystem menu is provided which allows you to - create/delete/move file and directory nodes as well as copy (for - supported OSs) - * The position and size of the NERD tree window can be customised - * The order in which the nodes in the tree are listed can be customised. - * A model of your filesystem is created/maintained as you explore it. This - has several advantages: - * All filesystem information is cached and is only re-read on demand - * If you revisit a part of the tree that you left earlier in your - session, the directory nodes will be opened/closed as you left them - * The script remembers the cursor position and window position in the NERD - tree so you can toggle it off (or just close the tree window) and then - reopen it (with NERDTreeToggle) the NERD tree window will appear EXACTLY - as you left it - * You can have a separate NERD tree for each tab - -============================================================================== -2. Functionality provided *NERDTreeFunctionality* - ------------------------------------------------------------------------------- -2.1. Global Commands *NERDTreeGlobalCommands* - -:NERDTree [ | ] *:NERDTree* - Opens a fresh NERD tree. The root of the tree depends on the argument - given. There are 3 cases: If no argument is given, the current directory - will be used. If a directory is given, that will be used. If a bookmark - name is given, the corresponding directory will be used. For example: > - :NERDTree /home/marty/vim7/src - :NERDTree foo (foo is the name of a bookmark) -< -:NERDTreeFromBookmark *:NERDTreeFromBookmark* - Opens a fresh NERD tree with the root initialized to the dir for - . This only reason to use this command over :NERDTree is for - the completion (which is for bookmarks rather than directories). - -:NERDTreeToggle [ | ] *:NERDTreeToggle* - If a NERD tree already exists for this tab, it is reopened and rendered - again. If no NERD tree exists for this tab then this command acts the - same as the |:NERDTree| command. - -:NERDTreeClose - Close the NERD tree in this tab. - ------------------------------------------------------------------------------- -2.2. Bookmarks *NERDTreeBookmarks* - -Bookmarks in the NERD tree are a way to tag files or directories of interest. -For example, you could use bookmarks to tag all of your project directories. - ------------------------------------------------------------------------------- -2.2.1. The Bookmark Table *NERDTreeBookmarkTable* - -If the bookmark table is active (see |NERDTree-B| and -|NERDTreeShowBookmarks|), it will be rendered above the tree. You can double -click bookmarks or use the |NERDTree-o| mapping to activate them. See also, -|NERDTree-t| and |NERDTree-T| - ------------------------------------------------------------------------------- -2.2.2. Bookmark commands *NERDTreeBookmarkCommands* - -Note that the following commands are only available in the NERD tree buffer. - -:Bookmark - Bookmark the current node as . If there is already a - bookmark, it is overwritten. must not contain spaces. - -:BookmarkToRoot - Make the directory corresponding to the new root. If a treenode - corresponding to is already cached somewhere in the tree then - the current tree will be used, otherwise a fresh tree will be opened. - Note that if points to a file then its parent will be used - instead. - -:RevealBookmark - If the node is cached under the current root then it will be revealed - (i.e. directory nodes above it will be opened) and the cursor will be - placed on it. - -:OpenBookmark - must point to a file. The file is opened as though |NERDTree-o| - was applied. If the node is cached under the current root then it will be - revealed and the cursor will be placed on it. - -:ClearBookmarks [] - Remove all the given bookmarks. If no bookmarks are given then remove all - bookmarks on the current node. - -:ClearAllBookmarks - Remove all bookmarks. - -:ReadBookmarks - Re-read the bookmarks in the |NERDTreeBookmarksFile|. - -See also |:NERDTree| and |:NERDTreeFromBookmark|. - ------------------------------------------------------------------------------- -2.2.3. Invalid Bookmarks *NERDTreeInvalidBookmarks* - -If invalid bookmarks are detected, the script will issue an error message and -the invalid bookmarks will become unavailable for use. - -These bookmarks will still be stored in the bookmarks file (see -|NERDTreeBookmarksFile|), down the bottom. There will always be a blank line -after the valid bookmarks but before the invalid ones. - -Each line in the bookmarks file represents one bookmark. The proper format is: - - -After you have corrected any invalid bookmarks, either restart vim, or go -:ReadBookmarks from the NERD tree window. - ------------------------------------------------------------------------------- -2.3. NERD tree Mappings *NERDTreeMappings* - -Default Description~ help-tag~ -Key~ - -o.......Open files, directories and bookmarks....................|NERDTree-o| -go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go| -t.......Open selected node/bookmark in a new tab.................|NERDTree-t| -T.......Same as 't' but keep the focus on the current tab........|NERDTree-T| -...Open selected file in a split window.....................|NERDTree-tab| -g..Same as , but leave the cursor on the NERDTree......|NERDTree-gtab| -!.......Execute the current file.................................|NERDTree-!| -O.......Recursively open the selected directory..................|NERDTree-O| -x.......Close the current nodes parent...........................|NERDTree-x| -X.......Recursively close all children of the current node.......|NERDTree-X| -e.......Open a netrw for the current dir.........................|NERDTree-e| - -double-click.......same as the |NERDTree-o| map. -middle-click.......same as |NERDTree-tab| for files, same as - |NERDTree-e| for dirs. - -D.......Delete the current bookmark .............................|NERDTree-D| - -P.......Jump to the root node....................................|NERDTree-P| -p.......Jump to current nodes parent.............................|NERDTree-p| -K.......Jump up inside directories at the current tree depth.....|NERDTree-K| -J.......Jump down inside directories at the current tree depth...|NERDTree-J| -...Jump down to the next sibling of the current directory...|NERDTree-c-j| -...Jump up to the previous sibling of the current directory.|NERDTree-c-k| - -C.......Change the tree root to the selected dir.................|NERDTree-C| -u.......Move the tree root up one directory......................|NERDTree-u| -U.......Same as 'u' except the old root node is left open........|NERDTree-U| -r.......Recursively refresh the current directory................|NERDTree-r| -R.......Recursively refresh the current root.....................|NERDTree-R| -m.......Display the filesystem menu..............................|NERDTree-m| -cd......Change the CWD to the dir of the selected node...........|NERDTree-cd| - -H.......Toggle whether hidden files displayed....................|NERDTree-H| -f.......Toggle whether the file filters are used.................|NERDTree-f| -F.......Toggle whether files are displayed.......................|NERDTree-F| -B.......Toggle whether the bookmark table is displayed...........|NERDTree-B| - -q.......Close the NERDTree window................................|NERDTree-q| -?.......Toggle the display of the quick help.....................|NERDTree-?| - ------------------------------------------------------------------------------- - *NERDTree-o* -Default key: o -Map option: NERDTreeMapActivateNode -Applies to: files and directories. - -If a file node is selected, it is opened in the previous window. - -If a directory is selected it is opened or closed depending on its current -state. - -If a bookmark that links to a directory is selected then that directory -becomes the new root. - -If a bookmark that links to a file is selected then that file is opened in the -previous window. - ------------------------------------------------------------------------------- - *NERDTree-go* -Default key: go -Map option: None -Applies to: files. - -If a file node is selected, it is opened in the previous window, but the -cursor does not move. - -The key combo for this mapping is always "g" + NERDTreeMapActivateNode (see -|NERDTree-o|). - ------------------------------------------------------------------------------- - *NERDTree-t* -Default key: t -Map option: NERDTreeMapOpenInTab -Applies to: files and directories. - -Opens the selected file in a new tab. If a directory is selected, a fresh -NERD Tree for that directory is opened in a new tab. - -If a bookmark which points to a directory is selected, open a NERD tree for -that directory in a new tab. If the bookmark points to a file, open that file -in a new tab. - ------------------------------------------------------------------------------- - *NERDTree-T* -Default key: T -Map option: NERDTreeMapOpenInTabSilent -Applies to: files and directories. - -The same as |NERDTree-t| except that the focus is kept in the current tab. - ------------------------------------------------------------------------------- - *NERDTree-tab* -Default key: -Map option: NERDTreeMapOpenSplit -Applies to: files. - -Opens the selected file in a new split window and puts the cursor in the new -window. - ------------------------------------------------------------------------------- - *NERDTree-gtab* -Default key: g -Map option: None -Applies to: files. - -The same as |NERDTree-tab| except that the cursor is not moved. - -The key combo for this mapping is always "g" + NERDTreeMapOpenSplit (see -|NERDTree-tab|). - ------------------------------------------------------------------------------- - *NERDTree-!* -Default key: ! -Map option: NERDTreeMapExecute -Applies to: files. - -Executes the selected file, prompting for arguments first. - ------------------------------------------------------------------------------- - *NERDTree-O* -Default key: O -Map option: NERDTreeMapOpenRecursively -Applies to: directories. - -Recursively opens the selelected directory. - -All files and directories are cached, but if a directory would not be -displayed due to file filters (see |NERDTreeIgnore| |NERDTree-f|) or the -hidden file filter (see |NERDTreeShowHidden|) then its contents are not -cached. This is handy, especially if you have .svn directories. - ------------------------------------------------------------------------------- - *NERDTree-x* -Default key: x -Map option: NERDTreeMapCloseDir -Applies to: files and directories. - -Closes the parent of the selected node. - ------------------------------------------------------------------------------- - *NERDTree-X* -Default key: X -Map option: NERDTreeMapCloseChildren -Applies to: directories. - -Recursively closes all children of the selected directory. - -Tip: To quickly "reset" the tree, use |NERDTree-P| with this mapping. - ------------------------------------------------------------------------------- - *NERDTree-e* -Default key: e -Map option: NERDTreeMapOpenExpl -Applies to: files and directories. - -Opens a netrw on the selected directory, or the selected file's directory. - ------------------------------------------------------------------------------- - *NERDTree-D* -Default key: D -Map option: NERDTreeMapDeleteBookmark -Applies to: lines in the bookmarks table - -Deletes the currently selected bookmark. - ------------------------------------------------------------------------------- - *NERDTree-P* -Default key: P -Map option: NERDTreeMapJumpRoot -Applies to: no restrictions. - -Jump to the tree root. - ------------------------------------------------------------------------------- - *NERDTree-p* -Default key: p -Map option: NERDTreeMapJumpParent -Applies to: files and directories. - -Jump to the parent node of the selected node. - ------------------------------------------------------------------------------- - *NERDTree-K* -Default key: K -Map option: NERDTreeMapJumpFirstChild -Applies to: files and directories. - -Jump to the first child of the current nodes parent. - -If the cursor is already on the first node then do the following: - * loop back thru the siblings of the current nodes parent until we find an - open dir with children - * go to the first child of that node - ------------------------------------------------------------------------------- - *NERDTree-J* -Default key: J -Map option: NERDTreeMapJumpLastChild -Applies to: files and directories. - -Jump to the last child of the current nodes parent. - -If the cursor is already on the last node then do the following: - * loop forward thru the siblings of the current nodes parent until we find - an open dir with children - * go to the last child of that node - ------------------------------------------------------------------------------- - *NERDTree-c-j* -Default key: -Map option: NERDTreeMapJumpNextSibling -Applies to: files and directories. - -Jump to the next sibling of the selected node. - ------------------------------------------------------------------------------- - *NERDTree-c-k* -Default key: -Map option: NERDTreeMapJumpPrevSibling -Applies to: files and directories. - -Jump to the previous sibling of the selected node. - ------------------------------------------------------------------------------- - *NERDTree-C* -Default key: C -Map option: NERDTreeMapChdir -Applies to: directories. - -Make the selected directory node the new tree root. If a file is selected, its -parent is used. - ------------------------------------------------------------------------------- - *NERDTree-u* -Default key: u -Map option: NERDTreeMapUpdir -Applies to: no restrictions. - -Move the tree root up a dir (like doing a "cd .."). - ------------------------------------------------------------------------------- - *NERDTree-U* -Default key: U -Map option: NERDTreeMapUpdirKeepOpen -Applies to: no restrictions. - -Like |NERDTree-u| except that the old tree root is kept open. - ------------------------------------------------------------------------------- - *NERDTree-r* -Default key: r -Map option: NERDTreeMapRefresh -Applies to: files and directories. - -If a dir is selected, recursively refresh that dir, i.e. scan the filesystem -for changes and represent them in the tree. - -If a file node is selected then the above is done on it's parent. - ------------------------------------------------------------------------------- - *NERDTree-R* -Default key: R -Map option: NERDTreeMapRefreshRoot -Applies to: no restrictions. - -Recursively refresh the tree root. - ------------------------------------------------------------------------------- - *NERDTree-m* -Default key: m -Map option: NERDTreeMapFilesystemMenu -Applies to: files and directories. - -Display the filesystem menu. See |NERDTreeFilesysMenu| for details. - ------------------------------------------------------------------------------- - *NERDTree-H* -Default key: H -Map option: NERDTreeMapToggleHidden -Applies to: no restrictions. - -Toggles whether hidden files are displayed. Hidden files are any -file/directory that starts with a "." - ------------------------------------------------------------------------------- - *NERDTree-f* -Default key: f -Map option: NERDTreeMapToggleFilters -Applies to: no restrictions. - -Toggles whether file filters are used. See |NERDTreeIgnore| for details. - ------------------------------------------------------------------------------- - *NERDTree-F* -Default key: F -Map option: NERDTreeMapToggleFiles -Applies to: no restrictions. - -Toggles whether file nodes are displayed. - ------------------------------------------------------------------------------- - *NERDTree-B* -Default key: B -Map option: NERDTreeMapToggleBookmarks -Applies to: no restrictions. - -Toggles whether the bookmarks table is displayed. - ------------------------------------------------------------------------------- - *NERDTree-q* -Default key: q -Map option: NERDTreeMapQuit -Applies to: no restrictions. - -Closes the NERDtree window. - ------------------------------------------------------------------------------- - *NERDTree-?* -Default key: ? -Map option: NERDTreeMapHelp -Applies to: no restrictions. - -Toggles whether the quickhelp is displayed. - ------------------------------------------------------------------------------- -2.3. The filesystem menu *NERDTreeFilesysMenu* - -The purpose of the filesystem menu is to allow you to perform basic filesystem -operations quickly from the NERD tree rather than the console. - -The filesystem menu can be accessed with 'm' mapping and has four supported -operations: > - 1. Adding nodes. - 2. Move nodes. - 3. Deleting nodes. - 3. Copying nodes. -< -1. Adding nodes: -To add a node move the cursor onto (or anywhere inside) the directory you wish -to create the new node inside. Select the 'add node' option from the -filesystem menu and type a filename. If the filename you type ends with a '/' -character then a directory will be created. Once the operation is completed, -the cursor is placed on the new node. - -2. Move nodes: -To move/rename a node, put the cursor on it and select the 'move' option from -the filesystem menu. Enter the new location for the node and it will be -moved. If the old file is open in a buffer, you will be asked if you wish to -delete that buffer. Once the operation is complete the cursor will be placed -on the renamed node. - -3. Deleting nodes: -To delete a node put the cursor on it and select the 'delete' option from the -filesystem menu. After confirmation the node will be deleted. If a file is -deleted but still exists as a buffer you will be given the option to delete -that buffer. - -4. Copying nodes: -To copy a node put the cursor on it and select the 'copy' option from the -filesystem menu. Enter the new location and you're done. Note: copying is -currently only supported for *nix operating systems. If someone knows a -one line copying command for windows that doesnt require user confirmation -then id be grateful if you'd email me. - -============================================================================== -3. Customisation *NERDTreeOptions* - - ------------------------------------------------------------------------------- -3.1. Customisation summary *NERDTreeOptionSummary* - -The script provides the following options that can customise the behaviour the -NERD tree. These options should be set in your vimrc. - -|loaded_nerd_tree| Turns off the script. - -|NERDChristmasTree| Tells the NERD tree to make itself colourful - and pretty. - -|NERDTreeAutoCenter| Controls whether the NERD tree window centers - when the cursor moves within a specified - distance to the top/bottom of the window. -|NERDTreeAutoCenterThreshold| Controls the sensitivity of autocentering. - -|NERDTreeCaseSensitiveSort| Tells the NERD tree whether to be case - sensitive or not when sorting nodes. - -|NERDTreeChDirMode| Tells the NERD tree if/when it should change - vim's current working directory. - -|NERDTreeHighlightCursorline| Tell the NERD tree whether to highlight the - current cursor line. - -|NERDTreeIgnore| Tells the NERD tree which files to ignore. - -|NERDTreeBookmarksFile| Where the bookmarks are stored. - -|NERDTreeMouseMode| Tells the NERD tree how to handle mouse - clicks. - -|NERDTreeQuitOnOpen| Closes the tree window after opening a file. - -|NERDTreeShowBookmarks| Tells the NERD tree whether to display the - bookmarks table on startup. - -|NERDTreeShowFiles| Tells the NERD tree whether to display files - in the tree on startup. - -|NERDTreeShowHidden| Tells the NERD tree whether to display hidden - files on startup. - -|NERDTreeShowLineNumbers| Tells the NERD tree whether to display line - numbers in the tree window. - -|NERDTreeSortOrder| Tell the NERD tree how to sort the nodes in - the tree. - -|NERDTreeWinPos| Tells the script where to put the NERD tree - window. - -|NERDTreeWinSize| Sets the window size when the NERD tree is - opened. - ------------------------------------------------------------------------------- -3.2. Customisation details *NERDTreeOptionDetails* - -To enable any of the below options you should put the given line in your -~/.vimrc - - *loaded_nerd_tree* -If this plugin is making you feel homicidal, it may be a good idea to turn it -off with this line in your vimrc: > - let loaded_nerd_tree=1 -< ------------------------------------------------------------------------------- - *NERDChristmasTree* -Values: 0 or 1. -Default: 1. - -If this option is set to 1 then some extra syntax highlighting elements are -added to the nerd tree to make it more colourful. - -Set it to 0 for a more vanilla looking tree. - ------------------------------------------------------------------------------- - *NERDTreeAutoCenter* -Values: 0 or 1. -Default: 1 - -If set to 1, the NERD tree window will center around the cursor if it moves to -within |NERDTreeAutoCenterThreshold| lines of the top/bottom of the window. - -This is ONLY done in response to tree navigation mappings, -i.e. |NERDTree-J| |NERDTree-K| |NERDTree-C-J| |NERDTree-c-K| |NERDTree-p| -|NERDTree-P| - -The centering is done with a |zz| operation. - ------------------------------------------------------------------------------- - *NERDTreeAutoCenterThreshold* -Values: Any natural number. -Default: 3 - -This option controls the "sensitivity" of the NERD tree auto centering. See -|NERDTreeAutoCenter| for details. - ------------------------------------------------------------------------------- - *NERDTreeCaseSensitiveSort* -Values: 0 or 1. -Default: 0. - -By default the NERD tree does not sort nodes case sensitively, i.e. nodes -could appear like this: > - bar.c - Baz.c - blarg.c - boner.c - Foo.c -< -But, if you set this option to 1 then the case of the nodes will be taken into -account. The above nodes would then be sorted like this: > - Baz.c - Foo.c - bar.c - blarg.c - boner.c -< ------------------------------------------------------------------------------- - *NERDTreeChDirMode* - -Values: 0, 1 or 2. -Default: 0. - -Use this option to tell the script when (if at all) to change the current -working directory (CWD) for vim. - -If it is set to 0 then the CWD is never changed by the NERD tree. - -If set to 1 then the CWD is changed when the NERD tree is first loaded to the -directory it is initialized in. For example, if you start the NERD tree with > - :NERDTree /home/marty/foobar -< -then the CWD will be changed to /home/marty/foobar and will not be changed -again unless you init another NERD tree with a similar command. - -If the option is set to 2 then it behaves the same as if set to 1 except that -the CWD is changed whenever the tree root is changed. For example, if the CWD -is /home/marty/foobar and you make the node for /home/marty/foobar/baz the new -root then the CWD will become /home/marty/foobar/baz. - ------------------------------------------------------------------------------- - *NERDTreeHighlightCursorline* -Values: 0 or 1. -Default: 1. - -If set to 1, the current cursor line in the NERD tree buffer will be -highlighted. This is done using the |cursorline| option. - ------------------------------------------------------------------------------- - *NERDTreeIgnore* -Values: a list of regular expressions. -Default: ['\~$']. - -This option is used to specify which files the NERD tree should ignore. It -must be a list of regular expressions. When the NERD tree is rendered, any -files/dirs that match any of the regex's in NERDTreeIgnore wont be displayed. - -For example if you put the following line in your vimrc: > - let NERDTreeIgnore=['\.vim$', '\~$'] -< -then all files ending in .vim or ~ will be ignored. - -Note: to tell the NERD tree not to ignore any files you must use the following -line: > - let NERDTreeIgnore=[] -< - -The file filters can be turned on and off dynamically with the |NERDTree-f| -mapping. - ------------------------------------------------------------------------------- - *NERDTreeBookmarksFile* -Values: a path -Default: $HOME/.NERDTreeBookmarks - -This is where bookmarks are saved. See |NERDTreeBookmarkCommands|. - ------------------------------------------------------------------------------- - *NERDTreeMouseMode* -Values: 1, 2 or 3. -Default: 1. - -If set to 1 then a double click on a node is required to open it. -If set to 2 then a single click will open directory nodes, while a double -click will still be required for file nodes. -If set to 3 then a single click will open any node. - -Note: a double click anywhere on a line that a tree node is on will -activate it, but all single-click activations must be done on name of the node -itself. For example, if you have the following node: > - | | |-application.rb -< -then (to single click activate it) you must click somewhere in -'application.rb'. - ------------------------------------------------------------------------------- - *NERDTreeQuitOnOpen* - -Values: 0 or 1. -Default: 0 - -If set to 1, the NERD tree window will close after opening a file with the -|NERDTree-o| or |NERDTree-tab| mappings. - ------------------------------------------------------------------------------- - *NERDTreeShowBookmarks* -Values: 0 or 1. -Default: 0. - -If this option is set to 1 then the bookmarks table will be displayed. - -This option can be toggled dynamically, per tree, with the |NERDTree-B| mapping. - ------------------------------------------------------------------------------- - *NERDTreeShowFiles* -Values: 0 or 1. -Default: 1. - -If this option is set to 1 then files are displayed in the NERD tree. If it is -set to 0 then only directories are displayed. - -This option can be toggled dynamically, per tree, with the |NERDTree-F| -mapping and is useful for drastically shrinking the tree when you are -navigating to a different part of the tree. - ------------------------------------------------------------------------------- - *NERDTreeShowHidden* -Values: 0 or 1. -Default: 0. - -This option tells vim whether to display hidden files by default. This option -can be dynamically toggled, per tree, with the |NERDTree-H| mapping. Use one -of the follow lines to set this option: > - let NERDTreeShowHidden=0 - let NERDTreeShowHidden=1 -< - ------------------------------------------------------------------------------- - *NERDTreeShowLineNumbers* -Values: 0 or 1. -Default: 0. - -This option tells vim whether to display line numbers for the NERD tree -window. Use one of the follow lines to set this option: > - let NERDTreeShowLineNumbers=0 - let NERDTreeShowLineNumbers=1 -< - ------------------------------------------------------------------------------- - *NERDTreeSortOrder* -Values: a list of regular expressions. -Default: ['\/$', '*', '\.swp$', '\.bak$', '\~$'] - -This option is set to a list of regular expressions which are used to -specify the order of nodes under their parent. - -For example, if the option is set to: > - ['\.vim$', '\.c$', '\.h$', '*', 'foobar'] -< -then all .vim files will be placed at the top, followed by all .c files then -all .h files. All files containing the string 'foobar' will be placed at the -end. The star is a special flag: it tells the script that every node that -doesnt match any of the other regexps should be placed here. - -If no star is present in NERDTreeSortOrder then one is automatically appended -to the array. - -The regex '\/$' should be used to match directory nodes. - -After this sorting is done, the files in each group are sorted alphabetically. - -Other examples: > - (1) ['*', '\/$'] - (2) [] - (3) ['\/$', '\.rb$', '\.php$', '*', '\.swp$', '\.bak$', '\~$'] -< -1. Directories will appear last, everything else will appear above. -2. Everything will simply appear in alphabetical order. -3. Dirs will appear first, then ruby and php. Swap files, bak files and vim - backup files will appear last with everything else preceding them. - ------------------------------------------------------------------------------- - *NERDTreeWinPos* -Values: "left", "right", "top" or "bottom" -Default: "left". - -This option is used to determine where NERD tree window is placed on the -screen. - -"top" or "bottom", will cause a horizontal split to be created for the tree, -while "left" and "right" will cause a vertical split. - -This option is makes it possible to use two different explorer type -plugins simultaneously. For example, you could have the taglist plugin on the -left of the window and the NERD tree on the right. - ------------------------------------------------------------------------------- - *NERDTreeWinSize* -Values: a positive integer. -Default: 31. - -This option is used to change the size of the NERD tree when it is loaded. - -============================================================================== - *NERDTreePublicFunctions* -5. Public functions ~ - -The script provides 2 public functions for your hacking pleasure. Their -signatures are: > - function! NERDTreeGetCurrentNode() - function! NERDTreeGetCurrentPath() -< -The first returns the node object that the cursor is currently on, while the -second returns the corresponding path object. - -This is probably a good time to mention that the script implements prototype -style OO. To see the functions that each class provides you can read look at -the code. - -Use the node objects to manipulate the structure of the tree. Use the path -objects to access the data the tree represents and to make changes to the -filesystem. - -============================================================================== -5. TODO list *NERDTreeTodo* - -Window manager integration? - -============================================================================== -6. The Author *NERDTreeAuthor* - -The author of the NERD tree is a terrible terrible monster called Martyzilla -who gobbles up small children with milk and sugar for breakfast. - -He can be reached at martin_grenfell at msn.com. He would love to hear from -you, so feel free to send him suggestions and/or comments about this plugin. -Don't be shy --- the worst he can do is slaughter you and stuff you in the -fridge for later ;) - -============================================================================== -7. Changelog *NERDTreeChangelog* - -2.14.0 - - fix a bug where the o mapping would cause the tree window to be - incorrectly sized when reopened. - - add keymapping to delete bookmarks from the bookmarks table, see - :help NERDTree-D - - lots of refactoring -2.13.0 - - make NERDTreeChDir option default to 0 (i.e. never change vims current - working dir by default) - - when moving/deleting nodes with the filesystem menu, move/delete any - associated bookmarks - - make the t/T on directory nodes open a fresh NERD tree for the selected - dir in a new tab, rather than a netrw. - - place the cursor at the top of the bookmarks table when opening it with B - - make NERDTreeQuitOnOpen option work with the g and go mappings, - thanks to Maxim Kim for the bug report - - change how invalid bookmarks are handled. Now they are not deleted. If a - bookmark is malformed (in the bookmarks file) or points to an - invalid/nonexisting location then print an error and place the offending - bookmarks at the bottom of the bookmarks file. See :help - |NERDTreeInvalidBookmarks| for info. Thanks to Zhang Shuhan for the - suggestion and the testing. - - fix a bug with the 'o' mapping that occurred when opening a new buffer - for a file whose name was a substring of an already open file. Thanks to - Charlton Wang for the report. - - stop the script from going into an infinite loop when it tries to cache - a named pipe. Thanks to Charlton Wang for the report. - -2.12.0 - - added a UI for bookmarks. See :help NERDTreeBookmarkTable for details. - Thanks to Zhang Shuhan for testing and bug reports. - - relaxed the restrictions on bookmark names, now the only restriction is - that they cant contain spaces. This allows for e.g. Chinese bookmark - names. Thanks to Zhang Shuhan for the suggestion. - - combined the NERDTreeWinPos and NERDTreeSplitVertical options. See :help - NERDTreeWinPos. - - applied a patch from Matan Nassau to add the NERDTreeQuitOnOpen option - which closes the tree window after opening a file. See :help - NERDTreeQuitOnOpen. - - optimised the nerd tree rendering. Now it takes just over 1/3 of the time - it previously took to render. - - now the tree filter mappings toggle the filters "per tree" rather than - globally. The global filter variables are used to set the initial filter - settings for each new NERD tree. - - fix to window resizing when opening a file when NERD tree is the only - window open - - other fixes - -2.11.0 - - changes to the 'o' mapping when opening files: - - dont clobber "special" windows (eg taglist/quickfix/etc). This should - make the NERD tree play nicer with other explorer plugins. Thanks to - Yuan Jiang for the suggestion. - - if the file is already open in the current tab, just move the cursor - to that window - - highlight executable files, made some slight changes to other - highlighting - - if the user resizes the tree window, keep that new size. Dont reset to - the default during the mapping, or :NERDTreeToggle command. Only - reset the size if a fresh tree is started with :NERDTree. - - remove the "magic" functionality from the / mappings (it was - more confusing than helpful) - - other minor fixes - -2.10.0 - - added bookmarks, see :help NERDTreeBookmarkCommands for details. Thanks - to Piotr Czachur for all his testing and suggestions. - - fixed screen jumping bug with when &scrolloff != 0 - - fixed some bugs with copying nodes - - other random fixes - - change license to wtfpl - -2.9.0 - - - path handling improvements, thanks to Zhang Shuhan for heaps of - testing/bug reports - * improved how paths are stored, now the script will no longer get - confused about drives on MF Windows - * made the script way better at handling paths with strange characters - in them (eg '$@; etc) - - applied a patch from Cory Echols - * add the command :NERDTreeClose to close the tree for the current tab - * set the filetype for the NERD tree buffer to "nerdtree" - -2.8.0 - - added an option to enable/disable line numbers in the NERD tree window, - thanks to Olivier Yiptong for the email. - -2.7.1 - - Changed the keys for the filesystem menu to be mnemonic rather than - arbitrary integers - - Documented the copying functionality in the filesystem menu - -2.7.0 - - Bug fix: Now when you have the tree on the right and you open it with - multiple windows stacked, it will take up the full height of the vim - window. - - Now line numbers always turned off in the tree by default - - Implemented copying of nodes (via the filesystem menu) for *nix/macosx - - took the help doc out of the script and repackaged the whole thing as a - zip - -2.6.2 - - Now when you try to open a file node into a window that is modified, the - window is not split if the &hidden option is set. Thanks to Niels Aan - de Brugh for this suggestion. - -2.6.1 - - Fixed a major bug with the mapping. Thanks to Zhang Weiwu for - emailing me. - -2.6.0 - - Extended the behaviour of . Now if the cursor is on a file node - and you use the cursor will jump to its PARENTS next/previous - sibling. Go :help NERDTree-c-j and :help NERDTree-c-k for info. - - Extended the behaviour of the J/K mappings. Now if the cursor is on the - last child of a node and you push J/K it will jump down to the last child - of the next/prev of its parents siblings that is open and has children. - Go :help NERDTree-J and :help NERDTree-K for info. - - The goal of these changes is to make tree navigation faster. - - Reorganised the help page a bit. - - Removed the E mapping. - - bugfixes - -2.5.0 - - Added an option to enforce case sensitivity when sorting tree nodes. - Read :help NERDTreeCaseSensitiveSort for details. (thanks to Michael - Madsen for emailing me about this). Case sensitivity defaults to off. - - Made the script echo a "please wait" style message when opening large - directories. Thanks to AOYAMA Shotaro for this suggestion. - - Added 2 public functions that can be used to retrieve the treenode and - path that the cursor is on. Read :help NERDTreePublicFunctions for - details (thanks again to AOYAMA Shotaro for the idea :). - - added 2 new mappings for file nodes: "g" and "go". These are the - same as the "" and "o" maps except that the cursor stays in the - NERDTree. Note: these maps are slaved to the o and mappings, so if - eg you remap "" to "i" then the "g" map will also be changed - to "gi". - - Renamed many of the help tags to be simpler. - - Simplified the ascii "graphics" for the filesystem menu - - Fixed bugs. - - Probably created bugs. - - Refactoring. - -2.4.0 - - Added the P mapping to jump to the tree root. - - Added window centering functionality that can be triggered when doing - using any of the tree nav mappings. Essentially, if the cursor comes - within a certain distance of the top/bottom of the window then a zz is - done in the window. Two related options were added: NERDTreeAutoCenter - to turn this functionality on/off, and NERDTreeAutoCenterThreshold to - control how close the cursor has to be to the window edge to trigger the - centering. - -2.3.0 - - Tree navigation changes: - - Added J and K mappings to jump to last/first child of the current dir. - Options to customise these mappings have also been added. - - Remapped the jump to next/prev sibling commands to be and by - default. - These changes should hopefully make tree navigation mappings easier to - remember and use as the j and k keys are simply reused 3 times (twice - with modifier keys). - - - Made it so that, when any of the tree filters are toggled, the cursor - stays with the selected node (or goes to its parent/grandparent/... if - that node is no longer visible) - - Fixed an error in the doc for the mouse mode option. - - Made the quickhelp correctly display the current single/double click - mappings for opening nodes as specified by the NERDTreeMouseMode option. - - Fixed a bug where the script was spazzing after prompting you to delete - a modified buffer when using the filesystem menu. - - Refactoring -2.2.3 - - Refactored the :echo output from the script. - - Fixed some minor typos in the doc. - - Made some minor changes to the output of the 'Tree filtering mappings' - part of the quickhelp - -2.2.2 - - More bugfixes... doh. - -2.2.1 - - Bug fix that was causing an exception when closing the nerd tree. Thanks - to Tim carey-smith and Yu Jun for pointing this out. - -2.2.0 - - Now 'cursorline' is set in the NERD tree buffer by default. See :help - NERDTreeHighlightCursorline for how to disable it. - -2.1.2 - - Stopped the script from clobbering the 1,2,3 .. 9 registers. - - Made it "silent!"ly delete buffers when renaming/deleting file nodes. - - Minor correction to the doc - - Fixed a bug when refreshing that was occurring when the node you - refreshed had been deleted externally. - - Fixed a bug that was occurring when you open a file that is already open - and modified. - -2.1.1 - - Added a bit more info about the buffers you are prompted to delete when - renaming/deleting nodes from the filesystem menu that are already loaded - into buffers. - - Refactoring and bugfixes - -2.1.0 - - Finally removed the blank line that always appears at the top of the - NERDTree buffer - - Added NERDTreeMouseMode option. If set to 1, then a double click is - required to activate all nodes, if set to 2 then a single click will - activate directory nodes, if set to 3 then a single click will activate - all nodes. - - Now if you delete a file node and have it open in a buffer you are given - the option to delete that buffer as well. Similarly if you rename a file - you are given the option to delete any buffers containing the old file - (if any exist) - - When you rename or create a node, the cursor is now put on the new node, - this makes it easy immediately edit the new file. - - Fixed a bug with the ! mapping that was occurring on windows with paths - containing spaces. - - Made all the mappings customisable. See |NERD_tree-mappings| for - details. A side effect is that a lot of the "double mappings" have - disappeared. E.g 'o' is now the key that is used to activate a node, - is no longer mapped to the same. - - Made the script echo warnings in some places rather than standard echos - - Insane amounts of refactoring all over the place. - -2.0.0 - - Added two new NERDChristmasTree decorations. First person to spot them - and email me gets a free copy of the NERDTree. - - Made it so that when you jump around the tree (with the p, s and S - mappings) it is counted as a jump by vim. This means if you, eg, push - 'p' one too many times then you can go `` or ctrl-o. - - Added a new option called NERDTreeSortOrder which takes an array of - regexs and is used to determine the order that the treenodes are listed - in. Go :help NERDTreeSortOrder for details. - - Removed the NERDTreeSortDirs option because it is consumed by - NERDTreeSortOrder - - Added the 'i' mapping which is the same as but requires less - effort to reach. - - Added the ! mapping which is used to execute file in the tree (after it - prompts you for arguments etc) - - -============================================================================== -8. Credits *NERDTreeCredits* - -Thanks to Tim Carey-Smith for testing/using the NERD tree from the first -pre-beta version, for his many suggestions and for his constant stream of bug -complaints. - -Thanks to Vigil for trying it out before the first release :) and suggesting -that mappings to open files in new tabs should be implemented. - -Thanks to Nick Brettell for testing, fixing my spelling and suggesting i put a - .. (up a directory) -line in the gui. - -Thanks to Thomas Scott Urban - the author of the vtreeexplorer plugin - whose -gui code i borrowed from. - -Thanks to Terrance Cohen for pointing out a bug where the script was changing -vims CWD all over the show. - -Thanks to Yegappan Lakshmanan (author of Taglist and other orgasmically -wonderful plugins) for telling me how to fix a bug that was causing vim to go -into visual mode everytime you double clicked a node :) - -Thanks to Jason Mills for sending me a fix that allows windows paths to use -forward slashes as well as backward. - -Thanks to Michael Geddes (frogonwheels on #vim at freenode) for giving me some -tips about syntax highlighting when i was doing highlighting for the -quickhelp. - -Thanks to Yu Jun for emailing me about a bug that was occurring when closing -the tree. - -Thanks to Michael Madsen for emailing me about making case sensitivity -optional when sorting nodes. - -Thanks to AOYAMA Shotaro for suggesting that i echo a "please wait" message -when opening large directories. - -Thanks to Michael Madsen for requesting the NERDTreeCaseSensitiveSort option. - -Thanks to AOYAMA Shotaro for suggesting that a "please wait" style message be -echoed when opening large directories. Also, thanks for the suggestion of -having public functions in the script to access the internal data :D - -Thanks to Zhang Weiwu for emailing me about a bug with the the mapping -in 2.6.0 - -Thanks to Niels Aan de Brugh for the suggestion that the script now split the -window if you try to open a file in a window containing a modified buffer when -the &hidden option is set. - -Thanks to Olivier Yiptong for prompting me to make line numbers in the -NERD tree window optional. - -Thanks to Zhang Shuhan for all of his emails and testing to help improve the -NERD tree path handling. Thanks also for suggesting the bookmarks gui, and for -testing and his many suggestions and bugreports about bookmarks. - -Thanks to Cory Echols for sending a patch to add the :NERDTreeClose command and -set the NERD tree buffers filetype to 'nerdtree' - -Thanks to Piotr Czachur for all his suggestions and testing for the bookmarks -feature. - -Thanks to Yuan Jiang for suggesting the "o" mapping shouldnt clobber "special" -windows, like taglist. - -Thanks to Matan Nassau for the patch to add the NERDTreeQuitOnOpen option. - -Thanks to Maxim Kim for reporting a bug with g and go mappings when -NERDTreeQuitOnOpen was set. - -Thanks to Charlton Wang for reporting bugs with the 'o' mapping and with -handling named pipes. - -============================================================================== -9. License *NERDTreeLicense* - -The NERD tree is released under the wtfpl. -See http://sam.zoy.org/wtfpl/COPYING. diff --git a/doc/ZoomWin.txt b/doc/ZoomWin.txt deleted file mode 100644 index 451357c..0000000 --- a/doc/ZoomWin.txt +++ /dev/null @@ -1,121 +0,0 @@ -*ZoomWin.txt* Zoom into/out-of a window Jan 26, 2009 -Authors: Charles E. Campbell, Jr. *zoomwin* - Ron Aaron -Copyright: (c) 2004-2008 by Charles E. Campbell, Jr. *zoomwin-copyright* - The VIM LICENSE applies to ZoomWin.vim and ZoomWin.txt - (see |copyright|) except use "ZoomWin" instead of "Vim" - No warranty, express or implied. Use At-Your-Own-Risk. - -============================================================================== -1. Usage *zoomwin-usage* - - :call ZoomWin() - :ZoomWin - o - - Either of the two commands or the normal mode o will toggle between - * selecting the current window for display as the only window or - * to restore the original multiple-window view. - -============================================================================== -2. Setup *zoomwin-setup* - - Simply put ZoomWin.vim into your .vim/plugin directory (you may need to - make such a directory first). Under Windows that should be - vimfiles\plugin. ZoomWin now uses the HelpExtractor method to - automatically extract help and to make it known to vim by running helptags - on it. - -============================================================================== -3. History *zoomwin-history* - - v23 Apr 24, 2008 : * when |'scrollbind'| was activated: when ZoomWin - attempted to restore multiple-windows, the cursor - position was incorrect. Fixed. - Jan 02, 2009 * included some more things in the session file - * broke ZoomWin into an plugin + autoload pair - * (Ingo Karkat) contributed a patch to retain the - the search pattern before zooming - * (Ingo Karkat) contributed a patch to detect the - vim 7.2 name for the command line window - v22 Apr 10, 2006 : * "only" was occasionally issuing an "Already one - window" message, which is now prevented - * SavePosn() issued error message when handling an - empty buffer - * saves yank registers and restores them on each - zoom/unzoom - v21 Oct 12, 2004 : * v14 fixed a bug when wmw and/or wmv equal to 0; - v21 will invoke the patch only if the version <= 603. - For vim version 6.3 users, this fix allows more files - to be handled by ZoomWin. - May 10, 2005 * When :version shows -mksession, and the vim version - is at least 6.3, ZoomWin will now do a partial zoom - v20 Jul 26, 2004 : * bugfix - ZoomWin didn't always retain the - position in the former zoomed-in window after - the window layout was restored. It was restoring - the position when the zoom-in occurred. - v19 May 26, 2004 : * bugfix - winmanager has events firing that, - amongst other things, reset the bufhidden - option to delete for some windows while - ZoomWin worked. ZoomWin now works - successfully with winmanager. - v18 May 20, 2004 : * bugfix - didn't adversely affect anything, but - ZoomWin was deleting its session file twice. - * bugfix -- a multi-source file + minibufexplorer - + Taglist interaction bug -- minibufexplorer's - autocmd events were firing, generating a new - window while ZoomWin was attempting to restore - the display. ZoomWin didn't have restoration - information for the new window and so reported - an error. Events are now temporarily disabled - while ZoomWin is restoring the layout. - v17 Mar 26, 2004 : * ZoomWin command installed. Works nicely with - taglist: vim +Tlist +ZoomWin filename - v16 Dec 22, 2003 : * handles bufhidden and nobl windows (TagList support). - * Now also works with quickfix window (:copen) but - still not with |cmdline-window| (q:) - v15 Dec 19, 2003 : * SavePosn()/RestorePosn() needed to be preceded - by s: to prevent clashes - v14 Dec 18, 2003 : * works around a restoration-bug with mksession - when either wmw or wmh settings are zero - * Bwipes internal temporary buffers - * Known bugs: will not work with command-line - * Editing window (|cmdline-window|) nor the - quickfix window (|copen|). - v13 Dec 18, 2003 : Uses eventignore to prevent events/autocmds from - firing while changing the mksession results. - v12 Dec 12, 2003 : uses hidden and a minimalist mksession save - v11 Oct 14, 2003 : bug fix: apparently RestorePosn()'s variables, - which were b:, weren't always defined, so s: - ones are now used. - v10 Sep 22, 2003 : Bug fix: when a single window is showing, the user - moves the cursor, then o used to restore - screen, the current cursor position wasn't retained - Restores v:this_session. - Bug fix: change a window, use o, then write. - Was saving file only to temporary file instead of - actual file, but when the actual file was brought back, - the changes were lost. - v9 Aug 15, 2003 : v8 managed to trash syntax highlighting on - reload, this one removes the eventignore - handling. Will need more pondering... - v8 Aug 14, 2003 : now handles not-modified but not filereadable - buffers, nowrite buffers uses eventignore to - bypass autocmd firing - v7 May 23, 2003 : bugfix - GotoWinNum() didn't always get the - cursor into the correct window - v6 Mar 25, 2003 : more cleanup included - v5 Mar 14, 2003 : includes support for handling scratch buffers, - no-name buffer windows, and modified-buffer - windows. All windows' contents will be saved to - temporary buffers - v4 Dec 12, 2002 : Zak Beck contributed code to clean up temporary - session files if one leaves vim while zoomed-in - v3 Dec 11, 2002 : plugin-ized - v2 Nov 08, 2002 : A guaranteed-to-be-unique to this - session file is used for session information. - Modified but not yet saved files are made hidden - during zoom in. - v1 the epoch : Ron Aaron's original - -vim:tw=78:ts=8:ft=help diff --git a/doc/lookupfile.txt b/doc/lookupfile.txt deleted file mode 100644 index 16161ec..0000000 --- a/doc/lookupfile.txt +++ /dev/null @@ -1,765 +0,0 @@ -*lookupfile.txt* Lookup files using Vim7 ins-completion - Requires Vim 7.0 - Last Change: 24-Aug-2007 @ 18:25 - Author: Hari Krishna Dara (hari.vim at gmail dot com) - - *lookupfile-introduction* - *lookupfile-plugin* -Lookupfile is a very simple approach to opening files by typing a pattern to -represent the file you are looking for, and selecting a file from the completion -dropdown to open in the current Vim session. It provides a consistent interface -to lookup files by various means (tags, path, buffers, external tools etc.). It -uses the new Vim7 insert-mode completion mechanism to show matching files. It -is a new tool - - -The default functionality of the plugin is to lookup filenames from the tag -files, by matching the pattern against tag names. However, using the standard -tags (generated by ctags) can be very slow at best, so it is recommended to use -specially generated tagfiles, that are meant only for finding the filenames. You -don't however need to generate tag files at all to use the plugin, as there are -ways to lookup files from sources other than tag files. - -============================================================================== -OVERVIEW *lookupfile-overview* - -|lookupfile-installation| Installing the plugin. - -|lookupfile-usage| A brief usage to get you quickly started. - -|lookupfile-maps| Mappings defined in the lookup window. - -|lookupfile-tags| Creating index of files for a fast lookup. - -|lookupfile-settings| An explanation of various configure options. - -|lookupfile-extend| Features that make the plugin extensible. - -|lookupfile-known-issues| A list of known issues. - -|lookupfile-wishlist| Wishlist items that may be worth doing for a future - version. - -|lookupfile-changes| A change list for current version from the previous - versions. - -|lookupfile-acknowledgements| Acknowledgements. -============================================================================== - - *lookupfile-installation* -The distribution comes as a zipfile that can be extracted straight into your -runtime directory (vimfiles/.vim). Please note that it depends on genutils -plugin that needs to be downloaded separately and installed. Also note that -the version of genutils that this plugin depends on is a newer autoload -version that is not backwards compatible with the older versions of genutils. -This means, if you have other plugins that depend on the non-autoload version -of genutils, you need to follow special instructions given in genutils such -that you can have both installed at the same time. - -To install the help file, you need to run :helptags command on your runtime -doc directory. - - *lookupfile-map* - *lookupfile-default-cmd* - *LookupFile-command* - *:LookupFile* -Once installed, you can optionally choose a key to be used to open the -lookupfile window. The default is . To change this value, choose a key of -your liking, say , and add the below line to your vimrc: > - - nmap LookupFile -< -Note that the plugin creates a mapping for the insert-mode as well, so unless -you also explicitly specify a mapping for insert mode, the default will get -mapped to invoke lookupfile in the insert-mode. > - - imap LookupFile -< -The LookupFile mapping is mapped to the :LookupFile command, which always -assumes the last :LU command you use. This means, after using |:LUWalk|, -pressing would result in executing the :LUWalk command until you type -another command. Take a look at the |LookupFile_DefaultCmd| to specify the -initial command that this map should get assigned to and -|LookupFile_EnableRemapCmd| to disable this behavior. If you want a map to -always execute a specific command, you can also create additional maps. E.g., -if you want to always execute :LUTags, irrespective of what command you -last used, then you can define something like: -> - nnoremap :LUTags -< -You can also disable the default map completely, see -|LookupFile_DisableDefaultMap| for details. -============================================================================== - - *lookupfile-usage* -To lookup a file, press the assigned key (default: F5) or use the :LookupFile -command. This will open a small window above the current window, where you can -type in a regex, and the matching filenames will be shown in the Vim7 completion -style. Selecting a matching file and pressing Enter () will open it in the -previous window (or ^O (C-O) will open it in a split window). You can also -press and scroll back to previous filenames to press o or O (or use -:OpenFile[!]) to open the file in the previous window or a new window, -respectively. - -If you want to quickly close the [Lookup File] window without making a file -selection, you can press the same key that you assigned to open the plugin, to -also cancel the completion menu and close the window. - -Note that this works only when you use the mapping to create a mapping -(see |lookupfile-map|), not when you assign a mapping directly while disablign -the default mapping (see |LookupFile_DisableDefaultMap|). - -Note that the completion menu will be shown only when you are in the insert -mode and the cursor is at the end of the line (this is the normal Vim behavior). - -Here is a summary of all the commands that the plugin defines. All commands -accept the initial pattern as an argument, and support appropriate -|command-completion| mode. - - Command Lookup source ~ - LUTags Lookup files from tag files. This is a like a fast GNU - find on name. It can lookup files from any Vim - compatible tag file (which includes those from ctags), - but at the moment it is advisable to generate - specialized tag files using :find command (see - |lookupfile-tags|). - LUPath Lookup files from 'path' using |globpath()|. The :find - command while being able to lookup files from 'path', it - doesn't provide any completion mechanism, and it is - clumsy when there are multiple files with the same name. - The :find command doesn't even accept a pattern. - LUBufs Lookup loaded files (buffers) using |bufname()|. This is - a great addition to whatever buffer-explorer you are - using. When there are too many buffers open, this - sometimes makes it easy to find the right buffer, by - typing part of its name. - LUWalk Lookup files using |glob()|. This works like the Emacs - ido.el, allowing you to walk up and down a path looking - for files. If you use the filename completion with :edit - command, then you will find this a lot more convenient - and faster to use. - LUArgs Lookup files from |:args| list. - LookupFile A shortcut to the last command used from above set. - -It is also very easy to add new commands to or customize the plugin at various -levels. At the simplest, you can create custom command on top of the above that -either pass dynamic arguments or tmporarily change the settings (e.g., you could -have a command that will start LUPath with the 'path' temporarily changed to -find only the include header files). You can also take advantage of the the -|lookupfile-extend| features to add new commands that lookup files from a -completely new source. You can even add commands that lookup something -completely different than a file (like e.g., a spelling using spellsuggest()). - -The :LookupFile and all the above commands accept an argument which is treated -as the initial pattern. Specify a bang(!) after the command to always start with -an empty line. - - *:LUTags* - *lookupfile-from-tags-files* -The LUTags command provides a fast lookup of files from tags files. This works -similar to the "Open Resource" command in eclipse where you can type part of the -name and all the resources whose name has matching part are shown for selection. - -To use the :LUTags command, it is recommended to generate and maintain -separate tags files containing only filenames, for this plugin to work -efficiently (see |lookupfile-tags|). Though it will work with the regular tags -files, it could be very slow (due to the current performance of |taglist()| and -might not return the right set of filenames. Configure the tag expression such -that the plugin will use the right tag files. It is any valid Vim {rhs}, the -evaluated value should be a valid 'tags' value. For a static string, use extra -quotes. Ex: -> - let g:LookupFile_TagExpr = string('./filenametags') - -< or > - let g:myLookupFileTagExpr = './filenanmetags' - let g:LookupFile_TagExpr = 'g:myLookupFileTagExpr' -< -Also see |LookupFile_UsingSpecializedTags| to enable better formatting of -results once these specialized tags are generated and lookupfile is configured -to take advantage of them. - *:LUPath* - *lookupfile-find-cmd-alternative* -The LUPath command is a complete replacement for the built-in |:find| command. -The completion popup alone is a good enough reason to use this command instead -of the :find, but since it also recognizes the 'ignorecase' and 'smartcase' -settings it makes it easier to type and still be able to do exact match when -required. - - *lookupfile-ido* -The LUWalk and LUBufs commands are special in that they provide features that -will be very fimilar to those who used Emacs ido lisp package. - -Similar to the ido, you can quickly switch from file lookup to buffer lookup -using and from buffer lookup to file lookup using while in insert -mode. - - *:LUBufs* - *lookupfile-buffer-cmd-alternative* -LUBufs command allows you to quickly search the already loaded buffers for a -match and open it, so it can be used in the place of the built-in |:buffer| -command and provides the same matching semantics by default. Take a look at the -settings that start with "LookupFile_Bufs_" in their name to configure the -behavior of this command. The :LUBufs command also supports an initial pattern -as an arguments and supports filename completion. - -A good use case for :LUBufs command is when you have several files named -similarly (e.g., having several buffers named Makefile or build.xml is very -common). Using a traditional buffer explorer plugin, finding the right file can -become cumbersome when you have a large set of buffers opened. In this case, the -:LUBufs command can help you locate the buffer much faster, as only the buffers -that match what you specify will be shown with their path clearly visible. - - *:LUWalk* - *lookupfile-walk-path* -The LUWalk command is very useful to quickly navigate or "walk" filesystem -paths. The plugin provides a popup with matches for each path component as you -type in a partial string. The matches are based on the Vim |glob()| expression -rules. The :LUWalk command also accepts the initial directory name with or -without a pattern as an argument, and supports directory name completion. - -When no root is specified, the match starts from the current directory. -Pressing before typing in any pattern will result in inserting the -directory of the last file automatically. Type an extra "/" after a directory -name to have only the directories shown in the results. - -To accept the first entry in the matches, you can simply press or , -and if the entry happens to be a directory, new matches will be shown for that -directory. - - *lookupfile-recent-files* -The plugin saves a list of most recently opened files using any of the above -commands. To trigger showing this list, simply use a space by itself. For more -details, see |LookupFile_RecentFileListSize|. -============================================================================== - - *lookupfile-maps* -The maps that are available in the [Lookup File] window are listed below. Some -of them are the same from |popupmenu-keys|, but have been modified to behave -slightly differently. All the below maps are applicable only when the popup menu -is visible, otherwise, they should have their default behavior. - Key mode Action ~ - i Opens the selected file in the previous window/ - Select the first file. - i Same as - i Same as , except that the file opens in a split - window. - i Selects next file. Same as |i_CTRL-N|. - i Selects previous file. Same as |i_CTRL-P|. - i Selects a file several entries down. - i Selects a file several entries up. - i Stops completion and insert mode, and restores - pattern. - i Stops completion, restores pattern and executes - o n Opens the current file in the previous window. - O n Same as o, except the file opens in a split window. -============================================================================== - - *lookupfile-tags* -Unless you want to lookup files from alternate sources such as 'path', you -should generate special tags files for the lookup from filesystem to work well. - -It is very easy to generate a tag file for an efficient lookup of filenames. -If you have Unixy tools installed, you can run the below shell command to -generate a tags file (you can put it in a shell-script and schedule it to be run -every now and then to keep this file up to date) > - - (echo "!_TAG_FILE_SORTED 2 /2=foldcase/"; - (find . -type f -printf "%f\t%p\t1\n" | \ - sort -f)) > ./filenametags - -Typically you would want to exclude generated files such as .class and -.o. You can do this easily by specifying additional expressions to -the find command (see manpage for find command). E.g., replace the find -command above with: > - - find . -not -iname "*.class" -type f -printf "%f\t%p\t1\n" \ - -< or, with something more useful: > - - find . \( -name .svn -o -wholename ./classes \) -prune -o -not -iregex '.*\.\(jar\|gif\|jpg\|class\|exe\|dll\|pdd\|sw[op]\|xls\|doc\|pdf\|zip\|tar\|ico\|ear\|war\|dat\).*' -type f -printf "%f\t%p\t1\n" \ -< -============================================================================== - - *lookupfile-settings* -The settings are global variables that you can set in your vimrc. All settings -are optional, as they all have default values, but it is highly recommended that -you fine tune the g:LookupFile_TagExpr setting, as per |lookupfile-tags|. - *LookupFile_DefaultCmd* -- This specifies the |lookupfile-command| that should be invoked when the - |LookupFile-command| or |lookupfile-map| is used. This defaults to ":LUTags", - but you can change it to say, ":LUWalk". The :LookupFile command always - assumes the last command that you used, so this setting only specifies the - command to be invoked for the first time. - Ex: > - let g:LookupFile_DefaultCmd = ':LUWalk' -< - *LookupFile_EnableRemapCmd* -- When this is set (the default), the :LookupFile command takes the form of - the last command that is used. Disabling this while setting - |LookupFile_DefaultCmd| allows you to configure a custom command as the - command to run when you press the LookupFile mapping. See - |LookupFile-command| for more details. - - *LookupFile_DisableDefaultMap* -- Setting this flag turns off the default maps created by the plugin such that - the user has full control on what maps to what command. > - let g:LookupFile_DisableDefaultMap = 1 -< -NOTE: setting this doesn't prevent the mapping from created, try -setting no_lookupfile_maps or no_plugin_maps for this (see |usr_41.txt|). - - *LookupFile_TagExpr* -- Use g:LookupFile_TagExpr to use custom tagfiles. A valid Vim expression - resulting in a String should be used, which means "eval(g:LookupFile_TagExpr)" - should return a valid value for 'tags' setting. Once you set a value for this - setting and startup Vim, try > - echo eval(g:LookupFile_TagExpr) -< to make sure it is valid. Ex: > - let g:LookupFile_TagExpr = string('./filenametags') -< - *LookupFile_MinPatLength* -- By default g:LookupFile_MinPatLength is set to 4, which means you have to type - at least 4 characters before the lookup is triggered. This is because the - current taglist() function is too slow if the tag file is large. Depending on - the number of files you have, you may be able to set a lower value (or may - even have to increase the value) for this setting. - *LookupFile_ShowFiller* -- If you don't want the filler to be shown while the tags are being - looked up, you can disable it by setting g:LookupFile_ShowFiller to 0. If you - know for sure that the lookup never takes too long, then disabling the filler - could make the completion menu less flashy. - *LookupFile_UsingSpecializedTags* -- When you generate specialized tags as described in the |lookupfile-tags| - section, you can set g:LookupFile_UsingSpecializedTags to enabled better - formatting for showing the results. - *LookupFile_PreservePatternHistory* -- By default, the plugin leaves a copy of the pattern that you used to - lookup the file, so that you can scroll-back and find them (this is like a - history), but you can disable this behavior by setting - g:LookupFile_PreservePatternHistory to 0. - *LookupFile_PreserveLastPattern* -- By default, the lookup window is started with the last pattern, which you can - remove by quick pressing , but if you always want to start blank, set - g:LookupFile_PreserveLastPattern to 0. - *LookupFile_LookupFunc* - *LookupFile_LookupNotifyFunc* - *LookupFile_LookupAcceptFunc* -- If you want to lookup matches yourself using an alternative procedure, you - can specify a user function that should be called by the plugin, and - by-pass the default tag based lookup. Use g:LookupFile_LookupFunc - setting to specify the name or Funcref for such a function. The function - will be called with one argument, which is the pattern typed so far. The - results will be sorted by the plugin anyway, so your function need not. - You can also set g:LookupFile_LookupNotifyFunc to be notified when a - file is selected from the matches (not called with o or O commands), and - g:LookupFile_LookupAcceptFunc to override the default handling of selection. - *LookupFile_switchbuf* -- If you have 'switchbuf' set to "split" for your quickfix commands to - always split open windows, the plugin recognizes this setting and split-opens - all files. - *LookupFile_AlwaysAcceptFirst* -- Normally when or is pressed while the popup is visible, the first - item in the list is selected, unless there is exactly only one item matching. - This means, if you want to select the first item, you have to press it - twice. You can change this behavior to always accept the first item by - setting g:LookupFile_AlwaysAcceptFirst (like ido.el). - *LookupFile_FileFilter* -- Use the g:LookupFile_FileFilter to specify a Vim regular expression pattern - that, when matched against the filename (or path, depending on the mode) - results in filtered out. E.x: > - - " Don't display binary files - let g:LookupFile_FileFilter = '\.class$\|\.o$\|\.obj$\|\.exe$\|\.jar$\|\.zip$\|\.war$\|\.ear$' -< - NOTE that the |:LUPath| and |:LUWalk| commands use the Vim functions |globpath()| - and |glob()| that recognize the Vim setting 'wildignore', so setting this in - addition to 'wildignore' will have the matches filtered by both rules. - *LookupFile_AllowNewFiles* -- Use the g:LookupFile_AllowNewFiles to specify whether entering non-existent - files should generate an error or result in getting a new buffer created. - *LookupFile_ignorecase* - *LookupFile_smartcase* -- The plugin now recognizes 'ignorecase' and 'smartcase' settings to match files - even on systems that are case-sensitive. On unix like platforms, glob() - matches patterns in a case-sensitive manner, so setting 'ignorecase' will - enable special translation of patterns so that you get case-insensitive - results. On Windows, since glob() is already case-insensitive no special - handling is required for 'ignorecase', however, when 'smartcase' is set, there - is no way to force glob() to return case-sensitive results, so a - post-processing of the results is done to drop files that would not otherwise - have matched. - *LookupFile_SortMethod* -- Use this setting to specify the sort method to use for sorting results. The - default value is "alpha", which means that they will be sorted alphabatically. - You can also set an empty value to disable sorting. See also - |LookupFile_Bufs_BufListExpr| to enable MRU sorting for |:LUBufs| command. - *LookupFile_Bufs_BufListExpr* -- Use g:LookupFile_Bufs_BufListExpr to specify an expression that returns a - |List| of buffers to display. By default this is set to an empty string, but - you can set any valid Vim expression that results in a List. If you also have - the latest version of SelectBuf (http://www.vim.org/script.php?script_id=107) - installed, a useful value that you can set here is "g:SB_MRUlist", which will - then display buffers in the MRU order. > - - let g:LookupFile_Bufs_BufListExpr = 'g:SB_MRUlist' -< - You can use this setting to even specify your own global function. - *LookupFile_Bufs_SkipUnlisted* -- By default, the |:LUBufs| commands skips all unlisted buffers from results, - but if you want them to be included, reset LookupFile_Bufs_SkipUnlisted - setting. - *LookupFile_Bufs_LikeBufCmd* -- This setting impacts the behavior of |:LUBufs| command on how the pattern is - matched. By default, it matches just like the |:buffer| command, so the - pattern is treated as per the rules of |wildcard| matching against the current - |bufname()| of each buffer. Clearing this setting will cause the command to - match the pattern as a Vim regex against only the filename portion of each - buffer. - *LookupFile_UpdateTime* -- LookupFile uses |CursorHoldI| autocommand to trigger the completion and this - event doesn't get triggered unless nothing is typed for 'updatetime' - milliseconds. Since the default value for 'updatetime' is rather large, the - plugin changes this value to g:LookupFile_UpdateTime (which defaults to 300 - milliseconds or 3/10th of a second) while the [Lookup File] window is active. - *LookupFile_EscCancelsPopup* -- On some systems, the mapping for to cancel the popup could interfere - with the arrow keys, so if you want the plugin to not map key, then - reset |LookupFile_EscCancelsPopup| setting. > - - let g:LookupFile_EscCancelsPopup = 0 -< - *LookupFile_SearchForBufsInTabs* -- Normally, when you seleclt a file that is already visible in a window, - LookupFile simply makes that window the current window instead of opening - the file again. Setting this flag will make LookupFile also search in other - tabs for a window that already has this file visible, and switch to that tab - to set the focus. This setting is most useful with the |LUBufs| command. > - - let g:LookupFile_SearchForBufsInTabs = 1 -< - *LookupFile_TagsExpandCamelCase* -- When this setting is enabled (the default), typing consecutive upper case - letters are treated as abbreviations for type names that follow the - CamelCase naming pattern (like all the java class names are) and the pattern - is translated automatically. This is modelled after the "Open Type" dialog - in eclipse and works only for the tag lookup (|LUTags| command). To disable - this feature, set it to 0 > - - let g:LookupFile_TagsExpandCamelCase = 0 -< - Ex: - - To match the filename VimTheSupremeEditor.txt, you could enter the pattern - in several variations such as: > - VTSE - VTSEditor - VTSEdi.* - VTS.* - VTheSE -< -NOTE: While using the CamelCase expansion, 'ignorecase' is disabled so -something like "VTSEDi.*" will not match "VimTheSupremeEditor", but will match -"VimTheSupremeEditorDictator", if it exists. - *LookupFile_RecentFileListSize* -This setting allows you to control the number of most recently used filenames -that should be rememberd by the plugin. The default size is 20, but it can be -set to 0 to not remember any and any -ve value to remember all. The list is -not persisted across Vim sessions. > - - let g:LookupFile_RecentFileListSize = 30 -< -See also, |lookupfile-recent-files|. -============================================================================== - - *lookupfile-extend* -If you want to extend the functionality of the plugin, by creating new commands -to lookup files in different ways, you can take advantage of the -g:LookupFile_LookupFunc and lookupfile_LookupNotifyFunc settings as below: - - - Create a function that can take a pattern and return file matches for it: - function! FileMatches(pattern) - let matches = [] - " Find and fill up matches. - return matches - endfunction - - Create an entry function and a command: - function! MyLookup() - unlet! s:savedLookupFunc s:savedLookupNotifyFunc - let g:savedLookupFunc = g:LookupFile_LookupFunc - let g:savedLookupNotifyFunc = g:LookupFile_LookupNotifyFunc - unlet g:LookupFile_LookupFunc g:LookupFile_LookupNotifyFunc - let g:LookupFile_LookupFunc = 'FileMatches' - let g:LookupFile_LookupNotifyFunc = 'MyNotify' - LookupFile - endfunction - command! MyLookup call MyLookup() - - Define the MyNotify() function to clear the settings. - function! MyNotify() - unlet g:LookupFile_LookupFunc g:LookupFile_LookupNotifyFunc - let g:LookupFile_LookupFunc = g:savedLookupFunc - let g:LookupFile_LookupNotifyFunc = g:savedLookupNotifyFunc - endfunction - -Once you follow the above steps, you can use both the default LookupFile command -as well as the new MyLookup command. The completion will behave differently -based on how you opened the lookup window. - -You can also override the default action when the user presses or to -get your function invoked, by setting the g:LookupFile_LookupAcceptFunc. The -function should have the below signature: > - - " splitWin is 1 if a new window should be split. - " key is the exact key that user pressed ("\"/"\"). - function accept(splitWin, key) -< -The last pattern and the matching results for it are accessible in the global -variables g:lookupfile#lastPattern and g:lookupfile#lastResults. - -You can also create ftplugin/lookupfile.vim in your vim runtime and put commands -to further customize or override the behavior of the plugin. E.g., you could put -a map such that pressing twice in succession will close the window: > - - nnoremap q - inoremap q -< - *lookupfile-tips* -- A pattern is a Vim regex, so you can e.g., start with an "^" to anchor the - pattern match to the start of the filename. This will also speed up the - lookup. You can also enter the extension (such as \.prop) to narrow down the - results further. -- If the filename has special characters, don't forget to protect them while - entering the pattern, or you may not find what you are looking for (or - might find too much). E.g., to find a file named "abc*xyz" (not possible - on windows), you need to enter "abc\*" as pattern. Since the pattern is - used as if 'magic' is set, unless you have the "\" itself in the - filenames, you only have to worry about those characters that are special - without needing to prefix with a "\", and these are ".", "^", "[", "*" and - "$". -- If the lookup is taking too long, you can stop it by pressing ^C. You may - still be able to see partial set of matches. -- You can use instead of to deliberately insert a newline into - the lookup buffer. -- Pressing after selecting a file, results in restoring the pattern. If - you actually want to cancel the completion menu, without restoring the - pattern, you can press . -- When you want to start entering a new pattern, press to quickly - kill the previous pattern. -- Use g:LookupFile_LookupFunc setting to modify the functionality of the - plugin. The plugin/lookupfile.vim comes with a few of alternative ways to - lookup files, such as looking up files from 'path' (see |lookupfile-usage|). - Other ideas for alternative lookup for files are: - - Use id-utils' lid to lookup files from ID database. You can e.g., use the - command "lid -R filenames -S newline -k token" to lookup for the typed - pattern as a token (there are other options for lid to treat token as regex) - - Use GNU find to find files matching the pattern, something like: - "find . -name '*pattern*'". There are a number of options for find, so this - could be made very flexible, but running find for every character typed - could be very slow. - - You can create an alternate tags file to store only directory names such - that you can lookup directory names instead of filenames. The following - command can create such a tags file: > - - (echo "!_TAG_FILE_SORTED 2 /2=foldcase/"; - find . -type d -printf "%f\t%p\t1\n") | \ - sort -f > ./dirnametags -< - Note that this generates tag file with relative paths, which is known to - cause problem with |taglist()| function when the tag file is not in the same - directory as Vim's current directory (see |lookupfile-known-issues|. To - workaround, you can generate absolute paths, you can use "`pwd`" instead of "." - as the root. -- You can create custom commands/mappings that always start with a fixed or - computed pattern. E.g., to always start LUWalk in the root of c: drive, create - a command as: > - - command! WalkRoot LUWalk c:/ -< - Another useful variation of the above is to start with the directory of the - current file: > - - command! WalkCur :exec "LUWalk" expand('%:p:h').'/' -< - Another example that works well with :LookupFile is to start with the current - word as pattern: > - - command! CurWord :LookupFile -< -- The :LUWalk command maps your key such that it will remove a complete - directory component at a time (like ido.el). To remove only a part of the - directory name, first press to remove the "/" and use to remove the - required number characters. You can also press and use normal commands - to edit. -- While using :LUWalk, when no pattern is entered yet, you can press to - show the files in the directory of the current buffer. -- While using :LUWalk, you can enter "**" after any directory in the path to - match keyword recursively under that path. -- If you want to extend the funcationality of the plugin, take a look at the - plugin/lookupfile.vim for various examples. -- Here is a sample function that you can use to lookup spellings as you type, - using spellsuggest() function. You need to first turn on 'spell' inside - lookup window for this to work. > - function! s:LookupSpell(pattern) - return spellsuggest(a:pattern) - endfunction -< - This is a dummy accept function that prevents the word from being treated as a - file and open it: > - function! s:SpellAccept(splitWin, key) - call input('SpellAccept') - endfunction -< -============================================================================== - - *lookupfile-known-issues* -- Vim sometimes automatically replaces the pattern with the first filename - from the completion menu. You have to select back the original pattern using - ^P. -- The taglist() function's performance (on which this plugin depends on) - seems to be bad. A newer version of Vim might accept additional arguments - for taglist() to limit the number of matches, which can speed up some of - the cases. -- If you press the LookupFile key while making a file selection, the - completion doesn't get aborted, but instead it gets selected and the - [Lookup File] window still remains open. -- There is a bug in taglist() that returns incorrect relative paths if the - current directory of Vim is not the same as the directory in which tags file - resides. This impacts the :LookupFile command. If this is an issue for you, - you should generate the tag files with absolute paths instead of relative - paths, by giving absolute directory names. -============================================================================== - - *lookupfile-wishlist* -- Allow on the fly filtering of the filenames by prompting the user for a - pattern to match (or not match) against the whole filename. -- Option to sort filenames by their extension, or by MRU. -- Save and restore matching results, for patterns that take a long time to build - (especially those that involve "**"). -- Option to have separate window/buffers for each type of command (Timothy, - Guo) -============================================================================== - - *lookupfile-changes* - - *lookupfile-changes-1.8* -- New settings |LookupFile_EnableRemapCmd|, |LookupFile_SearchForBufsInTabs|, - |LookupFile_TagsExpandCamelCase|, |Lookupfile_RecentFileListSize|. -- Even more control on the mappings with the new setting - |LookupFile_EnableRemapCmd|. -- New feature to specify names that follow CamelCasing pattern by abbreviating - them. This works more or less like for the "Open Type" dialog in Eclipse. - For more information see, |LookupFile_TagsExpandCamelCase|. -- New feature to remember the recent files, see - |Lookupfile_RecentFileListSize|. -- Changed the message line such that the message is shown on the left side and - the pattern is shown on the right side. This prevents the more important - message from getting lost when the filenames are too long. - - *lookupfile-changes-1.7* -- Bug fix: LUPath and LUArgs were broken (stoning at gmail dot com). -- Removed debugging code. - - *lookupfile-changes-1.6* - *lookupfile-changes-1.5* -- LookupFile now uses CursorHoldI instead of CursorMovedI to show matches. This - means, the matches are not computed until you stop typing, which should give a - better experience. See |LookupFile_UpdateTime| for more information. -- The plugin now sets 'completefunc' such that you can now hit to - trigger completions explicitly (instead of waiting for - g:LookupFile_UpdateTime). This is useful if you are a slow typer and so prefer - a large value for g:LookupFile_UpdateTime. -- The plugin now recognizes 'ignorecase' and 'smartcase' settings to match files - even on systems that are case-sensitive. This is mainly significant for the - commands that use |globpath()| or |glob()| which are, |:LUPath| and |:LUWalk|, - as the others already respect these settings. -- There is now a separate command called :LUTags that always does what - :LookupFile used to do, while the :LookupFile command itself now gets - dynamically assigned to the last command used. This also means, the map that - is choosen in |lookupfile-map| now invokes the last command that is used, use - |LookupFile_DefaultCmd| and |LookupFile_DisableDefaultMap| settings to control - this behavior. -- LUWalk now supports showing only directory names in the results. Just type - an extra / to filter those that are not directories (the suffix will then be - two slashes). -- The default behavior of |:LUBufs| is now to match the entire |bufname()|, - just like the |:buffer| command would do. To see the old behavior, reset - |LookupFile_Bufs_LikeBufCmd| setting. -- If you have the new version of SelectBuf also installed, you can have - |:LUBufs| sort buffers in MRU order. See, |LookupFile_Bufs_BufListExpr|. -- When tags file is not generated as per the requirements of |lookupfile-tags|, - the format of the matches doesn't look good, so by default the matches just - show full filenames. See |LookupFile_UsingSpecializedTags| to get better - formatted results. -- New settings |LookupFile_UsingSpecializedTags|, |LookupFile_SortMethod|, - |LookupFile_DefaultCmd|, |LookupFile_DisableDefaultMap|, - |LookupFile_Bufs_LikeBufCmd|, |LookupFile_Bufs_BufListExpr|, - |LookupFile_EscCancelsPopup|. -- Bug fix: exact matches were getting dropped from results (Max Dyckhoff). -- Bug fix: in |:LUWalk| right after selecting a directory match caused it - to misbehave. -- Bug fix: if tags file is not in the current directory, the opening fails. Now - :LookupFile expands the filenames explicitly so that the paths are always - valid. -- Bug fix: Unsetting |LookupFile_AllowNewFiles| didn't disable the feature. -- Bug fix: was not hiding the popup. -- Bug fix: triggers the default insert-mode completion (Max Dyckhoff). -- Fixed misc. bugs in opening files. -- Workaround for not working on some systems, allow disabling the - mapping. -- Bug fix: When there is an exising swapfile, opening the files result in an - error message (David Fishburn). -- When LookupFile_UsingSpecializedTags is set, sorting should be done on the - filename (patch by Timothy, Guo). - - *lookupfile-changes-1.4* -- Fixed a bug in the initial pattern getting ignored. -- LUBufs now completes the full pathname of the buffers, so that it is less - dependent on the current directory of Vim. -- LUBufs and LUPath commands now present the matches in a better format. -- Pressing while popup is visible didn't close the lookupfile window. - - *lookupfile-changes-1.3* -- New feature to create a file, if the file doesn't already exist (Ido). Can be - disabled using g:LookupFile_AllowNewFiles setting. -- Bug fix: while using LUWalk, if the first match is a directory, then selecting - files was offset by one. - - *lookupfile-changes-1.2* -- g:LookupFile_AlwaysAcceptFirst setting to always accept the first - entry (the default is 0). -- g:LookupFile_FileFilter to specify a filter. -- New LUWalk command that works very similar to Emacs ido.el to quickly navigate - paths. -- All commands now accepts the initial pattern as argument. This provides - unlimited number of possibilities to create your own custom commands (see - |lookupfile-tips| for some examples). -- The g:LookupFile_MinPatLength is automatically set to 0 except for tag and - 'path' lookup. -- When Lookup window is opened, the filetype is set to "lookupfile". This allows - you to create ftplugins to fine tune the behavior. -- Renamed :LUBuf command to :LUBufs. - - *lookupfile-changes-1.1* -- Added LUBuf and LUPath commands. -- Renamed the prefix for all the settings from g:lookupfile_ to g:LookupFile_. - This is required to support Funcref settings. -- Now the cursor position is preserved, while opening a file that is already - loaded. -- Using genutils 2.1. -============================================================================== - - *lookupfile-acknowledgements* -- Max Dyckhoff (maxd at microsoft dot com) for beta testing and reporting - numerous issues and suggesting improvements etc. The plugin is a lot - more stable, thanks to him. - I would also like to specially thank him for proof reading the first version - of this documentation. -- Eddy Zhao (eddy dot y dot zhao at gmail dot com> for suggesting several - improvements on the lines of emacs ido.el and rigorously testing them. The - LUWalk command is the result of this. -- Eddy Zhao (eddy dot y dot zhao at gmail dot com> for suggesting several -- Dane Summers (dsummersl at yahoo dot com) for feedback and doc updates. -- Timothy, Guo (firemeteor dot guo at gmail dot com) for improving the sorting - and other feedback. - - - vim6:tw=80:ts=8:ft=help:ai:sw=4:et diff --git a/doc/surround.txt b/doc/surround.txt deleted file mode 100644 index fec64a2..0000000 --- a/doc/surround.txt +++ /dev/null @@ -1,218 +0,0 @@ -*surround.txt* Plugin for deleting, changing, and adding "surroundings" - -Author: Tim Pope *surround-author* -License: Same terms as Vim itself (see |license|) - -This plugin is only available if 'compatible' is not set. - -INTRODUCTION *surround* - -This plugin is a tool for dealing with pairs of "surroundings." Examples -of surroundings include parentheses, quotes, and HTML tags. They are -closely related to what Vim refers to as |text-objects|. Provided -are mappings to allow for removing, changing, and adding surroundings. - -Details follow on the exact semantics, but first, consider the following -examples. An asterisk (*) is used to denote the cursor position. - - Old text Command New text ~ - "Hello *world!" ds" Hello world! - [123+4*56]/2 cs]) (123+456)/2 - "Look ma, I'm *HTML!" cs" Look ma, I'm HTML! - if *x>3 { ysW( if ( x>3 ) { - my $str = *whee!; vlllls' my $str = 'whee!'; - -While a few features of this plugin will work in older versions of Vim, -Vim 7 is recommended for full functionality. - -MAPPINGS *surround-mappings* - -Delete surroundings is *ds* . The next character given determines the target -to delete. The exact nature of the target are explained in |surround-targets| -but essentially it is the last character of a |text-object|. This mapping -deletes the difference between the "inner" object and "an" object. This is -easiest to understand with some examples: - - Old text Command New text ~ - "Hello *world!" ds" Hello world! - (123+4*56)/2 ds) 123+456/2 -
Yo!*
dst Yo! - -Change surroundings is *cs* . It takes two arguments, a target like with -|ds|, and a replacement. Details about the second argument can be found -below in |surround-replacements|. Once again, examples are in order. - - Old text Command New text ~ - "Hello *world!" cs"' 'Hello world!' - "Hello *world!" cs" Hello world! - (123+4*56)/2 cs)] [123+456]/2 - (123+4*56)/2 cs)[ [ 123+456 ]/2 -
Yo!*
cst

Yo!

- -*ys* takes an valid Vim motion or text object as the first object, and wraps -it using the second argument as with |cs|. (Unfortunately there's no good -mnemonic for "ys".) - - Old text Command New text ~ - Hello w*orld! ysiw) Hello (world)! - -As a special case, *yss* operates on the current line, ignoring leading -whitespace. - - Old text Command New text ~ - Hello w*orld! yssB {Hello world!} - -There is also *yS* and *ySS* which indent the surrounded text and place it -on a line of its own. - -In visual mode, a simple "s" with an argument wraps the selection. This is -referred to as the *vs* mapping, although ordinarily there will be -additional keystrokes between the v and s. In linewise visual mode, the -surroundings are placed on separate lines. In blockwise visual mode, each -line is surrounded. - -An "S" in visual mode (*vS*) behaves similarly but always places the -surroundings on separate lines. Additionally, the surrounded text is -indented. In blockwise visual mode, using "S" instead of "s" instead skips -trailing whitespace. - -Note that "s" and "S" already have valid meaning in visual mode, but it is -identical to "c". If you have muscle memory for "s" and would like to use a -different key, add your own mapping and the existing one will be disabled. -> - vmap s Vsurround - vmap S VSurround -< - *i_CTRL-G_s* *i_CTRL-G_S* -Finally, there is an experimental insert mode mapping on s and . -Beware that the latter won't work on terminals with flow control (if you -accidentally freeze your terminal, use to unfreeze it). The mapping -inserts the specified surroundings and puts the cursor between them. If, -immediately after the mapping and before the replacement, a second or -carriage return is pressed, the prefix, cursor, and suffix will be placed on -three separate lines. S (not s) also exhibits this behavior. - -TARGETS *surround-targets* - -The |ds| and |cs| commands both take a target as their first argument. The -possible targets are based closely on the |text-objects| provided by Vim. -In order for a target to work, the corresponding text object must be -supported in the version of Vim used (Vim 7 adds several text objects, and -thus is highly recommended). All targets are currently just one character. - -Eight punctuation marks, (, ), {, }, [, ], <, and >, represent themselves -and their counterpart. If the opening mark is used, contained whitespace is -also trimmed. The targets b, B, r, and a are aliases for ), }, ], and > -(the first two mirror Vim; the second two are completely arbitrary and -subject to change). - -Three quote marks, ', ", `, represent themselves, in pairs. They are only -searched for on the current line. - -A t is a pair of HTML or XML tags. See |tag-blocks| for details. Remember -that you can specify a numerical argument if you want to get to a tag other -than the innermost one. - -The letters w, W, and s correspond to a |word|, a |WORD|, and a |sentence|, -respectively. These are special in that they have nothing to delete, and -used with |ds| they are a no-op. With |cs|, one could consider them a -slight shortcut for ysi (cswb == ysiwb, more or less). - -A p represents a |paragraph|. This behaves similarly to w, W, and s above; -however, newlines are sometimes added and/or removed. - -REPLACEMENTS *surround-replacements* - -A replacement argument is a single character, and is required by |cs|, |ys|, -and |vs|. Undefined replacement characters (with the exception of alphabetic -characters) default to placing themselves at the beginning and end of the -destination, which can be useful for characters like / and |. - -If either ), }, ], or > is used, the text is wrapped in the appropriate pair -of characters. Similar behavior can be found with (, {, and [ (but not <), -which append an additional space to the inside. Like with the targets above, -b, B, r, and a are aliases for ), }, ], and >. To fulfill the common need for -code blocks in C-style languages, (which is really ) adds braces on -lines separate from the content. - -If t or < is used, Vim prompts for an HTML/XML tag to insert. You may specify -attributes here and they will be stripped from the closing tag. End your -input by pressing or >. If is used, the tags will appear on lines -by themselves. - -A deprecated replacement of a LaTeX environment is provided on \ and l. The -name of the environment and any arguments will be input from a prompt. This -will be removed once a more fully functional customization system is -implemented. The following shows the resulting environment from -csp\tabular}{lc -> - \begin{tabular}{lc} - \end{tabular} -< -CUSTOMIZING *surround-customizing* - -The following adds a potential replacement on "-" (ASCII 45) in PHP files. -(To determine the ASCII code to use, :echo char2nr("-")). The carriage -return will be replaced by the original text. -> - autocmd FileType php let b:surround_45 = "" -< -This can be used in a PHP file as in the following example. - - Old text Command New text ~ - print "Hello *world!" yss- - -Additionally, one can use a global variable for globally available -replacements. -> - let g:surround_45 = "<% \r %>" - let g:surround_61 = "<%= \r %>" -< -Advanced, experimental, and subject to change: One can also prompt for -replacement text. The syntax for this is to surround the replacement in pairs -of low numbered control characters. If this sounds confusing, that's because -it is (but it makes the parsing easy). Consider the following example for a -LaTeX environment on the "l" replacement. -> - let g:surround_108 = "\\begin{\1environment: \1}\r\\end{\1\1}" -< -When this replacement is used, the user is prompted with an "environment: " -prompt for input. This input is inserted between each set of \1's. -Additional inputs up to \7 can be used. - -Furthermore, one can specify a regular expression substitution to apply. -> - let g:surround_108 = "\\begin{\1environment: \1}\r\\end{\1\r}.*\r\1}" -< -This will remove anything after the first } in the input when the text is -placed within the \end{} slot. The first \r marks where the pattern begins, -and the second where the replacement text begins. - -Here's a second example for creating an HTML
. The substitution cleverly -prompts for an id, but only adds id="" if it is non-blank. You may have to -read this one a few times slowly before you understand it. -> - let g:surround_{char2nr("d")} = "\r
" -< -Inputting text replacements is a proof of concept at this point. The ugly, -unintuitive interface and the brevity of the documentation reflect this. - -Finally, It is possible to always append a string to surroundings in insert -mode (and only insert mode). This is useful with certain plugins and mappings -that allow you to jump to such markings. -> - let g:surround_insert_tail = "<++>" -< -ISSUES *surround-issues* - -Vim could potentially get confused when deleting/changing occurs at the very -end of the line. Please report any repeatable instances of this. - -Do we need to use |inputsave()|/|inputrestore()| with the tag replacement? - -Indenting is handled haphazardly. Need to decide the most appropriate -behavior and implement it. Right now one can do :let b:surround_indent = 1 -(or the global equivalent) to enable automatic re-indenting by Vim via |=|; -should this be the default? - - vim:tw=78:ts=8:ft=help:norl: diff --git a/doc/vcscommand.txt b/doc/vcscommand.txt deleted file mode 100644 index cf6bd97..0000000 --- a/doc/vcscommand.txt +++ /dev/null @@ -1,819 +0,0 @@ -*vcscommand.txt* vcscommand -Copyright (c) 2007 Bob Hiestand - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. - -For instructions on installing this file, type - :help add-local-help -inside Vim. - -Author: Bob Hiestand -Credits: Benji Fisher's excellent MatchIt documentation - -============================================================================== -1. Contents *vcscommand-contents* - - Installation : |vcscommand-install| - vcscommand Intro : |vcscommand| - vcscommand Manual : |vcscommand-manual| - Customization : |vcscommand-customize| - SSH "integration" : |vcscommand-ssh| - Changes from cvscommand : |cvscommand-changes| - Bugs : |vcscommand-bugs| - -============================================================================== - -2. vcscommand Installation *vcscommand-install* - -The vcscommand plugin comprises five files: vcscommand.vim, vcssvn.vim, -vcscvs.vim, vcssvk.vim and vcscommand.txt (this file). In order to install -the plugin, place the vcscommand.vim, vcssvn.vim, vcssvk.vim, and vcscvs.vim -files into a plugin directory in your runtime path (please see -|add-global-plugin| and |'runtimepath'|. - -This help file can be included in the VIM help system by copying it into a -'doc' directory in your runtime path and then executing the |:helptags| -command, specifying the full path of the 'doc' directory. Please see -|add-local-help| for more details. - -vcscommand may be customized by setting variables, creating maps, and -specifying event handlers. Please see |vcscommand-customize| for more -details. - -============================================================================== - -3. vcscommand Intro *vcscommand* - *vcscommand-intro* - -The vcscommand plugin provides global ex commands for manipulating -version-controlled source files, currently those controlled either by CVS or -Subversion. In general, each command operates on the current buffer and -accomplishes a separate source control function, such as update, commit, log, -and others (please see |vcscommand-commands| for a list of all available -commands). The results of each operation are displayed in a scratch buffer. -Several buffer variables are defined for those scratch buffers (please see -|vcscommand-buffer-variables|). - -The notion of "current file" means either the current buffer, or, in the case -of a directory buffer (such as Explorer or netrw buffers), the directory (and -all subdirectories) represented by the the buffer. - -For convenience, any vcscommand invoked on a vcscommand scratch buffer acts as -though it was invoked on the original file and splits the screen so that the -output appears in a new window. - -Many of the commands accept revisions as arguments. By default, most operate -on the most recent revision on the current branch if no revision is specified. - -Each vcscommand is mapped to a key sequence starting with the -keystroke. The default mappings may be overridden by supplying different -mappings before the plugin is loaded, such as in the vimrc, in the standard -fashion for plugin mappings. For examples, please see -|vcscommand-mappings-override|. - -The vcscommand plugin may be configured in several ways. For more details, -please see |vcscommand-customize|. - -============================================================================== - -4. vcscommand Manual *vcscommand-manual* - -4.1 vcscommand commands *vcscommand-commands* - -vcscommand defines the following commands: - -|:VCSAdd| -|:VCSAnnotate| -|:VCSBlame| -|:VCSCommit| -|:VCSDelete| -|:VCSDiff| -|:VCSGotoOriginal| -|:VCSLog| -|:VCSRemove| -|:VCSRevert| -|:VCSReview| -|:VCSStatus| -|:VCSUpdate| -|:VCSVimDiff| - -The following commands are specific to CVS files: - -|:CVSEdit| -|:CVSEditors| -|:CVSUnedit| -|:CVSWatch| -|:CVSWatchAdd| -|:CVSWatchOn| -|:CVSWatchOff| -|:CVSWatchRemove| -|:CVSWatchers| - -:VCSAdd *:VCSAdd* - -This command adds the current file to source control. Please note, this does -not commit the newly-added file. All parameters to the command are passed to -the underlying VCS. - -:VCSAnnotate[!] *:VCSAnnotate* - -This command displays the current file with each line annotated with the -version in which it was most recently changed. If an argument is given, the -argument is used as a revision number to display. If not given an argument, -it uses the most recent version of the file (on the current branch, if under -CVS control). Additionally, if the current buffer is a VCSAnnotate buffer -already, the version number on the current line is used. - -If '!' is used, the view of the annotated buffer is split so that the -annotation is in a separate window from the content, and each is highlighted -separately. - -For CVS buffers, the 'VCSCommandCVSAnnotateParent' option, if set to non-zero, -will cause the above behavior to change. Instead of annotating the version on -the current line, the parent revision is used instead, crossing branches if -necessary. - -The filetype of the vcscommand scratch buffer is set to one of 'CVSAnnotate', -'SVNAnnotate', 'SVKAnnotate' or 'gitAnnotate' as appropriate, to take advantage of the -bundled syntax files. - -:VCSBlame[!] *:VCSBlame* - -Alias for |:VCSAnnotate|. - -:VCSCommit[!] *:VCSCommit* - -This command commits changes to the current file to source control. - -If called with arguments, the arguments are the log message. - -If '!' is used, an empty log message is committed. - -If called with no arguments, this is a two-step command. The first step opens -a buffer to accept a log message. When that buffer is written, it is -automatically closed and the file is committed using the information from that -log message. The commit can be abandoned if the log message buffer is deleted -or wiped before being written. - -Alternatively, the mapping that is used to invoke :VCSCommit (by default -cc) can be used in the log message buffer to immediately commit. This -is useful if the |VCSCommandCommitOnWrite| variable is set to 0 to disable the -normal commit-on-write behavior. - -:VCSDelete *:VCSDelete* - -Deletes the current file and removes it from source control. All parameters -to the command are passed to the underlying VCS. - -:VCSDiff *:VCSDiff* - -With no arguments, this displays the differences between the current file and -its parent version under source control in a new scratch buffer. - -With one argument, the diff is performed on the current file against the -specified revision. - -With two arguments, the diff is performed between the specified revisions of -the current file. - -For CVS, this command uses the |VCSCommandCVSDiffOpt| variable to specify diff -options. If that variable does not exist, a plugin-specific default is used. -If you wish to have no options, then set it to the empty string. - -For SVN, this command uses the |VCSCommandSVNDiffOpt| variable to specify diff -options. If that variable does not exist, the SVN default is used. -Additionally, |VCSCommandSVNDiffExt| can be used to select an external diff -application. - -:VCSGotoOriginal *:VCSGotoOriginal* - -This command jumps to the source buffer if the current buffer is a VCS scratch -buffer. - -:VCSGotoOriginal! - -Like ":VCSGotoOriginal" but also executes :bufwipeout on all VCS scrach -buffers associated with the original file. - -:VCSInfo *:VCSInfo* - -This command displays extended information about the current file in a new -scratch buffer. - -:VCSLock *:VCSLock* - -This command locks the current file in order to prevent other users from -concurrently modifying it. The exact semantics of this command depend on the -underlying VCS. This does nothing in CVS. All parameters are passed to the -underlying VCS. - -:VCSLog *:VCSLog* - -Displays the version history of the current file in a new scratch buffer. If -there is one parameter supplied, it is taken as as a revision parameters to be -passed through to the underlying VCS. Otherwise, all parameters are passed to -the underlying VCS. - -:VCSRemove *:VCSRemove* - -Alias for |:VCSDelete|. - -:VCSRevert *:VCSRevert* - -This command replaces the current file with the most recent version from the -repository in order to wipe out any undesired changes. - -:VCSReview *:VCSReview* - -Displays a particular version of the current file in a new scratch buffer. If -no argument is given, the most recent version of the file on the current -branch is retrieved. - -:VCSStatus *:VCSStatus* - -Displays versioning information about the current file in a new scratch -buffer. All parameters are passed to the underlying VCS. - - -:VCSUnlock *:VCSUnlock* - -Unlocks the current file in order to allow other users from concurrently -modifying it. The exact semantics of this command depend on the underlying -VCS. All parameters are passed to the underlying VCS. - -:VCSUpdate *:VCSUpdate* - -Updates the current file with any relevant changes from the repository. This -intentionally does not automatically reload the current buffer, though vim -should prompt the user to do so if the underlying file is altered by this -command. - -:VCSVimDiff *:VCSVimDiff* - -Uses vimdiff to display differences between versions of the current file. - -If no revision is specified, the most recent version of the file on the -current branch is used. With one argument, that argument is used as the -revision as above. With two arguments, the differences between the two -revisions is displayed using vimdiff. - -With either zero or one argument, the original buffer is used to perform the -vimdiff. When the scratch buffer is closed, the original buffer will be -returned to normal mode. - -Once vimdiff mode is started using the above methods, additional vimdiff -buffers may be added by passing a single version argument to the command. -There may be up to 4 vimdiff buffers total. - -Using the 2-argument form of the command resets the vimdiff to only those 2 -versions. Additionally, invoking the command on a different file will close -the previous vimdiff buffers. - -:CVSEdit *:CVSEdit* - -This command performs "cvs edit" on the current file. Yes, the output buffer -in this case is almost completely useless. - -:CVSEditors *:CVSEditors* - -This command performs "cvs edit" on the current file. - -:CVSUnedit *:CVSUnedit* - -Performs "cvs unedit" on the current file. Again, yes, the output buffer here -is basically useless. - -:CVSWatch *:CVSWatch* - -This command takes an argument which must be one of [on|off|add|remove]. The -command performs "cvs watch" with the given argument on the current file. - -:CVSWatchAdd *:CVSWatchAdd* - -This command is an alias for ":CVSWatch add" - -:CVSWatchOn *:CVSWatchOn* - -This command is an alias for ":CVSWatch on" - -:CVSWatchOff *:CVSWatchOff* - -This command is an alias for ":CVSWatch off" - -:CVSWatchRemove *:CVSWatchRemove* - -This command is an alias for ":CVSWatch remove" - -:CVSWatchers *:CVSWatchers* - -This command performs "cvs watchers" on the current file. - -4.2 Mappings *vcscommand-mappings* - -By default, a mapping is defined for each command. These mappings execute the -default (no-argument) form of each command. - -ca VCSAdd -cn VCSAnnotate -cN VCSAnnotate! -cc VCSCommit -cD VCSDelete -cd VCSDiff -cg VCSGotoOriginal -cG VCSGotoOriginal! -ci VCSInfo -cl VCSLog -cL VCSLock -cr VCSReview -cs VCSStatus -cu VCSUpdate -cU VCSUnlock -cv VCSVimDiff - -Only for CVS buffers: - -ce CVSEdit -cE CVSEditors -ct CVSUnedit -cwv CVSWatchers -cwa CVSWatchAdd -cwn CVSWatchOn -cwf CVSWatchOff -cwf CVSWatchRemove - - *vcscommand-mappings-override* - -The default mappings can be overridden by user-provided instead by mapping to -CommandName. This is especially useful when these mappings collide with -other existing mappings (vim will warn of this during plugin initialization, -but will not clobber the existing mappings). - -There are three methods for controlling mapping: - -First, maps can be overriden for individual commands. For instance, to -override the default mapping for :VCSAdd to set it to '\add', add the -following to the vimrc: - -nmap \add VCSAdd - -Second, the default map prefix ('c') can be overridden by defining the -|VCSCommandMapPrefix| variable. - -Third, the entire set of default maps can be overridden by defining the -|VCSCommandMappings| variable. - - -4.3 Automatic buffer variables *vcscommand-buffer-variables* - -Several buffer variables are defined in each vcscommand result buffer. These -may be useful for additional customization in callbacks defined in the event -handlers (please see |vcscommand-events|). - -The following variables are automatically defined: - -b:VCSCommandOriginalBuffer *b:VCSCommandOriginalBuffer* - -This variable is set to the buffer number of the source file. - -b:VCSCommandCommand *b:VCSCommandCommand* - -This variable is set to the name of the vcscommand that created the result -buffer. - -b:VCSCommandSourceFile *b:VCSCommandSourceFile* - -This variable is set to the name of the original file under source control. - -b:VCSCommandVCSType *b:VCSCommandVCSType* - -This variable is set to the type of the source control. This variable is also -set on the original file itself. -============================================================================== - -5. Configuration and customization *vcscommand-customize* - *vcscommand-config* - -The vcscommand plugin can be configured in several ways: by setting -configuration variables (see |vcscommand-options|) or by defining vcscommand -event handlers (see |vcscommand-events|). Additionally, the vcscommand plugin -supports a customized status line (see |vcscommand-statusline| and -|vcscommand-buffer-management|). - -5.1 vcscommand configuration variables *vcscommand-options* - -Several variables affect the plugin's behavior. These variables are checked -at time of execution, and may be defined at the window, buffer, or global -level and are checked in that order of precedence. - - -The following variables are available: - -|VCSCommandCommitOnWrite| -|VCSCommandCVSDiffOpt| -|VCSCommandCVSExec| -|VCSCommandDeleteOnHide| -|VCSCommandDiffSplit| -|VCSCommandDisableAll| -|VCSCommandDisableMappings| -|VCSCommandDisableExtensionMappings| -|VCSCommandEdit| -|VCSCommandEnableBufferSetup| -|VCSCommandMappings| -|VCSCommandMapPrefix| -|VCSCommandResultBufferNameExtension| -|VCSCommandResultBufferNameFunction| -|VCSCommandSplit| -|VCSCommandSVKExec| -|VCSCommandSVNDiffExt| -|VCSCommandSVNDiffOpt| -|VCSCommandSVNExec| -|VCSCommandVCSTypeOverride| - -VCSCommandCommitOnWrite *VCSCommandCommitOnWrite* - -This variable, if set to a non-zero value, causes the pending commit -to take place immediately as soon as the log message buffer is written. -If set to zero, only the VCSCommit mapping will cause the pending commit to -occur. If not set, it defaults to 1. - -VCSCommandCVSExec *VCSCommandCVSExec* - -This variable controls the executable used for all CVS commands If not set, -it defaults to "cvs". - -VCSCommandDeleteOnHide *VCSCommandDeleteOnHide* - -This variable, if set to a non-zero value, causes the temporary result buffers -to automatically delete themselves when hidden. - -VCSCommandCVSDiffOpt *VCSCommandCVSDiffOpt* - -This variable, if set, determines the options passed to the diff command of -CVS. If not set, it defaults to 'u'. - -VCSCommandDiffSplit *VCSCommandDiffSplit* - -This variable overrides the |VCSCommandSplit| variable, but only for buffers -created with |:VCSVimDiff|. - -VCSCommandDisableAll *VCSCommandDisableAll* - -This variable, if set, prevents the plugin or any extensions from loading at -all. This is useful when a single runtime distribution is used on multiple -systems with varying versions. - -VCSCommandDisableMappings *VCSCommandDisableMappings* - -This variable, if set to a non-zero value, prevents the default command -mappings from being set. This supercedes -|VCSCommandDisableExtensionMappings|. - -VCSCommandDisableExtensionMappings *VCSCommandDisableExtensionMappings* - -This variable, if set to a non-zero value, prevents the default command -mappings from being set for commands specific to an individual VCS. - -VCSCommandEdit *VCSCommandEdit* - -This variable controls whether the original buffer is replaced ('edit') or -split ('split'). If not set, it defaults to 'split'. - -VCSCommandEnableBufferSetup *VCSCommandEnableBufferSetup* - -This variable, if set to a non-zero value, activates VCS buffer management -mode see (|vcscommand-buffer-management|). This mode means that the -'VCSCommandBufferInfo' variable is filled with version information if the file -is VCS-controlled. This is useful for displaying version information in the -status bar. - -VCSCommandMappings *VCSCommandMappings* - -This variable, if set, overrides the default mappings used for shortcuts. It -should be a List of 2-element Lists, each containing a shortcut and function -name pair. The value of the '|VCSCommandMapPrefix|' variable will be added to -each shortcut. - -VCSCommandMapPrefix *VCSCommandMapPrefix* - -This variable, if set, overrides the default mapping prefix ('c'). -This allows customization of the mapping space used by the vcscommand -shortcuts. - -VCSCommandResultBufferNameExtension *VCSCommandResultBufferNameExtension* - -This variable, if set to a non-blank value, is appended to the name of the VCS -command output buffers. For example, '.vcs'. Using this option may help -avoid problems caused by autocommands dependent on file extension. - -VCSCommandResultBufferNameFunction *VCSCommandResultBufferNameFunction* - -This variable, if set, specifies a custom function for naming VCS command -output buffers. This function is expected to return the new buffer name, and -will be passed the following arguments: - - command - name of the VCS command being executed (such as 'Log' or - 'Diff'). - - originalBuffer - buffer number of the source file. - - vcsType - type of VCS controlling this file (such as 'CVS' or 'SVN'). - - statusText - extra text associated with the VCS action (such as version - numbers). - -VCSCommandSplit *VCSCommandSplit* - -This variable controls the orientation of the various window splits that -may occur. - -If set to 'horizontal', the resulting windows will be on stacked on top of -one another. If set to 'vertical', the resulting windows will be -side-by-side. If not set, it defaults to 'horizontal' for all but -VCSVimDiff windows. VCSVimDiff windows default to the user's 'diffopt' -setting, if set, otherwise 'vertical'. - -VCSCommandSVKExec *VCSCommandSVKExec* - -This variable controls the executable used for all SVK commands If not set, -it defaults to "svk". - -VCSCommandSVNDiffExt *VCSCommandSVNDiffExt* - -This variable, if set, is passed to SVN via the --diff-cmd command to select -an external application for performing the diff. - -VCSCommandSVNDiffOpt *VCSCommandSVNDiffOpt* - -This variable, if set, determines the options passed with the '-x' parameter -to the SVN diff command. If not set, no options are passed. - -VCSCommandSVNExec *VCSCommandSVNExec* - -This variable controls the executable used for all SVN commands If not set, -it defaults to "svn". - -VCSCommandVCSTypeOverride *VCSCommandVCSTypeOverride* - -This variable allows the VCS type detection to be overridden on a path-by-path -basis. The value of this variable is expected to be a List of Lists. Each -item in the high-level List is a List containing two elements. The first -element is a regular expression that will be matched against the full file -name of a given buffer. If it matches, the second element will be used as the -VCS type. - -5.2 VCSCommand events *vcscommand-events* - -For additional customization, vcscommand can trigger user-defined events. -Event handlers are provided by defining User event autocommands (see -|autocommand|, |User|) in the vcscommand group with patterns matching the -event name. - -For instance, the following could be added to the vimrc to provide a 'q' -mapping to quit a vcscommand scratch buffer: - -augroup VCSCommand - au User VCSBufferCreated silent! nmap q :bwipeout -augroup END - -The following hooks are available: - -VCSBufferCreated This event is fired just after a vcscommand - result buffer is created and populated. It is - executed within the context of the vcscommand - buffer. The vcscommand buffer variables may - be useful for handlers of this event (please - see |vcscommand-buffer-variables|). - -VCSBufferSetup This event is fired just after vcscommand buffer - setup occurs, if enabled. - -VCSPluginInit This event is fired when the vcscommand plugin - first loads. - -VCSPluginFinish This event is fired just after the vcscommand - plugin loads. - -VCSVimDiffFinish This event is fired just after the VCSVimDiff - command executes to allow customization of, - for instance, window placement and focus. - -Additionally, there is another hook which is used internally to handle loading -the multiple scripts in order. This hook should probably not be used by an -end user without a good idea of how it works. Among other things, any events -associated with this hook are cleared after they are executed (during -vcscommand.vim script initialization). - -VCSLoadExtensions This event is fired just before the - VCSPluginFinish. It is used internally to - execute any commands from the VCS - implementation plugins that needs to be - deferred until the primary plugin is - initialized. - -5.3 vcscommand buffer naming *vcscommand-naming* - -vcscommand result buffers use the following naming convention: -[{VCS type} {VCS command} {Source file name}] - -If additional buffers are created that would otherwise conflict, a -distinguishing number is added: - -[{VCS type} {VCS command} {Source file name}] (1,2, etc) - -5.4 vcscommand status line support *vcscommand-statusline* - -It is intended that the user will customize the |'statusline'| option to -include vcscommand result buffer attributes. A sample function that may be -used in the |'statusline'| option is provided by the plugin, -VCSCommandGetStatusLine(). In order to use that function in the status line, do -something like the following: - -set statusline=%<%f\ %{VCSCommandGetStatusLine()}\ %h%m%r%=%l,%c%V\ %P - -of which %{VCSCommandGetStatusLine()} is the relevant portion. - -The sample VCSCommandGetStatusLine() function handles both vcscommand result -buffers and VCS-managed files if vcscommand buffer management is enabled -(please see |vcscommand-buffer-management|). - -5.5 vcscommand buffer management *vcscommand-buffer-management* - -The vcscommand plugin can operate in buffer management mode, which means that -it attempts to set a buffer variable ('VCSCommandBufferInfo') upon entry into -a buffer. This is rather slow because it means that the VCS will be invoked -at each entry into a buffer (during the |BufEnter| autocommand). - -This mode is disabled by default. In order to enable it, set the -|VCSCommandEnableBufferSetup| variable to a true (non-zero) value. Enabling -this mode simply provides the buffer variable mentioned above. The user must -explicitly include information from the variable in the |'statusline'| option -if they are to appear in the status line (but see |vcscommand-statusline| for -a simple way to do that). - -The 'VCSCommandBufferInfo' variable is a list which contains, in order, the -revision of the current file, the latest revision of the file in the -repository, and (for CVS) the name of the branch. If those values cannot be -determined, the list is a single element: 'Unknown'. - -============================================================================== - -6. SSH "integration" *vcscommand-ssh* - -The following instructions are intended for use in integrating the -vcscommand.vim plugin with an SSH-based CVS environment. - -Familiarity with SSH and CVS are assumed. - -These instructions assume that the intent is to have a message box pop up in -order to allow the user to enter a passphrase. If, instead, the user is -comfortable using certificate-based authentication, then only instructions -6.1.1 and 6.1.2 (and optionally 6.1.4) need to be followed; ssh should then -work transparently. - -6.1 Environment settings *vcscommand-ssh-env* - -6.1.1 CVSROOT should be set to something like: - - :ext:user@host:/path_to_repository - -6.1.2 CVS_RSH should be set to: - - ssh - - Together, those settings tell CVS to use ssh as the transport when - performing CVS calls. - -6.1.3 SSH_ASKPASS should be set to the password-dialog program. In my case, - running gnome, it's set to: - - /usr/libexec/openssh/gnome-ssh-askpass - - This tells SSH how to get passwords if no input is available. - -6.1.4 OPTIONAL. You may need to set SSH_SERVER to the location of the cvs - executable on the remote (server) machine. - -6.2 CVS wrapper program *vcscommand-ssh-wrapper* - -Now you need to convince SSH to use the password-dialog program. This means -you need to execute SSH (and therefore CVS) without standard input. The -following script is a simple perl wrapper that dissasociates the CVS command -from the current terminal. Specific steps to do this may vary from system to -system; the following example works for me on linux. - -#!/usr/bin/perl -w -use strict; -use POSIX qw(setsid); -open STDIN, '/dev/null'; -fork and do {wait; exit;}; -setsid; -exec('cvs', @ARGV); - -6.3 Configuring vcscommand.vim *vcscommand-ssh-config* - -At this point, you should be able to use your wrapper script to invoke CVS with -various commands, and get the password dialog. All that's left is to make CVS -use your newly-created wrapper script. - -6.3.1 Tell vcscommand.vim what CVS executable to use. The easiest way to do this - is globally, by putting the following in your .vimrc: - - let VCSCommandCVSExec=/path/to/cvs/wrapper/script - -6.4 Where to go from here *vcscommand-ssh-other* - -The script given above works even when non-SSH CVS connections are used, -except possibly when interactively entering the message for CVS commit log -(depending on the editor you use... VIM works fine). Since the vcscommand.vim -plugin handles that message without a terminal, the wrapper script can be used -all the time. - -This allows mixed-mode operation, where some work is done with SSH-based CVS -repositories, and others with pserver or local access. - -It is possible, though beyond the scope of the plugin, to dynamically set the -CVS executable based on the CVSROOT for the file being edited. The user -events provided (such as VCSBufferCreated and VCSBufferSetup) can be used to -set a buffer-local value (b:VCSCommandCVSExec) to override the CVS executable -on a file-by-file basis. Alternatively, much the same can be done (less -automatically) by the various project-oriented plugins out there. - -It is highly recommended for ease-of-use that certificates with no passphrase -or ssh-agent are employed so that the user is not given the password prompt -too often. - -============================================================================== - -7. Changes from cvscommand *cvscommand-changes* - -1. Require Vim 7 in order to leverage several convenient features; also -because I wanted to play with Vim 7. - -2. Renamed commands to start with 'VCS' instead of 'CVS'. The exceptions are -the 'CVSEdit' and 'CVSWatch' family of commands, which are specific to CVS. - -3. Renamed options, events to start with 'VCSCommand'. - -4. Removed option to jump to the parent version of the current line in an -annotated buffer, as opposed to the version on the current line. This made -little sense in the branching scheme used by subversion, where jumping to a -parent branch required finding a different location in the repository. It -didn't work consistently in CVS anyway. - -5. Removed option to have nameless scratch buffers. - -6. Changed default behavior of scratch buffers to split the window instead of -displaying in the current window. This may still be overridden using the -'VCSCommandEdit' option. - -7. Split plugin into multiple plugins. - -8. Added 'VCSLock' and 'VCSUnlock' commands. These are implemented for -subversion but not for CVS. These were not kept specific to subversion as they -seemed more general in nature and more likely to be supported by any future VCS -supported by this plugin. - -9. Changed name of buffer variables set by commands. - -'b:cvsOrigBuffNR' became 'b:VCSCommandOriginalBuffer' -'b:cvscmd' became 'b:VCSCommandCommand' - -10. Added new automatic variables to command result buffers. - -'b:VCSCommandSourceFile' -'b:VCSCommandVCSType' - -============================================================================== - -8. Known bugs *vcscommand-bugs* - -Please let me know if you run across any. - -CVSUnedit may, if a file is changed from the repository, provide prompt text -to determine whether the changes should be thrown away. Currently, that text -shows up in the CVS result buffer as information; there is no way for the user -to actually respond to the prompt and the CVS unedit command does nothing. If -this really bothers anyone, please let me know. - -VCSVimDiff, when using the original (real) source buffer as one of the diff -buffers, uses some hacks to try to restore the state of the original buffer -when the scratch buffer containing the other version is destroyed. There may -still be bugs in here, depending on many configuration details. - -vim:tw=78:ts=8:ft=help diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt deleted file mode 100644 index 849b6be..0000000 --- a/doc/vimwiki.txt +++ /dev/null @@ -1,2331 +0,0 @@ -*vimwiki.txt* A Personal Wiki for Vim - - __ __ ___ __ __ _ _ ___ ___ _ ___ ~ - | | | || | | |_| || | _ | || | | | | || | ~ - | |_| || | | || || || || | | |_| || | ~ - | || | | || || | | _|| | ~ - | || | | || || | | |_ | | ~ - | | | | | ||_|| || _ || | | _ || | ~ - |___| |___| |_| |_||__| |__||___| |___| |_||___| ~ - - - Version: 2.0.1 'stu' - -============================================================================== -CONTENTS *vimwiki-contents* - - 1. Intro |vimwiki| - 2. Prerequisites |vimwiki-prerequisites| - 3. Mappings |vimwiki-mappings| - 3.1. Global mappings |vimwiki-global-mappings| - 3.2. Local mappings |vimwiki-local-mappings| - 3.3. Text objects |vimwiki-text-objects| - 4. Commands |vimwiki-commands| - 4.1. Global commands |vimwiki-global-commands| - 4.2. Local commands |vimwiki-local-commands| - 5. Wiki syntax |vimwiki-syntax| - 5.1. Typefaces |vimwiki-syntax-typefaces| - 5.2. Links |vimwiki-syntax-links| - 5.3. Headers |vimwiki-syntax-headers| - 5.4. Paragraphs |vimwiki-syntax-paragraphs| - 5.5. Lists |vimwiki-syntax-lists| - 5.6. Tables |vimwiki-syntax-tables| - 5.7. Preformatted text |vimwiki-syntax-preformatted| - 5.8. Mathematical formulae |vimwiki-syntax-math| - 5.9. Blockquotes |vimwiki-syntax-blockquotes| - 5.10. Comments |vimwiki-syntax-comments| - 5.11. Horizontal line |vimwiki-syntax-hr| - 5.12. Schemes |vimwiki-syntax-schemes| - 5.13. Transclusions |vimwiki-syntax-transclude| - 5.14. Thumbnails |vimwiki-syntax-thumbnails| - 6. Folding/Outline |vimwiki-folding| - 7. Placeholders |vimwiki-placeholders| - 8. Todo lists |vimwiki-todo-lists| - 9. Tables |vimwiki-tables| - 10. Diary |vimwiki-diary| - 11. Options |vimwiki-options| - 11.1. Registered Wiki |vimwiki-register-wiki| - 11.2. Temporary Wiki |vimwiki-temporary-wiki| - 11.3. Per-Wiki Options |vimwiki-local-options| - 11.4. Global Options |viwmiki-global-options| - 12. Help |vimwiki-help| - 13. Developers |vimwiki-developers| - 14. Changelog |vimwiki-changelog| - 15. License |vimwiki-license| - - -============================================================================== -1. Intro *vimwiki* - -Vimwiki is a personal wiki for Vim -- a number of linked text files that have -their own syntax highlighting. - -With vimwiki you can: - - organize notes and ideas; - - manage todo-lists; - - write documentation. - -To do a quick start press ww (this is usually \ww) to go to your index -wiki file. By default it is located in: > - ~/vimwiki/index.wiki - -Feed it with the following example: - -= My knowledge base = - * Tasks -- things to be done _yesterday_!!! - * Project Gutenberg -- good books are power. - * Scratchpad -- various temporary stuff. - -Place your cursor on 'Tasks' and press Enter to create a link. Once pressed, -'Tasks' will become '[[Tasks]]' -- a vimwiki link. Press Enter again to -open it. Edit the file, save it, and then press Backspace to jump back to your -index. - -A vimwiki link can be constructed from more than one word. Just visually -select the words to be linked and press Enter. Try it with 'Project -Gutenberg'. The result should look something like: - -= My knowledge base = - * [[Tasks]] -- things to be done _yesterday_!!! - * [[Project Gutenberg]] -- good books are power. - * Scratchpad -- various temporary stuff. - -============================================================================== -2. Prerequisites *vimwiki-prerequisites* - -Make sure you have these settings in your vimrc file: > - set nocompatible - filetype plugin on - syntax on - -Without them Vimwiki will not work properly. - - -============================================================================== -3. Mappings *vimwiki-mappings* - -There are global and local mappings in vimwiki. - ------------------------------------------------------------------------------- -3.1. Global mappings *vimwiki-global-mappings* - -[count]ww or VimwikiIndex - Open index file of the [count]'s wiki. - - ww opens the first wiki from |g:vimwiki_list|. - 1ww as above, opens the first wiki from |g:vimwiki_list|. - 2ww opens the second wiki from |g:vimwiki_list|. - 3ww opens the third wiki from |g:vimwiki_list|. - etc. - To remap: > - :nmap w VimwikiIndex -< -See also |:VimwikiIndex| - - -[count]wt or VimwikiTabIndex - Open index file of the [count]'s wiki in a new tab. - - wt tabopens the first wiki from |g:vimwiki_list|. - 1wt as above tabopens the first wiki from |g:vimwiki_list|. - 2wt tabopens the second wiki from |g:vimwiki_list|. - 3wt tabopens the third wiki from |g:vimwiki_list|. - etc. - To remap: > - :nmap t VimwikiTabIndex -< -See also |:VimwikiTabIndex| - - -ws or VimwikiUISelect - List and select available wikies. - To remap: > - :nmap wq VimwikiUISelect -< -See also |:VimwikiUISelect| - - -[count]wi or VimwikiDiaryIndex - Open diary index file of the [count]'s wiki. - - wi opens diary index file of the first wiki from - |g:vimwiki_list|. - 1wi the same as above. - 2wi opens diary index file of the second wiki from - |g:vimwiki_list|. - etc. - To remap: > - :nmap i VimwikiDiaryIndex - -See also |:VimwikiDiaryIndex| - - -[count]ww or VimwikiMakeDiaryNote - Open diary wiki-file for today of the [count]'s wiki. - - ww opens diary wiki-file for today in the first wiki - from |g:vimwiki_list|. - 1ww as above opens diary wiki-file for today in the - first wiki from |g:vimwiki_list|. - 2ww opens diary wiki-file for today in the second wiki - from |g:vimwiki_list|. - 3ww opens diary wiki-file for today in the third wiki - from |g:vimwiki_list|. - etc. - To remap: > - :nmap d VimwikiMakeDiaryNote -< -See also |:VimwikiMakeDiaryNote| - - -[count]wt or VimwikiTabMakeDiaryNote - Open diary wiki-file for today of the [count]'s wiki in a new tab. - - wt tabopens diary wiki-file for today in the first - wiki from |g:vimwiki_list|. - 1wt as above tabopens diary wiki-file for today in the - first wiki from |g:vimwiki_list|. - 2wt tabopens diary wiki-file for today in the second - wiki from |g:vimwiki_list|. - 3wt tabopens diary wiki-file for today in the third - wiki from |g:vimwiki_list|. - etc. - To remap: > - :nmap dt VimwikiTabMakeDiaryNote -< -See also |:VimwikiTabMakeDiaryNote| - - ------------------------------------------------------------------------------- -3.2. Local mappings - -NORMAL MODE *vimwiki-local-mappings* - *vimwiki_wh* -wh Convert current wiki page to HTML. - Maps to |:Vimwiki2HTML| - To remap: > - :nmap wc Vimwiki2HTML -< - *vimwiki_whh* -whh Convert current wiki page to HTML and open it in - webbrowser. - Maps to |:Vimwiki2HTML| - To remap: > - :nmap wcc Vimwiki2HTMLBrowse -< - *vimwiki_wi* -wi Update diary section (delete old, insert new) - Only works from the diary index. - Maps to |:VimwikiDiaryGenerateLinks| - To remap: > - :nmap wcr VimwikiDiaryGenerateLinks -< - *vimwiki_* - Follow/create wiki link (create target wiki page if - needed). - Maps to |:VimwikiFollowLink|. - To remap: > - :nmap wf VimwikiFollowLink -< - *vimwiki_* - Split and follow (create target wiki page if needed). - May not work in some terminals. Remapping could help. - Maps to |:VimwikiSplitLink|. - To remap: > - :nmap we VimwikiSplitLink -< - *vimwiki_* - Vertical split and follow (create target wiki page if - needed). - May not work in some terminals. Remapping could help. - Maps to |:VimwikiVSplitLink|. - To remap: > - :nmap wq VimwikiVSplitLink -< - *vimwiki_* *vimwiki_* -, Follow wiki link (create target wiki page if needed), - opening in a new tab. - May not work in some terminals. Remapping could help. - Maps to |:VimwikiTabnewLink|. - To remap: > - :nmap wt VimwikiTabnewLink -< - *vimwiki_* - Go back to previous wiki page. - Maps to |:VimwikiGoBackLink|. - To remap: > - :nmap wb VimwikiGoBackLink -< - *vimwiki_* - Find next link on the current page. - Maps to |:VimwikiNextLink|. - To remap: > - :nmap wn VimwikiNextLink -< - *vimwiki_* - Find previous link on the current page. - Maps to |:VimwikiPrevLink|. - To remap: > - :nmap wp VimwikiPrevLink -< - *vimwiki_wd* -wd Delete wiki page you are in. - Maps to |:VimwikiDeleteLink|. - To remap: > - :nmap dd VimwikiDeleteLink -< - *vimwiki_wr* -wr Rename wiki page you are in. - Maps to |:VimwikiRenameLink|. - To remap: > - :nmap rr VimwikiRenameLink -< - *vimwiki_* - Toggle list item on/off (checked/unchecked) - Maps to |:VimwikiToggleListItem|. - To remap: > - :nmap tt VimwikiToggleListItem -< See |vimwiki-todo-lists|. - - *vimwiki_=* -= Add header level. Create if needed. - There is nothing to indent with '==' command in - vimwiki, so it should be ok to use '=' here. - To remap: > - :nmap == VimwikiAddHeaderLevel -< - *vimwiki_-* -- Remove header level. - To remap: > - :nmap -- VimwikiRemoveHeaderLevel -< - *vimwiki_+* -+ Create and/or decorate links. Depending on the - context, this command will: convert words into - Wikilinks; convert raw URLs into Wikilinks; and add - placeholder text to Wiki- or Weblinks that are missing - descriptions. Can be activated in normal mode with - the cursor over a word or link, or in visual mode with - the selected text . - - *vimwiki_glm* -glm Increase the indent of a single-line list item. - - *vimwiki_gll* -gll Decrease the indent of a single-line list item. - - *vimwiki_glstar* *vimwiki_gl8* -gl* or gl8 Switch or insert a "*" symbol. Only available in - supported syntaxes. - - *vimwiki_gl#* *vimwiki_gl3* -gl# or gl3 Switch or insert a "#" symbol. Only available in - supported syntaxes. - - *vimwiki_gl-* -gl- Switch or insert a "-" symbol. Only available in - supported syntaxes. - - *vimwiki_gl1* -gl1 Switch or insert a "1." symbol. Only available in - supported syntaxes. - - *vimwiki_gqq* *vimwiki_gww* -gqq Format table. If you made some changes to a table - or without swapping insert/normal modes this command -gww will reformat it. - - *vimwiki_* - Move current table column to the left. - See |:VimwikiTableMoveColumnLeft| - To remap: > - :nmap wtl VimwikiTableMoveColumnLeft -< - *vimwiki_* - Move current table column to the right. - See |:VimwikiTableMoveColumnRight| - To remap: > - :nmap wtr VimwikiTableMoveColumnRight -< - *vimwiki_* - Open the previous day's diary link if available. - See |:VimwikiDiaryPrevDay| - - *vimwiki_* - Open the next day's diary link if available. - See |:VimwikiDiaryNextDay| - - -Works only if |g:vimwiki_use_mouse| is set to 1. -<2-LeftMouse> Follow wiki link (create target wiki page if needed). - - Split and follow wiki link (create target wiki page if - needed). - - Vertical split and follow wiki link (create target - wiki page if needed). - - Go back to previous wiki page. - -Note: <2-LeftMouse> is just left double click. - - - -INSERT MODE *vimwiki-table-mappings* - *vimwiki_i_* - Go to the table cell beneath the current one, create - a new row if on the last one. - - *vimwiki_i_* - Go to the next table cell, create a new row if on the - last cell. -See |g:vimwiki_table_mappings| to turn them off. - - ------------------------------------------------------------------------------- -3.3. Text objects *vimwiki-text-objects* - -ah A section segment (the area between two consecutive - headings) including trailing empty lines. -ih A section segment without trailing empty lines. - -You can 'vah' to select a section segment with its contents or 'dah' to delete -it or 'yah' to yank it or 'cah' to change it. - -a\ A cell in a table. -i\ An inner cell in a table. -ac A column in a table. -ic An inner column in a table. - - -============================================================================== -4. Commands *vimwiki-commands* - ------------------------------------------------------------------------------- -4.1. Global Commands *vimwiki-global-commands* - -*:VimwikiIndex* - Open index file of the current wiki. - -*:VimwikiTabIndex* - Open index file of the current wiki in a new tab. - -*:VimwikiUISelect* - Open index file of the selected wiki. - -*:VimwikiDiaryIndex* - Open diary index file of the current wiki. - -*:VimwikiMakeDiaryNote* - Open diary wiki-file for today of the current wiki. - -*:VimwikiTabMakeDiaryNote* - Open diary wiki-file for today of the current wiki in a new tab. - - ------------------------------------------------------------------------------- -4.2. Local commands *vimwiki-local-commands* - -*:VimwikiFollowLink* - Follow wiki link (create target wiki page if needed). - -*:VimwikiGoBackLink* - Go back to the wiki page you came from. - -*:VimwikiSplitLink* - Split and follow wiki link (create target wiki page if needed). - -*:VimwikiVSplitLink* - Vertical split and follow wiki link (create target wiki page if needed). - -*:VimwikiTabnewLink* - Follow wiki link in a new tab (create target wiki page if needed). - -*:VimwikiNextLink* - Find next link on the current page. - -*:VimwikiPrevLink* - Find previous link on the current page. - -*:VimwikiGoto* - Goto link provided by an argument. For example: > - :VimwikiGoto HelloWorld -< opens opens/creates HelloWorld wiki page. - -*:VimwikiDeleteLink* - Delete the wiki page that you are in. - -*:VimwikiRenameLink* - Rename the wiki page that you are in. - -*:Vimwiki2HTML* - Convert current wiki page to HTML using vimwiki's own converter or a - user-supplied script (see |vimwiki-option-custom_wiki2html|). - -*:Vimwiki2HTMLBrowse* - Convert current wiki page to HTML and open it in webbrowser. - -*:VimwikiAll2HTML* - Convert all wiki pages to HTML. - Default css file (style.css) is created if there is no one. - -*:VimwikiToggleListItem* - Toggle list item on/off (checked/unchecked) - See |vimwiki-todo-lists|. - -*:VimwikiListChangeLevel* CMD - Change the nesting level, or symbol, for a single-line list item. - CMD may be ">>" or "<<" to change the indentation of the item, or - one of the syntax-specific bullets: "*", "#", "1.", "-". - See |vimwiki-todo-lists|. - -*:VimwikiSearch* /pattern/ -*:VWS* /pattern/ - Search for /pattern/ in all files of current wiki. - To display all matches use |:lopen| command. - To display next match use |:lnext| command. - To display previous match use |:lprevious| command. - -*:VimwikiBacklinks* -*:VWB* - Search for wikilinks to the [[current wiki page]] - in all files of current wiki. - To display all matches use |:lopen| command. - To display next match use |:lnext| command. - To display previous match use |:lprevious| command. - - -*:VimwikiTable* - Create a table with 5 cols and 2 rows. - - :VimwikiTable cols rows - Create a table with the given cols and rows - - :VimwikiTable cols - Create a table with the given cols and 2 rows - - -*:VimwikiTableMoveColumnLeft* , *:VimwikiTableMoveColumnRight* - Move current column to the left or to the right: - Example: > - - | head1 | head2 | head3 | head4 | head5 | - |--------|--------|--------|--------|--------| - | value1 | value2 | value3 | value4 | value5 | - - - Cursor is on 'head1'. - :VimwikiTableMoveColumnRight - - | head2 | head1 | head3 | head4 | head5 | - |--------|--------|--------|--------|--------| - | value2 | value1 | value3 | value4 | value5 | - - Cursor is on 'head3'. - :VimwikiTableMoveColumnLeft - - | head2 | head3 | head1 | head4 | head5 | - |--------|--------|--------|--------|--------| - | value2 | value3 | value1 | value4 | value5 | -< - - Commands are mapped to and respectively. - - -*:VimwikiGenerateLinks* - Insert all available links into current buffer. - -*:VimwikiDiaryGenerateLinks* - Delete old, insert new diary section into diary index file. - -*:VimwikiDiaryNextDay* - Open next day diary link if available. - Mapped to . - -*:VimwikiDiaryPrevDay* - Open previous day diary link if available. - Mapped to . - - -============================================================================== -5. Wiki syntax *vimwiki-syntax* - - -There are a lot of different wikies out there. Most of them have their own -syntax and vimwiki's default syntax is not an exception here. - -Vimwiki has evolved its own syntax that closely resembles google's wiki -markup. This syntax is described in detail below. - -Vimwiki also supports alternative syntaxes, like Markdown and MediaWiki, to -varying degrees; see |vimwiki-option-syntax|. Static elements like headers, -quotations, and lists are customized in syntax/vimwiki_xxx.vim, where xxx -stands for the chosen syntax. - -Interactive elements such as links and vimwiki commands are supported by -definitions and routines in syntax/vimwiki_xxx_custom.vim and -autoload/vimwiki/xxx_base.vim. Currently, only Markdown includes this level -of support. - -Vimwiki2HTML is currently functional only for the default syntax. - ------------------------------------------------------------------------------- -5.1. Typefaces *vimwiki-syntax-typefaces* - -There are a few typefaces that gives you a bit of control over how your -text should be decorated: > - *bold text* - _italic text_ - ~~strikeout text~~ - `code (no syntax) text` - super^script^ - sub,,script,, - - ------------------------------------------------------------------------------- -5.2. Links *vimwiki-syntax-links* - -Wikilinks~ - -Link with spaces in it: > - [[This is a link]] -or: > - [[This is a link source|Description of the link]] - -Links to directories (ending with a "/") are also supported: > - [[/home/somebody/|Home Directory]] - -Use |g:vimwiki_dir_link| to control the behaviour when opening directories. - -Raw URLs~ - -Raw URLs are also supported: > - http://code.google.com/p/vimwiki - mailto:habamax@gmail.com - ftp://vim.org - - -Markdown Links~ - -These links are only available for Markdown syntax. See -http://daringfireball.net/projects/markdown/syntax#link. - -Inline link: > - [Looks like this](URL) - -Image link: > - ![Looks like this](URL) - -The URL can be anything recognized by vimwiki as a raw URL. - - -Reference-style links: > - a) [Link Name][Id] - b) [Id][], using the "implicit link name" shortcut - -Reference style links must always include *two* consecutive pairs of -[-brackets, and field entries can not use "[" or "]". - - -NOTE: (in Vimwiki's current implementation) Reference-style links are a hybrid -of Vimwiki's default "Wikilink" and the tradition reference-style link. - -If the Id is defined elsewhere in the source, as per the Markdown standard: > - [Id]: URL - -then the URL is opened with the system default handler. Otherwise, Vimwiki -treats the reference-sytle link as a Wikilink, interpreting the Id field as a -wiki page name. - -Highlighting of existing links when |vimwiki-option-maxhi| is activated -identifies links whose Id field is not defined, either as a reference-link or -as a wiki page. - -To scan the page for new or changed definitions for reference-links, simply -re-open the page ":e". - - ------------------------------------------------------------------------------- -5.3. Headers *vimwiki-syntax-headers* - -= Header level 1 =~ -By default all headers are highlighted using |hl-Title| highlight group. - -== Header level 2 ==~ -You can set up different colors for each header level: > - :hi VimwikiHeader1 guifg=#FF0000 - :hi VimwikiHeader2 guifg=#00FF00 - :hi VimwikiHeader3 guifg=#0000FF - :hi VimwikiHeader4 guifg=#FF00FF - :hi VimwikiHeader5 guifg=#00FFFF - :hi VimwikiHeader6 guifg=#FFFF00 -Set up colors for all 6 header levels or none at all. - -=== Header level 3 ===~ -==== Header level 4 ====~ -===== Header level 5 =====~ -====== Header level 6 ======~ - - -You can center your headers in HTML by placing spaces before the first '=': - = Centered Header L1 =~ - - ------------------------------------------------------------------------------- -5.4. Paragraphs *vimwiki-syntax-paragraphs* - -A paragraph is a group of lines starting in column 1 (no indentation). -Paragraphs are separated by a blank line: - -This is first paragraph -with two lines. - -This is a second paragraph with -two lines. - - ------------------------------------------------------------------------------- -5.5. Lists *vimwiki-syntax-lists* - -Unordered lists: > - * Bulleted list item 1 - * Bulleted list item 2 - * Bulleted list sub item 1 - * Bulleted list sub item 2 - * more ... - * and more ... - * ... - * Bulleted list sub item 3 - * etc. -or: > - - Bulleted list item 1 - - Bulleted list item 2 - - Bulleted list sub item 1 - - Bulleted list sub item 2 - - more ... - - and more ... - - ... - - Bulleted list sub item 3 - - etc. - -or mix: > - - Bulleted list item 1 - - Bulleted list item 2 - * Bulleted list sub item 1 - * Bulleted list sub item 2 - * more ... - - and more ... - - ... - * Bulleted list sub item 3 - * etc. - -Ordered lists: > - # Numbered list item 1 - # Numbered list item 2 - # Numbered list sub item 1 - # Numbered list sub item 2 - # more ... - # and more ... - # ... - # Numbered list sub item 3 - # etc. - -It is possible to mix bulleted and numbered lists: > - * Bulleted list item 1 - * Bulleted list item 2 - # Numbered list sub item 1 - # Numbered list sub item 2 - -Note that a space after *, - or # is essential. - -Multiline list items: > - * Bulleted list item 1 - List item 1 continued line. - List item 1 next continued line. - * Bulleted list item 2 - * Bulleted list sub item 1 - List sub item 1 continued line. - List sub item 1 next continued line. - * Bulleted list sub item 2 - * etc. - -Definition lists: > -Term 1:: Definition 1 -Term 2:: -:: Definition 2 -:: Definition 3 - - ------------------------------------------------------------------------------- -5.6. Tables *vimwiki-syntax-tables* - -Tables are created by entering the content of each cell separated by | -delimiters. You can insert other inline wiki syntax in table cells, including -typeface formatting and links. -For example: > - - | Year | Temperature (low) | Temperature (high) | - |------|-------------------|--------------------| - | 1900 | -10 | 25 | - | 1910 | -15 | 30 | - | 1920 | -10 | 32 | - | 1930 | _N/A_ | _N/A_ | - | 1940 | -2 | 40 | -> - -In HTML the following part > - | Year | Temperature (low) | Temperature (high) | - |------|-------------------|--------------------| -> -is higlighted as a table header. - -If you indent a table then it will be centered in HTML. - -If you set > in a cell, the cell spans the left column. -If you set \/ in a cell, the cell spans the above row. -For example: > - - | a | b | c | d | - | \/ | e | > | f | - | \/ | \/ | > | g | - | h | > | > | > | -> - -See |vimwiki-tables| for more details on how to manage tables. - - ------------------------------------------------------------------------------- -5.7. Preformatted text *vimwiki-syntax-preformatted* - -Use {{{ and }}} to define a block of preformatted text: -{{{ > - Tyger! Tyger! burning bright - In the forests of the night, - What immortal hand or eye - Could frame thy fearful symmetry? - In what distant deeps or skies - Burnt the fire of thine eyes? - On what wings dare he aspire? - What the hand dare sieze the fire? -}}} - - -You can add optional information to {{{ tag: > -{{{class="brush: python" > - def hello(world): - for x in range(10): - print("Hello {0} number {1}".format(world, x)) -}}} - -Result of HTML export: > -
- def hello(world):
-     for x in range(10):
-         print("Hello {0} number {1}".format(world, x))
- 
- -This might be useful for coloring program code with external js tools -such as google's syntax highlighter. - -You can setup vimwiki to highlight code snippets in preformatted text. -See |vimwiki-option-nested_syntaxes| - - ------------------------------------------------------------------------------- -5.8. Mathematical formulae *vimwiki-syntax-math* - -Mathematical formulae are highlighted, and can be rendered in HTML using the -powerful open source display engine MathJax (http://www.mathjax.org/). - -There are three supported syntaxes, which are inline, block display and -block environment. - -Inline math is for short formulae within text. It is enclosed by single -dollar signs, e.g.: - $ \sum_i a_i^2 = 1 $ - -Block display creates a centered formula with some spacing before and after -it. It must start with a line including only {{$, then an arbitrary number -of mathematical text are allowed, and it must end with a line including only -}}$. -E.g.: - {{$ - \sum_i a_i^2 - = - 1 - }}$ - -Note: no matter how many lines are used in the text file, the HTML will -compress it to *one* line only. - -Block environment is similar to block display, but is able to use specific -LaTeX environments, such as 'align'. The syntax is the same as for block -display, except for the first line which is {{$%environment%. -E.g.: - {{$%align% - \sum_i a_i^2 &= 1 + 1 \\ - &= 2. - }}$ - -Similar compression rules for the HTML page hold (as MathJax interprets the -LaTeX code). - -Note: the highlighting in VIM is automatic. For the rendering in HTML, you -have two *alternative* options: - -1. using the MathJax server for rendering (needs an internet connection). -Add to your HTML template the following line: - - - -2. installing MathJax locally (faster, no internet required). Choose a -folder on your hard drive and save MathJax in it. Then add to your HTML -template the following line: - - - -where is the folder on your HD, as a relative path to the -template folder. For instance, a sensible folder structure could be: - -- wiki - - text - - html - - templates - - mathjax - -In this case, would be "../mathjax" (without quotes). - - ------------------------------------------------------------------------------- -5.9. Blockquotes *vimwiki-syntax-blockquotes* - -Text started with 4 or more spaces is a blockquote. - - This would be a blockquote in vimwiki. It is not highlighted in vim but - could be styled by CSS in HTML. Blockquotes are usually used to quote a - long piece of text from another source. - - ------------------------------------------------------------------------------- -5.10. Comments *vimwiki-syntax-comments* - -Text line started with %% is a comment. -E.g.: > - %% this text would not be in HTML -< - - ------------------------------------------------------------------------------- -5.11. Horizontal line *vimwiki-syntax-hr* - -4 or more dashes at the start of the line is a 'horizontal line' (
): > - ---- -< - ------------------------------------------------------------------------------- -5.12. Schemes *vimwiki-syntax-schemes* - -In addition to standard web schemes (e.g. `http:`, `https:`, `ftp:`, etc.) a -number of special schemes are supported: "wiki#:", "local:", "diary:", -"file:", and schemeless. - -While "wiki:#", "diary" and schemeless links are automatically opened in Vi, -all other links are opened with the system command. To customize this -behavior, see |VimwikiLinkHandler|. - -Interwiki:~ - -If you maintain more than one wiki, you can create interwiki links between them -by adding a numbered prefix "wiki#:" in front of a link: > - [[wiki#:This is a link]] -or: > - [[wiki#:This is a link source|Description of the link]] - -The number "#", in the range 0..N-1, identifies the destination wiki in -|g:vimwiki_list|. - -Diary:~ - -The diary scheme is used to concisely link to diary entries: > - [[diary:2012-03-05]] - -This scheme precludes explicit inclusion of |vimwiki-option-diary_rel_path|, -and is most useful on subwiki pages to avoid links such as: > - [[../../diary/2012-03-05]] - -Local:~ - -A local resource that is not a wiki page may be specified with a path relative -to the current page: > - [[local:../assets/data.csv|data (CSV)]] - -When followed or converted to HTML, extensions of local-scheme links are not -modified. - -File:~ - -The file scheme allows you to directly link to arbitray resources using -absolute paths and extensions: > - [[file:///home/somebody/a/b/c/music.mp3]] - -Schemeless:~ - -Schemeless URLs, which are the default, are treated internally as "wiki#:" -URLs in all respects except when converted to Html. - -Schemeless links convert to plain relative path URLs, nearly verbatim: > - relpath/wikipage.html - -The "wiki#:", "local:", and "diary:" schemes use absolute paths as URLs: > - file:///abs_path_to_html#/relpath/wikipage.html - -When |vimwiki-option-maxhi| equals 1, a distinct highlighting style is used to -identify schemeless links whose targets are not found. All other links appear -as regular links even if the files to which they refer do not exist. - - ------------------------------------------------------------------------------- -5.13. Transclusions *vimwiki-syntax-transclude* - -Transclusion (Wiki-Include) Links~ - -Links that use "{{" and "}}" delimiters signify content that is to be -included into the Html output, rather than referenced via hyperlink. - -Wiki-include URLs may use any of the supported schemes, may be absolute or -relative, and need not end with an extension. - -The primary purpose for wiki-include links is to include images. - -Transclude from a local URL: > - {{local:../../images/vimwiki_logo.png}} -or from a universal URL: > - {{http://vimwiki.googlecode.com/hg/images/vimwiki_logo.png}} - -Transclude image with alternate text: > - {{http://vimwiki.googlecode.com/hg/images/vimwiki_logo.png|Vimwiki}} -in HTML: > - Vimwiki - -Transclude image with alternate text and some style: > - {{http://.../vimwiki_logo.png|cool stuff|style="width:150px; height: 120px;"}} -in HTML: > - cool stuff - -Transclude image _without_ alternate text and with css class: > - {{http://.../vimwiki_logo.png||class="center flow blabla"}} -in HTML: > - - -A trial feature allows you to supply your own handler for wiki-include links. -See |VimwikiWikiIncludeHandler|. - - ------------------------------------------------------------------------------- -5.14. Thumbnails *vimwiki-syntax-thumbnails* - -Thumbnail links~ -> -Thumbnail links are constructed like this: > - [[http://someaddr.com/bigpicture.jpg|{{http://someaddr.com/thumbnail.jpg}}]] - -in HTML: > -
- - %title% - - - -
- %content% -
- - - -where - %title% is replaced by a wiki page name or by a |vimwiki-title| - %root_path% is replaced by a count of ../ for pages buried in subdirs: - if you have wikilink [[dir1/dir2/dir3/my page in a subdir]] then - %root_path% is replaced by '../../../'. - - %content% is replaced by a wiki file content. - - -The default template will be applied to all wiki pages unless a page specifies -a template. Consider you have wiki page named 'Maxim.wiki' and you want apply -'person.html' template to it. Just add: > - %template person -to that page. - - -*vimwiki-option-template_default* ------------------------------------------------------------------------------- -Key Default value~ -template_default default - -Description~ -Setup default template name (without extension). - -See |vimwiki-option-template_path| for details. - - -*vimwiki-option-template_ext* ------------------------------------------------------------------------------- -Key Default value~ -template_ext .html - -Description~ -Setup template filename extension. - -See |vimwiki-option-template_path| for details. - - -*vimwiki-option-css_name* ------------------------------------------------------------------------------- -Key Default value~ -css_name style.css - -Description~ -Setup CSS file name: > - let g:vimwiki_list = [{'path': '~/my_pages/', - \ 'css_name': 'main.css'}] -< -or even > - let g:vimwiki_list = [{'path': '~/my_pages/', - \ 'css_name': 'css/main.css'}] -< - - -*vimwiki-option-maxhi* ------------------------------------------------------------------------------- -Key Default value Values~ -maxhi 0 0, 1 - -Description~ -Non-existent wiki links highlighting can be quite slow. If you still want it, -set maxhi to 1: > - let g:vimwiki_list = [{'path': '~/my_site/', 'maxhi': 1}] - -This disables filesystem checks for wiki links. - - -*vimwiki-option-nested_syntaxes* ------------------------------------------------------------------------------- -Key Default value Values~ -nested_syntaxes {} pairs of highlight keyword and vim filetype - -Description~ -You can configure preformatted text to be highlighted with any syntax -available for vim. -For example the following setup in your vimrc: > - let wiki = {} - let wiki.path = '~/my_wiki/' - let wiki.nested_syntaxes = {'python': 'python', 'c++': 'cpp'} - let g:vimwiki_list = [wiki] - -would give you Python and C++ highlighting in: > - {{{class="brush: python" - for i in range(1, 5): - print(i) - }}} - - {{{class="brush: c++" - #include "helloworld.h" - int helloworld() - { - printf("hello world"); - } - }}} - -or in: > - {{{c++ - #include "helloworld.h" - int helloworld() - { - printf("hello world"); - } - }}} - - {{{python - for i in range(1, 5): - print(i) - }}} - - -*vimwiki-option-diary_rel_path* ------------------------------------------------------------------------------- -Key Default value~ -diary_rel_path diary/ - -Description~ -Related to |vimwiki-option-path| path for diary wiki-files. - - -*vimwiki-option-diary_index* ------------------------------------------------------------------------------- -Key Default value~ -diary_index diary - -Description~ -Name of wiki-file that holds all links to dated wiki-files. - - -*vimwiki-option-diary_header* ------------------------------------------------------------------------------- -Key Default value~ -diary_header Diary - -Description~ -Name of the header in |vimwiki-option-diary_index| where links to dated -wiki-files are located. - - -*vimwiki-option-diary_sort* ------------------------------------------------------------------------------- -Key Default value Values~ -diary_sort desc desc, asc - -Description~ -Sort links in a diary index page. - - -*vimwiki-option-custom_wiki2html* ------------------------------------------------------------------------------- -Key Default value~ -custom_wiki2html '' - -Description~ -The full path to an user-provided script that converts a wiki page to HTML. -Vimwiki calls the provided |vimwiki-option-custom_wiki2html| script from the -command-line, using '!' invocation. - -The following arguments, in this order, are passed to the -|vimwiki-option-custom_wiki2html| script: - -1. force : [0/1] overwrite an existing file -2. syntax : the syntax chosen for this wiki -3. extension : the file extension for this wiki -4. output_dir : the full path of the output directory, i.e. 'path_html' -5. input_file : the full path of the wiki page -6. css_file : the full path of the css file for this wiki - -For an example and further instructions, refer to the following script: - - $VIMHOME/autoload/vimwiki/customwiki2html.sh - -To use the internal wiki2html converter, use an empty string (the default). - - -*vimwiki-option-list_margin* ------------------------------------------------------------------------------- -Key Default value~ -list_margin -1 - -Description~ -Width of left-hand margin for lists. When negative, the current |shiftwidth| -is used. This affects the behavior of the list manipulation commands -|VimwikiListChangeLevel| and local mappings |vimwiki_gll|, |vimwiki_glm|, -|vimwiki_glstar|, |vimwiki_gl8|, |vimwiki_gl#|, |vimwiki_gl3|, -|vimwiki_gl-| and |vimwiki_gl1|. - - - ------------------------------------------------------------------------------- -11.4 Global Options *viwmiki-global-options* - - -Global options are configured using the following pattern: > - - let g:option_name = option_value - - ------------------------------------------------------------------------------ -*g:vimwiki_hl_headers* - -Highlight headers with =Reddish=, ==Greenish==, ===Blueish=== colors. - -Value Description~ -1 Use VimwikiHeader1-VimwikiHeader6 group colors to highlight - different header levels. -0 Use |hl-Title| color for headers. -Default: 0 - - ------------------------------------------------------------------------------- -*g:vimwiki_hl_cb_checked* - -Checked list items can be highlighted with a color: - - * [X] the whole line can be highlighted with the option set to 1. - * [ ] I wish vim could use strikethru. - -Value Description~ -1 Highlight checked [X] check box with |group-name| "Comment". -0 Don't. - -Default: 0 - - ------------------------------------------------------------------------------- -*g:vimwiki_global_ext* - -Control the creation of |vimwiki-temporary-wiki|s. - -If a file with a registered extension (see |vimwiki-register-extension|) is -opened in a directory that is: 1) not listed in |g:vimwiki_list|, and 2) not a -subdirectory of any such directory, then: - -Value Description~ -1 make temporary wiki and append it to |g:vimwiki_list|. -0 don't make temporary wiki in that dir. - -If your preferred wiki extension is .txt then you can > - let g:vimwiki_global_ext = 0 -to restrict vimwiki's operation to only those paths listed in g:vimwiki_list. -Other text files wouldn't be treated as wiki pages. - -Default: 1 - - ------------------------------------------------------------------------------- -*g:vimwiki_ext2syntax* *vimwiki-register-extension* - -A many-to-one map between file extensions and syntaxes whose purpose is to -register the extensions with vimwiki. - -E.g.: > - let g:vimwiki_ext2syntax = {'.md': 'markdown', - \ '.mkd': 'markdown', - \ '.wiki': 'media'} - -An extension that is registered with vimwiki can trigger creation of a -|vimwiki-temporary-wiki| with the associated syntax. File extensions used in -|g:vimwiki_list| are automatically registered with vimwiki using the default -syntax. - -Default: {'.md': 'markdown'} - ------------------------------------------------------------------------------- -*g:vimwiki_auto_checkbox* - -If on, creates checkbox while toggling list item. - -Value Description~ -0 Do not create checkbox. -1 Create checkbox. - -Default: 1 - -E.g.: -Press (|:VimwikiToggleListItem|) on a list item without checkbox to -create it: > - * List item -Result: > - * [ ] List item - - ------------------------------------------------------------------------------- -*g:vimwiki_menu* - -GUI menu of available wikies to select. - -Value Description~ -'' No menu -'Vimwiki' Top level menu "Vimwiki" -'Plugin.Vimwiki' "Vimwiki" submenu of top level menu "Plugin" -etc. - -Default: 'Vimwiki' - - ------------------------------------------------------------------------------- -*g:vimwiki_listsyms* - -String of 5 symbols for list items with checkboxes. -Default value is ' .oOX'. - -g:vimwiki_listsyms[0] is for 0% done items. -g:vimwiki_listsyms[4] is for 100% done items. - - ------------------------------------------------------------------------------- -*g:vimwiki_use_mouse* - -Use local mouse mappings from |vimwiki-local-mappings|. - -Value Description~ -0 Do not use mouse mappings. -1 Use mouse mappings. - -Default: 0 - - ------------------------------------------------------------------------------- -*g:vimwiki_folding* - -Enable/disable vimwiki's folding/outline functionality. Folding in vimwiki -uses the 'expr' foldmethod which is very flexible but really slow. - -Value Description~ -0 Disable folding. -1 Enable folding. - -Default: 0 - - ------------------------------------------------------------------------------- -*g:vimwiki_fold_lists* - -Enable/disable folding of list subitems. - -Value Description~ -0 Disable list subitem's folding. -1 Enable list subitem's folding. - -Default: 0 - - ------------------------------------------------------------------------------- -*g:vimwiki_list_ignore_newline* - -This is HTML related. -Convert newlines to
s in multiline list items. - -Value Description~ -0 Newlines in a list item are converted to
s. -1 Ignore newlines. - -Default: 1 - - ------------------------------------------------------------------------------- -*g:vimwiki_use_calendar* - -Create new or open existing diary wiki-file for the date selected in Calendar. -See |vimwiki-calendar|. - -Value Description~ -0 Do not use calendar. -1 Use calendar. - -Default: 1 - - ------------------------------------------------------------------------------- -*VimwikiLinkHandler* - -A customizable link handler, |VimwikiLinkHandler|, can be defined to override -Vimwiki's opening of links. Each recognized link, whether it is a wikilink, -wiki-include link or a weblink, is first passed to |VimwikiLinkHandler| to see -if it can be handled. The return value 1/0 indicates success. - -If the link is not handled successfully, the behaviour of Vimwiki depends on -the scheme. Wiki:, diary: or schemeless links are opened in Vim. All others, -including local: and file: schemes, are opened with a system default handler; -i.e. Linux (!xdg-open), Mac (!open), and Windows (!start). - -You can redefine |VimwikiLinkHandler| function to do something else: > - - function! VimwikiLinkHandler(link) - try - let browser = 'C:\Program Files\Firefox\firefox.exe' - execute '!start "'.browser.'" ' . a:link - return 1 - catch - echo "This can happen for a variety of reasons ..." - endtry - return 0 - endfunction - -A second example handles two new schemes, 'vlocal:' and 'vfile:', which behave -similar to 'local:' and 'file:' schemes, but are always opened with Vim: > - - function! VimwikiLinkHandler(link) "{{{ Use Vim to open links with the - " 'vlocal:' or 'vfile:' schemes. E.g.: - " 1) [[vfile:///~/Code/PythonProject/abc123.py]], and - " 2) [[vlocal:./|Wiki Home]] - let link = a:link - if link =~ "vlocal:" || link =~ "vfile:" - let link = link[1:] - else - return 0 - endif - let [idx, scheme, path, subdir, lnk, ext, url] = - \ vimwiki#base#resolve_scheme(link, 0) - if g:vimwiki_debug - echom 'LinkHandler: idx='.idx.', scheme=[v]'.scheme.', path='.path. - \ ', subdir='.subdir.', lnk='.lnk.', ext='.ext.', url='.url - endif - if url == '' - echom 'Vimwiki Error: Unable to resolve link!' - return 0 - else - call vimwiki#base#edit_file('tabnew', url, [], 0) - return 1 - endif - endfunction " }}} - - ------------------------------------------------------------------------------ -*VimwikiWikiIncludeHandler*~ - -Vimwiki includes the contents of a wiki-include URL as an image by default. - -A trial feature allows you to supply your own handler for wiki-include links. -The handler should return the empty string when it does not recognize or -cannot otherwise convert the link. A customized handler might look like this: > - - " Convert {{URL|#|ID}} -> URL#ID - function! VimwikiWikiIncludeHandler(value) "{{{ - let str = a:value - - " complete URL - let url_0 = matchstr(str, g:vimwiki_rxWikiInclMatchUrl) - " URL parts - let [scheme, path, subdir, lnk, ext, url] = - \ vimwiki#base#resolve_scheme(url_0, VimwikiGet('ext')) - let arg1 = matchstr(str, VimwikiWikiInclMatchArg(1)) - let arg2 = matchstr(str, VimwikiWikiInclMatchArg(2)) - - if arg1 =~ '#' - return url.'#'.arg2 - endif - - " Return the empty string when unable to process link - return '' - endfunction "}}} -< - ------------------------------------------------------------------------------- -*g:vimwiki_table_mappings* - -Enable/disable table mappings for INSERT mode. - -Value Description~ -0 Disable table mappings. -1 Enable table mappings. - -Default: 1 - - ------------------------------------------------------------------------------- -*g:vimwiki_table_auto_fmt* - -Enable/disable table auto formatting after leaving INSERT mode. - -Value Description~ -0 Disable table auto formatting. -1 Enable table auto formatting. - -Default: 1 - - ------------------------------------------------------------------------------- -*g:vimwiki_w32_dir_enc* - -Convert directory name from current |encoding| into 'g:vimwiki_w32_dir_enc' -before it is created. - -If you have 'enc=utf-8' and set up > - let g:vimwiki_w32_dir_enc = 'cp1251' -< -then following the next link with : > - [[привет/мир]] -> -would convert utf-8 'привет' to cp1251 and create directory with that name. - -Default: '' - - ------------------------------------------------------------------------------- -*g:vimwiki_CJK_length* - -Use special method to calculate correct length of the strings with double-wide -characters (to align table cells properly). - -Value Description~ -0 Do not use it. -1 Use it. - -Default: 0 - -Note: Vim73 has a new function |strdisplaywidth|, so for Vim73 users this -option is obsolete. - - ------------------------------------------------------------------------------- -*g:vimwiki_dir_link* - -This option is about what to do with links to directories -- [[directory/]], -[[papers/]], etc. - -Value Description~ -'' Open 'directory/' using standard netrw plugin. -'index' Open 'directory/index.wiki', create if needed. -'main' Open 'directory/main.wiki', create if needed. -etc. - -Default: '' (empty string) - - ------------------------------------------------------------------------------- -*g:vimwiki_html_header_numbering* - -Set this option if you want headers to be auto-numbered in HTML. - -E.g.: > - 1 Header1 - 1.1 Header2 - 1.2 Header2 - 1.2.1 Header3 - 1.2.2 Header3 - 1.3 Header2 - 2 Header1 - 3 Header1 -etc. - -Value Description~ -0 Header numbering is off. -1 Header numbering is on. Headers are numbered starting from - header level 1. -2 Header numbering is on. Headers are numbered starting from - header level 2. -etc. -Example when g:vimwiki_html_header_numbering = 2: > - Header1 - 1 Header2 - 2 Header2 - 2.1 Header3 - 2.1.1 Header4 - 2.1.2 Header4 - 2.2 Header3 - 3 Header2 - 4 Header2 -etc. - -Default: 0 - - ------------------------------------------------------------------------------- -*g:vimwiki_html_header_numbering_sym* - -Ending symbol for |g:vimwiki_html_header_numbering|. - -Value Description~ -'.' Dot will be added after a header's number. -')' Closing bracket will be added after a header's number. -etc. - -With - let g:vimwiki_html_header_numbering_sym = '.' -headers would look like: > - 1. Header1 - 1.1. Header2 - 1.2. Header2 - 1.2.1. Header3 - 1.2.2. Header3 - 1.3. Header2 - 2. Header1 - 3. Header1 - - -Default: '' (empty) - - ------------------------------------------------------------------------------- -*g:vimwiki_valid_html_tags* - -Comma-separated list of HTML tags that can be used in vimwiki. - -Default: 'b,i,s,u,sub,sup,kbd,br,hr' - - ------------------------------------------------------------------------------- -*g:vimwiki_user_htmls* - -Comma-separated list of HTML files that have no corresponding wiki files and -should not be deleted after |:VimwikiAll2HTML|. - -Default: '' - -Example: -Consider you have 404.html and search.html in your vimwiki 'path_html'. -With: > - let g:vimwiki_user_htmls = '404.html,search.html' -they would not be deleted after |:VimwikiAll2HTML|. - - ------------------------------------------------------------------------------- -*g:vimwiki_conceallevel* - -In vim73 |conceallevel| is local to window, thus if you open viwmiki buffer in -a new tab or window, it would be set to default value. - -Vimwiki sets |conceallevel| to g:vimwiki_conceallevel everytime vimwiki buffer -is entered. - -Default: 2 - - ------------------------------------------------------------------------------- -*g:vimwiki_url_mingain* - -The minimum number of characters that should be gained by concealing URLs. If -the length of the concealed part of the URL would be less than -|g:vimwiki_url_mingain|, the URL is not concealed at all. -The conceal feature works only with vim >= 7.3. - -Default: 12 - - ------------------------------------------------------------------------------- -*g:vimwiki_url_maxsave* - -The maximum number of characters that is retained at the end after concealing -URLs. At most there will be |g:vimwiki_url_maxsave| characters left at the end of the URL. -However, it could be less when one of /,#,? can be found at the end. -In that case the URL will be concealed right before the last occurrence of one -of these characters. -The conceal feature works only with vim >= 7.3. Beware: when using the default -'wrap' option, the effect is not always pleasing. - -Default: 15 - - ------------------------------------------------------------------------------- -*g:vimwiki_debug* - -Controls verbosity of debugging output, for example, the diagnostic -information about HTML conversion. - -Value Description~ -0 Do not show debug messages. -1 Show debug messages. - -Default: 0 - ------------------------------------------------------------------------------- -*g:vimwiki_diary_months* - -It is a |Dictionary| with the numbers of months and corresponding names. Diary -uses it. - -Redefine it in your .vimrc to get localized months in your diary: -let g:vimwiki_diary_months = { - \ 1: 'Январь', 2: 'Февраль', 3: 'Март', - \ 4: 'Апрель', 5: 'Май', 6: 'Июнь', - \ 7: 'Июль', 8: 'Август', 9: 'Сентябрь', - \ 10: 'Октябрь', 11: 'Ноябрь', 12: 'Декабрь' - \ } - -Default: -let g:vimwiki_diary_months = { - \ 1: 'January', 2: 'February', 3: 'March', - \ 4: 'April', 5: 'May', 6: 'June', - \ 7: 'July', 8: 'August', 9: 'September', - \ 10: 'October', 11: 'November', 12: 'December' - \ } - - -============================================================================== -12. Help *vimwiki-help* - -Your help in making vimwiki better is really appreciated! -Any help, whether it is a spelling correction or a code snippet to patch -- -everything is welcomed. - -Issues can be filed at http://code.google.com/p/vimwiki/issues . - - -============================================================================== -13. Developers *vimwiki-developers* - - - Maxim Kim as original author. - - Stuart Andrews - - Tomas Pospichal - - See the http://code.google.com/p/vimwiki/people/list for the others. - -Web: http://code.google.com/p/vimwiki/ -Mail-List: https://groups.google.com/forum/#!forum/vimwiki -Vim plugins: http://www.vim.org/scripts/script.php?script_id=2226 - - -============================================================================== -14. Changelog *vimwiki-changelog* - -2.0.1 'stu'~ - - * Follow (i.e. open target of) markdown reference-style links. - * Bug fixes. - - -2.0 'stu'~ - -This release is partly incompatible with previous. - * -Summary ~ - - * Quick page-link creation. - * Redesign of link syntaxes (!) - * No more CamelCase links. Check the ways to convert them - https://groups.google.com/forum/?fromgroups#!topic/vimwiki/NdS9OBG2dys - * No more [[link][desc]] links. - * No more [http://link description] links. - * No more plain image links. Use transclusions. - * No more image links identified by extension. Use transclusions. - * Interwiki links. See |vimwiki-syntax-schemes|. - * Link schemes. See |vimwiki-syntax-schemes|. - * Transclusions. See |vimwiki-syntax-transclude|. - * Normalize link command. See |vimwiki_+|. - * Improved diary organization and generation. See |vimwiki-diary|. - * List manipulation. See |vimwiki-list-manipulation|. - * Markdown support. - * Mathjax support. See |vimwiki-syntax-math|. - * Improved handling of special characters and punctuation in filenames and - urls. - * Back links command: list links referring to the current page. - * Highlighting nonexisted links are off by default. - * Table syntax change. Row separator uses | instead of +. - * Fold multilined list items. - * Custom wiki to HTML converters. See |vimwiki-option-custom_wiki2html|. - * Conceal long weblinks. See |g:vimwiki_url_mingain|. - * Option to disable table mappings. See |g:vimwiki_table_mappings|. - -For detailed information see issues list on -http://code.google.com/p/vimwiki/issues/list - - -1.2~ - * Issue 70: Table spanning cell support. - * Issue 72: Do not convert again for unchanged file. |:VimwikiAll2HTML| - converts only changed wiki files. - * Issue 117: |VimwikiDiaryIndex| command that opens diary index wiki page. - * Issue 120: Links in headers are not highlighted in vimwiki but are - highlighted in HTML. - * Issue 138: Added possibility to remap table-column move bindings. See - |:VimwikiTableMoveColumnLeft| and |:VimwikiTableMoveColumnRight| - commands. For remap instructions see |vimwiki_| - and |vimwiki_|. - * Issue 125: Problem with 'o' command given while at the of the file. - * Issue 131: FileType is not set up when GUIEnter autocommand is used in - vimrc. Use 'nested' in 'au GUIEnter * nested VimwikiIndex' - * Issue 132: Link to perl (or any non-wiki) file in vimwiki subdirectory - doesn't work as intended. - * Issue 135: %title and %toc used together cause TOC to appear in an - unexpected place in HTML. - * Issue 139: |:VimwikiTabnewLink| command is added. - * Fix of g:vimwiki_stripsym = '' (i.e. an empty string) -- it removes bad - symbols from filenames. - * Issue 145: With modeline 'set ft=vimwiki' links are not correctly - highlighted when open wiki files. - * Issue 146: Filetype difficulty with ".txt" as a vimwiki extension. - * Issue 148: There are no mailto links. - * Issue 151: Use location list instead of quickfix list for :VimwikiSearch - command result. Use :lopen instead of :copen, :lnext instead of :cnext - etc. - * Issue 152: Add the list of HTML files that would not be deleted after - |:VimwikiAll2HTML|. - * Issue 153: Delete HTML files that has no corresponding wiki ones with - |:VimwikiAll2HTML|. - * Issue 156: Add multiple HTML templates. See - |vimwiki-option-template_path|. Options html_header and html_footer are - no longer exist. - * Issue 173: When virtualedit=all option is enabled the 'o' command behave - strange. - * Issue 178: Problem with alike wikie's paths. - * Issue 182: Browser command does not quote url. - * Issue 183: Spelling error highlighting is not possible with nested - syntaxes. - * Issue 184: Wrong foldlevel in some cases. - * Issue 195: Page renaming issue. - * Issue 196: vim: modeline bug -- syn=vim doesn't work. - * Issue 199: Generated HTML for sublists is invalid. - * Issue 200: Generated HTML for todo lists does not show completion status - the fix relies on CSS, thus your old stylesheets need to be updated!; - may not work in obsolete browsers or font-deficient systems. - * Issue 205: Block code: highlighting differs from processing. Inline code - block {{{ ... }}} is removed. Use `...` instead. - * Issue 208: Default highlight colors are problematic in many - colorschemes. Headers are highlighted as |hl-Title| by default, use - |g:vimwiki_hl_headers| to restore previous default Red, Green, Blue or - custom header colors. Some other changes in highlighting. - * Issue 209: Wild comments slow down html generation. Comments are - changed, use %% to comment out entire line. - * Issue 210: HTML: para enclose header. - * Issue 214: External links containing Chinese characters get trimmed. - * Issue 218: Command to generate HTML file and open it in webbrowser. See - |:Vimwiki2HTMLBrowse|(bind to whh) - * NEW: Added wh mapping to call |:Vimwiki2HTML| - - -... - -39 releases - -... - -0.1~ - * First public version. - -============================================================================== -15. License *vimwiki-license* - -The MIT Licence -http://www.opensource.org/licenses/mit-license.php - -Copyright (c) 2008-2010 Maxim Kim - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - - - vim:tw=78:ts=8:ft=help diff --git a/ftplugin/vimwiki.vim b/ftplugin/vimwiki.vim deleted file mode 100644 index bf6e7b5..0000000 --- a/ftplugin/vimwiki.vim +++ /dev/null @@ -1,475 +0,0 @@ -" vim:tabstop=2:shiftwidth=2:expandtab:foldmethod=marker:textwidth=79 -" Vimwiki filetype plugin file -" Author: Maxim Kim -" Home: http://code.google.com/p/vimwiki/ - -if exists("b:did_ftplugin") - finish -endif -let b:did_ftplugin = 1 " Don't load another plugin for this buffer - -" UNDO list {{{ -" Reset the following options to undo this plugin. -let b:undo_ftplugin = "setlocal ". - \ "suffixesadd< isfname< comments< ". - \ "autowriteall< ". - \ "formatoptions< foldtext< ". - \ "foldmethod< foldexpr< commentstring< " -" UNDO }}} - -" MISC STUFF {{{ - -setlocal autowriteall -setlocal commentstring=%%%s - -if g:vimwiki_conceallevel && exists("+conceallevel") - let &conceallevel = g:vimwiki_conceallevel -endif - -" MISC }}} - -" GOTO FILE: gf {{{ -execute 'setlocal suffixesadd='.VimwikiGet('ext') -setlocal isfname-=[,] -" gf}}} - -" Autocreate list items {{{ -" for list items, and list items with checkboxes -setlocal formatoptions+=tnro -setlocal formatoptions-=cq -if VimwikiGet('syntax') == 'default' - setl comments=b:*,b:#,b:- - setl formatlistpat=^\\s*[*#-]\\s* -elseif VimwikiGet('syntax') == 'markdown' - setlocal comments=fb:*,fb:-,fb:+,nb:> commentstring=\ >\ %s - setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+j -else - setl comments=n:*,n:# -endif - -if !empty(&langmap) - " Valid only if langmap is a comma separated pairs of chars - let l_o = matchstr(&langmap, '\C,\zs.\zeo,') - if l_o - exe 'nnoremap '.l_o.' :call vimwiki#lst#kbd_oO("o")a' - endif - - let l_O = matchstr(&langmap, '\C,\zs.\zeO,') - if l_O - exe 'nnoremap '.l_O.' :call vimwiki#lst#kbd_oO("O")a' - endif -endif - -" COMMENTS }}} - -" FOLDING for headers and list items using expr fold method. {{{ -function! VimwikiFoldLevel(lnum) "{{{ - let line = getline(a:lnum) - - " Header folding... - if line =~ g:vimwiki_rxHeader - let n = vimwiki#u#count_first_sym(line) - return '>'.n - endif - - let base_level = s:get_base_level(a:lnum) - - " List item folding... - if g:vimwiki_fold_lists - let nnline = getline(a:lnum + 1) - - let rx_list_item = '\('. - \ g:vimwiki_rxListBullet.'\|'.g:vimwiki_rxListNumber. - \ '\)' - - - if line =~ rx_list_item - let [nnum, nline] = s:find_forward(rx_list_item, a:lnum) - let level = s:get_li_level(a:lnum) - let leveln = s:get_li_level(nnum) - let adj = s:get_li_level(s:get_start_list(rx_list_item, a:lnum)) - - if leveln > level - return ">".(base_level+leveln-adj) - " check if multilined list item - elseif (nnum-a:lnum) > 1 - \ && nline =~ rx_list_item && nnline !~ '^\s*$' - return ">".(base_level+level+1-adj) - else - return (base_level+level-adj) - endif - else - " process multilined list items - let [pnum, pline] = s:find_backward(rx_list_item, a:lnum) - if pline =~ rx_list_item - if indent(a:lnum) >= indent(pnum) && line !~ '^\s*$' - let level = s:get_li_level(pnum) - let adj = s:get_li_level(s:get_start_list(rx_list_item, pnum)) - return (base_level+level+1-adj) - endif - endif - endif - endif - - return base_level -endfunction "}}} - -function! s:get_base_level(lnum) "{{{ - let lnum = a:lnum - 1 - while lnum > 0 - if getline(lnum) =~ g:vimwiki_rxHeader - return vimwiki#u#count_first_sym(getline(lnum)) - endif - let lnum -= 1 - endwhile - return 0 -endfunction "}}} - -function! s:find_forward(rx_item, lnum) "{{{ - let lnum = a:lnum + 1 - - while lnum <= line('$') - let line = getline(lnum) - if line =~ a:rx_item - \ || line =~ '^\S' - \ || line =~ g:vimwiki_rxHeader - break - endif - let lnum += 1 - endwhile - - return [lnum, getline(lnum)] -endfunction "}}} - -function! s:find_backward(rx_item, lnum) "{{{ - let lnum = a:lnum - 1 - - while lnum > 1 - let line = getline(lnum) - if line =~ a:rx_item - \ || line =~ '^\S' - break - endif - let lnum -= 1 - endwhile - - return [lnum, getline(lnum)] -endfunction "}}} - -function! s:get_li_level(lnum) "{{{ - if VimwikiGet('syntax') == 'media' - let level = vimwiki#u#count_first_sym(getline(a:lnum)) - else - let level = (indent(a:lnum) / &sw) - endif - return level -endfunction "}}} - -function! s:get_start_list(rx_item, lnum) "{{{ - let lnum = a:lnum - while lnum >= 1 - let line = getline(lnum) - if line !~ a:rx_item && line =~ '^\S' - return nextnonblank(lnum + 1) - endif - let lnum -= 1 - endwhile - return 0 -endfunction "}}} - -function! VimwikiFoldText() "{{{ - let line = substitute(getline(v:foldstart), '\t', - \ repeat(' ', &tabstop), 'g') - return line.' ['.(v:foldend - v:foldstart).']' -endfunction "}}} - -" FOLDING }}} - -" COMMANDS {{{ -command! -buffer Vimwiki2HTML - \ silent w - \ let res = vimwiki#html#Wiki2HTML(expand(VimwikiGet('path_html')), - \ expand('%')) - \ - \ if res != '' | echo 'Vimwiki: HTML conversion is done.' | endif -command! -buffer Vimwiki2HTMLBrowse - \ silent w - \ call vimwiki#base#system_open_link(vimwiki#html#Wiki2HTML( - \ expand(VimwikiGet('path_html')), - \ expand('%'))) -command! -buffer VimwikiAll2HTML - \ call vimwiki#html#WikiAll2HTML(expand(VimwikiGet('path_html'))) - -command! -buffer VimwikiNextLink call vimwiki#base#find_next_link() -command! -buffer VimwikiPrevLink call vimwiki#base#find_prev_link() -command! -buffer VimwikiDeleteLink call vimwiki#base#delete_link() -command! -buffer VimwikiRenameLink call vimwiki#base#rename_link() -command! -buffer VimwikiFollowLink call vimwiki#base#follow_link('nosplit') -command! -buffer VimwikiGoBackLink call vimwiki#base#go_back_link() -command! -buffer VimwikiSplitLink call vimwiki#base#follow_link('split') -command! -buffer VimwikiVSplitLink call vimwiki#base#follow_link('vsplit') - -command! -buffer -nargs=? VimwikiNormalizeLink call vimwiki#base#normalize_link() - -command! -buffer VimwikiTabnewLink call vimwiki#base#follow_link('tabnew') - -command! -buffer -range VimwikiToggleListItem call vimwiki#lst#ToggleListItem(, ) - -command! -buffer VimwikiGenerateLinks call vimwiki#base#generate_links() - -command! -buffer -nargs=0 VimwikiBacklinks call vimwiki#base#backlinks() -command! -buffer -nargs=0 VWB call vimwiki#base#backlinks() - -exe 'command! -buffer -nargs=* VimwikiSearch lvimgrep '. - \ escape(VimwikiGet('path').'**/*'.VimwikiGet('ext'), ' ') - -exe 'command! -buffer -nargs=* VWS lvimgrep '. - \ escape(VimwikiGet('path').'**/*'.VimwikiGet('ext'), ' ') - -command! -buffer -nargs=1 VimwikiGoto call vimwiki#base#goto("") - - -" list commands -command! -buffer -nargs=* VimwikiListChangeLevel call vimwiki#lst#change_level() - -" table commands -command! -buffer -nargs=* VimwikiTable call vimwiki#tbl#create() -command! -buffer VimwikiTableAlignQ call vimwiki#tbl#align_or_cmd('gqq') -command! -buffer VimwikiTableAlignW call vimwiki#tbl#align_or_cmd('gww') -command! -buffer VimwikiTableMoveColumnLeft call vimwiki#tbl#move_column_left() -command! -buffer VimwikiTableMoveColumnRight call vimwiki#tbl#move_column_right() - -" diary commands -command! -buffer VimwikiDiaryNextDay call vimwiki#diary#goto_next_day() -command! -buffer VimwikiDiaryPrevDay call vimwiki#diary#goto_prev_day() - -" COMMANDS }}} - -" KEYBINDINGS {{{ -if g:vimwiki_use_mouse - nmap - nmap - nnoremap <2-LeftMouse> :call vimwiki#base#follow_link("nosplit", "\2-LeftMouse>") - nnoremap :VimwikiSplitLink - nnoremap :VimwikiVSplitLink - nnoremap :VimwikiGoBackLink -endif - - -if !hasmapto('Vimwiki2HTML') - nmap wh Vimwiki2HTML -endif -nnoremap # - \ contains=@phpClTop keepend extend - -if s:asp_tags - syn region phpRegionAsp matchgroup=phpRegionDelimiter start=/<%=\=/ end=/%>/ - \ keepend extend contains=@phpClTop -endif - -if s:strict_blocks - syn cluster phpClValues add=phpHTMLError - syn match phpHTMLError /?>/ contained -endif - -" if using strict blocks, need to look out for HTML inside -" blocks -if s:strict_blocks - " only allow in base-level code (not inside () or []) - syn cluster phpClCode add=htmlRegion - if s:long_tags - " only match full php tags - syn region htmlRegion contained contains=TOP matchgroup=phpRegionDelimiter - \ start=/?>/ end=// end=// end=/<%=\=/ keepend extend - endif -endif - -" if strict curly-braces matching is enabled, then match braces -" properly -if s:strict_blocks - " DEFINITIONS FOR: - " function ...() { - " class ... { - " method ...() { - " these need to be done piece-by-piece so that we can use 'nextgroups' - " to match the { } code blocks - we want to use special colors for them! - " {{{1 - - " Match the 'final' and 'abstract' keywords first, they can be inside the - " global scope or inside a class declaration - syn cluster phpClTop add=phpStructureType - syn cluster phpClInClass add=phpStructureType - syn keyword phpStructureType contained abstract final - - " the phpStructure keywords (class/interface) can be found anywhere in - " global scope - syn cluster phpClTop add=phpStructure - - " CLASSES: class myFoo extends baseFoo implements foo, Iterator { }: {{{2 - " I MATCH: extends baseFoo implements foo, Iterator { }: {{{3 - - " 2: match the start of the class declaration - syn keyword phpStructure contained class - \ nextgroup=phpDefineClassName skipwhite skipempty - - " 3: an empty placeholder for any class name (which in turn can contain - " any of the known PHP class names) - " NOTE: allow matching the class block immediately after the class name - syn cluster phpClClassHere add=phpDefineClassName - syn match phpDefineClassName /\h\w*/ contained contains=@phpClStructures - \ nextgroup=@phpClDefineClassBlock skipwhite skipempty - - " II MATCH: class myFoo implements foo, Iterator { }: {{{3 - - " match the 'extends' keyword and follow it by the match - " for class names in a declaration (as above) - syn keyword phpStructure contained extends - \ nextgroup=phpDefineClassName skipwhite skipempty - - " III MATCH: class myFoo extends baseFoo { }: {{{3 - - " 1: match the 'implements' keyword and follow it by the match - " for class names in a declaration (as above) - syn keyword phpStructure contained implements - \ nextgroup=@phpClDefineClassImplements skipwhite skipempty - - " 2: define a place-holding for interfaces which matches any valid - " interface name and also contains the recognized names - syn cluster phpClDefineClassImplements add=phpDefineClassImplementsName - syn cluster phpClInterfaceHere add=phpDefineClassImplementsName - syn cluster phpClClassHere add=phpDefineClassImplementsName - syn match phpDefineClassImplementsName /\h\w*/ contained contains=@phpClStructures - \ nextgroup=@phpClDefineClassImplements skipwhite skipempty - - " 3: allow a comma in the list - syn cluster phpClDefineClassImplements add=phpDefineClassImplementsComma - syn match phpDefineClassImplementsComma /,/ contained - \ nextgroup=@phpClDefineClassImplements skipwhite skipempty - - " 4: there might be a '#' or '//'-style comment in-between! - syn cluster phpClDefineClassImplements add=phpDefineClassImplementsCommentOneLine - syn region phpDefineClassImplementsCommentOneLine - \ start=/#/ start=,//, end=/$/ end=/.\ze?>/ oneline - \ contained contains=phpComment - \ nextgroup=@phpClDefineClassImplements skipwhite skipempty - - " 5: there might a C-style comment (/*...*/) in-between - syn cluster phpClDefineClassImplements add=phpDefineClassImplementsCommentCStyle - syn region phpDefineClassImplementsCommentCStyle start=,/\*, end=,\*/, keepend - \ contained contains=@Spell - \ nextgroup=@phpClDefineClassImplements skipwhite skipempty - hi link phpDefineClassImplementsCommentCStyle phpComment - - " 6: add the block to the list so it can match here also - syn cluster phpClDefineClassImplements add=phpClassBlock - - " IV MATCH: class myFoo extends baseFoo implements foo, Iterator <{ }>: {{{3 - - " 1: there might be a '#' or '//'-style comment in-between! - syn cluster phpClDefineClassBlock add=phpDefineClassBlockCommentOneline - syn region phpDefineClassBlockCommentOneline start=/#/ start=,//, end=/$/ end=/.\ze?>/ oneline - \ contained contains=phpComment - \ nextgroup=@phpClDefineClassBlock skipwhite skipempty - - " 2: there might a C-style comment (/*...*/) in-between - syn cluster phpClDefineClassBlock add=phpDefineClassBlockCommentCStyle - syn region phpDefineClassBlockCommentCStyle start=,/\*, end=,\*/, keepend - \ contained contains=@Spell - \ nextgroup=@phpClDefineClassBlock skipwhite skipempty - hi link phpDefineClassBlockCommentCStyle phpComment - - " 3: look for the actual { } block - syn cluster phpClDefineClassBlock add=phpClassBlock - if (s:folding == 1) || (s:folding == 2) - syn region phpClassBlock matchgroup=phpBraceClass start=/{/ end=/}/ keepend extend - \ contained contains=@phpClInClass - \ matchgroup=phpHTMLError end=/?>/ - \ fold - else - syn region phpClassBlock matchgroup=phpBraceClass start=/{/ end=/}/ keepend extend - \ contained contains=@phpClInClass - \ matchgroup=phpHTMLError end=/?>/ - if s:fold_manual - syn region phpClassBlock matchgroup=phpBraceClass start='{\ze\s*//\s*fold\s*$\c' end='}' keepend extend - \ contained contains=@phpClInClass - \ matchgroup=phpHTMLError end=/?>/ - \ fold - endif - endif - - - " }}}2 - - " INTERFACES: interface myFoo extends baseFoo { }: {{{2 - " I MATCH: extends baseFoo { }: {{{3 - - " 1: match the start of the interface declaration - syn keyword phpStructure contained interface - \ nextgroup=phpDefineInterfaceName skipwhite skipempty - - " 2: an empty placeholder for any interface name (which in turn can contain - " any of the known PHP class names) - " NOTE: allow matching the class block immediately after the class name - " NOTE: maybe one day will make a separate block for interface bodies - syn cluster phpClClassHere add=phpDefineInterfaceName - syn cluster phpClInterfaceHere add=phpDefineInterfaceName - syn match phpDefineInterfaceName /\h\w*/ contained contains=@phpClStructures - \ nextgroup=@phpClDefineClassBlock skipwhite skipempty - - " II MATCH: interface myFoo { }: {{{3 - - " NOTE: this is handled in the class syntax handling above - - " IV MATCH: class myFoo extends baseFoo implements foo, Iterator <{ }>: {{{3 - - " NOTE: this is handled in the class syntax handling above - - " }}}2 - - " FUNCTIONS: function & somefunc($a = 0, &$b) { }: {{{2 - " I MATCH: & somefunc($a = 0, &$b) { }: {{{3 - - " if we are finding functions anywhere, allow this match only - syn cluster phpClCode add=phpDefine - - syn keyword phpDefine function contained - \ nextgroup=@phpClDefineFuncName,phpDefineFuncByRef - \ skipwhite skipempty - - " II MATCH: function <&> somefunc($a = 0, &$b) { }: {{{3 - - " second, there might be a '&' return-by-reference option, so add - " a match for that. - syn match phpDefineFuncByRef /&/ contained nextgroup=@phpClDefineFuncName skipwhite skipnl - hi link phpDefineFuncByRef phpAssignByRef - - - " III MATCH: function & ($a = 0, &$b) { }: {{{3 - - " what can go inside a function name? Anything that does will need - " a 'nextgroup=phpDefineFuncProto' argument! - - " first up, an empty placeholder to match any valid function name. - " It should contain the special user-defineable function names. - syn cluster phpClDefineFuncName add=phpDefineFuncName - syn cluster phpClFunctionHere add=phpDefineFuncName - syn match phpDefineFuncName /\h\w*/ contained - \ contains=@phpClFunctions - \ nextgroup=phpDefineFuncProto - \ skipwhite skipempty - " TODO: allow adding comments between 'function' and 'someFunc' - - - " IV MATCH: function & somefunc<(>$a = 0, &$b<)> { }: {{{3 - " match the parenthesis surrounding the function arguments - if s:folding - syn region phpDefineFuncProto contained contains=@phpClDefineFuncProtoArgs - \ matchgroup=phpParent start=/(/ end=/)/ keepend extend - \ nextgroup=@phpClDefineFuncBlock - \ skipwhite skipempty - \ fold - else - syn region phpDefineFuncProto contained contains=@phpClDefineFuncProtoArgs - \ matchgroup=phpParent start=/(/ end=/)/ keepend extend - \ nextgroup=@phpClDefineFuncBlock - \ skipwhite skipempty - endif - " TODO: allow comments in this cluster - - - " V MATCH: function & somefunc( $a = 0, &$b) { }: {{{3 - " first: any valid class name - syn cluster phpClDefineFuncProtoArgs add=@phpClClasses,@phpClInterfaces - - " we still need to match an 'array' keyword, because it can be used for - " parameter type-requirements - syn cluster phpClDefineFuncProtoArgs add=phpProtoArrayCheck - syn match phpProtoArrayCheck /\/ contained - hi link phpProtoArrayCheck phpArray - - " VI MATCH: function & somefunc(stdClass <$a => 0, <&$b>) { }: {{{3 - - " 1: match the by-ref '&' - syn cluster phpClDefineFuncProtoArgs add=phpProtoArgByRef - syn match phpProtoArgByRef /&/ display contained - hi link phpProtoArgByRef phpAssignByRef - - " 2: match a valid identifier - syn cluster phpClDefineFuncProtoArgs add=phpIdentifier,phpAssign - - " VII MATCH: function & somefunc(stdClass $a = <0>, &$b) { }: {{{3 - " What about other items? numbers? strings? arrays()? - syn cluster phpClDefineFuncProtoArgs add=@phpClProtoValues - - " 1: simple types (null, boolean) - syn cluster phpClProtoValues add=phpNull - syn cluster phpClProtoValues add=phpBoolean - - " 2: numbers and strings and constants - syn cluster phpClProtoValues add=phpNumber,phpFloat - syn cluster phpClProtoValues add=phpStringSingle,phpStringDouble - syn cluster phpClProtoValues add=@phpClConstants - - " 3: arrays must be done separately to ensure ( and ) match correctly - " (but only if using alt colors for arrays) - if s:alt_arrays - syn cluster phpClProtoValues add=phpProtoArray - syn region phpProtoArray matchgroup=phpArrayParens start=/\) { }: {{{3 - " What about comment items? - syn cluster phpClDefineFuncProtoArgs add=phpComment - - " IX MATCH: function & somefunc(stdclass $a = 0, &$b) <{ }>: {{{3 - - " 1: there might be a '#' or '//'-style comment in-between! - syn cluster phpClDefineFuncBlock add=phpDefineFuncBlockCommentOneline - syn region phpDefineFuncBlockCommentOneline start=/#/ start=,//, end=/$/ end=/.\ze?>/ oneline - \ contained contains=phpComment - \ nextgroup=@phpClDefineFuncBlock skipwhite skipempty - - " 2: there might a C-style comment (/*...*/) in-between - syn cluster phpClDefineFuncBlock add=phpDefineFuncBlockCommentCStyle - syn region phpDefineFuncBlockCommentCStyle start=,/\*, end=,\*/, keepend - \ contained contains=@Spell - \ nextgroup=@phpClDefineFuncBlock skipwhite skipempty - hi link phpDefineFuncBlockCommentCStyle phpComment - - " 3: look for the actual { } block - " NOTE: how the function block will end at the next function - " declaration: this helps stop the region extending indefinitely, - " forcing the recalculation of all { } blocks for the rest of the file. - " Otherwise, inserting an open-brace will - " NOTE: that the error can't happen on a 'final', 'abstract', 'class', - " or 'interface' keyword because they can't be contained in a function - syn cluster phpClDefineFuncBlock add=phpFuncBlock - - let s:foldHere = s:folding ? 'fold' : '' - let s:endEarly = s:nested_functions ? '' : 'matchgroup=Error end=/\%(^\|\s\)function\>/' - -" if s:folding -" if s:nested_functions -" syn region phpFuncBlock keepend extend matchgroup=phpBraceFunc start=/{/ end=/}/ -" \ matchgroup=Error end=/\%(^\|\s\)\%(public\|private\|protected\)\>/ -" \ contained contains=@phpClInFunction -" \ fold -" else -" syn region phpFuncBlock keepend extend matchgroup=phpBraceFunc start=/{/ end=/}/ -" \ matchgroup=Error end=/\%(^\|\s\)function\>/ -" \ matchgroup=Error end=/\%(^\|\s\)\%(public\|private\|protected\)\>/ -" \ contained contains=@phpClInFunction -" \ fold -" endif -" else -" if s:nested_functions -" syn region phpFuncBlock keepend extend matchgroup=phpBraceFunc start=/{/ end=/}/ -" \ matchgroup=Error end=/\%(^\|\s\)\%(public\|private\|protected\)\>/ -" \ contained contains=@phpClInFunction -" else -" syn region phpFuncBlock keepend extend matchgroup=phpBraceFunc start=/{/ end=/}/ -" \ matchgroup=Error end=/\%(^\|\s\)function\>/ -" \ matchgroup=Error end=/\%(^\|\s\)p\%(ublic\|rivate\|rotected\)\>/ -" \ contained contains=@phpClInFunction -" endif -" endif - - execute 'syn region phpFuncBlock keepend extend matchgroup=phpBraceFunc' - \ 'end=/}/ start=/{/' - \ 'matchgroup=Error end=/\%(^\|\s\)\%(public\|private\|protected\)\>/' - \ s:endEarly - \ 'contained contains=@phpClInFunction' - \ s:foldHere - " for manual folding, we use an alternate start - if s:fold_manual - execute 'syn region phpFuncBlock keepend extend matchgroup=phpBraceFunc' - \ 'start=#{\ze\s*//\s*fold\s*$\c# end=/}/' - \ 'matchgroup=Error end=/\%(^\|\s\)\%(public\|private\|protected\)\>/' - \ s:endEarly - \ 'contained contains=@phpClInFunction' - \ s:foldHere - endif - unlet s:foldHere s:endEarly - - " }}}2 - - " METHODS: protected function & somefunc($a = 0, &$b) { }: {{{2 - " I MATCH: somefunc($a = 0, &$b) { }: {{{3 - - " 1: match the final / abstract / private keywords at start - " TODO: rename 'phpStorageClass' to Typedef (for global and static keywords) - " and rename 'phpStorageClass2' to 'phpStorageClass' - syn cluster phpClInClass add=phpStorageClass2 - syn keyword phpStorageClass2 contained private protected public static final abstract - hi link phpStorageClass2 phpStorageClass - - syn keyword phpDefineMethod function contained containedin=phpClassBlock - \ nextgroup=@phpClDefineMethodName,phpDefineMethodByRef - \ skipwhite skipempty - " TODO: add phpDefineFunction in the proper place - hi link phpDefineFunction phpDefine - hi link phpDefineMethod phpDefineFunction - - " II MATCH: protected function <&> somefunc($a = 0, &$b) { }: {{{3 - " second, there might be a '&' return-by-reference option, so add - " a match for that. - syn match phpDefineMethodByRef /&/ contained - \ nextgroup=@phpClDefineMethodName skipwhite skipnl - hi link phpDefineMethodByRef phpDefineFuncByRef - - " III MATCH: protected function & ($a = 0, &$b) { }: {{{3 - " what can go inside a method name? Anything that does will need - " a 'nextgroup=phpDefineMethodProto' argument! - - " An empty placeholder to match any valid method name. - " It should contain the special user-defineable method names. - " NOTE: how we are just re-using 'function' block instead of - " making more stuff to have a special 'method' block also. - " I don't think it would be worthwhile at this stage. - " NOTE: phpSpecialFunction must be included as well, because - " that's a reserved function name and will break things. - " TODO: cater for a new group, phpReservedFunction - syn cluster phpClDefineMethodName add=phpDefineMethodName - syn cluster phpClMethodHere add=phpDefineMethodName - syn match phpDefineMethodName /\h\w*/ contained - \ contains=phpSpecialFunction,@phpClMethods - \ nextgroup=phpDefineFuncProto - \ skipwhite skipempty - " TODO: allow adding comments between 'function' and 'someFunc' - - " }}}2 - - " EXCEPTIONS: try/catch { } {{{2 - - syn cluster phpClCode add=phpException - - " 1: match the start of a try block - syn keyword phpException try contained nextgroup=@phpClTryBlock skipwhite skipnl - - " TODO: 2: allow having comments preceding the { } block? - - " 3: match the try block - syn cluster phpClTryBlock add=phpTryBlock - " TODO: manual folding from here (search for \) - if s:folding == 2 - syn region phpTryBlock matchgroup=phpBraceException start=/{/ end=/}/ keepend extend - \ contained transparent - \ fold - else - syn region phpTryBlock matchgroup=phpBraceException start=/{/ end=/}/ keepend extend - \ contained transparent - endif - - " 3: match the start of the catch block - syn keyword phpException catch contained nextgroup=phpCatchRegion skipwhite skipnl - syn region phpCatchRegion matchgroup=phpParent start=/(/ end=/)/ keepend extend - \ contained contains=@phpClExpressions - \ nextgroup=@phpClCatchBlock skipwhite skipnl - - " TODO: 4: allow having comments preceding the { } block? - - " 5: match the catch block - syn cluster phpClCatchBlock add=phpCatchBlock - if s:folding == 2 - syn region phpCatchBlock matchgroup=phpBraceException start=/{/ end=/}/ keepend extend - \ contained transparent - \ fold - else - syn region phpCatchBlock matchgroup=phpBraceException start=/{/ end=/}/ keepend extend - \ contained transparent - endif - - " }}}2 - - " }}}1 - - " make sure 'static' and 'global' work inside a function block - " TODO: refactor this? - syn keyword phpStorageClass static global contained - - " set foldmethod if folding - if s:folding - set foldmethod=syntax - endif -else - " Fold - if s:folding == 1 " {{{1 - " match one line constructs here and skip them at folding - syn keyword phpSCKeyword abstract final private protected public static contained - syn keyword phpFCKeyword function contained - syn keyword phpStorageClass global contained - syn match phpDefine "\(\s\|^\)\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\(\s\+.*[;}]\)\@=" contained contains=phpSCKeyword - syn match phpStructure "\(\s\|^\)\(abstract\s\+\|final\s\+\)*class\(\s\+.*}\)\@=" contained - syn match phpStructure "\(\s\|^\)interface\(\s\+.*}\)\@=" contained - syn match phpException "\(\s\|^\)try\(\s\+.*}\)\@=" contained - syn match phpException "\(\s\|^\)catch\(\s\+.*}\)\@=" contained - - set foldmethod=syntax - syn region phpFoldHtmlInside contained transparent contains=@htmlTop - \ matchgroup=phpRegionDelimiter start="?>" end="" end="" end="/ end=/;/ end=/\ze?>/ - \ matchgroup=Error end=/[})\]]/ -else - syn cluster phpClCode add=phpEcho - syn keyword phpEcho contained echo -endif - -syn match phpEchoComma contained display /,/ -hi! link phpEchoComma phpEcho - -syn cluster phpClExpressions add=phpPrint,phpInclude -syn keyword phpPrint contained print -syn keyword phpInclude contained include require include_once require_once - -" match when a '(type)' is used to cast the type of something - -" Highlighting for PHP5's user-definable magic class methods -syn cluster phpClMethods add=phpSpecialMethods -syn keyword phpSpecialMethods contained containedin=phpRegion - \ __construct __destruct __sleep __wakeup __clone __set_state __toString - \ __set __get __unset __isset __call - -" these methods are used by the SPL Interfaces -syn cluster phpClMethods add=phpSPLMethods -" Serializable -syn keyword phpSPLMethods contained serialize unserialize -" ArrayAccess -syn keyword phpSPLMethods contained offsetSet offsetGet offsetExists offsetUnset -" Iterator -syn keyword phpSPLMethods contained current next key valid rewind -" IteratorAggregate -syn keyword phpSPLMethods contained getIterator -" RecursiveIterator -syn keyword phpSPLMethods contained hasChildren getChildren current next key valid rewind -" OuterIterator -syn keyword phpSPLMethods contained getInnerIterator current next key valid rewind -" SeekableIterator -syn keyword phpSPLMethods contained seek current next key valid rewind -" Countable -syn keyword phpSPLMethods contained count -" SplObserver -syn keyword phpSPLMethods contained update -" SplSubject -syn keyword phpSPLMethods contained attach detach notify -" Reflector -syn keyword phpSPLMethods contained export -hi link phpSPLMethods phpSpecialMethods - -syn keyword phpSpecialFunction contained __autoload - -" Highlighting for PHP5's built-in classes -" - built-in classes harvested from get_declared_classes() in 5.1.4 -syn cluster phpClClasses add=phpClasses -syn keyword phpClasses contained containedin=phpRegion - \ stdClass __PHP_Incomplete_Class php_user_filter Directory ArrayObject - \ Exception ErrorException LogicException BadFunctionCallException BadMethodCallException DomainException - \ RecursiveIteratorIterator IteratorIterator FilterIterator RecursiveFilterIterator ParentIterator LimitIterator - \ CachingIterator RecursiveCachingIterator NoRewindIterator AppendIterator InfiniteIterator EmptyIterator - \ ArrayIterator RecursiveArrayIterator DirectoryIterator RecursiveDirectoryIterator - \ InvalidArgumentException LengthException OutOfRangeException RuntimeException OutOfBoundsException - \ OverflowException RangeException UnderflowException UnexpectedValueException - \ PDO PDOException PDOStatement PDORow - \ Reflection ReflectionFunction ReflectionParameter ReflectionMethod ReflectionClass - \ ReflectionObject ReflectionProperty ReflectionExtension ReflectionException - \ SplFileInfo SplFileObject SplTempFileObject SplObjectStorage - \ XMLWriter LibXMLError XMLReader SimpleXMLElement SimpleXMLIterator - \ DOMException DOMStringList DOMNameList DOMDomError DOMErrorHandler - \ DOMImplementation DOMImplementationList DOMImplementationSource - \ DOMNode DOMNameSpaceNode DOMDocumentFragment DOMDocument DOMNodeList DOMNamedNodeMap - \ DOMCharacterData DOMAttr DOMElement DOMText DOMComment DOMTypeinfo DOMUserDataHandler - \ DOMLocator DOMConfiguration DOMCdataSection DOMDocumentType DOMNotation DOMEntity - \ DOMEntityReference DOMProcessingInstruction DOMStringExtend DOMXPath - \ DateTime DateTimeZone - -" Highlighting for PHP5's built-in interfaces -" - built-in classes harvested from get_declared_interfaces() in 5.1.4 -syn cluster phpClInterfaces add=phpInterfaces -syn keyword phpInterfaces contained - \ Iterator IteratorAggregate RecursiveIterator OuterIterator SeekableIterator - \ Traversable ArrayAccess Serializable Countable SplObserver SplSubject Reflector -" -" add php_errormsg as a special variable - - -"syn cluster phpClExpressions add=phpProperty -"syn match phpProperty /->\_s*\%(\$\=\h\w*\)\@>\ze\_s*(\@!/ display extend -" \ contained contains=phpPropertySelector,phpIdentifier,@phpClProperties -"syn match phpPropertySelector /->/ contained display - -" for going in string where can be followed by () without making it a method -" call -"syn match phpPropertySelectorInString /->/ contained display -"hi link phpPropertySelectorInString phpPropertySelector - -if s:special_functions - " Highlighting for PHP built-in functions which exhibit special behaviours - " - isset()/unset()/empty() are not real functions. - " - compact()/extract() directly manipulate variables in the local scope where - " regular functions would not be able to. - " - eval() and assert() - " - user_error()/trigger_error() can be overloaded by set_error_handler and also - " have the capacity to terminate your script when type is E_USER_ERROR. - syn cluster phpClFunctions add=phpSpecialFunction - syn keyword phpSpecialFunction contained - \ user_error trigger_error isset unset empty eval assert extract compact __halt_compiler -endif - -" special highlighting for '=&' operator -syn cluster phpClExpressions add=phpAssignByRef -syn match phpAssignByRef /=\_s*&/ contained display - -" call-time pass-by-reference -syn match phpAssignByRef /&\$\@=/ contained display - -" highlighting for the '@' error-supressing operator -syn cluster phpClExpressions add=phpSupressErrors -syn match phpSupressErrors /@/ contained display - -" ================================================================ - -" Sync -if s:sync == -1 -" syn sync match phpSyncKeyword grouphere phpRegion /\ze\$\@/ -" syn sync match phpSyncKeyword grouphere phpRegion /\ze\$\@/ - - " best things to look for are the class/interface keywords or - " private/protected/public keywords, as we can be 100% confident where we - " are when we find them - if s:strict_blocks - syn sync match phpClassStart grouphere phpClassBlock - \ /\$\@\s*{/ - " Note: the 'var' and 'const' sync methods have been causing Vim to miss - " out the '?>' at the end of a file, so I had to drop them out. I'm not - " sure if it syncs faster -" syn sync match phpSyncKeyword grouphere phpClassBlock /\ze\$\@/ -" syn sync match phpSyncKeyword grouphere phpClassBlock /\ze\$\@/ -" syn sync match phpSyncKeyword grouphere phpClassBlock -" \ /\$\@/ - endif - - syn sync match phpSyncStartOfFile grouphere NONE /\%^/ - - " watch out for strings and comments in syncing process - " TODO: make sure this actually works - syn sync region phpSyncComment start=/\/\// start=/#/ end=/$/ - syn sync region phpSyncString start=/\z(['"]\)/ skip=/\\./ end=/\z1/ - - if s:long_tags - syn sync match phpRegionSync grouphere phpRegion "^\s*\s*$+ -" if s:asp_tags -" syn sync match phpRegionSync grouphere phpRegionAsp "^\s*<%\(=\)\=\s*$" -" endif -" syn sync match phpRegionSync grouphere NONE "^\s*?>\s*$" -" syn sync match phpRegionSync grouphere NONE "^\s*%>\s*$" -" syn sync match phpRegionSync grouphere phpRegion "function\s.*(.*\$" -" "syn sync match phpRegionSync grouphere NONE "/\i*>\s*$" - -" Sync backwards a certain number of lines? -"elseif s:sync > 0 -" exec "syn sync minlines=" . s:sync - -else - syn sync fromstart -endif - -" Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_php_syn_inits") - if version < 508 - let did_php_syn_inits = 1 - command -nargs=+ HiLink hi link - else - "command -nargs=+ HiLink hi def link - command -nargs=+ HiLink hi link - endif - - " Peter Hodge, June 17 2006 - " - I'm optimizing these highlight links for the default - " colorscheme, or 'elflord' when it would make a major - " difference. - " After most HiLinks I have noted which color the group - " will revert back to under default or elflord. - - " TODO: remove this testing - let s:is_elflord = (exists('g:colors_name') && g:colors_name == 'elflord') - - if exists("php_oldStyle") - hi phpOperator guifg=SeaGreen ctermfg=DarkGreen - hi phpIdentifier guifg=DarkGray ctermfg=Brown -" hi phpIdentifierSimply guifg=DarkGray ctermfg=Brown - hi phpVarSelector guifg=SeaGreen ctermfg=DarkGreen - - hi phpRelation guifg=SeaGreen ctermfg=DarkGreen - - hi phpSuperglobal guifg=Red ctermfg=DarkRed - else - HiLink phpOperator Operator " => Statement(Yellow) / Operator(Red) - HiLink phpIdentifier Identifier " => Identifier(Cyan) - HiLink phpIdentifierErratic phpIdentifier - - HiLink phpVarSelector Operator - HiLink phpVarSelectorDeref PreProc - HiLink phpVarSelectorError Error - - HiLink phpType Type - - " list() / arrays - HiLink phpList phpType - HiLink phpArray phpType - if s:alt_arrays - HiLink phpArrayParens phpArray - HiLink phpArrayPair phpArray - - if s:alt_arrays == 2 - HiLink phpArrayComma phpArrayParens - endif - else - HiLink phpArrayParens phpParent - HiLink phpArrayPair phpOperator - endif - HiLink phpListComma phpArrayComma - HiLink phpArrayPairError Error - - if s:alt_comparisons - if s:is_elflord - HiLink phpRelation Statement " => Yellow - else - HiLink phpRelation Constant " => Constant (SlateBlue) - endif - else - HiLink phpRelation phpOperator - endif - - " special variables support: - if s:special_vars - " NOTE: this is better highlighted using the 'Operator' colour ... - HiLink phpSuperglobal Operator " => Special (orange/red) - else - HiLink phpSuperglobal phpIdentifier - endif - endif - - " support for other variables - HiLink phpBuiltinVar phpSuperglobal - HiLink phpLongVar phpSuperglobal - HiLink phpEnvVar phpSuperglobal - - " language: - HiLink phpComment Comment " Slateblue - - HiLink phpSemicolon Macro " => PreProc (LightMagenta) - HiLink phpSemicolonNotAllowedHere Error - - HiLink phpDefine Define " => PreProc (LightMagenta) - HiLink phpObjectOperator phpDefine - HiLink phpInclude Include " => PreProc (LightMagenta) - - HiLink phpEcho Macro " => PreProc (LightMagenta) - HiLink phpPrint phpEcho - - HiLink phpParent Delimiter " => Special (Red) - if s:alt_control_parents - HiLink phpControlParent phpConditional - else - HiLink phpControlParent phpParent - endif - HiLink phpBrace phpParent " => Special (Red) - HiLink phpBraceError Error " => Error - - if s:alt_blocks - HiLink phpBraceFunc phpDefine - HiLink phpBraceClass phpStructure - HiLink phpBraceException phpException - else - HiLink phpBraceFunc phpBrace - HiLink phpBraceClass phpBrace - HiLink phpBraceException phpBrace - endif - - " other operations - HiLink phpSupressErrors PreProc " LightMagenta - - if s:alt_refs - HiLink phpAssignByRef Type " Green - else - HiLink phpAssignByRef Operator " Red - endif - - HiLink phpMemberSelector Structure " => Type (Green) - if s:alt_properties - HiLink phpPropertySelector Function " => Identifier (Cyan) / (White) - HiLink phpDynamicSelector Operator " => Operator (Red) / (White) - else - HiLink phpPropertySelector phpMemberSelector - HiLink phpDynamicSelector phpMemberSelector - endif - - - " execution control structures - HiLink phpConditional Conditional " => Statement (Yellow) / Repeat (White) - HiLink phpRepeat Repeat " => Statement (Yellow) / Repeat (White) - HiLink phpStatement Statement " (Yellow / Brown) - HiLink phpCase Label " => Statement (Yellow / Brown) - HiLink phpException Exception " => Statement (Yellow) - - " constants - HiLink phpMagicConstant Constant " Pink / Magenta - HiLink phpCoreConstant Constant " Pink / Magenta - HiLink phpNumber Number " => Constant (Pink) - HiLink phpFloat Float " => Constant (Pink) - HiLink phpBoolean phpType - HiLink phpNull phpType - - HiLink phpStringSingle String - HiLink phpStringDouble phpStringSingle - HiLink phpStringDoubleConstant phpStringSingle - HiLink phpBacktick phpStringSingle - - HiLink phpStringLiteral SpecialChar - - HiLink phpSpecialChar SpecialChar " => Special (Orange / Red) - - " keywords (mainly class / function definitions) - HiLink phpStorageClass StorageClass " => Type (Green) - HiLink phpSCKeyword phpStorageClass - - HiLink phpStructure Structure " => Type (Green) - HiLink phpStructureType phpStructure - - HiLink phpFCKeyword phpDefine - HiLink phpMagicClass StorageClass - if s:alt_comparisons - HiLink phpInstanceof phpRelation - else - HiLink phpInstanceof phpMagicClass - endif - - if s:show_quotes - HiLink phpQuoteSingle String - HiLink phpQuoteDouble String - else - HiLink phpQuoteSingle Normal - HiLink phpQuoteDouble Normal - endif - - " always highlight backtick quotes like an operator - " (seeing as it executes stuff) - HiLink phpQuoteBacktick phpOperator - - " built-in langauge functions / classes - HiLink phpFunctions Function " => Identifier (Cyan) / Function (White) - HiLink phpClasses phpFunctions - HiLink phpMethods phpFunctions - HiLink phpInterfaces phpCoreConstant - HiLink phpSpecialFunction SpecialComment " => Special (Orange / Red) - HiLink phpSpecialMethods phpSpecialFunction - - " other items - HiLink phpMemberError Error - HiLink phpParentError Error - HiLink phpHTMLError Error - HiLink phpOctalError Error - HiLink phpTodo Todo - - " Peter Hodge June 17, 2006: - " changed matchgroup for phpRegion from Delimiter to phpRegionDelimiter - HiLink phpRegionDelimiter Debug " => Special (Orange / Red) - - " changed matchgroup for phpHereDoc to phpHereDocDelimiter - HiLink phpHereDocDelimiter phpRegionDelimiter " => Special (Orange / Red) - - delcommand HiLink -endif - -" optional support for PCRE extension (preg_* functions) -if s:show_pcre - " =================================================== - " Note: I have deliberately neglected to support the '\cx' functionality - " - it would do more harm than good by complicating this already- - " mind-numbing syntax file when nobody really needs this feature in - " PHP. - " TODO: add support for '\cx' sequences (I changed my mind) - - " 1) Allow for dropping out of SQ and concatenating a variable {{{ - - " flag a lone quote as an error! - syn match pregError /'/ display contained containedin=pregPattern_S - syn match pregError /"/ display contained containedin=pregPattern_D - - " find real concatenations (overrides the errors) - syn region pregConcat matchgroup=phpQuoteSingle start=#'\ze\%(\%(\_s*\|\/\*.\{-}\*\/\|\/\/.*\n\)*\)\@>\.# end=/'/ - \ skip=/\['.\{-}'\]\|('.\{-}'[,)]/ - \ keepend extend - \ contained containedin=pregPattern_S - \ contains=@phpClExpressions - syn region pregConcat matchgroup=phpQuoteDouble start=/"/ end=/"/ - \ skip=/\[".\{-}"\]\|(".\{-}"[,)]/ - \ keepend extend - \ contained containedin=pregPattern_D - \ contains=@phpClExpressions - " }}} - - " 2) look for special characters {{{ - - " TODO: re-examine how \$ is going to fit into a double-quoted string ... - syn match pregSpecial /\$/ contained containedin=pregPattern_S display - syn match pregSpecial /\$/ contained containedin=pregPattern_D display - \ contains=phpIdentifierInString,phpIdentifierInStringComplex - syn match pregSpecial /\^/ contained containedin=@pregPattern_Q display - syn match pregSpecial /|/ contained containedin=@pregPattern_Q display - syn match pregDot /\./ contained containedin=@pregPattern_Q display - - " TODO: move these things out of here??? - " find a ] character at the start of a character range ... - syn match pregClassIncStartBracket /\]/ contained display containedin=@pregClassIncStart_Q - syn match pregClassExcStartBracket /\]/ contained display containedin=@pregClassExcStart_Q - hi link pregClassIncStartBracket pregClassInc - hi link pregClassExcStartBracket pregClassExc - " }}} - - " 3) look for escape sequences {{{ - - " look for any escape sequence inside the pattern and mark them as errors - " by default, all escape sequences are errors - " NOTE: adding 'display' to this next one can break the highlighting - " (because it contains sequences such as \" which aren't supposed to end - " the string) - syn match pregEscapeUnknown /\\./ contained containedin=@pregPattern_Q - - " TODO: when \$ is encountered, the \ is a PHP escape and prevents - " variable expansion, but the '$' becomes the end-of-line wildcard. - " \\$ will match a literal '$', but the '$' might be part of a variable - " name also. \\\$ is the proper way to match - - " TODO: deprecate these clusters? - " TODO: deprecate pregClass_any - syn cluster pregClass_any add=@pregClassInc,pregClassExc - syn cluster pregClassRange_any_S add=pregClassIncRange_S,pregClassExcRange_S - syn cluster pregClassRange_any_D add=pregClassIncRange_D,pregClassExcRange_D - - syn match pregClassEscapeUnknown /\\[^\^\-\]]/ contained containedin=@pregClass_any_Q display - syn match pregClassEscape /\\[^a-zA-Z0-9]/ contained containedin=@pregClass_any_Q display extend - - " known escape sequences: - syn match pregClassIncEscapeKnown /\C\\[abtnfret]/ contained display - \ containedin=@pregClassInc_Q,@pregClassIncRange_Q - syn match pregClassIncEscapeRange /\\[dsw]/ contained display - \ containedin=@pregClassInc_Q,@pregClassIncRange_Q - syn match pregClassExcEscapeKnown /\C\\[abtnfret]/ contained display - \ containedin=@pregClassExc_Q,@pregClassExcRange_Q - syn match pregClassExcEscapeRange /\\[dsw]/ contained display - \ containedin=@pregClassExc_Q,@pregClassExcRange_Q - - " ... including hex sequences - syn match pregClassIncEscapeKnown /\C\\x\x\{0,2}/ contained display - \ containedin=@pregClassInc_Q,@pregClassIncRange_Q - syn match pregClassExcEscapeKnown /\C\\x\x\{0,2}/ contained display - \ containedin=@pregClassExc_Q,@pregClassExcRange_Q - - " ... and octal sequences - syn match pregClassIncEscapeKnown /\\\o\{1,3}/ contained display - \ containedin=@pregClassInc_Q,@pregClassIncRange_Q - syn match pregClassExcEscapeKnown /\\\o\{1,3}/ contained display - \ containedin=@pregClassExc_Q,@pregClassExcRange_Q - - syn match pregClassEscapeMainQuote /\\'/ contained transparent display contains=pregEscapePHP - \ containedin=@pregClass_any_S,@pregClassRange_any_S - syn match pregClassEscapeMainQuote /\\"/ contained transparent display contains=pregEscapePHP - \ containedin=@pregClass_any_D,@pregClassRange_any_D - - syn match pregClassEscape /\\\\\ze\\'/ contained display - \ containedin=@pregClass_any_S contains=pregEscapePHP - \ nextgroup=pregClassEscapeMainQuote - syn match pregClassEscape /\\\\\ze\\"/ contained display - \ containedin=@pregClass_any_D contains=pregEscapePHP - \ nextgroup=pregClassEscapeMainQuote - - syn match pregClassEscapeDouble1 /\\\\\ze\\\\/ contained containedin=@pregClass_any_Q display - \ contains=pregEscapePHP - \ nextgroup=pregClassEscapeDouble2 - syn match pregClassEscapeDouble2 /\\\\/ contained transparent display - \ containedin=@pregClassRange_any_S,@pregClassRange_any_D - \ contains=pregEscapePHP - hi link pregClassEscapeDouble1 pregClassEscape - - " in the unknown escapes, match those that make a special character - " take on its literal meaning (except for which is covered next) - " NOTE: am changing these from being contained inside pregEscapeUnknown - " to being in the main scope to make SQ and DQ containment easier - syn match pregEscapeLiteral /\\[^A-Za-z0-9]/ contained containedin=@pregPattern_Q display - syn match pregEscapeLiteral /\\\{4}/ contained containedin=@pregPattern_Q display - - " for single-quoted strings - syn match pregEscapeLiteral /\\"/ contained containedin=pregPattern_S display - syn match pregEscapeLiteral /\\\\\\'/ contained containedin=pregPattern_S display contains=pregEscapePHP - - " for double-quoted strings - syn match pregEscapeLiteral /\\'/ contained containedin=pregPattern_D display - syn match pregEscapeLiteral /\\\\\\"/ contained containedin=pregPattern_D display contains=pregEscapePHP - - syn match pregEscapeMainQuote /\\'/ contained containedin=pregPattern_S display - syn match pregEscapeMainQuote /\\"/ contained containedin=pregPattern_D display - - " match the escaped strings which are known - syn match pregBackreference /\\[1-9][0-9]\=/ contained containedin=pregEscapeUnknown display - syn match pregEscapeSpecial /\C\\[rnt]/ contained containedin=pregEscapeUnknown display - syn match pregEscapeSpecial /\C\\x\x\{0,2}/ contained containedin=pregEscapeUnknown display - syn match pregEscapeSpecial /\\\%(0\o\{0,2}\|\o\o\o\)/ contained containedin=pregEscapeUnknown display - syn match pregEscapeRange /\\[wsd]/ contained containedin=pregEscapeUnknown display - syn match pregEscapeAnchor /\C\\[AbBGzZ]/ contained containedin=pregEscapeUnknown display - - " unicode characters - syn match pregEscapeUnicode /\C\\X/ contained containedin=pregEscapeUnknown display - syn match pregEscapeUnicodeError /\c\\p{\^\=\w\+}/ contained display - \ containedin=pregEscapeUnknown,pregClassEscapeUnknown - syn match pregEscapeUnicode /\\p{^\=/ contained containedin=pregEscapeUnicodeError display - syn match pregEscapeUnicode /\CC[cfnos]\=/ contained containedin=pregEscapeUnicodeError display - syn match pregEscapeUnicode /\CL[lmotu]\=/ contained containedin=pregEscapeUnicodeError display - syn match pregEscapeUnicode /\CM[cen]\=/ contained containedin=pregEscapeUnicodeError display - syn match pregEscapeUnicode /\CN[dlo]\=/ contained containedin=pregEscapeUnicodeError display - syn match pregEscapeUnicode /\CP[cdefios]\=/ contained containedin=pregEscapeUnicodeError display - syn match pregEscapeUnicode /\CS[ckmo]\=/ contained containedin=pregEscapeUnicodeError display - syn match pregEscapeUnicode /\CZ[lps]\=/ contained containedin=pregEscapeUnicodeError display - syn match pregEscapeUnicode /}/ contained containedin=pregEscapeUnicodeError display - " shorthand - syn match pregEscapeUnicode /\C\\[pP][CLMNPSZ]/ contained display - \ containedin=pregEscapeUnknown,pregClassEscapeUnknown - - " match the PHP escaping in literal escapes - syn match pregEscapePHP /\\./he=s+1 contained display containedin=pregEscapeMainQuote - syn match pregEscapePHP /\\\\/he=s+1 contained display containedin=pregEscapeLiteral - - " this captures confusing usage of escape characters: - " - need to make sure they don't capture the quote character because - " that wouldn't right - syn match pregEscapeNotNeeded /\\\ze\\[^\\']/ contained display containedin=pregPattern_S,@pregClass_any_S - syn match pregEscapeNotNeeded /\\\ze\\[^\\"]/ contained display containedin=pregPattern_D,@pregClass_any_D - - " a triple-backslash can be dangerous: it is not obvious that - " the meaning of the 3rd backslash is dependent on the following - " character; if the following character is changed to a - " single-quote or backslash, it will change the meaning of the 3 - " backslashes - syn match pregEscapeLiteral /\\\{3}\ze[^\\']/ contained display containedin=pregPattern_S - syn match pregEscapeLiteral /\\\{3}\ze[^\\"]/ contained display containedin=pregPattern_D - syn match pregClassEscape /\\\{3}\ze[^\\']/ contained display contains=pregClassEscapePHP containedin=@pregClass_any_S - syn match pregClassEscape /\\\{3}\ze[^\\"]/ contained display contains=pregClassEscapePHP containedin=@pregClass_any_D - syn match pregClassEscapePHP /\\\\/he=s+1 contained - hi link pregClassEscapePHP pregEscapePHP - " }}} - - " 4) Look for quantifiers ?*+{1,2} {{{ - - syn match pregQuantifier /\*?\=/ contained containedin=@pregPattern_Q display - syn match pregQuantifier /+?\=/ contained containedin=@pregPattern_Q display - syn match pregQuantifier /??\=/ contained containedin=@pregPattern_Q display - - syn match pregQuantifierComplex /{\d\+\(,\d*\)\=}/ contained containedin=@pregPattern_Q display - syn match pregQuantifierComplex /{,\d\+}/ contained containedin=@pregPattern_Q display - syn match pregQuantifier /\d\+/ contained containedin=pregQuantifierComplex display - " }}} - - " 5) Look for sub-patterns {{{ - syn match pregParens /(/ contained containedin=@pregPattern_Q display - syn match pregParens /(?<[=!]/ contained containedin=@pregPattern_Q display extend - syn match pregParens /(?[:>=!]/ contained containedin=@pregPattern_Q display extend - syn match pregParens /(?(?<\=[=!]/ contained containedin=@pregPattern_Q display extend - - " recursion - syn match pregParens /(?R)/ contained containedin=@pregPattern_Q display extend - syn match pregParens /(?[1-9]\d\=)/ contained containedin=@pregPattern_Q display extend - \ contains=pregBackreferenceNumber - - " conditional sub-patterns - syn match pregParens /(?(\d\+)/ contained containedin=@pregPattern_Q display - \ contains=pregBackreferenceNumber - syn match pregBackreferenceNumber /\d\+/ contained display - " TODO: move hi link out of here? - hi link pregBackreferenceNumber pregBackreference - syn match pregParens /(?\a\+\(-\a\+\)\=[):]/ contained containedin=@pregPattern_Q display - \ contains=pregOption - syn match pregParens /(?-\a\+[):]/ contained containedin=@pregPattern_Q display - \ contains=pregOption - syn match pregParens /)/ contained containedin=@pregPattern_Q display - - " find a named backreference - syn match pregBackreference contained containedin=@pregPattern_Q /(?P>\w\+)/ display - \ contains=pregNamedBackreference - syn match pregParens contained containedin=@pregPattern_Q /(?P<\w\+>/ display - \ contains=pregNamedBackreference - - syn match pregNamedBackreference /(?P>\zs\w\+\ze)/ contained display - syn match pregNamedBackreference /(?P<\zs\w\+\ze>/ contained display - hi link pregNamedBackreference pregEscapeRange - " }}} - - " 6) Look for PCRE patterns {{{ - syn cluster phpClFunctions add=phpPREGFunctions - - " look for preg_* functions which take a single pattern - syn keyword phpPREGFunctions contained preg_match preg_match_all preg_split preg_grep - \ nextgroup=phpPREGOpenParent,phpPREGRegion - - " special case for preg_replace functions which can take an array of - " patterns - syn keyword phpPREGFunctions contained preg_replace preg_replace_callback - \ nextgroup=phpPREGOpenParentMulti,phpPREGRegionMulti skipwhite skipempty - - if s:strict_blocks - " regions for ( ) after name of preg_* function - syn region phpPREGRegion matchgroup=phpParent start=/(/ end=/)/ keepend extend - \ contained contains=@phpClExpressions,phpPREGStringStarter - syn region phpPREGRegionMulti matchgroup=phpParent start=/(/ end=/)/ keepend extend - \ contained contains=@phpClExpressions,phpPREGStringStarter,phpPREGArray - - " match an array of preg patterns - if s:alt_arrays - syn region phpPREGArray matchgroup=phpArrayParens start=/\%((\_s*\)\@<=array\_s*(/ end=/)/ - \ keepend extend - \ contained - \ contains=@phpClExpressions,phpPREGStringStarter,phpPREGArrayComma,phpPREGArrayComment - else - syn match phpPREGArray /\%((\_s*\)\@<=array/ contained - \ nextgroup=phpPREGArrayRegion skipwhite skipempty - - syn region phpPREGArrayRegion matchgroup=phpParent start=/(/ end=/)/ - \ keepend extend - \ contained - \ contains=phpPREGStringStarter,phpPREGArrayComment,phpPREGArrayComma - endif - hi link phpPREGArray phpArray - - " a special match to open a pattern string immediately after a '(' - " TODO: will this work as a match instead? -" syn region phpPREGStringStarter start=/\%((\_s*\)\@<=\z(['"]\)/ end=/\z1/ extend -" \ contained contains=@phpPREGString_any - syn match phpPREGStringStarter /\%((\_s*\)\@<=['"]/ extend - \ contained contains=@phpPREGString_any - - " TODO: move 'hi link' commands out of here - hi link phpPREGArrayComma phpArrayComma - else - " highlight the opening parenthesis - syn match phpPREGOpenParent /(/ contained nextgroup=@phpPREGString_any display - hi link phpPREGOpenParent phpParent - syn match phpPREGOpenParentMulti /(/ contained display - \ nextgroup=@phpPREGString_any,phpPREGArray skipwhite skipnl skipempty - hi link phpPREGOpenParentMulti phpPREGOpenParent - - " TODO: move 'hi link' commands out of here - " match an array of preg patterns - syn keyword phpPREGArray array contained nextgroup=phpPREGArrayOpenParent - hi link phpPREGArray phpType - syn match phpPREGArrayOpenParent /(/ contained display - \ nextgroup=@phpPREGArrayString_any skipwhite skipnl skipempty - hi link phpPREGArrayOpenParent phpPREGOpenParent - endif - - " match a phpString (single or double-quoted) which is able to contain a - " pregPattern - " NOTE: we can only error on comma-ending as long as the delimiter is - " not a comma!!! - syn cluster phpPREGString_any add=phpPREGStringSingle,phpPREGStringDouble - syn region phpPREGStringSingle matchgroup=phpQuoteSingle start=/'\ze\z(.\)/ end=/'/ - \ keepend extend contained contains=pregPattern_S - \ matchgroup=Error end=/\z1\@!,/ - syn region phpPREGStringDouble matchgroup=phpQuoteSingle start=/"\ze\z(.\)/ end=/"/ - \ keepend extend contained contains=pregPattern_D - \ matchgroup=Error end=/\z1\@!,/ - - " match a single-quoted string inside an array, followed by a comma - " and another string - " TODO: remove hi link commands from here - syn cluster phpPREGArrayString_any add=phpPREGArrayStringSingle,phpPREGArrayStringDouble - syn region phpPREGArrayStringSingle matchgroup=phpQuoteSingle start=/'/ end=/'/ - \ keepend extend contained contains=pregPattern_S - \ nextgroup=phpPREGArrayComma skipwhite skipnl skipempty - hi link phpPREGArrayStringSingle phpPREGStringSingle - syn region phpPREGArrayStringDouble matchgroup=phpQuoteDouble start=/"/ end=/"/ - \ keepend extend contained contains=pregPattern_D - \ nextgroup=phpPREGArrayComma skipwhite skipnl skipempty - hi link phpPREGArrayStringDouble phpPREGStringDouble - - " use the comma inside a pattern array to trigger off the next pattern - syn match phpPREGArrayComma /,/ contained - \ nextgroup=@phpPREGArrayString_any skipwhite skipnl skipempty - - " use the comments inside a pattern array to trigger off the next pattern - syn region phpPREGArrayComment start=#//# end=#$# contained keepend extend contains=@Spell - \ nextgroup=@phpPREGArrayString_any skipwhite skipnl skipempty - syn region phpPREGArrayComment start=#/\*# end=#\*/# contained keepend extend contains=@Spell - \ nextgroup=@phpPREGArrayString_any skipwhite skipnl skipempty - hi link phpPREGArrayComment phpComment - " }}} - - " 7) Look for pattern delimiters {{{ - syn cluster pregPattern_Q add=pregPattern_S,pregPattern_D - - " add a region which starts with any valid delimiter character - " and ends when the delimiter character is met again - syn region pregPattern_S matchgroup=pregDelimiter - \ start=/\z([ !"#$%&*+,-./:;=?@^_`|~]\)/ start=/\z(\\'\)/ - \ end=/\z1/ skip=/\\\\\{2,3}\|\\\\\z1\=\|\\\z1/ keepend extend - \ contained nextgroup=pregOptionError_S - \ contains=pregCommentMultiline - " repeat above command, but this time instead of the multi-line comment, - " make it 'oneline' - syn region pregPattern_S matchgroup=pregDelimiter - \ start=/\z([ !"#$%&*+,-./:;=?@^_`|~]\)/ start=/\z(\\'\)/ - \ end=/\z1/ skip=/\\\\\{2,3}\|\\\\\z1\=\|\\\z1/ keepend extend - \ contained nextgroup=pregOptionError_S - \ oneline - - function! s:pregPattern_S(open, close) - execute 'syntax region pregPattern_S matchgroup=pregDelimiter' - \ 'start=/' . a:open . '/' - \ 'end=/' . a:close . '/' - \ 'skip=/\\\{4}\|\\\\\=./ keepend extend' - \ 'contained nextgroup=pregOptionError_S' - endfunction - function! s:pregPattern_D(open, close) - execute 'syntax region pregPattern_D matchgroup=pregDelimiter' - \ 'start=/' . a:open . '/' - \ 'end=/' . a:close . '/' - \ 'skip=/\\\{4}\|\\\\\=./ keepend extend' - \ 'contained nextgroup=pregOptionError_D' - endfunction - call s:pregPattern_S('(', ')') - call s:pregPattern_S('<', '>') - call s:pregPattern_S('\[', '\]') - call s:pregPattern_S('{', '}') - call s:pregPattern_D('(', ')') - call s:pregPattern_D('<', '>') - call s:pregPattern_D('\[', '\]') - call s:pregPattern_D('{', '}') - - " TODO: make a cluster for the things which go inside double-quoted - " strings! - syn region pregPattern_D matchgroup=pregDelimiter - \ start=/\z([ !'#$%&*+,-./:;=?@^_`|~]\)/ start=/\z(\\"\)/ - \ end=/\z1/ skip=/\\\\\{2,3}\|\\\\\z1\=\|\\\z1/ - \ keepend extend - \ contained nextgroup=pregOptionError_D - \ contains=phpIdentifierInString,phpIdentifierInStringComplex,pregCommentMultiline - " repeat above command, but this time instead of the multi-line comment, - " make it 'oneline' - syn region pregPattern_D matchgroup=pregDelimiter - \ start=/\z([ !'#$%&*+,-./:;=?@^_`|~]\)/ start=/\z(\\"\)/ - \ end=/\z1/ skip=/\\\\\{2,3}\|\\\\\z1\=\|\\\z1/ - \ keepend extend - \ contained nextgroup=pregOptionError_D - \ contains=phpIdentifierInString,phpIdentifierInStringComplex - \ oneline - - " TODO: work out how to have '$' as delimiter in a double-quoted string -" syn region pregPattern_D matchgroup=pregDelimiter -" \ start=/\\\$\|\$[a-z_]\@!\%({[a-z_$]\)\@!/ -" \ end=/\\\$\|\$[a-z_]\@!\%({[a-z_$]\)\@!/ skip=/\\\{4}\|\\\{3}[^$]\|\\\\\$/ -" \ keepend extend -" \ contained nextgroup=pregOptionError_D -" \ contains=phpIdentifierInString,phpIdentifierInStringComplex - - " TODO move hi link out of here - hi link pregPattern_S pregPattern - hi link pregPattern_D pregPattern - " }}} - - " 8) Look for character classes {{{ - " Inc[lusive] and Exc[lusive] character classes: - " if the first char is ']' - " that is tricky so is handled by another match below - syn cluster pregClassInc_Q add=pregClassInc_S,pregClassInc_D - syn cluster pregClassExc_Q add=pregClassExc_S,pregClassExc_D - syn cluster pregClass_any_S add=pregClassInc_S,pregClassExc_S - syn cluster pregClass_any_D add=pregClassInc_D,pregClassExc_D - syn cluster pregClass_any_Q add=@pregClassInc_Q,@pregClassExc_Q - - " TODO: does that 'skip' need to be copied to the line below? - syn region pregClassInc_S matchgroup=pregClassParent start=/\[\ze[^\^\]]/ end=/\]/ skip=/\\\%(\\\\\]\)\@!\&\\./ - \ keepend display contained containedin=pregPattern_S - syn region pregClassInc_D matchgroup=pregClassParent start=/\[\ze[^\^\]]/ end=/\]/ skip=/\\./ - \ keepend display contained containedin=pregPattern_D - " TODO: move these out of here??? - hi link pregClassInc_S pregClassInc - hi link pregClassInc_D pregClassInc - hi link pregClassExc_S pregClassExc - hi link pregClassExc_D pregClassExc - - syn region pregClassExc_S matchgroup=pregClassParent start=/\[\^\]\@!/ end=/\]/ skip=/\\./ - \ keepend display contained containedin=pregPattern_S - syn region pregClassExc_D matchgroup=pregClassParent start=/\[\^\]\@!/ end=/\]/ skip=/\\./ - \ keepend display contained containedin=pregPattern_D - - " TODO: move hi link commands out of here - - " TODO: just use one match for all character classes??? - " this is an alternate form of the character class region, - " it is not contained in @pregPattern_Q and can only be activated - " by a nextgroup=pregClassInc. - " 'EXECUTE'ed: - "syntax region pregClassInc_S start=/\ze./ matchgroup=pregClassParent end=/\]/ skip=/\\\\\|\\]/ contained display - "syntax region pregClassInc_D start=/\ze./ matchgroup=pregClassParent end=/\]/ skip=/\\\\\|\\]/ contained display - "syntax region pregClassExc_S start=/\ze./ matchgroup=pregClassParent end=/\]/ skip=/\\\\\|\\]/ contained display - "syntax region pregClassExc_D start=/\ze./ matchgroup=pregClassParent end=/\]/ skip=/\\\\\|\\]/ contained display - let s:command = 'syntax region pregClass start=/\ze./ matchgroup=pregClassParent end=/\]/' - \ . ' skip=/\\\\\|\\]/ contained display keepend' - execute substitute(s:command, '', 'Inc_S', 'g') - execute substitute(s:command, '', 'Inc_D', 'g') - execute substitute(s:command, '', 'Exc_S', 'g') - execute substitute(s:command, '', 'Exc_D', 'g') - unlet! s:command - - " this is a special match to start off the character class - " region when the very first character inside it is ']', - " because otherwise the character class region would end - " immediately - syn cluster pregClassIncStart_Q add=pregClassIncStart_S,pregClassIncStart_D - syn cluster pregClassExcStart_Q add=pregClassExcStart_S,pregClassExcStart_D - let s:command = 'syntax match pregClassIncStart_ /\[\]/ contained display' - \ . ' containedin=pregPattern_ nextgroup=pregClassInc_,pregClassIncEnd' - execute substitute(s:command, '', 'S', 'g') - execute substitute(s:command, '', 'D', 'g') - let s:command = 'syntax match pregClassExcStart_ /\[\^\]/ contained display' - \ . ' containedin=pregPattern_ nextgroup=pregClassExc_,pregClassExcEnd' - execute substitute(s:command, '', 'S', 'g') - execute substitute(s:command, '', 'D', 'g') - unlet! s:command - - " TODO: move hi link commands out of here - hi link pregClassIncStart_S pregClassParent - hi link pregClassIncStart_D pregClassParent - hi link pregClassExcStart_S pregClassParent - hi link pregClassExcStart_D pregClassParent - - " this is a special match to end off the character class immediately - " should a ']' be followed immediately by another ']' - " TODO: move hi link commands out of here - syn match pregClassIncEnd /\]/ contained display - hi link pregClassIncEnd pregClassParent - syn match pregClassExcEnd /\]/ contained display - hi link pregClassExcEnd pregClassParent - - " add the range-matching string here - syn cluster pregClassIncRange_Q add=pregClassIncRange_S,pregClassIncRange_D - syn cluster pregClassExcRange_Q add=pregClassExcRange_S,pregClassExcRange_D - syn match pregClassIncRange_S contained display - \ containedin=pregClassInc_S,pregClassIncStart_S - \ /\%([^\\]\|\\\%(\\\{2}[\\']\=\|x\x\{0,2}\|\o\{1,3}\|[^dsw]\)\)-\%(\\\{3,4}\|\\[^dsw]\|[^\\\]]\)/ - syn match pregClassIncRange_D contained display - \ containedin=pregClassInc_D,pregClassIncStart_D - \ /\%([^\\]\|\\\%(\\\{2}[\\"]\=\|x\x\{0,2}\|\o\{1,3}\|[^dsw]\)\)-\%(\\\{3,4}\|\\[^dsw]\|[^\\\]]\)/ - syn match pregClassExcRange_S contained display - \ containedin=pregClassExc_S,pregClassExcStart_S - \ /\%([^\\]\|\\\%(\\\{2}[\\']\=\|x\x\{0,2}\|\o\{1,3}\|[^dsw]\)\)-\%(\\\{3,4}\|\\[^dsw]\|[^\\\]]\)/ - syn match pregClassExcRange_D contained display - \ containedin=pregClassExc_D,pregClassExcStart_D - \ /\%([^\\]\|\\\%(\\\{2}[\\']\=\|x\x\{0,2}\|\o\{1,3}\|[^dsw]\)\)-\%(\\\{3,4}\|\\[^dsw]\|[^\\\]]\)/ - hi link pregClassIncRange_S pregClassIncRange - hi link pregClassIncRange_D pregClassIncRange - hi link pregClassExcRange_S pregClassExcRange - hi link pregClassExcRange_D pregClassExcRange - - " what about the pre-defined sets using [:space:]? - syn region pregClassSetRegion matchgroup=pregClassSet start=/\[:/ end=/:\]/ - \ extend keepend - \ contained containedin=@pregClass_any_Q contains=pregClassSet - hi link pregClassSetRegion Error - syn keyword pregClassSet contained - \ alnum digit punct - \ alpha graph space - \ blank lower upper - \ cntrl print xdigit - hi link pregClassSet pregEscapeRange - - " highlighted a lone single/double quote as an error - syn match pregClassQuoteError contained display /'/ containedin=@pregClass_any_S - syn match pregClassQuoteError contained display /"/ containedin=@pregClass_any_D - hi link pregClassQuoteError Error - - " }}} - - " 9) Look for escaping using \Q and \E {{{ - syn region pregNonSpecial_S matchgroup=pregParens start=/\C\\Q/ end=/\C\\E/ - \ contained containedin=pregPattern_S - syn region pregNonSpecial_D matchgroup=pregParens start=/\C\\Q/ end=/\C\\E/ - \ contained containedin=pregPattern_D - hi link pregNonSpecial_S pregNonSpecial - hi link pregNonSpecial_D pregNonSpecial - hi link pregNonSpecial pregPattern - - " I'm just going to rebuild escapes here to make it easier - syn match pregError /'/ contained containedin=pregNonSpecial_S display - syn match pregError /"/ contained containedin=pregNonSpecial_D display - syn match pregNonSpecialEscape /\\['\\]/ contained containedin=pregNonSpecial_S display - syn match pregNonSpecialEscape /\\["\\$]/ contained containedin=pregNonSpecial_D display - syn match pregNonSpecialEscapePHP /\\./he=s+1 contained containedin=pregNonSpecialEscape display - syn match pregNonSpecialEscapePHP /\\[rnt]/ contained containedin=pregNonSpecial_D display - hi link pregNonSpecialEscapePHP pregEscapePHP - " }}} - - " 10) Match PCRE pattern options {{{ - syn match pregOptionError_S /\%(\\[\\']\|[^']\)\+/ contained contains=pregOption display - syn match pregOptionError_D /\%(\\[\\"]\|[^"]\)\+/ contained display - \ contains=pregOption,phpIdentifierInString,phpIdentifierInStringComplex - syn match pregOption /\C[eimsuxADSUX]\+/ contained display - " TODO: move hi links out of here? - hi link pregOptionError_S pregOptionError - hi link pregOptionError_D pregOptionError - " }}} - - " 11) PCRE pattern comments {{{ - syn match pregComment /\v\(\?\#[^)]*\)/ contained containedin=@pregPattern_Q contains=@Spell - - " TODO: multi-line comments must be turned on explicitly!? - " syntax match pregComment /\v\#(.*)@>/ contained containedin=@pregPattern_Q -" if exists('b:php_preg_multiline') - syntax match pregCommentMultiline /\#\(.*\)\@>/ contained contains=@Spell - hi! link pregCommentMultiline pregComment -" endif - " }}} - - " 12) highlight links {{{ - command -nargs=+ HiLink hi link - - HiLink phpPREGFunctions phpFunctions - HiLink phpPREGOpenParent phpParent - HiLink phpPREGStringSingle phpStringSingle - HiLink phpPREGStringDouble phpStringDouble - - HiLink pregError Error - HiLink pregAmbiguous Todo - - HiLink pregDelimiter Statement - - HiLink pregOptionError Error - HiLink pregOption Type - - HiLink pregComment phpComment - - HiLink pregEscapeDelimiter pregDelimiter - HiLink pregEscapeUnknown pregAmbiguous - HiLink pregEscapeLiteral Comment - HiLink pregEscapeSpecial Number - HiLink pregEscapeAnchor Typedef - HiLink pregEscapeRange Identifier - HiLink pregEscapePHP phpSpecialChar - HiLink pregEscapeUnicode pregEscapeRange - HiLink pregEscapeUnicodeError pregError - - HiLink pregEscapeNotNeeded pregEscapePHP - - HiLink pregPattern Normal - HiLink pregSpecial Typedef - HiLink pregDot Typedef - HiLink pregParens PreProc - HiLink pregBackreference pregParens - - HiLink pregQuantifier Typedef - HiLink pregQuantifierComplex Typedef - - HiLink pregClassParent pregParens - HiLink pregClassInc pregClassParent - HiLink pregClassExc pregClassParent - HiLink pregClassIncRange Identifier - HiLink pregClassExcRange Identifier - HiLink pregClassEscape Comment - HiLink pregClassIncEscapeKnown pregEscapeSpecial - HiLink pregClassIncEscapeRange pregClassIncRange - HiLink pregClassExcEscapeKnown Type - HiLink pregClassExcEscapeRange pregClassExcRange - HiLink pregClassEscapeUnknown pregAmbiguous - - delcommand HiLink - " }}} -endif - -" ================================================================ - -let b:current_syntax = "php" - -if main_syntax == 'php' - unlet main_syntax -endif - -" vim: sw=2 sts=2 et fdm=marker fdc=1 diff --git a/syntax/vcscommit.vim b/syntax/vcscommit.vim deleted file mode 100644 index 0cd4c5e..0000000 --- a/syntax/vcscommit.vim +++ /dev/null @@ -1,31 +0,0 @@ -" Vim syntax file -" Language: VCS commit file -" Maintainer: Bob Hiestand (bob.hiestand@gmail.com) -" License: -" Copyright (c) 2007 Bob Hiestand -" -" Permission is hereby granted, free of charge, to any person obtaining a copy -" of this software and associated documentation files (the "Software"), to -" deal in the Software without restriction, including without limitation the -" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -" sell copies of the Software, and to permit persons to whom the Software is -" furnished to do so, subject to the following conditions: -" -" The above copyright notice and this permission notice shall be included in -" all copies or substantial portions of the Software. -" -" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -" IN THE SOFTWARE. - -if exists("b:current_syntax") - finish -endif - -syntax region vcsComment start="^VCS: " end="$" -highlight link vcsComment Comment -let b:current_syntax = "vcscommit" diff --git a/syntax/vimwiki.vim b/syntax/vimwiki.vim deleted file mode 100644 index c100da6..0000000 --- a/syntax/vimwiki.vim +++ /dev/null @@ -1,601 +0,0 @@ -" vim:tabstop=2:shiftwidth=2:expandtab:foldmethod=marker:textwidth=79 -" Vimwiki syntax file -" Author: Maxim Kim -" Home: http://code.google.com/p/vimwiki/ - -" Quit if syntax file is already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif -"TODO do nothing if ...? (?) -let starttime = reltime() " start the clock -if VimwikiGet('maxhi') - let b:existing_wikifiles = vimwiki#base#get_links('*'.VimwikiGet('ext')) - let b:existing_wikidirs = vimwiki#base#get_links('*/') -endif -let timescans = vimwiki#u#time(starttime) "XXX - "let b:xxx = 1 - "TODO ? update wikilink syntax group here if really needed (?) for :e and such - "if VimwikiGet('maxhi') - " ... - "endif - -" LINKS: assume this is common to all syntaxes "{{{ - -" LINKS: WebLinks {{{ -" match URL for common protocols; -" see http://en.wikipedia.org/wiki/URI_scheme http://tools.ietf.org/html/rfc3986 -let g:vimwiki_rxWebProtocols = ''. - \ '\%('. - \ '\%('. - \ '\%('.join(split(g:vimwiki_web_schemes1, '\s*,\s*'), '\|').'\):'. - \ '\%(//\)'. - \ '\)'. - \ '\|'. - \ '\%('.join(split(g:vimwiki_web_schemes2, '\s*,\s*'), '\|').'\):'. - \ '\)' -" -let g:vimwiki_rxWeblinkUrl = g:vimwiki_rxWebProtocols . - \ '\S\{-1,}'. '\%(([^ \t()]*)\)\=' -" }}} - -" }}} - -" ------------------------------------------------------------------------- -" Load concrete Wiki syntax: sets regexes and templates for headers and links -execute 'runtime! syntax/vimwiki_'.VimwikiGet('syntax').'.vim' -" ------------------------------------------------------------------------- -let time0 = vimwiki#u#time(starttime) "XXX - - -" LINKS: setup of larger regexes {{{ - -" LINKS: setup wikilink regexps {{{ -let g:vimwiki_rxWikiLinkPrefix = '[[' -let g:vimwiki_rxWikiLinkSuffix = ']]' -let g:vimwiki_rxWikiLinkSeparator = '|' -" [[URL]] -let g:vimwiki_WikiLinkTemplate1 = g:vimwiki_rxWikiLinkPrefix . '__LinkUrl__'. - \ g:vimwiki_rxWikiLinkSuffix -" [[URL|DESCRIPTION]] -let g:vimwiki_WikiLinkTemplate2 = g:vimwiki_rxWikiLinkPrefix . '__LinkUrl__'. - \ g:vimwiki_rxWikiLinkSeparator. '__LinkDescription__'. - \ g:vimwiki_rxWikiLinkSuffix -" -let magic_chars = '.*[]\^$' -let valid_chars = '[^\\]' - -let g:vimwiki_rxWikiLinkPrefix = escape(g:vimwiki_rxWikiLinkPrefix, magic_chars) -let g:vimwiki_rxWikiLinkSuffix = escape(g:vimwiki_rxWikiLinkSuffix, magic_chars) -let g:vimwiki_rxWikiLinkSeparator = escape(g:vimwiki_rxWikiLinkSeparator, magic_chars) -let g:vimwiki_rxWikiLinkUrl = valid_chars.'\{-}' -let g:vimwiki_rxWikiLinkDescr = valid_chars.'\{-}' - -let g:vimwiki_rxWord = '[^[:blank:]()\\]\+' - -" -" [[URL]], or [[URL|DESCRIPTION]] -" a) match [[URL|DESCRIPTION]] -let g:vimwiki_rxWikiLink = g:vimwiki_rxWikiLinkPrefix. - \ g:vimwiki_rxWikiLinkUrl.'\%('.g:vimwiki_rxWikiLinkSeparator. - \ g:vimwiki_rxWikiLinkDescr.'\)\?'.g:vimwiki_rxWikiLinkSuffix -" b) match URL within [[URL|DESCRIPTION]] -let g:vimwiki_rxWikiLinkMatchUrl = g:vimwiki_rxWikiLinkPrefix. - \ '\zs'. g:vimwiki_rxWikiLinkUrl.'\ze\%('. g:vimwiki_rxWikiLinkSeparator. - \ g:vimwiki_rxWikiLinkDescr.'\)\?'.g:vimwiki_rxWikiLinkSuffix -" c) match DESCRIPTION within [[URL|DESCRIPTION]] -let g:vimwiki_rxWikiLinkMatchDescr = g:vimwiki_rxWikiLinkPrefix. - \ g:vimwiki_rxWikiLinkUrl.g:vimwiki_rxWikiLinkSeparator.'\%('. - \ '\zs'. g:vimwiki_rxWikiLinkDescr. '\ze\)\?'. g:vimwiki_rxWikiLinkSuffix -" }}} - -" LINKS: Syntax helper {{{ -let g:vimwiki_rxWikiLinkPrefix1 = g:vimwiki_rxWikiLinkPrefix. - \ g:vimwiki_rxWikiLinkUrl.g:vimwiki_rxWikiLinkSeparator -let g:vimwiki_rxWikiLinkSuffix1 = g:vimwiki_rxWikiLinkSuffix -" }}} - - -" LINKS: setup of wikiincl regexps {{{ -let g:vimwiki_rxWikiInclPrefix = '{{' -let g:vimwiki_rxWikiInclSuffix = '}}' -let g:vimwiki_rxWikiInclSeparator = '|' -" -" '{{__LinkUrl__}}' -let g:vimwiki_WikiInclTemplate1 = g:vimwiki_rxWikiInclPrefix . '__LinkUrl__'. - \ g:vimwiki_rxWikiInclSuffix -" '{{__LinkUrl____LinkDescription__}}' -let g:vimwiki_WikiInclTemplate2 = g:vimwiki_rxWikiInclPrefix . '__LinkUrl__'. - \ '__LinkDescription__'. - \ g:vimwiki_rxWikiInclSuffix - -let g:vimwiki_rxWikiInclPrefix = escape(g:vimwiki_rxWikiInclPrefix, magic_chars) -let g:vimwiki_rxWikiInclSuffix = escape(g:vimwiki_rxWikiInclSuffix, magic_chars) -let g:vimwiki_rxWikiInclSeparator = escape(g:vimwiki_rxWikiInclSeparator, magic_chars) -let g:vimwiki_rxWikiInclUrl = valid_chars.'\{-}' -let g:vimwiki_rxWikiInclArg = valid_chars.'\{-}' -let g:vimwiki_rxWikiInclArgs = '\%('. g:vimwiki_rxWikiInclSeparator. g:vimwiki_rxWikiInclArg. '\)'.'\{-}' -" -" -" *. {{URL}[{...}]} - i.e. {{URL}}, {{URL|ARG1}}, {{URL|ARG1|ARG2}}, etc. -" *a) match {{URL}[{...}]} -let g:vimwiki_rxWikiIncl = g:vimwiki_rxWikiInclPrefix. - \ g:vimwiki_rxWikiInclUrl. - \ g:vimwiki_rxWikiInclArgs. g:vimwiki_rxWikiInclSuffix -" *b) match URL within {{URL}[{...}]} -let g:vimwiki_rxWikiInclMatchUrl = g:vimwiki_rxWikiInclPrefix. - \ '\zs'. g:vimwiki_rxWikiInclUrl. '\ze'. - \ g:vimwiki_rxWikiInclArgs. g:vimwiki_rxWikiInclSuffix -" }}} - -" LINKS: Syntax helper {{{ -let g:vimwiki_rxWikiInclPrefix1 = g:vimwiki_rxWikiInclPrefix. - \ g:vimwiki_rxWikiInclUrl.g:vimwiki_rxWikiInclSeparator -let g:vimwiki_rxWikiInclSuffix1 = g:vimwiki_rxWikiInclArgs. - \ g:vimwiki_rxWikiInclSuffix -" }}} - -" LINKS: Setup weblink regexps {{{ -" 0. URL : free-standing links: keep URL UR(L) strip trailing punct: URL; URL) UR(L)) -" let g:vimwiki_rxWeblink = '[\["(|]\@ 1 - echom '[vimwiki_debug] syntax target > '.a:target - endif - let prefix0 = 'syntax match '.a:type.' `' - let suffix0 = '` display contains=@NoSpell,VimwikiLinkRest,'.a:type.'Char' - let prefix1 = 'syntax match '.a:type.'T `' - let suffix1 = '` display contained' - execute prefix0. a:target. suffix0 - execute prefix1. a:target. suffix1 -endfunction "}}} - -function! s:add_target_syntax_OFF(target) " {{{ - if g:vimwiki_debug > 1 - echom '[vimwiki_debug] syntax target > '.a:target - endif - let prefix0 = 'syntax match VimwikiNoExistsLink `' - let suffix0 = '` display contains=@NoSpell,VimwikiLinkRest,VimwikiLinkChar' - let prefix1 = 'syntax match VimwikiNoExistsLinkT `' - let suffix1 = '` display contained' - execute prefix0. a:target. suffix0 - execute prefix1. a:target. suffix1 -endfunction "}}} - -function! s:highlight_existing_links() "{{{ - " Wikilink - " Conditional highlighting that depends on the existence of a wiki file or - " directory is only available for *schemeless* wiki links - " Links are set up upon BufEnter (see plugin/...) - let safe_links = vimwiki#base#file_pattern(b:existing_wikifiles) - " Wikilink Dirs set up upon BufEnter (see plugin/...) - let safe_dirs = vimwiki#base#file_pattern(b:existing_wikidirs) - - " match [[URL]] - let target = vimwiki#base#apply_template(g:vimwiki_WikiLinkTemplate1, - \ safe_links, g:vimwiki_rxWikiLinkDescr, '') - call s:add_target_syntax_ON(target, 'VimwikiLink') - " match [[URL|DESCRIPTION]] - let target = vimwiki#base#apply_template(g:vimwiki_WikiLinkTemplate2, - \ safe_links, g:vimwiki_rxWikiLinkDescr, '') - call s:add_target_syntax_ON(target, 'VimwikiLink') - - " match {{URL}} - let target = vimwiki#base#apply_template(g:vimwiki_WikiInclTemplate1, - \ safe_links, g:vimwiki_rxWikiInclArgs, '') - call s:add_target_syntax_ON(target, 'VimwikiLink') - " match {{URL|...}} - let target = vimwiki#base#apply_template(g:vimwiki_WikiInclTemplate2, - \ safe_links, g:vimwiki_rxWikiInclArgs, '') - call s:add_target_syntax_ON(target, 'VimwikiLink') - " match [[DIRURL]] - let target = vimwiki#base#apply_template(g:vimwiki_WikiLinkTemplate1, - \ safe_dirs, g:vimwiki_rxWikiLinkDescr, '') - call s:add_target_syntax_ON(target, 'VimwikiLink') - " match [[DIRURL|DESCRIPTION]] - let target = vimwiki#base#apply_template(g:vimwiki_WikiLinkTemplate2, - \ safe_dirs, g:vimwiki_rxWikiLinkDescr, '') - call s:add_target_syntax_ON(target, 'VimwikiLink') -endfunction "}}} - - -" use max highlighting - could be quite slow if there are too many wikifiles -if VimwikiGet('maxhi') - " WikiLink - call s:add_target_syntax_OFF(g:vimwiki_rxWikiLink) - " WikiIncl - call s:add_target_syntax_OFF(g:vimwiki_rxWikiIncl) - - " Subsequently, links verified on vimwiki's path are highlighted as existing - let time01 = vimwiki#u#time(starttime) "XXX - call s:highlight_existing_links() - let time02 = vimwiki#u#time(starttime) "XXX -else - let time01 = vimwiki#u#time(starttime) "XXX - " Wikilink - call s:add_target_syntax_ON(g:vimwiki_rxWikiLink, 'VimwikiLink') - " WikiIncl - call s:add_target_syntax_ON(g:vimwiki_rxWikiIncl, 'VimwikiLink') - let time02 = vimwiki#u#time(starttime) "XXX -endif - -" Weblink -call s:add_target_syntax_ON(g:vimwiki_rxWeblink, 'VimwikiLink') - -" WikiLink -" All remaining schemes are highlighted automatically -let rxSchemes = '\%('. - \ join(split(g:vimwiki_schemes, '\s*,\s*'), '\|').'\|'. - \ join(split(g:vimwiki_web_schemes1, '\s*,\s*'), '\|'). - \ '\):' - -" a) match [[nonwiki-scheme-URL]] -let target = vimwiki#base#apply_template(g:vimwiki_WikiLinkTemplate1, - \ rxSchemes.g:vimwiki_rxWikiLinkUrl, g:vimwiki_rxWikiLinkDescr, '') -call s:add_target_syntax_ON(target, 'VimwikiLink') -" b) match [[nonwiki-scheme-URL|DESCRIPTION]] -let target = vimwiki#base#apply_template(g:vimwiki_WikiLinkTemplate2, - \ rxSchemes.g:vimwiki_rxWikiLinkUrl, g:vimwiki_rxWikiLinkDescr, '') -call s:add_target_syntax_ON(target, 'VimwikiLink') - -" a) match {{nonwiki-scheme-URL}} -let target = vimwiki#base#apply_template(g:vimwiki_WikiInclTemplate1, - \ rxSchemes.g:vimwiki_rxWikiInclUrl, g:vimwiki_rxWikiInclArgs, '') -call s:add_target_syntax_ON(target, 'VimwikiLink') -" b) match {{nonwiki-scheme-URL}[{...}]} -let target = vimwiki#base#apply_template(g:vimwiki_WikiInclTemplate2, - \ rxSchemes.g:vimwiki_rxWikiInclUrl, g:vimwiki_rxWikiInclArgs, '') -call s:add_target_syntax_ON(target, 'VimwikiLink') - -" }}} - - -" generic headers "{{{ -if g:vimwiki_symH - "" symmetric - for i in range(1,6) - let g:vimwiki_rxH{i}_Template = repeat(g:vimwiki_rxH, i).' __Header__ '.repeat(g:vimwiki_rxH, i) - let g:vimwiki_rxH{i} = '^\s*'.g:vimwiki_rxH.'\{'.i.'}[^'.g:vimwiki_rxH.'].*[^'.g:vimwiki_rxH.']'.g:vimwiki_rxH.'\{'.i.'}\s*$' - endfor - let g:vimwiki_rxHeader = '^\s*\('.g:vimwiki_rxH.'\{1,6}\)\zs[^'.g:vimwiki_rxH.'].*[^'.g:vimwiki_rxH.']\ze\1\s*$' -else - " asymmetric - for i in range(1,6) - let g:vimwiki_rxH{i}_Template = repeat(g:vimwiki_rxH, i).' __Header__' - let g:vimwiki_rxH{i} = '^\s*'.g:vimwiki_rxH.'\{'.i.'}[^'.g:vimwiki_rxH.'].*$' - endfor - let g:vimwiki_rxHeader = '^\s*\('.g:vimwiki_rxH.'\{1,6}\)\zs[^'.g:vimwiki_rxH.'].*\ze$' -endif - -" Header levels, 1-6 -for i in range(1,6) - execute 'syntax match VimwikiHeader'.i.' /'.g:vimwiki_rxH{i}.'/ contains=VimwikiTodo,VimwikiHeaderChar,VimwikiNoExistsLink,VimwikiCode,VimwikiLink,@Spell' -endfor - -" }}} - -" concealed chars " {{{ -let cchar = '' -if exists("+conceallevel") - syntax conceal on - let cchar = ' cchar=~ ' -endif - -syntax spell toplevel - -if g:vimwiki_debug > 1 - echom 'WikiLink Prefix: '.g:vimwiki_rxWikiLinkPrefix1 - echom 'WikiLink Suffix: '.g:vimwiki_rxWikiLinkSuffix1 - echom 'WikiIncl Prefix: '.g:vimwiki_rxWikiInclPrefix1 - echom 'WikiIncl Suffix: '.g:vimwiki_rxWikiInclSuffix1 -endif - -" VimwikiLinkChar is for syntax markers (and also URL when a description -" is present) and may be concealed -let options = ' contained transparent contains=NONE' -" conceal wikilinks -execute 'syn match VimwikiLinkChar /'.g:vimwiki_rxWikiLinkPrefix.'/'.options -execute 'syn match VimwikiLinkChar /'.g:vimwiki_rxWikiLinkSuffix.'/'.options -execute 'syn match VimwikiLinkChar /'.g:vimwiki_rxWikiLinkPrefix1.'/'.options -execute 'syn match VimwikiLinkChar /'.g:vimwiki_rxWikiLinkSuffix1.'/'.options - -" conceal wikiincls -execute 'syn match VimwikiLinkChar /'.g:vimwiki_rxWikiInclPrefix.'/'.options -execute 'syn match VimwikiLinkChar /'.g:vimwiki_rxWikiInclSuffix.'/'.options -execute 'syn match VimwikiLinkChar /'.g:vimwiki_rxWikiInclPrefix1.'/'.options -execute 'syn match VimwikiLinkChar /'.g:vimwiki_rxWikiInclSuffix1.'/'.options - -" A shortener for long URLs: LinkRest (a middle part of the URL) is concealed -execute 'syn match VimwikiLinkRest `\%(///\=[^/ \t]\+/\)\zs\S\{' - \.g:vimwiki_url_mingain.',}\ze\%([/#?]\w\|\S\{' - \.g:vimwiki_url_maxsave.'}\)`'.cchar.options - -execute 'syn match VimwikiEqInChar contained /'.g:vimwiki_char_eqin.'/' -execute 'syn match VimwikiBoldChar contained /'.g:vimwiki_char_bold.'/' -execute 'syn match VimwikiItalicChar contained /'.g:vimwiki_char_italic.'/' -execute 'syn match VimwikiBoldItalicChar contained /'.g:vimwiki_char_bolditalic.'/' -execute 'syn match VimwikiItalicBoldChar contained /'.g:vimwiki_char_italicbold.'/' -execute 'syn match VimwikiCodeChar contained /'.g:vimwiki_char_code.'/' -execute 'syn match VimwikiDelTextChar contained /'.g:vimwiki_char_deltext.'/' -execute 'syn match VimwikiSuperScript contained /'.g:vimwiki_char_superscript.'/' -execute 'syn match VimwikiSubScript contained /'.g:vimwiki_char_subscript.'/' -if exists("+conceallevel") - syntax conceal off -endif -" }}} - -" non concealed chars " {{{ -execute 'syn match VimwikiHeaderChar contained /\%(^\s*'.g:vimwiki_rxH.'\+\)\|\%('.g:vimwiki_rxH.'\+\s*$\)/' -execute 'syn match VimwikiEqInCharT contained /'.g:vimwiki_char_eqin.'/' -execute 'syn match VimwikiBoldCharT contained /'.g:vimwiki_char_bold.'/' -execute 'syn match VimwikiItalicCharT contained /'.g:vimwiki_char_italic.'/' -execute 'syn match VimwikiBoldItalicCharT contained /'.g:vimwiki_char_bolditalic.'/' -execute 'syn match VimwikiItalicBoldCharT contained /'.g:vimwiki_char_italicbold.'/' -execute 'syn match VimwikiCodeCharT contained /'.g:vimwiki_char_code.'/' -execute 'syn match VimwikiDelTextCharT contained /'.g:vimwiki_char_deltext.'/' -execute 'syn match VimwikiSuperScriptT contained /'.g:vimwiki_char_superscript.'/' -execute 'syn match VimwikiSubScriptT contained /'.g:vimwiki_char_subscript.'/' - -" Emoticons -"syntax match VimwikiEmoticons /\%((.)\|:[()|$@]\|:-[DOPS()\]|$@]\|;)\|:'(\)/ - -let g:vimwiki_rxTodo = '\C\%(TODO:\|DONE:\|STARTED:\|FIXME:\|FIXED:\|XXX:\)' -execute 'syntax match VimwikiTodo /'. g:vimwiki_rxTodo .'/' -" }}} - -" main syntax groups {{{ - -" Tables -syntax match VimwikiTableRow /^\s*|.\+|\s*$/ - \ transparent contains=VimwikiCellSeparator, - \ VimwikiLinkT, - \ VimwikiNoExistsLinkT, - \ VimwikiEmoticons, - \ VimwikiTodo, - \ VimwikiBoldT, - \ VimwikiItalicT, - \ VimwikiBoldItalicT, - \ VimwikiItalicBoldT, - \ VimwikiDelTextT, - \ VimwikiSuperScriptT, - \ VimwikiSubScriptT, - \ VimwikiCodeT, - \ VimwikiEqInT, - \ @Spell -syntax match VimwikiCellSeparator - \ /\%(|\)\|\%(-\@<=+\-\@=\)\|\%([|+]\@<=-\+\)/ contained - -" List items -execute 'syntax match VimwikiList /'.g:vimwiki_rxListBullet.'/' -execute 'syntax match VimwikiList /'.g:vimwiki_rxListNumber.'/' -execute 'syntax match VimwikiList /'.g:vimwiki_rxListDefine.'/' -" List item checkbox -"syntax match VimwikiCheckBox /\[.\?\]/ -let g:vimwiki_rxCheckBox = '\s*\[['.g:vimwiki_listsyms.']\?\]\s' -" Todo lists have a checkbox -execute 'syntax match VimwikiListTodo /'.g:vimwiki_rxListBullet.g:vimwiki_rxCheckBox.'/' -execute 'syntax match VimwikiListTodo /'.g:vimwiki_rxListNumber.g:vimwiki_rxCheckBox.'/' -if g:vimwiki_hl_cb_checked - execute 'syntax match VimwikiCheckBoxDone /'. - \ g:vimwiki_rxListBullet.'\s*\['.g:vimwiki_listsyms[4].'\]\s.*$/'. - \ ' contains=VimwikiNoExistsLink,VimwikiLink' - execute 'syntax match VimwikiCheckBoxDone /'. - \ g:vimwiki_rxListNumber.'\s*\['.g:vimwiki_listsyms[4].'\]\s.*$/'. - \ ' contains=VimwikiNoExistsLink,VimwikiLink' -endif - -execute 'syntax match VimwikiEqIn /'.g:vimwiki_rxEqIn.'/ contains=VimwikiEqInChar' -execute 'syntax match VimwikiEqInT /'.g:vimwiki_rxEqIn.'/ contained contains=VimwikiEqInCharT' - -execute 'syntax match VimwikiBold /'.g:vimwiki_rxBold.'/ contains=VimwikiBoldChar,@Spell' -execute 'syntax match VimwikiBoldT /'.g:vimwiki_rxBold.'/ contained contains=VimwikiBoldCharT,@Spell' - -execute 'syntax match VimwikiItalic /'.g:vimwiki_rxItalic.'/ contains=VimwikiItalicChar,@Spell' -execute 'syntax match VimwikiItalicT /'.g:vimwiki_rxItalic.'/ contained contains=VimwikiItalicCharT,@Spell' - -execute 'syntax match VimwikiBoldItalic /'.g:vimwiki_rxBoldItalic.'/ contains=VimwikiBoldItalicChar,VimwikiItalicBoldChar,@Spell' -execute 'syntax match VimwikiBoldItalicT /'.g:vimwiki_rxBoldItalic.'/ contained contains=VimwikiBoldItalicChatT,VimwikiItalicBoldCharT,@Spell' - -execute 'syntax match VimwikiItalicBold /'.g:vimwiki_rxItalicBold.'/ contains=VimwikiBoldItalicChar,VimwikiItalicBoldChar,@Spell' -execute 'syntax match VimwikiItalicBoldT /'.g:vimwiki_rxItalicBold.'/ contained contains=VimwikiBoldItalicCharT,VimsikiItalicBoldCharT,@Spell' - -execute 'syntax match VimwikiDelText /'.g:vimwiki_rxDelText.'/ contains=VimwikiDelTextChar,@Spell' -execute 'syntax match VimwikiDelTextT /'.g:vimwiki_rxDelText.'/ contained contains=VimwikiDelTextChar,@Spell' - -execute 'syntax match VimwikiSuperScript /'.g:vimwiki_rxSuperScript.'/ contains=VimwikiSuperScriptChar,@Spell' -execute 'syntax match VimwikiSuperScriptT /'.g:vimwiki_rxSuperScript.'/ contained contains=VimwikiSuperScriptCharT,@Spell' - -execute 'syntax match VimwikiSubScript /'.g:vimwiki_rxSubScript.'/ contains=VimwikiSubScriptChar,@Spell' -execute 'syntax match VimwikiSubScriptT /'.g:vimwiki_rxSubScript.'/ contained contains=VimwikiSubScriptCharT,@Spell' - -execute 'syntax match VimwikiCode /'.g:vimwiki_rxCode.'/ contains=VimwikiCodeChar' -execute 'syntax match VimwikiCodeT /'.g:vimwiki_rxCode.'/ contained contains=VimwikiCodeCharT' - -"
horizontal rule -execute 'syntax match VimwikiHR /'.g:vimwiki_rxHR.'/' - -execute 'syntax region VimwikiPre start=/^\s*'.g:vimwiki_rxPreStart. - \ '/ end=/^\s*'.g:vimwiki_rxPreEnd.'\s*$/ contains=@Spell' - -execute 'syntax region VimwikiMath start=/^\s*'.g:vimwiki_rxMathStart. - \ '/ end=/^\s*'.g:vimwiki_rxMathEnd.'\s*$/ contains=@Spell' - - -" placeholders -syntax match VimwikiPlaceholder /^\s*%toc\%(\s.*\)\?$/ contains=VimwikiPlaceholderParam -syntax match VimwikiPlaceholder /^\s*%nohtml\s*$/ -syntax match VimwikiPlaceholder /^\s*%title\%(\s.*\)\?$/ contains=VimwikiPlaceholderParam -syntax match VimwikiPlaceholder /^\s*%template\%(\s.*\)\?$/ contains=VimwikiPlaceholderParam -syntax match VimwikiPlaceholderParam /\s.*/ contained - -" html tags -if g:vimwiki_valid_html_tags != '' - let html_tags = join(split(g:vimwiki_valid_html_tags, '\s*,\s*'), '\|') - exe 'syntax match VimwikiHTMLtag #\c#' - execute 'syntax match VimwikiBold #\c.\{-}# contains=VimwikiHTMLTag' - execute 'syntax match VimwikiItalic #\c.\{-}# contains=VimwikiHTMLTag' - execute 'syntax match VimwikiUnderline #\c.\{-}# contains=VimwikiHTMLTag' - - execute 'syntax match VimwikiComment /'.g:vimwiki_rxComment.'/ contains=@Spell' -endif -" }}} - -" header groups highlighting "{{{ - -if g:vimwiki_hl_headers == 0 - " Strangely in default colorscheme Title group is not set to bold for cterm... - if !exists("g:colors_name") - hi Title cterm=bold - endif - for i in range(1,6) - execute 'hi def link VimwikiHeader'.i.' Title' - endfor -else - " default colors when headers of different levels are highlighted differently - " not making it yet another option; needed by ColorScheme autocommand - let g:vimwiki_hcolor_guifg_light = ['#aa5858','#507030','#1030a0','#103040','#505050','#636363'] - let g:vimwiki_hcolor_ctermfg_light = ['DarkRed','DarkGreen','DarkBlue','Black','Black','Black'] - let g:vimwiki_hcolor_guifg_dark = ['#e08090','#80e090','#6090e0','#c0c0f0','#e0e0f0','#f0f0f0'] - let g:vimwiki_hcolor_ctermfg_dark = ['Red','Green','Blue','White','White','White'] - for i in range(1,6) - execute 'hi def VimwikiHeader'.i.' guibg=bg guifg='.g:vimwiki_hcolor_guifg_{&bg}[i-1].' gui=bold ctermfg='.g:vimwiki_hcolor_ctermfg_{&bg}[i-1].' term=bold cterm=bold' - endfor -endif -"}}} - - -" syntax group highlighting "{{{ - -hi def link VimwikiMarkers Normal - -hi def link VimwikiEqIn Number -hi def link VimwikiEqInT VimwikiEqIn - -hi def VimwikiBold term=bold cterm=bold gui=bold -hi def link VimwikiBoldT VimwikiBold - -hi def VimwikiItalic term=italic cterm=italic gui=italic -hi def link VimwikiItalicT VimwikiItalic - -hi def VimwikiBoldItalic term=bold cterm=bold gui=bold,italic -hi def link VimwikiItalicBold VimwikiBoldItalic -hi def link VimwikiBoldItalicT VimwikiBoldItalic -hi def link VimwikiItalicBoldT VimwikiBoldItalic - -hi def VimwikiUnderline gui=underline - -hi def link VimwikiCode PreProc -hi def link VimwikiCodeT VimwikiCode - -hi def link VimwikiPre PreProc -hi def link VimwikiPreT VimwikiPre - -hi def link VimwikiMath Number -hi def link VimwikiMathT VimwikiMath - -hi def link VimwikiNoExistsLink SpellBad -hi def link VimwikiNoExistsLinkT VimwikiNoExistsLink - -hi def link VimwikiLink Underlined -hi def link VimwikiLinkT VimwikiLink - -hi def link VimwikiList Identifier -hi def link VimwikiListTodo VimwikiList -"hi def link VimwikiCheckBox VimwikiList -hi def link VimwikiCheckBoxDone Comment -hi def link VimwikiEmoticons Character -hi def link VimwikiHR Identifier - -hi def link VimwikiDelText Constant -hi def link VimwikiDelTextT VimwikiDelText - -hi def link VimwikiSuperScript Number -hi def link VimwikiSuperScriptT VimwikiSuperScript - -hi def link VimwikiSubScript Number -hi def link VimwikiSubScriptT VimwikiSubScript - -hi def link VimwikiTodo Todo -hi def link VimwikiComment Comment - -hi def link VimwikiPlaceholder SpecialKey -hi def link VimwikiPlaceholderParam String -hi def link VimwikiHTMLtag SpecialKey - -hi def link VimwikiEqInChar VimwikiMarkers -hi def link VimwikiCellSeparator VimwikiMarkers -hi def link VimwikiBoldChar VimwikiMarkers -hi def link VimwikiItalicChar VimwikiMarkers -hi def link VimwikiBoldItalicChar VimwikiMarkers -hi def link VimwikiItalicBoldChar VimwikiMarkers -hi def link VimwikiDelTextChar VimwikiMarkers -hi def link VimwikiSuperScriptChar VimwikiMarkers -hi def link VimwikiSubScriptChar VimwikiMarkers -hi def link VimwikiCodeChar VimwikiMarkers -hi def link VimwikiHeaderChar VimwikiMarkers - -hi def link VimwikiEqInCharT VimwikiMarkers -hi def link VimwikiBoldCharT VimwikiMarkers -hi def link VimwikiItalicCharT VimwikiMarkers -hi def link VimwikiBoldItalicCharT VimwikiMarkers -hi def link VimwikiItalicBoldCharT VimwikiMarkers -hi def link VimwikiDelTextCharT VimwikiMarkers -hi def link VimwikiSuperScriptCharT VimwikiMarkers -hi def link VimwikiSubScriptCharT VimwikiMarkers -hi def link VimwikiCodeCharT VimwikiMarkers -hi def link VimwikiHeaderCharT VimwikiMarkers -hi def link VimwikiLinkCharT VimwikiLinkT -hi def link VimwikiNoExistsLinkCharT VimwikiNoExistsLinkT -"}}} - -" ------------------------------------------------------------------------- -" Load syntax-specific functionality -execute 'runtime! syntax/vimwiki_'.VimwikiGet('syntax').'_custom.vim' -" ------------------------------------------------------------------------- - -let b:current_syntax="vimwiki" - -" EMBEDDED syntax setup "{{{ -let nested = VimwikiGet('nested_syntaxes') -if !empty(nested) - for [hl_syntax, vim_syntax] in items(nested) - call vimwiki#base#nested_syntax(vim_syntax, - \ '^\s*'.g:vimwiki_rxPreStart.'\%(.*[[:blank:][:punct:]]\)\?'. - \ hl_syntax.'\%([[:blank:][:punct:]].*\)\?', - \ '^\s*'.g:vimwiki_rxPreEnd, 'VimwikiPre') - endfor -endif -" LaTeX -call vimwiki#base#nested_syntax('tex', - \ '^\s*'.g:vimwiki_rxMathStart.'\%(.*[[:blank:][:punct:]]\)\?'. - \ '\%([[:blank:][:punct:]].*\)\?', - \ '^\s*'.g:vimwiki_rxMathEnd, 'VimwikiMath') -"}}} - -let timeend = vimwiki#u#time(starttime) "XXX -call VimwikiLog_extend('timing',['syntax:scans',timescans],['syntax:regexloaded',time0],['syntax:beforeHLexisting',time01],['syntax:afterHLexisting',time02],['syntax:end',timeend]) diff --git a/syntax/vimwiki_default.vim b/syntax/vimwiki_default.vim deleted file mode 100644 index 1d5093b..0000000 --- a/syntax/vimwiki_default.vim +++ /dev/null @@ -1,89 +0,0 @@ -" vim:tabstop=2:shiftwidth=2:expandtab:foldmethod=marker:textwidth=79 -" Vimwiki syntax file -" Default syntax -" Author: Maxim Kim -" Home: http://code.google.com/p/vimwiki/ - -" placeholder for math environments -let b:vimwiki_mathEnv = "" - -" text: $ equation_inline $ -let g:vimwiki_rxEqIn = '\$[^$`]\+\$' -let g:vimwiki_char_eqin = '\$' - -" text: *strong* -" let g:vimwiki_rxBold = '\*[^*]\+\*' -let g:vimwiki_rxBold = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'\*'. - \'\%([^*`[:space:]][^*`]*[^*`[:space:]]\|[^*`[:space:]]\)'. - \'\*'. - \'\%([[:punct:]]\|\s\|$\)\@=' -let g:vimwiki_char_bold = '*' - -" text: _emphasis_ -" let g:vimwiki_rxItalic = '_[^_]\+_' -let g:vimwiki_rxItalic = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'_'. - \'\%([^_`[:space:]][^_`]*[^_`[:space:]]\|[^_`[:space:]]\)'. - \'_'. - \'\%([[:punct:]]\|\s\|$\)\@=' -let g:vimwiki_char_italic = '_' - -" text: *_bold italic_* or _*italic bold*_ -let g:vimwiki_rxBoldItalic = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'\*_'. - \'\%([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`[:space:]]\)'. - \'_\*'. - \'\%([[:punct:]]\|\s\|$\)\@=' -let g:vimwiki_char_bolditalic = '\*_' - -let g:vimwiki_rxItalicBold = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'_\*'. - \'\%([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`[:space:]]\)'. - \'\*_'. - \'\%([[:punct:]]\|\s\|$\)\@=' -let g:vimwiki_char_italicbold = '_\*' - -" text: `code` -let g:vimwiki_rxCode = '`[^`]\+`' -let g:vimwiki_char_code = '`' - -" text: ~~deleted text~~ -let g:vimwiki_rxDelText = '\~\~[^~`]\+\~\~' -let g:vimwiki_char_deltext = '\~\~' - -" text: ^superscript^ -let g:vimwiki_rxSuperScript = '\^[^^`]\+\^' -let g:vimwiki_char_superscript = '^' - -" text: ,,subscript,, -let g:vimwiki_rxSubScript = ',,[^,`]\+,,' -let g:vimwiki_char_subscript = ',,' - -" generic headers -let g:vimwiki_rxH = '=' -let g:vimwiki_symH = 1 - - - -"
, horizontal rule -let g:vimwiki_rxHR = '^-----*$' - -" Tables. Each line starts and ends with '|'; each cell is separated by '|' -let g:vimwiki_rxTableSep = '|' - -" List items start with optional whitespace(s) then '* ' or '# ' -let g:vimwiki_rxListBullet = '^\s*[*-]\s' -let g:vimwiki_rxListNumber = '^\s*#\s' - -let g:vimwiki_rxListDefine = '::\(\s\|$\)' - -" Preformatted text -let g:vimwiki_rxPreStart = '{{{' -let g:vimwiki_rxPreEnd = '}}}' - -" Math block -let g:vimwiki_rxMathStart = '{{\$' -let g:vimwiki_rxMathEnd = '}}\$' - -let g:vimwiki_rxComment = '^\s*%%.*$' diff --git a/syntax/vimwiki_markdown.vim b/syntax/vimwiki_markdown.vim deleted file mode 100644 index 13e35e1..0000000 --- a/syntax/vimwiki_markdown.vim +++ /dev/null @@ -1,89 +0,0 @@ -" vim:tabstop=2:shiftwidth=2:expandtab:foldmethod=marker:textwidth=79 -" Vimwiki syntax file -" Default syntax -" Author: Maxim Kim -" Home: http://code.google.com/p/vimwiki/ - -" placeholder for math environments -let b:vimwiki_mathEnv = "" - -" text: $ equation_inline $ -let g:vimwiki_rxEqIn = '\$[^$`]\+\$' -let g:vimwiki_char_eqin = '\$' - -" text: *strong* -" let g:vimwiki_rxBold = '\*[^*]\+\*' -let g:vimwiki_rxBold = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'\*'. - \'\%([^*`[:space:]][^*`]*[^*`[:space:]]\|[^*`[:space:]]\)'. - \'\*'. - \'\%([[:punct:]]\|\s\|$\)\@=' -let g:vimwiki_char_bold = '*' - -" text: _emphasis_ -" let g:vimwiki_rxItalic = '_[^_]\+_' -let g:vimwiki_rxItalic = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'_'. - \'\%([^_`[:space:]][^_`]*[^_`[:space:]]\|[^_`[:space:]]\)'. - \'_'. - \'\%([[:punct:]]\|\s\|$\)\@=' -let g:vimwiki_char_italic = '_' - -" text: *_bold italic_* or _*italic bold*_ -let g:vimwiki_rxBoldItalic = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'\*_'. - \'\%([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`[:space:]]\)'. - \'_\*'. - \'\%([[:punct:]]\|\s\|$\)\@=' -let g:vimwiki_char_bolditalic = '\*_' - -let g:vimwiki_rxItalicBold = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'_\*'. - \'\%([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`[:space:]]\)'. - \'\*_'. - \'\%([[:punct:]]\|\s\|$\)\@=' -let g:vimwiki_char_italicbold = '_\*' - -" text: `code` -let g:vimwiki_rxCode = '`[^`]\+`' -let g:vimwiki_char_code = '`' - -" text: ~~deleted text~~ -let g:vimwiki_rxDelText = '\~\~[^~`]\+\~\~' -let g:vimwiki_char_deltext = '\~\~' - -" text: ^superscript^ -let g:vimwiki_rxSuperScript = '\^[^^`]\+\^' -let g:vimwiki_char_superscript = '^' - -" text: ,,subscript,, -let g:vimwiki_rxSubScript = ',,[^,`]\+,,' -let g:vimwiki_char_subscript = ',,' - -" generic headers -let g:vimwiki_rxH = '#' -let g:vimwiki_symH = 0 - - - -"
, horizontal rule -let g:vimwiki_rxHR = '^-----*$' - -" Tables. Each line starts and ends with '|'; each cell is separated by '|' -let g:vimwiki_rxTableSep = '|' - -" List items start with optional whitespace(s) then '* ' or '1. ', '2. ', etc. -let g:vimwiki_rxListBullet = '^\s*[*+-]\s' -let g:vimwiki_rxListNumber = '^\s*[0-9]\+\.\s' - -let g:vimwiki_rxListDefine = '::\%(\s\|$\)' - -" Preformatted text -let g:vimwiki_rxPreStart = '```' -let g:vimwiki_rxPreEnd = '```' - -" Math block -let g:vimwiki_rxMathStart = '\$\$' -let g:vimwiki_rxMathEnd = '\$\$' - -let g:vimwiki_rxComment = '^\s*%%.*$' diff --git a/syntax/vimwiki_markdown_custom.vim b/syntax/vimwiki_markdown_custom.vim deleted file mode 100644 index 94ab358..0000000 --- a/syntax/vimwiki_markdown_custom.vim +++ /dev/null @@ -1,392 +0,0 @@ -" vim:tabstop=2:shiftwidth=2:expandtab:foldmethod=marker:textwidth=79 -" Vimwiki syntax file -" Author: Stuart Andrews -" Home: http://code.google.com/p/vimwiki/ - -" LINKS: assume this is common to all syntaxes "{{{ - -" }}} - -" ------------------------------------------------------------------------- -" Load concrete Wiki syntax: sets regexes and templates for headers and links - -" ------------------------------------------------------------------------- - - - -" LINKS: setup of larger regexes {{{ - -" LINKS: setup wikilink0 regexps {{{ -" 0. [[URL]], or [[URL|DESCRIPTION]] - -" 0a) match [[URL|DESCRIPTION]] -let g:vimwiki_rxWikiLink0 = g:vimwiki_rxWikiLink -" 0b) match URL within [[URL|DESCRIPTION]] -let g:vimwiki_rxWikiLink0MatchUrl = g:vimwiki_rxWikiLinkMatchUrl -" 0c) match DESCRIPTION within [[URL|DESCRIPTION]] -let g:vimwiki_rxWikiLink0MatchDescr = g:vimwiki_rxWikiLinkMatchDescr -" }}} - -" LINKS: setup wikilink1 regexps {{{ -" 1. [URL][], or [DESCRIPTION][URL] - -let g:vimwiki_rxWikiLink1Prefix = '[' -let g:vimwiki_rxWikiLink1Suffix = ']' -let g:vimwiki_rxWikiLink1Separator = '][' - -" [URL][] -let g:vimwiki_WikiLink1Template1 = g:vimwiki_rxWikiLink1Prefix . '__LinkUrl__'. - \ g:vimwiki_rxWikiLink1Separator. g:vimwiki_rxWikiLink1Suffix -" [DESCRIPTION][URL] -let g:vimwiki_WikiLink1Template2 = g:vimwiki_rxWikiLink1Prefix . '__LinkDescription__'. - \ g:vimwiki_rxWikiLink1Separator. '__LinkUrl__'. - \ g:vimwiki_rxWikiLink1Suffix -" -let magic_chars = '.*[]\^$' -let valid_chars = '[^\\\[\]]' - -let g:vimwiki_rxWikiLink1Prefix = escape(g:vimwiki_rxWikiLink1Prefix, magic_chars) -let g:vimwiki_rxWikiLink1Suffix = escape(g:vimwiki_rxWikiLink1Suffix, magic_chars) -let g:vimwiki_rxWikiLink1Separator = escape(g:vimwiki_rxWikiLink1Separator, magic_chars) -let g:vimwiki_rxWikiLink1Url = valid_chars.'\{-}' -let g:vimwiki_rxWikiLink1Descr = valid_chars.'\{-}' - -let g:vimwiki_rxWikiLink1InvalidPrefix = '[\]\[]\@ 1 - echom '[vimwiki_debug] syntax target > '.a:target - endif - let prefix0 = 'syntax match '.a:type.' `' - let suffix0 = '` display contains=@NoSpell,VimwikiLinkRest,'.a:type.'Char' - let prefix1 = 'syntax match '.a:type.'T `' - let suffix1 = '` display contained' - execute prefix0. a:target. suffix0 - execute prefix1. a:target. suffix1 -endfunction "}}} - -function! s:add_target_syntax_OFF(target, type) " {{{ - if g:vimwiki_debug > 1 - echom '[vimwiki_debug] syntax target > '.a:target - endif - let prefix0 = 'syntax match VimwikiNoExistsLink `' - let suffix0 = '` display contains=@NoSpell,VimwikiLinkRest,'.a:type.'Char' - let prefix1 = 'syntax match VimwikiNoExistsLinkT `' - let suffix1 = '` display contained' - execute prefix0. a:target. suffix0 - execute prefix1. a:target. suffix1 -endfunction "}}} - -function! s:wrap_wikilink1_rx(target) "{{{ - return g:vimwiki_rxWikiLink1InvalidPrefix.a:target. - \ g:vimwiki_rxWikiLink1InvalidSuffix -endfunction "}}} - -function! s:existing_mkd_refs() "{{{ - call vimwiki#markdown_base#reset_mkd_refs() - return "\n".join(keys(vimwiki#markdown_base#get_reflinks()), "\n")."\n" -endfunction "}}} - -function! s:highlight_existing_links() "{{{ - " Wikilink1 - " Conditional highlighting that depends on the existence of a wiki file or - " directory is only available for *schemeless* wiki links - " Links are set up upon BufEnter (see plugin/...) - let safe_links = vimwiki#base#file_pattern(b:existing_wikifiles) - " Wikilink1 Dirs set up upon BufEnter (see plugin/...) - let safe_dirs = vimwiki#base#file_pattern(b:existing_wikidirs) - " Ref links are cached - let safe_reflinks = vimwiki#base#file_pattern(s:existing_mkd_refs()) - - - " match [URL][] - let target = vimwiki#base#apply_template(g:vimwiki_WikiLink1Template1, - \ safe_links, g:vimwiki_rxWikiLink1Descr, '') - call s:add_target_syntax_ON(s:wrap_wikilink1_rx(target), 'VimwikiWikiLink1') - " match [DESCRIPTION][URL] - let target = vimwiki#base#apply_template(g:vimwiki_WikiLink1Template2, - \ safe_links, g:vimwiki_rxWikiLink1Descr, '') - call s:add_target_syntax_ON(s:wrap_wikilink1_rx(target), 'VimwikiWikiLink1') - - " match [DIRURL][] - let target = vimwiki#base#apply_template(g:vimwiki_WikiLink1Template1, - \ safe_dirs, g:vimwiki_rxWikiLink1Descr, '') - call s:add_target_syntax_ON(s:wrap_wikilink1_rx(target), 'VimwikiWikiLink1') - " match [DESCRIPTION][DIRURL] - let target = vimwiki#base#apply_template(g:vimwiki_WikiLink1Template2, - \ safe_dirs, g:vimwiki_rxWikiLink1Descr, '') - call s:add_target_syntax_ON(s:wrap_wikilink1_rx(target), 'VimwikiWikiLink1') - - " match [MKDREF][] - let target = vimwiki#base#apply_template(g:vimwiki_WikiLink1Template1, - \ safe_reflinks, g:vimwiki_rxWikiLink1Descr, '') - call s:add_target_syntax_ON(s:wrap_wikilink1_rx(target), 'VimwikiWikiLink1') - " match [DESCRIPTION][MKDREF] - let target = vimwiki#base#apply_template(g:vimwiki_WikiLink1Template2, - \ safe_reflinks, g:vimwiki_rxWikiLink1Descr, '') - call s:add_target_syntax_ON(s:wrap_wikilink1_rx(target), 'VimwikiWikiLink1') -endfunction "}}} - - -" use max highlighting - could be quite slow if there are too many wikifiles -if VimwikiGet('maxhi') - " WikiLink - call s:add_target_syntax_OFF(g:vimwiki_rxWikiLink1, 'VimwikiWikiLink1') - - " Subsequently, links verified on vimwiki's path are highlighted as existing - let time01 = vimwiki#u#time(starttime) "XXX - call s:highlight_existing_links() - let time02 = vimwiki#u#time(starttime) "XXX -else - let time01 = vimwiki#u#time(starttime) "XXX - " Wikilink - call s:add_target_syntax_ON(g:vimwiki_rxWikiLink1, 'VimwikiWikiLink1') - let time02 = vimwiki#u#time(starttime) "XXX -endif - -" Weblink -call s:add_target_syntax_ON(g:vimwiki_rxWeblink1, 'VimwikiWeblink1') - -" WikiLink -" All remaining schemes are highlighted automatically -let rxSchemes = '\%('. - \ join(split(g:vimwiki_schemes, '\s*,\s*'), '\|').'\|'. - \ join(split(g:vimwiki_web_schemes1, '\s*,\s*'), '\|'). - \ '\):' - -" a) match [nonwiki-scheme-URL] -let target = vimwiki#base#apply_template(g:vimwiki_WikiLink1Template1, - \ rxSchemes.g:vimwiki_rxWikiLink1Url, g:vimwiki_rxWikiLink1Descr, '') -call s:add_target_syntax_ON(s:wrap_wikilink1_rx(target), 'VimwikiWikiLink1') -" b) match [DESCRIPTION][nonwiki-scheme-URL] -let target = vimwiki#base#apply_template(g:vimwiki_WikiLink1Template2, - \ rxSchemes.g:vimwiki_rxWikiLink1Url, g:vimwiki_rxWikiLink1Descr, '') -call s:add_target_syntax_ON(s:wrap_wikilink1_rx(target), 'VimwikiWikiLink1') -" }}} - - -" generic headers "{{{ - -" Header levels, 1-6 -for i in range(1,6) - execute 'syntax match VimwikiHeader'.i.' /'.g:vimwiki_rxH{i}.'/ contains=VimwikiTodo,VimwikiHeaderChar,VimwikiNoExistsLink,VimwikiCode,VimwikiLink,VimwikiWeblink1,VimwikiWikiLink1,@Spell' -endfor - -" }}} - -" concealed chars " {{{ -if exists("+conceallevel") - syntax conceal on -endif - -syntax spell toplevel - -if g:vimwiki_debug > 1 - echom 'WikiLink1 Prefix: '.g:vimwiki_rxWikiLink1Prefix1 - echom 'WikiLink1 Suffix: '.g:vimwiki_rxWikiLink1Suffix1 - echom 'Weblink1 Prefix: '.g:vimwiki_rxWeblink1Prefix1 - echom 'Weblink1 Suffix: '.g:vimwiki_rxWeblink1Suffix1 -endif - -" VimwikiWikiLink1Char is for syntax markers (and also URL when a description -" is present) and may be concealed -let options = ' contained transparent contains=NONE' -" conceal wikilink1 -execute 'syn match VimwikiWikiLink1Char /'.g:vimwiki_rxWikiLink1Prefix.'/'.options -execute 'syn match VimwikiWikiLink1Char /'.g:vimwiki_rxWikiLink1Suffix.'/'.options -execute 'syn match VimwikiWikiLink1Char /'.g:vimwiki_rxWikiLink1Prefix1.'/'.options -execute 'syn match VimwikiWikiLink1Char /'.g:vimwiki_rxWikiLink1Suffix1.'/'.options - -" conceal weblink1 -execute 'syn match VimwikiWeblink1Char "'.g:vimwiki_rxWeblink1Prefix1.'"'.options -execute 'syn match VimwikiWeblink1Char "'.g:vimwiki_rxWeblink1Suffix1.'"'.options - -if exists("+conceallevel") - syntax conceal off -endif -" }}} - -" non concealed chars " {{{ -" }}} - -" main syntax groups {{{ - -" Tables -syntax match VimwikiTableRow /^\s*|.\+|\s*$/ - \ transparent contains=VimwikiCellSeparator, - \ VimwikiLinkT, - \ VimwikiWeblink1T, - \ VimwikiWikiLink1T, - \ VimwikiNoExistsLinkT, - \ VimwikiEmoticons, - \ VimwikiTodo, - \ VimwikiBoldT, - \ VimwikiItalicT, - \ VimwikiBoldItalicT, - \ VimwikiItalicBoldT, - \ VimwikiDelTextT, - \ VimwikiSuperScriptT, - \ VimwikiSubScriptT, - \ VimwikiCodeT, - \ VimwikiEqInT, - \ @Spell - -" }}} - -" header groups highlighting "{{{ -"}}} - - -" syntax group highlighting "{{{ -hi def link VimwikiWeblink1 VimwikiLink -hi def link VimwikiWeblink1T VimwikiLink - -hi def link VimwikiWikiLink1 VimwikiLink -hi def link VimwikiWikiLink1T VimwikiLink -"}}} - - - -" EMBEDDED syntax setup "{{{ -"}}} -" diff --git a/syntax/vimwiki_media.vim b/syntax/vimwiki_media.vim deleted file mode 100644 index c168eed..0000000 --- a/syntax/vimwiki_media.vim +++ /dev/null @@ -1,71 +0,0 @@ -" vim:tabstop=2:shiftwidth=2:expandtab:foldmethod=marker:textwidth=79 -" Vimwiki syntax file -" MediaWiki syntax -" Author: Maxim Kim -" Home: http://code.google.com/p/vimwiki/ - -" placeholder for math environments -let b:vimwiki_mathEnv = "" - -" text: $ equation_inline $ -let g:vimwiki_rxEqIn = '\$[^$`]\+\$' -let g:vimwiki_char_eqin = '\$' - -" text: '''strong''' -let g:vimwiki_rxBold = "'''[^']\\+'''" -let g:vimwiki_char_bold = "'''" - -" text: ''emphasis'' -let g:vimwiki_rxItalic = "''[^']\\+''" -let g:vimwiki_char_italic = "''" - -" text: '''''strong italic''''' -let g:vimwiki_rxBoldItalic = "'''''[^']\\+'''''" -let g:vimwiki_rxItalicBold = g:vimwiki_rxBoldItalic -let g:vimwiki_char_bolditalic = "'''''" -let g:vimwiki_char_italicbold = g:vimwiki_char_bolditalic - -" text: `code` -let g:vimwiki_rxCode = '`[^`]\+`' -let g:vimwiki_char_code = '`' - -" text: ~~deleted text~~ -let g:vimwiki_rxDelText = '\~\~[^~]\+\~\~' -let g:vimwiki_char_deltext = '\~\~' - -" text: ^superscript^ -let g:vimwiki_rxSuperScript = '\^[^^]\+\^' -let g:vimwiki_char_superscript = '^' - -" text: ,,subscript,, -let g:vimwiki_rxSubScript = ',,[^,]\+,,' -let g:vimwiki_char_subscript = ',,' - -" generic headers -let g:vimwiki_rxH = '=' -let g:vimwiki_symH = 1 - - - -"
, horizontal rule -let g:vimwiki_rxHR = '^-----*$' - -" Tables. Each line starts and ends with '|'; each cell is separated by '|' -let g:vimwiki_rxTableSep = '|' - -" Bulleted list items start with whitespace(s), then '*' -" highlight only bullets and digits. -let g:vimwiki_rxListBullet = '^\s*\*\+\s\%([^*]*$\)\@=' -let g:vimwiki_rxListNumber = '^\s*#\+\s' - -let g:vimwiki_rxListDefine = '^\%(;\|:\)\s' - -" Preformatted text -let g:vimwiki_rxPreStart = '
'
-let g:vimwiki_rxPreEnd = '<\/pre>'
-
-" Math block
-let g:vimwiki_rxMathStart = '{{\$'
-let g:vimwiki_rxMathEnd = '}}\$'
-
-let g:vimwiki_rxComment = '^\s*%%.*$'