diff --git a/vim_old/.netrwhist b/vim_old/.netrwhist deleted file mode 100644 index 1c54a85..0000000 --- a/vim_old/.netrwhist +++ /dev/null @@ -1,7 +0,0 @@ -let g:netrw_dirhistmax =10 -let g:netrw_dirhist_cnt =5 -let g:netrw_dirhist_1='/srv/http/default/iocom/test' -let g:netrw_dirhist_2='/srv/http/default/include' -let g:netrw_dirhist_3='/home/dustinswan/.npm/socket.io' -let g:netrw_dirhist_4='/srv/http/default/wantfeed.com/services' -let g:netrw_dirhist_5='/srv/http/default/conrad' diff --git a/vim_old/after/plugin/snipMate.vim b/vim_old/after/plugin/snipMate.vim deleted file mode 100644 index 03e79ae..0000000 --- a/vim_old/after/plugin/snipMate.vim +++ /dev/null @@ -1,35 +0,0 @@ -" These are the mappings for snipMate.vim. Putting it here ensures that it -" will be mapped after other plugins such as supertab.vim. -if !exists('loaded_snips') || exists('s:did_snips_mappings') - finish -endif -let s:did_snips_mappings = 1 - -ino =TriggerSnippet() -snor i=TriggerSnippet() -ino =BackwardsSnippet() -snor i=BackwardsSnippet() -ino =ShowAvailableSnips() - -" The default mappings for these are annoying & sometimes break snipMate. -" You can change them back if you want, I've put them here for convenience. -snor b -snor a -snor bi -snor ' b' -snor ` b` -snor % b% -snor U bU -snor ^ b^ -snor \ b\ -snor b - -" By default load snippets in snippets_dir -if empty(snippets_dir) - finish -endif - -call GetSnippets(snippets_dir, '_') " Get global snippets - -au FileType * if &ft != 'help' | call GetSnippets(snippets_dir, &ft) | endif -" vim:noet:sw=4:ts=4:ft=vim diff --git a/vim_old/autoload/acp.vim b/vim_old/autoload/acp.vim deleted file mode 100644 index 827bbcc..0000000 --- a/vim_old/autoload/acp.vim +++ /dev/null @@ -1,431 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if exists('g:loaded_autoload_acp') || v:version < 702 - finish -endif -let g:loaded_autoload_acp = 1 - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS: {{{1 - -" -function acp#enable() - call acp#disable() - - augroup AcpGlobalAutoCommand - autocmd! - autocmd InsertEnter * unlet! s:posLast s:lastUncompletable - autocmd InsertLeave * call s:finishPopup(1) - augroup END - - if g:acp_mappingDriven - call s:mapForMappingDriven() - else - autocmd AcpGlobalAutoCommand CursorMovedI * call s:feedPopup() - endif - - nnoremap i i=feedPopup() - nnoremap a a=feedPopup() - nnoremap R R=feedPopup() -endfunction - -" -function acp#disable() - call s:unmapForMappingDriven() - augroup AcpGlobalAutoCommand - autocmd! - augroup END - nnoremap i | nunmap i - nnoremap a | nunmap a - nnoremap R | nunmap R -endfunction - -" -function acp#lock() - let s:lockCount += 1 -endfunction - -" -function acp#unlock() - let s:lockCount -= 1 - if s:lockCount < 0 - let s:lockCount = 0 - throw "AutoComplPop: not locked" - endif -endfunction - -" -function acp#meetsForSnipmate(context) - if g:acp_behaviorSnipmateLength < 0 - return 0 - endif - let matches = matchlist(a:context, '\(^\|\s\|\<\)\(\u\{' . - \ g:acp_behaviorSnipmateLength . ',}\)$') - return !empty(matches) && !empty(s:getMatchingSnipItems(matches[2])) -endfunction - -" -function acp#meetsForKeyword(context) - if g:acp_behaviorKeywordLength < 0 - return 0 - endif - let matches = matchlist(a:context, '\(\k\{' . g:acp_behaviorKeywordLength . ',}\)$') - if empty(matches) - return 0 - endif - for ignore in g:acp_behaviorKeywordIgnores - if stridx(ignore, matches[1]) == 0 - return 0 - endif - endfor - return 1 -endfunction - -" -function acp#meetsForFile(context) - if g:acp_behaviorFileLength < 0 - return 0 - endif - if has('win32') || has('win64') - let separator = '[/\\]' - else - let separator = '\/' - endif - if a:context !~ '\f' . separator . '\f\{' . g:acp_behaviorFileLength . ',}$' - return 0 - endif - return a:context !~ '[*/\\][/\\]\f*$\|[^[:print:]]\f*$' -endfunction - -" -function acp#meetsForRubyOmni(context) - if !has('ruby') - return 0 - endif - if g:acp_behaviorRubyOmniMethodLength >= 0 && - \ a:context =~ '[^. \t]\(\.\|::\)\k\{' . - \ g:acp_behaviorRubyOmniMethodLength . ',}$' - return 1 - endif - if g:acp_behaviorRubyOmniSymbolLength >= 0 && - \ a:context =~ '\(^\|[^:]\):\k\{' . - \ g:acp_behaviorRubyOmniSymbolLength . ',}$' - return 1 - endif - return 0 -endfunction - -" -function acp#meetsForPythonOmni(context) - return has('python') && g:acp_behaviorPythonOmniLength >= 0 && - \ a:context =~ '\k\.\k\{' . g:acp_behaviorPythonOmniLength . ',}$' -endfunction - -" -function acp#meetsForPerlOmni(context) - return g:acp_behaviorPerlOmniLength >= 0 && - \ a:context =~ '\w->\k\{' . g:acp_behaviorPerlOmniLength . ',}$' -endfunction - -" -function acp#meetsForXmlOmni(context) - return g:acp_behaviorXmlOmniLength >= 0 && - \ a:context =~ '\(<\|<\/\|<[^>]\+ \|<[^>]\+=\"\)\k\{' . - \ g:acp_behaviorXmlOmniLength . ',}$' -endfunction - -" -function acp#meetsForHtmlOmni(context) - return g:acp_behaviorHtmlOmniLength >= 0 && - \ a:context =~ '\(<\|<\/\|<[^>]\+ \|<[^>]\+=\"\)\k\{' . - \ g:acp_behaviorHtmlOmniLength . ',}$' -endfunction - -" -function acp#meetsForCssOmni(context) - if g:acp_behaviorCssOmniPropertyLength >= 0 && - \ a:context =~ '\(^\s\|[;{]\)\s*\k\{' . - \ g:acp_behaviorCssOmniPropertyLength . ',}$' - return 1 - endif - if g:acp_behaviorCssOmniValueLength >= 0 && - \ a:context =~ '[:@!]\s*\k\{' . - \ g:acp_behaviorCssOmniValueLength . ',}$' - return 1 - endif - return 0 -endfunction - -" -function acp#completeSnipmate(findstart, base) - if a:findstart - let s:posSnipmateCompletion = len(matchstr(s:getCurrentText(), '.*\U')) - return s:posSnipmateCompletion - endif - let lenBase = len(a:base) - let items = filter(GetSnipsInCurrentScope(), - \ 'strpart(v:key, 0, lenBase) ==? a:base') - return map(sort(items(items)), 's:makeSnipmateItem(v:val[0], v:val[1])') -endfunction - -" -function acp#onPopupCloseSnipmate() - let word = s:getCurrentText()[s:posSnipmateCompletion :] - for trigger in keys(GetSnipsInCurrentScope()) - if word ==# trigger - call feedkeys("\=TriggerSnippet()\", "n") - return 0 - endif - endfor - return 1 -endfunction - -" -function acp#onPopupPost() - " to clear = expression on command-line - echo '' - if pumvisible() - inoremap acp#onBs() - inoremap acp#onBs() - " a command to restore to original text and select the first match - return (s:behavsCurrent[s:iBehavs].command =~# "\" ? "\\" - \ : "\\") - endif - let s:iBehavs += 1 - if len(s:behavsCurrent) > s:iBehavs - call s:setCompletefunc() - return printf("\%s\=acp#onPopupPost()\", - \ s:behavsCurrent[s:iBehavs].command) - else - let s:lastUncompletable = { - \ 'word': s:getCurrentWord(), - \ 'commands': map(copy(s:behavsCurrent), 'v:val.command')[1:], - \ } - call s:finishPopup(0) - return "\" - endif -endfunction - -" -function acp#onBs() - " using "matchstr" and not "strpart" in order to handle multi-byte - " characters - if call(s:behavsCurrent[s:iBehavs].meets, - \ [matchstr(s:getCurrentText(), '.*\ze.')]) - return "\" - endif - return "\\" -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS: {{{1 - -" -function s:mapForMappingDriven() - call s:unmapForMappingDriven() - let s:keysMappingDriven = [ - \ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', - \ 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', - \ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', - \ 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', - \ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - \ '-', '_', '~', '^', '.', ',', ':', '!', '#', '=', '%', '$', '@', '<', '>', '/', '\', - \ '', '', '', ] - for key in s:keysMappingDriven - execute printf('inoremap %s %s=feedPopup()', - \ key, key) - endfor -endfunction - -" -function s:unmapForMappingDriven() - if !exists('s:keysMappingDriven') - return - endif - for key in s:keysMappingDriven - execute 'iunmap ' . key - endfor - let s:keysMappingDriven = [] -endfunction - -" -function s:setTempOption(group, name, value) - call extend(s:tempOptionSet[a:group], { a:name : eval('&' . a:name) }, 'keep') - execute printf('let &%s = a:value', a:name) -endfunction - -" -function s:restoreTempOptions(group) - for [name, value] in items(s:tempOptionSet[a:group]) - execute printf('let &%s = value', name) - endfor - let s:tempOptionSet[a:group] = {} -endfunction - -" -function s:getCurrentWord() - return matchstr(s:getCurrentText(), '\k*$') -endfunction - -" -function s:getCurrentText() - return strpart(getline('.'), 0, col('.') - 1) -endfunction - -" -function s:getPostText() - return strpart(getline('.'), col('.') - 1) -endfunction - -" -function s:isModifiedSinceLastCall() - if exists('s:posLast') - let posPrev = s:posLast - let nLinesPrev = s:nLinesLast - let textPrev = s:textLast - endif - let s:posLast = getpos('.') - let s:nLinesLast = line('$') - let s:textLast = getline('.') - if !exists('posPrev') - return 1 - elseif posPrev[1] != s:posLast[1] || nLinesPrev != s:nLinesLast - return (posPrev[1] - s:posLast[1] == nLinesPrev - s:nLinesLast) - elseif textPrev ==# s:textLast - return 0 - elseif posPrev[2] > s:posLast[2] - return 1 - elseif has('gui_running') && has('multi_byte') - " NOTE: auto-popup causes a strange behavior when IME/XIM is working - return posPrev[2] + 1 == s:posLast[2] - endif - return posPrev[2] != s:posLast[2] -endfunction - -" -function s:makeCurrentBehaviorSet() - let modified = s:isModifiedSinceLastCall() - if exists('s:behavsCurrent[s:iBehavs].repeat') && s:behavsCurrent[s:iBehavs].repeat - let behavs = [ s:behavsCurrent[s:iBehavs] ] - elseif exists('s:behavsCurrent[s:iBehavs]') - return [] - elseif modified - let behavs = copy(exists('g:acp_behavior[&filetype]') - \ ? g:acp_behavior[&filetype] - \ : g:acp_behavior['*']) - else - return [] - endif - let text = s:getCurrentText() - call filter(behavs, 'call(v:val.meets, [text])') - let s:iBehavs = 0 - if exists('s:lastUncompletable') && - \ stridx(s:getCurrentWord(), s:lastUncompletable.word) == 0 && - \ map(copy(behavs), 'v:val.command') ==# s:lastUncompletable.commands - let behavs = [] - else - unlet! s:lastUncompletable - endif - return behavs -endfunction - -" -function s:feedPopup() - " NOTE: CursorMovedI is not triggered while the popup menu is visible. And - " it will be triggered when popup menu is disappeared. - if s:lockCount > 0 || pumvisible() || &paste - return '' - endif - if exists('s:behavsCurrent[s:iBehavs].onPopupClose') - if !call(s:behavsCurrent[s:iBehavs].onPopupClose, []) - call s:finishPopup(1) - return '' - endif - endif - let s:behavsCurrent = s:makeCurrentBehaviorSet() - if empty(s:behavsCurrent) - call s:finishPopup(1) - return '' - endif - " In case of dividing words by symbols (e.g. "for(int", "ab==cd") while a - " popup menu is visible, another popup is not available unless input - " or try popup once. So first completion is duplicated. - call insert(s:behavsCurrent, s:behavsCurrent[s:iBehavs]) - call s:setTempOption(s:GROUP0, 'spell', 0) - call s:setTempOption(s:GROUP0, 'completeopt', 'menuone' . (g:acp_completeoptPreview ? ',preview' : '')) - call s:setTempOption(s:GROUP0, 'complete', g:acp_completeOption) - call s:setTempOption(s:GROUP0, 'ignorecase', g:acp_ignorecaseOption) - " NOTE: With CursorMovedI driven, Set 'lazyredraw' to avoid flickering. - " With Mapping driven, set 'nolazyredraw' to make a popup menu visible. - call s:setTempOption(s:GROUP0, 'lazyredraw', !g:acp_mappingDriven) - " NOTE: 'textwidth' must be restored after . - call s:setTempOption(s:GROUP1, 'textwidth', 0) - call s:setCompletefunc() - call feedkeys(s:behavsCurrent[s:iBehavs].command . "\=acp#onPopupPost()\", 'n') - return '' " this function is called by = -endfunction - -" -function s:finishPopup(fGroup1) - inoremap | iunmap - inoremap | iunmap - let s:behavsCurrent = [] - call s:restoreTempOptions(s:GROUP0) - if a:fGroup1 - call s:restoreTempOptions(s:GROUP1) - endif -endfunction - -" -function s:setCompletefunc() - if exists('s:behavsCurrent[s:iBehavs].completefunc') - call s:setTempOption(0, 'completefunc', s:behavsCurrent[s:iBehavs].completefunc) - endif -endfunction - -" -function s:makeSnipmateItem(key, snip) - if type(a:snip) == type([]) - let descriptions = map(copy(a:snip), 'v:val[0]') - let snipFormatted = '[MULTI] ' . join(descriptions, ', ') - else - let snipFormatted = substitute(a:snip, '\(\n\|\s\)\+', ' ', 'g') - endif - return { - \ 'word': a:key, - \ 'menu': strpart(snipFormatted, 0, 80), - \ } -endfunction - -" -function s:getMatchingSnipItems(base) - let key = a:base . "\n" - if !exists('s:snipItems[key]') - let s:snipItems[key] = items(GetSnipsInCurrentScope()) - call filter(s:snipItems[key], 'strpart(v:val[0], 0, len(a:base)) ==? a:base') - call map(s:snipItems[key], 's:makeSnipmateItem(v:val[0], v:val[1])') - endif - return s:snipItems[key] -endfunction - -" }}}1 -"============================================================================= -" INITIALIZATION {{{1 - -let s:GROUP0 = 0 -let s:GROUP1 = 1 -let s:lockCount = 0 -let s:behavsCurrent = [] -let s:iBehavs = 0 -let s:tempOptionSet = [{}, {}] -let s:snipItems = {} - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/vim_old/autoload/snipMate.vim b/vim_old/autoload/snipMate.vim deleted file mode 100644 index dcd28f6..0000000 --- a/vim_old/autoload/snipMate.vim +++ /dev/null @@ -1,433 +0,0 @@ -fun! Filename(...) - let filename = expand('%:t:r') - if filename == '' | return a:0 == 2 ? a:2 : '' | endif - return !a:0 || a:1 == '' ? filename : substitute(a:1, '$1', filename, 'g') -endf - -fun s:RemoveSnippet() - unl! g:snipPos s:curPos s:snipLen s:endCol s:endLine s:prevLen - \ s:lastBuf s:oldWord - if exists('s:update') - unl s:startCol s:origWordLen s:update - if exists('s:oldVars') | unl s:oldVars s:oldEndCol | endif - endif - aug! snipMateAutocmds -endf - -fun snipMate#expandSnip(snip, col) - let lnum = line('.') | let col = a:col - - let snippet = s:ProcessSnippet(a:snip) - " Avoid error if eval evaluates to nothing - if snippet == '' | return '' | endif - - " Expand snippet onto current position with the tab stops removed - let snipLines = split(substitute(snippet, '$\d\+\|${\d\+.\{-}}', '', 'g'), "\n", 1) - - let line = getline(lnum) - let afterCursor = strpart(line, col - 1) - " Keep text after the cursor - if afterCursor != "\t" && afterCursor != ' ' - let line = strpart(line, 0, col - 1) - let snipLines[-1] .= afterCursor - else - let afterCursor = '' - " For some reason the cursor needs to move one right after this - if line != '' && col == 1 && &ve != 'all' && &ve != 'onemore' - let col += 1 - endif - endif - - call setline(lnum, line.snipLines[0]) - - " Autoindent snippet according to previous indentation - let indent = matchend(line, '^.\{-}\ze\(\S\|$\)') + 1 - call append(lnum, map(snipLines[1:], "'".strpart(line, 0, indent - 1)."'.v:val")) - - " Open any folds snippet expands into - if &fen | sil! exe lnum.','.(lnum + len(snipLines) - 1).'foldopen' | endif - - let [g:snipPos, s:snipLen] = s:BuildTabStops(snippet, lnum, col - indent, indent) - - if s:snipLen - aug snipMateAutocmds - au CursorMovedI * call s:UpdateChangedSnip(0) - au InsertEnter * call s:UpdateChangedSnip(1) - aug END - let s:lastBuf = bufnr(0) " Only expand snippet while in current buffer - let s:curPos = 0 - let s:endCol = g:snipPos[s:curPos][1] - let s:endLine = g:snipPos[s:curPos][0] - - call cursor(g:snipPos[s:curPos][0], g:snipPos[s:curPos][1]) - let s:prevLen = [line('$'), col('$')] - if g:snipPos[s:curPos][2] != -1 | return s:SelectWord() | endif - else - unl g:snipPos s:snipLen - " Place cursor at end of snippet if no tab stop is given - let newlines = len(snipLines) - 1 - call cursor(lnum + newlines, indent + len(snipLines[-1]) - len(afterCursor) - \ + (newlines ? 0: col - 1)) - endif - return '' -endf - -" Prepare snippet to be processed by s:BuildTabStops -fun s:ProcessSnippet(snip) - let snippet = a:snip - " Evaluate eval (`...`) expressions. - " Using a loop here instead of a regex fixes a bug with nested "\=". - if stridx(snippet, '`') != -1 - while match(snippet, '`.\{-}`') != -1 - let snippet = substitute(snippet, '`.\{-}`', - \ substitute(eval(matchstr(snippet, '`\zs.\{-}\ze`')), - \ "\n\\%$", '', ''), '') - endw - let snippet = substitute(snippet, "\r", "\n", 'g') - endif - - " Place all text after a colon in a tab stop after the tab stop - " (e.g. "${#:foo}" becomes "${:foo}foo"). - " This helps tell the position of the tab stops later. - let snippet = substitute(snippet, '${\d\+:\(.\{-}\)}', '&\1', 'g') - - " Update the a:snip so that all the $# become the text after - " the colon in their associated ${#}. - " (e.g. "${1:foo}" turns all "$1"'s into "foo") - let i = 1 - while stridx(snippet, '${'.i) != -1 - let s = matchstr(snippet, '${'.i.':\zs.\{-}\ze}') - if s != '' - let snippet = substitute(snippet, '$'.i, s.'&', 'g') - endif - let i += 1 - endw - - if &et " Expand tabs to spaces if 'expandtab' is set. - return substitute(snippet, '\t', repeat(' ', &sts ? &sts : &sw), 'g') - endif - return snippet -endf - -" Counts occurences of haystack in needle -fun s:Count(haystack, needle) - let counter = 0 - let index = stridx(a:haystack, a:needle) - while index != -1 - let index = stridx(a:haystack, a:needle, index+1) - let counter += 1 - endw - return counter -endf - -" Builds a list of a list of each tab stop in the snippet containing: -" 1.) The tab stop's line number. -" 2.) The tab stop's column number -" (by getting the length of the string between the last "\n" and the -" tab stop). -" 3.) The length of the text after the colon for the current tab stop -" (e.g. "${1:foo}" would return 3). If there is no text, -1 is returned. -" 4.) If the "${#:}" construct is given, another list containing all -" the matches of "$#", to be replaced with the placeholder. This list is -" composed the same way as the parent; the first item is the line number, -" and the second is the column. -fun s:BuildTabStops(snip, lnum, col, indent) - let snipPos = [] - let i = 1 - let withoutVars = substitute(a:snip, '$\d\+', '', 'g') - while stridx(a:snip, '${'.i) != -1 - let beforeTabStop = matchstr(withoutVars, '^.*\ze${'.i.'\D') - let withoutOthers = substitute(withoutVars, '${\('.i.'\D\)\@!\d\+.\{-}}', '', 'g') - - let j = i - 1 - call add(snipPos, [0, 0, -1]) - let snipPos[j][0] = a:lnum + s:Count(beforeTabStop, "\n") - let snipPos[j][1] = a:indent + len(matchstr(withoutOthers, '.*\(\n\|^\)\zs.*\ze${'.i.'\D')) - if snipPos[j][0] == a:lnum | let snipPos[j][1] += a:col | endif - - " Get all $# matches in another list, if ${#:name} is given - if stridx(withoutVars, '${'.i.':') != -1 - let snipPos[j][2] = len(matchstr(withoutVars, '${'.i.':\zs.\{-}\ze}')) - let dots = repeat('.', snipPos[j][2]) - call add(snipPos[j], []) - let withoutOthers = substitute(a:snip, '${\d\+.\{-}}\|$'.i.'\@!\d\+', '', 'g') - while match(withoutOthers, '$'.i.'\(\D\|$\)') != -1 - let beforeMark = matchstr(withoutOthers, '^.\{-}\ze'.dots.'$'.i.'\(\D\|$\)') - call add(snipPos[j][3], [0, 0]) - let snipPos[j][3][-1][0] = a:lnum + s:Count(beforeMark, "\n") - let snipPos[j][3][-1][1] = a:indent + (snipPos[j][3][-1][0] > a:lnum - \ ? len(matchstr(beforeMark, '.*\n\zs.*')) - \ : a:col + len(beforeMark)) - let withoutOthers = substitute(withoutOthers, '$'.i.'\ze\(\D\|$\)', '', '') - endw - endif - let i += 1 - endw - return [snipPos, i - 1] -endf - -fun snipMate#jumpTabStop(backwards) - let leftPlaceholder = exists('s:origWordLen') - \ && s:origWordLen != g:snipPos[s:curPos][2] - if leftPlaceholder && exists('s:oldEndCol') - let startPlaceholder = s:oldEndCol + 1 - endif - - if exists('s:update') - call s:UpdatePlaceholderTabStops() - else - call s:UpdateTabStops() - endif - - " Don't reselect placeholder if it has been modified - if leftPlaceholder && g:snipPos[s:curPos][2] != -1 - if exists('startPlaceholder') - let g:snipPos[s:curPos][1] = startPlaceholder - else - let g:snipPos[s:curPos][1] = col('.') - let g:snipPos[s:curPos][2] = 0 - endif - endif - - let s:curPos += a:backwards ? -1 : 1 - " Loop over the snippet when going backwards from the beginning - if s:curPos < 0 | let s:curPos = s:snipLen - 1 | endif - - if s:curPos == s:snipLen - let sMode = s:endCol == g:snipPos[s:curPos-1][1]+g:snipPos[s:curPos-1][2] - call s:RemoveSnippet() - return sMode ? "\" : TriggerSnippet() - endif - - call cursor(g:snipPos[s:curPos][0], g:snipPos[s:curPos][1]) - - let s:endLine = g:snipPos[s:curPos][0] - let s:endCol = g:snipPos[s:curPos][1] - let s:prevLen = [line('$'), col('$')] - - return g:snipPos[s:curPos][2] == -1 ? '' : s:SelectWord() -endf - -fun s:UpdatePlaceholderTabStops() - let changeLen = s:origWordLen - g:snipPos[s:curPos][2] - unl s:startCol s:origWordLen s:update - if !exists('s:oldVars') | return | endif - " Update tab stops in snippet if text has been added via "$#" - " (e.g., in "${1:foo}bar$1${2}"). - if changeLen != 0 - let curLine = line('.') - - for pos in g:snipPos - if pos == g:snipPos[s:curPos] | continue | endif - let changed = pos[0] == curLine && pos[1] > s:oldEndCol - let changedVars = 0 - let endPlaceholder = pos[2] - 1 + pos[1] - " Subtract changeLen from each tab stop that was after any of - " the current tab stop's placeholders. - for [lnum, col] in s:oldVars - if lnum > pos[0] | break | endif - if pos[0] == lnum - if pos[1] > col || (pos[2] == -1 && pos[1] == col) - let changed += 1 - elseif col < endPlaceholder - let changedVars += 1 - endif - endif - endfor - let pos[1] -= changeLen * changed - let pos[2] -= changeLen * changedVars " Parse variables within placeholders - " e.g., "${1:foo} ${2:$1bar}" - - if pos[2] == -1 | continue | endif - " Do the same to any placeholders in the other tab stops. - for nPos in pos[3] - let changed = nPos[0] == curLine && nPos[1] > s:oldEndCol - for [lnum, col] in s:oldVars - if lnum > nPos[0] | break | endif - if nPos[0] == lnum && nPos[1] > col - let changed += 1 - endif - endfor - let nPos[1] -= changeLen * changed - endfor - endfor - endif - unl s:endCol s:oldVars s:oldEndCol -endf - -fun s:UpdateTabStops() - let changeLine = s:endLine - g:snipPos[s:curPos][0] - let changeCol = s:endCol - g:snipPos[s:curPos][1] - if exists('s:origWordLen') - let changeCol -= s:origWordLen - unl s:origWordLen - endif - let lnum = g:snipPos[s:curPos][0] - let col = g:snipPos[s:curPos][1] - " Update the line number of all proceeding tab stops if has - " been inserted. - if changeLine != 0 - let changeLine -= 1 - for pos in g:snipPos - if pos[0] >= lnum - if pos[0] == lnum | let pos[1] += changeCol | endif - let pos[0] += changeLine - endif - if pos[2] == -1 | continue | endif - for nPos in pos[3] - if nPos[0] >= lnum - if nPos[0] == lnum | let nPos[1] += changeCol | endif - let nPos[0] += changeLine - endif - endfor - endfor - elseif changeCol != 0 - " Update the column of all proceeding tab stops if text has - " been inserted/deleted in the current line. - for pos in g:snipPos - if pos[1] >= col && pos[0] == lnum - let pos[1] += changeCol - endif - if pos[2] == -1 | continue | endif - for nPos in pos[3] - if nPos[0] > lnum | break | endif - if nPos[0] == lnum && nPos[1] >= col - let nPos[1] += changeCol - endif - endfor - endfor - endif -endf - -fun s:SelectWord() - let s:origWordLen = g:snipPos[s:curPos][2] - let s:oldWord = strpart(getline('.'), g:snipPos[s:curPos][1] - 1, - \ s:origWordLen) - let s:prevLen[1] -= s:origWordLen - if !empty(g:snipPos[s:curPos][3]) - let s:update = 1 - let s:endCol = -1 - let s:startCol = g:snipPos[s:curPos][1] - 1 - endif - if !s:origWordLen | return '' | endif - let l = col('.') != 1 ? 'l' : '' - if &sel == 'exclusive' - return "\".l.'v'.s:origWordLen."l\" - endif - return s:origWordLen == 1 ? "\".l.'gh' - \ : "\".l.'v'.(s:origWordLen - 1)."l\" -endf - -" This updates the snippet as you type when text needs to be inserted -" into multiple places (e.g. in "${1:default text}foo$1bar$1", -" "default text" would be highlighted, and if the user types something, -" UpdateChangedSnip() would be called so that the text after "foo" & "bar" -" are updated accordingly) -" -" It also automatically quits the snippet if the cursor is moved out of it -" while in insert mode. -fun s:UpdateChangedSnip(entering) - if exists('g:snipPos') && bufnr(0) != s:lastBuf - call s:RemoveSnippet() - elseif exists('s:update') " If modifying a placeholder - if !exists('s:oldVars') && s:curPos + 1 < s:snipLen - " Save the old snippet & word length before it's updated - " s:startCol must be saved too, in case text is added - " before the snippet (e.g. in "foo$1${2}bar${1:foo}"). - let s:oldEndCol = s:startCol - let s:oldVars = deepcopy(g:snipPos[s:curPos][3]) - endif - let col = col('.') - 1 - - if s:endCol != -1 - let changeLen = col('$') - s:prevLen[1] - let s:endCol += changeLen - else " When being updated the first time, after leaving select mode - if a:entering | return | endif - let s:endCol = col - 1 - endif - - " If the cursor moves outside the snippet, quit it - if line('.') != g:snipPos[s:curPos][0] || col < s:startCol || - \ col - 1 > s:endCol - unl! s:startCol s:origWordLen s:oldVars s:update - return s:RemoveSnippet() - endif - - call s:UpdateVars() - let s:prevLen[1] = col('$') - elseif exists('g:snipPos') - if !a:entering && g:snipPos[s:curPos][2] != -1 - let g:snipPos[s:curPos][2] = -2 - endif - - let col = col('.') - let lnum = line('.') - let changeLine = line('$') - s:prevLen[0] - - if lnum == s:endLine - let s:endCol += col('$') - s:prevLen[1] - let s:prevLen = [line('$'), col('$')] - endif - if changeLine != 0 - let s:endLine += changeLine - let s:endCol = col - endif - - " Delete snippet if cursor moves out of it in insert mode - if (lnum == s:endLine && (col > s:endCol || col < g:snipPos[s:curPos][1])) - \ || lnum > s:endLine || lnum < g:snipPos[s:curPos][0] - call s:RemoveSnippet() - endif - endif -endf - -" This updates the variables in a snippet when a placeholder has been edited. -" (e.g., each "$1" in "${1:foo} $1bar $1bar") -fun s:UpdateVars() - let newWordLen = s:endCol - s:startCol + 1 - let newWord = strpart(getline('.'), s:startCol, newWordLen) - if newWord == s:oldWord || empty(g:snipPos[s:curPos][3]) - return - endif - - let changeLen = g:snipPos[s:curPos][2] - newWordLen - let curLine = line('.') - let startCol = col('.') - let oldStartSnip = s:startCol - let updateTabStops = changeLen != 0 - let i = 0 - - for [lnum, col] in g:snipPos[s:curPos][3] - if updateTabStops - let start = s:startCol - if lnum == curLine && col <= start - let s:startCol -= changeLen - let s:endCol -= changeLen - endif - for nPos in g:snipPos[s:curPos][3][(i):] - " This list is in ascending order, so quit if we've gone too far. - if nPos[0] > lnum | break | endif - if nPos[0] == lnum && nPos[1] > col - let nPos[1] -= changeLen - endif - endfor - if lnum == curLine && col > start - let col -= changeLen - let g:snipPos[s:curPos][3][i][1] = col - endif - let i += 1 - endif - - " "Very nomagic" is used here to allow special characters. - call setline(lnum, substitute(getline(lnum), '\%'.col.'c\V'. - \ escape(s:oldWord, '\'), escape(newWord, '\&'), '')) - endfor - if oldStartSnip != s:startCol - call cursor(0, startCol + s:startCol - oldStartSnip) - endif - - let s:oldWord = newWord - let g:snipPos[s:curPos][2] = newWordLen -endf -" vim:noet:sw=4:ts=4:ft=vim diff --git a/vim_old/c-support/codesnippets/Makefile b/vim_old/c-support/codesnippets/Makefile deleted file mode 100644 index 4b02b54..0000000 --- a/vim_old/c-support/codesnippets/Makefile +++ /dev/null @@ -1,204 +0,0 @@ -#=============================================================================== -# -# Filename: Makefile -# Description: -# -# Usage: make (generate executable ) -# make clean (remove objects, executable, prerequisits ) -# make tarball (generate compressed archive ) -# make zip (generate compressed archive ) -# -# Version: 1.0 -# Created: -# Revision: --- -# -# Author: -# Company: -# Email: -# -# Notes: This is a GNU make (gmake) makefile. -# C extension : c -# C++ extensions : cc cpp C -# C and C++ sources can be mixed. -# Prerequisites are generated automatically; makedepend is not -# needed (see documentation for GNU make Version 3.80, July 2002, -# section 4.13). The utility sed is used. -#========================================== makefile template version 1.8 ====== - -# DEBUG can be set to YES to include debugging info, or NO otherwise -DEBUG := YES - -# PROFILE can be set to YES to include profiling info, or NO otherwise -PROFILE := NO - -# ------------ name of the executable ---------------------------------------- -EXECUTABLE := main - -# ------------ list of all source files -------------------------------------- -SOURCES := main.c - -# ------------ compiler ------------------------------------------------------ -CC := gcc -CXX := g++ - -# ------------ compiler flags ------------------------------------------------ -DEBUG_CFLAGS := -Wall -ansi -pedantic -O0 -g -RELEASE_CFLAGS := -Wall -ansi -pedantic -O3 - -# ------------ linker flags -------------------------------------------------- -DEBUG_LDFLAGS := -g -RELEASE_LDFLAGS := - -ifeq (YES, ${DEBUG}) - CFLAGS := ${DEBUG_CFLAGS} - CXXFLAGS := ${DEBUG_CXXFLAGS} - LDFLAGS := ${DEBUG_LDFLAGS} -else - CFLAGS := ${RELEASE_CFLAGS} - CXXFLAGS := ${RELEASE_CXXFLAGS} - LDFLAGS := ${RELEASE_LDFLAGS} -endif - -ifeq (YES, ${PROFILE}) - CFLAGS := ${CFLAGS} -pg -O3 - CXXFLAGS := ${CXXFLAGS} -pg -O3 - LDFLAGS := ${LDFLAGS} -pg -endif - -# ------------ additional system include directories ------------------------- -GLOBAL_INC_DIR = - -# ------------ private include directories ----------------------------------- -LOCAL_INC_DIR = $(HOME)/include - -# ------------ system libraries (e.g. -lm ) --------------------------------- -SYS_LIBS = -lm - -# ------------ additional system library directories ------------------------- -GLOBAL_LIB_DIR = - -# ------------ additional system libraries ----------------------------------- -GLOBAL_LIBS = - -# ------------ private library directories ----------------------------------- -LOCAL_LIB_DIR = $(HOME)/lib - -# ------------ private libraries (e.g. libxyz.a ) --------------------------- -LOCAL_LIBS = - -# ------------ archive generation --------------------------------------------- -TARBALL_EXCLUDE = *.{o,gz,zip} -ZIP_EXCLUDE = *.{o,gz,zip} - -# ------------ run executable out of this Makefile (yes/no) ----------------- -# ------------ cmd line parameters for this executable ----------------------- -EXE_START = no -EXE_CMDLINE = - -#=============================================================================== -# The following statements usually need not to be changed -#=============================================================================== - -C_SOURCES = $(filter %.c, $(SOURCES)) -CPP_SOURCES = $(filter-out %.c, $(SOURCES)) -ALL_INC_DIR = $(addprefix -I, $(LOCAL_INC_DIR) $(GLOBAL_INC_DIR)) -ALL_LIB_DIR = $(addprefix -L, $(LOCAL_LIB_DIR) $(GLOBAL_LIB_DIR)) -GLOBAL_LIBSS = $(addprefix $(GLOBAL_LIB_DIR)/, $(GLOBAL_LIBS)) -LOCAL_LIBSS = $(addprefix $(LOCAL_LIB_DIR)/, $(LOCAL_LIBS)) -ALL_CFLAGS = $(CFLAGS) $(ALL_INC_DIR) -ALL_LFLAGS = $(LDFLAGS) $(ALL_LIB_DIR) -BASENAMES = $(basename $(SOURCES)) - -# ------------ generate the names of the object files ------------------------ -OBJECTS = $(addsuffix .o,$(BASENAMES)) - -# ------------ generate the names of the hidden prerequisite files ----------- -PREREQUISITES = $(addprefix .,$(addsuffix .d,$(BASENAMES))) - -# ------------ make the executable (the default goal) ------------------------ -$(EXECUTABLE): $(OBJECTS) -ifeq ($(strip $(CPP_SOURCES)),) - $(CC) $(ALL_LFLAGS) -o $(EXECUTABLE) $(OBJECTS) $(LOCAL_LIBSS) $(GLOBAL_LIBSS) $(SYS_LIBS) -else - $(CXX) $(ALL_LFLAGS) -o $(EXECUTABLE) $(OBJECTS) $(LOCAL_LIBSS) $(GLOBAL_LIBSS) $(SYS_LIBS) -endif -ifeq ($(EXE_START),yes) - ./$(EXECUTABLE) $(EXE_CMDLINE) -endif - -# ------------ include the automatically generated prerequisites ------------- -# ------------ if target is not clean, tarball or zip ------------- -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(MAKECMDGOALS),tarball) -ifneq ($(MAKECMDGOALS),zip) -include $(PREREQUISITES) -endif -endif -endif - -# ------------ make the objects ---------------------------------------------- -%.o: %.c - $(CC) -c $(ALL_CFLAGS) $< - -%.o: %.cc - $(CXX) -c $(ALL_CFLAGS) $< - -%.o: %.cpp - $(CXX) -c $(ALL_CFLAGS) $< - -%.o: %.C - $(CXX) -c $(ALL_CFLAGS) $< - -# ------------ make the prerequisites ---------------------------------------- -# -.%.d: %.c - @$(make-prerequisite-c) - -.%.d: %.cc - @$(make-prerequisite-cplusplus) - -.%.d: %.cpp - @$(make-prerequisite-cplusplus) - -.%.d: %.C - @$(make-prerequisite-cplusplus) - -# canned command sequences -# echoing of the sed command is suppressed by the leading @ - -define make-prerequisite-c - @$(CC) -MM $(ALL_CFLAGS) $< > $@.$$$$; \ - sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' < $@.$$$$ > $@; \ - rm -f $@.$$$$; -endef - -define make-prerequisite-cplusplus - @$(CXX) -MM $(ALL_CFLAGS) $< > $@.$$$$; \ - sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' < $@.$$$$ > $@; \ - rm -f $@.$$$$; -endef - -# ------------ remove generated files ---------------------------------------- -# ------------ remove hidden backup files ------------------------------------ -clean: - -rm --force $(EXECUTABLE) $(OBJECTS) $(PREREQUISITES) *~ - -# ------------ tarball generation ---------------------------------------------- -tarball: - @lokaldir=`pwd`; lokaldir=$${lokaldir##*/}; \ - rm --force $$lokaldir.tar.gz; \ - tar --exclude=$(TARBALL_EXCLUDE) \ - --create \ - --gzip \ - --verbose \ - --file $$lokaldir.tar.gz * - -# ------------ zip ------------------------------------------------------------- -zip: - @lokaldir=`pwd`; lokaldir=$${lokaldir##*/}; \ - zip -r $$lokaldir.zip * -x $(ZIP_EXCLUDE) - -.PHONY: clean tarball zip - -# ============================================================================== -# vim: set tabstop=2: set shiftwidth=2: diff --git a/vim_old/c-support/codesnippets/Makefile.multi-target.template b/vim_old/c-support/codesnippets/Makefile.multi-target.template deleted file mode 100644 index 75da8dd..0000000 --- a/vim_old/c-support/codesnippets/Makefile.multi-target.template +++ /dev/null @@ -1,70 +0,0 @@ -#=============================================================================== -# -# File: Makefile -# Description: -# -# Usage: make (generate executable(s) ) -# make clean (remove objects, executables, prerequisits ) -# make tarball (generate compressed archive ) -# make zip (generate compressed archive ) -# -# Author: Dr.-Ing. Fritz Mehner -# Email: mehner@mfh-iserlohn.de -# Created: -# -#=============================================================================== - - -CC = gcc -CCP = g++ -CFLAGS = -c -g -Wall -LFLAGS = -g -SYS_LIBS = -lm -TARBALL_EXCLUDE = "*.{o,gz,zip}" -ZIP_EXCLUDE = *.o *.gz *.zip - -TARGETS = target_1 target_2 - -#---------- targets -------------------------------------- -all: $(TARGETS) - -%.o: %.c - $(CC) $(CFLAGS) $*.c - -%.o: %.cc - $(CCP) $(CFLAGS) $*.cc - -#---------- target 1 ------------------------------------- -# C target -target_1: target_1.o - $(CC) $(LFLAGS) -o $@ $@.o $(SYS_LIBS) - -#---------- target 2 ------------------------------------- -# C++ target -target_2: target_2.o - $(CCP) $(LFLAGS) -o $@ $@.o $(SYS_LIBS) - - -#---------- target 3 ------------------------------------- - - - -#---------- tarball -------------------------------------- -tarball: - lokaldir=`pwd`; lokaldir=$${lokaldir##*/}; \ - rm --force $$lokaldir.tar.gz; \ - tar --exclude=$(TARBALL_EXCLUDE) \ - --create \ - --gzip \ - --verbose \ - --file $$lokaldir.tar.gz * - -#---------- zip ------------------------------------------ -zip: - lokaldir=`pwd`; lokaldir=$${lokaldir##*/}; \ - zip -r $$lokaldir.zip * -x $(ZIP_EXCLUDE) - -#---------- clear up ------------------------------------- -clean: - rm --force $(EXECUTABLE) $(OBJECTS) $(PREREQUISITES) - diff --git a/vim_old/c-support/codesnippets/calloc_double_matrix.c b/vim_old/c-support/codesnippets/calloc_double_matrix.c deleted file mode 100644 index ec71658..0000000 --- a/vim_old/c-support/codesnippets/calloc_double_matrix.c +++ /dev/null @@ -1,36 +0,0 @@ - -/* - * === FUNCTION ====================================================================== - * Name: calloc_double_matrix - * Description: Allocate a dynamic double-matrix of size rows*columns; - * return a pointer. - * ===================================================================================== - */ - double** -calloc_double_matrix ( int rows, int columns ) -{ - int i; - double **m; - m = calloc ( rows, sizeof(double*) ); /* allocate pointer array */ - assert( m != NULL); /* abort if allocation failed */ - *m = calloc ( rows*columns, sizeof(double) );/* allocate data array */ - assert(*m != NULL); /* abort if allocation failed */ - for ( i=1; i -#include -#include -#include -#include - -/* - * === FUNCTION ====================================================================== - * Name: main - * Description: main function - * ===================================================================================== - */ - int -main ( int argc, char *argv[] ) -{ - printf ("\nProgram %s\n\n", argv[0] ); - - return EXIT_SUCCESS; -} /* ---------- end of function main ---------- */ - diff --git a/vim_old/c-support/codesnippets/main.cc b/vim_old/c-support/codesnippets/main.cc deleted file mode 100644 index f3060ef..0000000 --- a/vim_old/c-support/codesnippets/main.cc +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include -#include -#include - -using namespace std; - -// === FUNCTION ====================================================================== -// Name: main -// Description: main function -// ===================================================================================== - int -main ( int argc, char *argv[] ) -{ - cout << "\nProgram " << argv[0] << endl << endl; - - return EXIT_SUCCESS; -} // ---------- end of function main ---------- - diff --git a/vim_old/c-support/codesnippets/print_array.cc.noindent b/vim_old/c-support/codesnippets/print_array.cc.noindent deleted file mode 100644 index 52c43d3..0000000 --- a/vim_old/c-support/codesnippets/print_array.cc.noindent +++ /dev/null @@ -1,29 +0,0 @@ - -// === FUNCTION ====================================================================== -// Name: print_array -// Description: Print an array with one dimension. -// Use -// print_array( *matrix, n1*n2, n2, "matrix" ); -// for -// T matrix[n1][n2]; -// ===================================================================================== - template -void print_array ( T *array, // array to print - int n, // number of elements to print - int nrow, // number of elements per row - string arrayname // array name - ) -{ - string line(" index | content\n ------+-"); - - cout << "\n\n array \"" << arrayname << "\", length " << n << endl << endl; - cout << line.append(width*nrow, '-'); - for ( int i=0; i improved (templates). -+ Minor improvements. - -================================================================================ - RELEASE NOTES FOR VERSION 5.5 -================================================================================ -+ Additional plugin-tags (jump targets in templates): <+text+>, <-text->. -+ Additional mapping Ctrl-j : jump to these new targets. -+ Template-file: additional macro |STYLE| and IF-ENDIF-construct to easily - choose between sets of templates. -+ Additional mapping: auto-complete classical C comment (also multi-line). -+ Additional mapping: auto-complete open block starting with { . -+ Visual mode for date and time insertion (menu 'Comments'). -+ Visual mode for tags (submenu 'Comments->tags (plugin)'). -+ Bugfix: hotkey \ica not working -+ Bugfix: hotkey Shift-F2 for the alternate-plugin disappeared. - -======================================================================================= - RELEASE NOTES FOR VERSION 5.4 -======================================================================================= -+ New hotkey \+co inserts ' cout << << endl;' -+ New menu item C++-menu: 'cout' replaces 'cout variable' and 'cout string'. -+ Hotkey \c/ removed ( \cc does the same). -+ Bugfix: after an unsuccessful compilation screen sometimes garbled. - -======================================================================================= - RELEASE NOTES FOR VERSION 5.3 -======================================================================================= -+ Insertions work properly when folding is used. -+ Menu items Idioms->for(...) : type declaration for loop variable possible (tab completion). -+ Specification of command line arguments (Run->cmd. line arg.): filename completion active. -+ New main menu item 'show manual' (hotkey \hm): read manual for word under cursor. -+ One hotkey renamed: \h -> \hp (help plugin) - -======================================================================================= - RELEASE NOTES FOR VERSION 5.2.1 -======================================================================================= -+ Bugfix: stray characters whith three dialogs -+ Bugfix: Missing parameter in 2 internal function calls -+ Menu items 'Snippets->edit local/global templates' start an file browser (convenience). - -======================================================================================= - RELEASE NOTES FOR VERSION 5.2 -======================================================================================= -+ Superfluous control characters for mode switching (menus, hotkeys) removed. Caused beeps. -+ Template files (local/global) can be opened from the snippet menu. -+ Three new preprocessor statements. -+ v-mode for RTTI-entries. - -======================================================================================= - RELEASE NOTES FOR VERSION 5.1 -======================================================================================= -+ Definition and implementation of classes have now different templates and menu entries. -+ Accessor methods (get/set) can be generated. -+ New templates: everything other than language keywords comes from a template - (and is user changeable). - -======================================================================================= - RELEASE NOTES FOR VERSION 5.0.5 -======================================================================================= -+ Bugfix: on a few systems doubling of path components in the run command (F9). - Skip this upgrade if you do not have this problem. - -======================================================================================= - RELEASE NOTES FOR VERSION 5.0.4 -======================================================================================= -+ Format for the macros |DATE|, |TIME|, and |YEAR| can be defined by the user. -+ Help text improved. - -======================================================================================= - RELEASE NOTES FOR VERSION 5.0.3 -======================================================================================= -+ Code snippets can now be used in the console mode (Vim without GUI). -+ Bugfix: Possible conflict with 'indent' removed when inserting templates. - -======================================================================================= - RELEASE NOTES FOR VERSION 5.0.2 -======================================================================================= -+ Bugfix: Prototype picker did not alway delete no longer used prototypes. -+ Bugfix: Prototype picker removed template specializations from parameter lists. - -======================================================================================= - RELEASE NOTES FOR VERSION 5.0.1 -======================================================================================= -+ Bugfix: autocmd setting can influence autocmd settings of OTHER plugins. - -======================================================================================= - RELEASE NOTES FOR VERSION 5.0 -======================================================================================= -+ Completely new template system. Now every menu item is user definable. -+ Changes to allow a system-wide installation. -+ A few hotkeys added and renamed. - -======================================================================================= - RELEASE NOTES FOR VERSION 4.6.1 -======================================================================================= -+ New global variable to control the filetype of *.h header files (default is now 'cpp'). -+ Bugfix: properly resetting 'compiler' after using make, splint, and CodeCheck. - -======================================================================================= - RELEASE NOTES FOR VERSION 4.6 -======================================================================================= -+ New insert mode mappings (comments, statements, preprocessing, idioms, C++). -+ Some mappings renamed (easier to remember). -+ New tag (basename of a file reduced to characters allowed in names). - -======================================================================================= - RELEASE NOTES FOR VERSION 4.5 -======================================================================================= -+ New menu item and hotkey for the (re)alignement of end-of-line comments. -+ Hotkey \cn removed. Only one menu item for end-of-line comments left. -+ Changed hotkeys: \ce -> \cl and \cl -> \cs . -+ Three new tags (giving the basename of a file) for writing template files. -+ Prototype picker handles template methods. -+ Bugfix: splint works now under Windows. -+ Minor improvements. - -======================================================================================= - RELEASE NOTES FOR VERSION 4.4 -======================================================================================= -+ Plugin directories rearranged. -+ main- and for-idiom have a visual mode now. -+ Four new commands (command line) to control the comment style. -+ Comment style (C/C++) can automatically follow the filetype. -+ Bugfix: empty new file after removing the header template can't be closed. -+ Bugfix : Tools entry missing when root menu not shown from the start. -+ Minor improvements. - -======================================================================================= - RELEASE NOTES FOR VERSION 4.3 -======================================================================================= -+ CodeCheck (TM) integrated (source code analysing tool). -+ New key mappings for preprocessor statements. -+ New preprocessor menu. -+ Bugfix: indent under Windows. -+ Minor improvements. - -======================================================================================= - RELEASE NOTES FOR VERSION 4.2.1 -======================================================================================= -+ Bugfix: change needed for some menu names after patch 7.0.054 . - -======================================================================================= - RELEASE NOTES FOR VERSION 4.2 -======================================================================================= -+ Setting the starting column for trailing comments improved. -+ Small bug in block uncommenting fixed. -+ Mac OS X : circumvent a Vim bug which caused a crash when loading plugin version 4.1. -+ File syntax/c.vim removed (but see help in csupport.txt). - -======================================================================================= - RELEASE NOTES FOR VERSION 4.1 -======================================================================================= -+ A complete switch statement can be made from a list of labels. -+ Additional cases can be made from a list of labels. -+ Small bug in line end commenting fixed. -+ Some minor improvements. - -======================================================================================= - RELEASE NOTES FOR VERSION 4.0 -======================================================================================= - -+ Kernighan & Ritchie style for block statements can be enabled. -+ Changes to make it compatible with Vim 7. -+ Set C/C++ file type for source files which should not be preprocessed (*.i, *.ii). -+ Some minor improvements. - -======================================================================================= - RELEASE NOTES FOR VERSION 3.11 -======================================================================================= - -+ Hotkeys and an accompanying reference card added. -+ Preparation for syntax based folding. -+ Some minor improvements. - -======================================================================================= - RELEASE NOTES FOR VERSION 3.10 -======================================================================================= - -+ Remove "#if 0 ... #endif" from the inside. -+ Change C comments to C++ comments and vice versa. -+ try..catch / catch / catch(...) now can be set surround a marked area. -+ Prototype picking improved (for C++). -+ A hardcopy shows the localized date and time in the header line. -+ New help menu entry in the main menu of this plugin (shows the plugin documentation). -+ Switch between corresponding source and header files with if the plugin a.vim - is present. -+ Plugin can be used with autocompletion for (, [, and { . - -======================================================================================= - RELEASE NOTES FOR VERSION 3.9.1 -======================================================================================= - -+ Doubling of file header for new c- and h-files under Windows fixed (Thanks to - Fabricio C A Oliveira). -+ Tiny bug in the file open idioms fixed. - -======================================================================================= - RELEASE NOTES FOR VERSION 3.9 -======================================================================================= - -+ Formatter 'indent' integrated. -+ Bugfix in the automatic header insertion. -+ Assert idiom added. -+ #if 0 ... #endif statement for blocking out code added. -+ Minor stylistic improvements in some idioms. - -======================================================================================= - RELEASE NOTES FOR VERSION 3.8.2 -======================================================================================= - -+ Screen update problem solved: color inversion under FC4 (Thanks to Bernie Barton). -+ RTTI menu : additional v-mode. -+ Statement menu and C++ menu rearranged. -+ Include guard : name generation improved. -+ File header templates will be included for additional file extensions (cp, cxx, c++, ...). - -======================================================================================= - RELEASE NOTES FOR VERSION 3.8.1 -======================================================================================= - -+ More C++ output manipulators, manipulator insertion more intuitive. -+ Output into buffer: cursor goes to top of file. -+ Makefile template improved (code snippet). -+ Some internal improvements. - -======================================================================================= - RELEASE NOTES FOR VERSION 3.8 -======================================================================================= - -+ Windows support. Most features are now available under Windows. - -======================================================================================= - RELEASE NOTES FOR VERSION 3.7.2 -======================================================================================= - -+ Run buffer through splint (A tool for statically checking C programs; see - http://www.splint.org). An error window will be opened; quickfix commands can be used. -+ Set buffer related command line arguments for splint. -+ Line end comments start in a fixed column (can be set from the menu). -+ Spaces in path names and file names are now possible. -+ Template files and snippet files are no longer kept in the list of alternate files. -+ Some minor improvements. - -======================================================================================= - RELEASE NOTES FOR VERSION 3.7.1 -======================================================================================= - -+ Bug fixed (command line arguments not passed to the executable). -+ File extension for executables can be set. -+ Minor improvements. - -======================================================================================= - RELEASE NOTES FOR VERSION 3.7 -======================================================================================= - -+ Running a program: - (1) Run program from the gVim command line. - (2) Run program and direct the output into a window with name "C-Output". - This buffer and its content will disappear when closing the window. - The buffer is reused when still open. - (3) Run program in an xterm (adjustable). -+ Command line arguments are now buffer related (each buffer can have its own arguments). -+ Code snippets can be protected from being indented during insertion. -+ Picked up prototypes will be deleted after insertion. -+ A code snippet with the file name extension "ni" or "noindent" will not be - indented on insertion. -+ for- and calloc-/malloc-idioms improved. -+ Bug fixed (word list handling). - - -======================================================================================= - RELEASE NOTES FOR VERSION 3.6 -======================================================================================= - -+ Installation simplified. -+ for-loop-idiom asks for control variable, initial value, ... -+ malloc-idiom asks for pointer variable and size. -+ Toggling the comment style works correct again. -+ Empty error windows will be closed. -+ Prototype picker removes trailing parts of the function body if marked. -+ The dialog windows (GUI) have been replaced by more flexible command line inputs. -+ The undocumented and unnecessary hot key F12 has been removed. -+ Extension to ctags + taglist shows makefile targets and qmake targets. - -======================================================================================= - RELEASE NOTES FOR VERSION 3.5 -======================================================================================= - -+ Aligned line end comments for consecutive lines. -+ Improved prototype picker removes comments. -+ Picked up prototypes can be shown. -+ Uncomment more than one block at once. -+ 3 new idioms. -+ Help file improved . - -======================================================================================= - RELEASE NOTES FOR VERSION 3.4 -======================================================================================= - -+ Two new global variables: C_Dictionary_File, C_MenuHeader . -+ The preprocessor statements #if... and the function idiom include marked - lines when invoked in visual mode. - -======================================================================================= - RELEASE NOTES FOR VERSION 3.3 -======================================================================================= - -+ The C/C++ root menu can be disabled. - -======================================================================================= - RELEASE NOTES FOR VERSION 3.2 -======================================================================================= - -+ Only one C/C++ entry in the gVim root menu. -+ All hotkeys are only defined for C/C++ files (file type plugin added). -+ The following constructs are now read as templates from files: - class, class using new, - template class, template class using new, - error class -+ Install script added. -+ Customization improved. -+ Documentation improved (help file added). -+ Bug fix (template file handling) - -======================================================================================= - RELEASE NOTES FOR VERSION 3.1 -======================================================================================= - -+ When the comment style "C" is active the menu entry "Comments.code->comment" - turns a marked region in one multiline C-comment. -+ The menu entry "Comments.comment->code" turns marked multiline C-comment - back into code. -+ A marked region can be surrounded by a for-, if, if-else, while-, do-while-statement - (with indentation). -+ The menu entry "Snippets.make prototype" makes a C- or C++-prototype from - the current line or marked region and puts it in an internal buffer. -+ The menu entry "Snippets.add prototype" also makes a C- or C++-prototype from - the current line or a marked region and adds it to the internal buffer. -+ The menu entry "Snippets.put prototype" inserts all gathered prototypes - below the current line. -+ Tag substitution rewritten (Some characters in a substitution text for a tag - prevented the tag from being substituted). - -======================================================================================= - RELEASE NOTES FOR VERSION 3.0 -======================================================================================= - -+ C-style comments AND C++-style comments are supported now. -+ The menu entry 'Comments->Comment style ..' switches the styles (toggle). -+ Block comments are now read as templates or skeletons from files: - Frame Block, Function Description, Method Description, - Class Description, H+file header, C/C++-file header -+ These templates can contain tags like |FILENAME|, |AUTHOR| etc. which are replaced - after reading (KDevelop templates can be used without any change). -+ indentation: multiline inserts and code snippets will be indented after insertion. -+ Most menu entries are now also active in normal mode. -+ new menu items: - includes for the C99 header, - includes for the standard C++ header, - includes for the C++ version of the Standard C Library header, - multiline C comment - vim modeline -+ Reading the templates is done in one function which can be called in an autocmd. -+ Code cleanup: register z no longer used. Most function calls are silent now. - - diff --git a/vim_old/c-support/doc/c-hotkeys.pdf b/vim_old/c-support/doc/c-hotkeys.pdf deleted file mode 100644 index baddbdc..0000000 Binary files a/vim_old/c-support/doc/c-hotkeys.pdf and /dev/null differ diff --git a/vim_old/c-support/doc/c-hotkeys.tex b/vim_old/c-support/doc/c-hotkeys.tex deleted file mode 100644 index 12e2ee9..0000000 --- a/vim_old/c-support/doc/c-hotkeys.tex +++ /dev/null @@ -1,366 +0,0 @@ -%%===================================================================================== -%% -%% File: c-hotkeys.tex -%% -%% Description: c-support.vim : Key mappings for Vim without GUI. -%% -%% -%% Author: Dr.-Ing. Fritz Mehner -%% Email: mehner@fh-swf.de -%% Copyright: Copyright (C) 2006-2010 Dr.-Ing. Fritz Mehner (mehner@fh-swf.de) -%% Version: 1.0 -%% Created: 10.11.2006 -%% Revision: $Id: c-hotkeys.tex,v 1.34 2010/05/14 19:13:40 mehner Exp $ -%% -%% Notes: -%% -%%===================================================================================== - -\documentclass[oneside,11pt,landscape,DIV16]{scrartcl} - -\usepackage[english]{babel} -\usepackage[utf8]{inputenc} -\usepackage[T1]{fontenc} -\usepackage{times} -\usepackage{lastpage} -\usepackage{multicol} -\usepackage{setspace} - -\setlength\parindent{0pt} - -\newcommand{\Pluginversion}{5.11} -\newcommand{\ReleaseDate}{ May 2010} - -%%---------------------------------------------------------------------- -%% luximono : Type1-font -%% Makes keyword stand out by using semibold letters. -%%---------------------------------------------------------------------- -\usepackage[scaled]{luximono} - -%%---------------------------------------------------------------------- -%% fancyhdr -%%---------------------------------------------------------------------- -\usepackage{fancyhdr} -\pagestyle{fancyplain} -\fancyfoot[L]{\small \ReleaseDate} -\fancyfoot[C]{c-support.vim} -\fancyfoot[R]{\small \textbf{Page \thepage{} / \pageref{LastPage}}} -\renewcommand{\headrulewidth}{0.0pt} - -%%---------------------------------------------------------------------- -%% hyperref -%%---------------------------------------------------------------------- -\usepackage[ps2pdf]{hyperref} -\hypersetup{pdfauthor={Dr.-Ing. Fritz Mehner, FH Südwestfalen, Iserlohn, Germany}} -\hypersetup{pdfkeywords={Vim, C/C++}} -\hypersetup{pdfsubject={Vim-plugin, c-support.vim, hot keys}} -\hypersetup{pdftitle={Vim-plugin, c-support.vim, hot keys}} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% START OF DOCUMENT -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\begin{document}% - -\begin{multicols}{3} -% -%%====================================================================== -%% title -%%====================================================================== -\begin{center} -\textbf{\textsc{\small{Vim-Plugin}}}\\ -\textbf{\LARGE{c-support.vim}}\\ -\textbf{\textsc{\small{Version \Pluginversion}}}\\ -\textbf{\textsc{\Huge{Hot keys}}}\\ -Key mappings for Vim with and without GUI.\\ -Plugin: http://vim.sourceforge.net\\ -\vspace{3.0mm} -{\normalsize (i)} insert mode, {\normalsize (n)} normal mode, {\normalsize (v)} visual mode\\ -\vspace{5.0mm} -% -%%====================================================================== -%% table, left part -%%====================================================================== -%%~~~~~ TABULAR : begin ~~~~~~~~~~ -\begin{tabular}[]{|p{10mm}|p{60mm}|} -% -\hline -\multicolumn{2}{|r|}{\textsl{\textbf{C}omments}} \\ -\hline \verb'\cl' & end-of-line comment \hfill (n,v,i)\\ -\hline \verb'\cj' & adjust end-of-line comment \hfill (n,v,i)\\ -\hline \verb'\cs' & set end-of-line comment column \hfill (n) \\ -\hline \verb'\c*' & code $\Rightarrow$ comment \verb'/* */' \hfill (n,v) \\ -\hline \verb'\cc' & code $\Rightarrow$ comment \verb'//' \hfill (n,v) \\ -\hline \verb'\co' & comment $\Rightarrow$ code \hfill (n,v) \\ - -\hline \verb'\cfr' & frame comment \hfill (n,i)\\ -\hline \verb'\cfu' & function comment \hfill (n,i)\\ -\hline \verb'\cme' & method description \hfill (n,i)\\ -\hline \verb'\ccl' & class description \hfill (n,i)\\ -\hline \verb'\cfdi'& file description (implementation) \hfill (n,i)\\ -\hline \verb'\cfdh'& file description (header) \hfill (n,i)\\ - -\hline \verb'\ccs'& C/C++--file sections\hspace{3mm}\footnotesize{(tab compl.)} \hfill \normalsize{(n,i)}\\ -\hline \verb'\chs'& H--file sections\hspace{10mm}\footnotesize{(tab compl.)} \hfill \normalsize{(n,i)}\\ -\hline \verb'\ckc'& keyword comment\hspace{5mm}\footnotesize{(tab compl.)} \hfill \normalsize{(n,i)}\\ -\hline \verb'\csc'& special comment\hspace{7,5mm}\footnotesize{(tab compl.)} \hfill \normalsize{(n,i)}\\ - -\hline \verb'\cd' & date \hfill (n,v,i)\\ -\hline \verb'\ct' & date \& time \hfill (n,v,i)\\ -\hline -\end{tabular}\\ -%%~~~~~ TABULAR : end ~~~~~~~~~~ -% -%%====================================================================== -%% table, middle part -%%====================================================================== -% -%%~~~~~ TABULAR : begin ~~~~~~~~~~ -\begin{tabular}[]{|p{15mm}|p{55mm}|} -%%---------------------------------------------------------------------- -%% menu statements -%%---------------------------------------------------------------------- -\hline -\multicolumn{2}{|r|}{\textsl{\textbf{S}tatements}} \\ -\hline \verb'\sd' & \verb'do { } while' \hfill (n,v,i)\\ -\hline \verb'\sf' & \verb'for' \hfill (n,i)\\ -\hline \verb'\sfo' & \verb'for { }' \hfill (n,v,i)\\ -\hline \verb'\si' & \verb'if' \hfill (n,i)\\ -\hline \verb'\sif' & \verb'if { }' \hfill (n,v,i)\\ -\hline \verb'\sie' & \verb'if else' \hfill (n,v,i)\\ -\hline \verb'\sife'& \verb'if { } else { }' \hfill (n,v,i)\\ -\hline \verb'\se' & \verb'else { }' \hfill (n,v,i)\\ -\hline \verb'\sw' & \verb'while' \hfill (n,i)\\ -\hline \verb'\swh' & \verb'while { }' \hfill (n,v,i)\\ -\hline \verb'\ss' & \verb'switch' \hfill (n,v,i)\\ -\hline \verb'\sc' & \verb'case' \hfill (n,i)\\ -\hline \verb'\s{ \sb' & \verb'{ }' \hfill (n,v,i)\\ -\hline -%%---------------------------------------------------------------------- -%% preprocessor menu -%%---------------------------------------------------------------------- -\hline -\multicolumn{2}{|r|}{\textsl{\textbf{P}reprocessor}} \\ -\hline \verb'\ps' & choose a Std. Lib. include \hfill (n,i)\\ -\hline \verb'\pc' & choose a C99 include \hfill (n,i)\\ -\hline \verb'\p<' & \verb$#include<...>$ \hfill (n,i)\\ -\hline \verb'\p"' & \verb$#include"..."$ \hfill (n,i)\\ -\hline \verb'\pd' & \verb'#define' \hfill (n,i)\\ -\hline \verb'\pu' & \verb'#undef' \hfill (n,i)\\ -\hline \verb'\pie' & \verb'#if #else #endif' \hfill (n,v,i)\\ -\hline \verb'\pid' & \verb'#ifdef #else #endif' \hfill (n,v,i)\\ -\hline \verb'\pin' & \verb'#ifndef #else #endif' \hfill (n,v,i)\\ -\hline \verb'\pind' & \verb'#ifndef #def #endif' \hfill (n,v,i)\\ -\hline \verb'\pi0' & \verb'#if 0 #endif' \hfill (n,v,i)\\ -\hline \verb'\pr0' & remove \verb'#if 0 #endif' \hfill (n,i)\\ -\hline \verb'\pe' & \verb'#error ' \hfill (n,i)\\ -\hline \verb'\pl' & \verb'#line ' \hfill (n,i)\\ -\hline \verb'\pp' & \verb'#pragma' \hfill (n,i)\\ -\hline -\end{tabular} \\ -%%~~~~~ TABULAR : end ~~~~~~~~~~ - -%%====================================================================== -%% table, right part -%%====================================================================== -% -%%~~~~~ TABULAR : begin ~~~~~~~~~~ -\begin{tabular}[]{|p{11mm}|p{60mm}|} -%%---------------------------------------------------------------------- -%% snippet menu -%%---------------------------------------------------------------------- -\hline -\multicolumn{2}{|r|}{\textsl{S\textbf{n}ippet}} \\ -\hline \verb'\nr' & read code snippet \hfill (n,i)\\ -\hline \verb'\nw' & write code snippet \hfill (n,v,i)\\ -\hline \verb'\ne' & edit code snippet \hfill (n,i)\\ -\hline \verb'\np' & pick up prototype \hfill (n,v,i)\\ -\hline \verb'\ni' & insert prototype(s) \hfill (n,i)\\ -\hline \verb'\nc' & clear prototype(s) \hfill (n,i)\\ -\hline \verb'\ns' & show prototype(s) \hfill (n,i)\\ -% -\hline \verb'\ntl' & edit local templates \hfill (n,i)\\ -\hline \verb'\ntg' & edit global templates \hfill (n,i)\\ -\hline \verb'\ntr' & reread the templates \hfill (n,i)\\ -\hline \verb'\nts' & change templates style \hfill (n,i)\\ -\hline -%%---------------------------------------------------------------------- -%% idioms menu -%%---------------------------------------------------------------------- -\hline -\multicolumn{2}{|r|}{\textsl{\textbf{I}dioms}} \\ -\hline \verb'\if' & function \hfill (n,v,i)\\ -\hline \verb'\isf' & static function \hfill (n,v,i)\\ -\hline \verb'\im' & \verb'main()' \hfill (n,v,i)\\ -\hline \verb'\i0' & \verb'for( x=0; x=0; x-=1 )' \hfill (n,v,i)\\ -\hline \verb'\ie' & \verb'enum' + \verb'typedef' \hfill (n,v,i)\\ -\hline \verb'\is' & \verb'struct' + \verb'typedef' \hfill (n,v,i)\\ -\hline \verb'\iu' & \verb'union' + \verb'typedef' \hfill (n,v,i)\\ -\hline \verb'\ip' & \verb'printf()' \hfill (n,i)\\ -\hline \verb'\isc' & \verb'scanf()' \hfill (n,i)\\ -\hline \verb'\ica' & \verb'p=calloc()' \hfill (n,i)\\ -\hline \verb'\ima' & \verb'p=malloc()' \hfill (n,i)\\ -\hline \verb'\isi' & \verb'sizeof()' \hfill (n,v,i)\\ -\hline \verb'\ias' & \verb'assert()' \hfill (n,v,i)\\ -\hline \verb'\ii' & open input file \hfill (n,v,i)\\ -\hline \verb'\io' & open output file \hfill (n,v,i)\\ -\hline -\end{tabular}\\ -% -%%====================================================================== -%% table, right part -%%====================================================================== -% -%%~~~~~ TABULAR : begin ~~~~~~~~~~ -\begin{tabular}[]{|p{12mm}|p{62mm}|} -%%---------------------------------------------------------------------- -%% C++ menu -%%---------------------------------------------------------------------- -\hline -\multicolumn{2}{|r|}{\textsl{C\textbf{+}+}} \\ -\hline \verb'\+co' & \verb'cout << << endl; ' \hfill (n,i)\\ -\hline \verb'\+c' & class \hfill (n,i)\\ -\hline \verb'\+ps' & \verb$#include<...> STL$ \hfill (n,i)\\ -\hline \verb'\+pc' & \verb$#include C$ \hfill (n,i)\\ -\hline \verb'\+cn' & class (using \verb'new') \hfill (n,i)\\ -\hline \verb'\+ci' & class implementation \hfill (n,i)\\ -\hline \verb'\+cni' & class (using \verb'new') implementation \hfill (n,i)\\ -\hline \verb'\+mi' & method implementation \hfill (n,i)\\ -\hline \verb'\+ai' & accessor implementation \hfill (n,i)\\ -\hline \verb'\+tc' & template class \hfill (n,i)\\ -\hline \verb'\+tcn' & template class (using \verb'new') \hfill (n,i)\\ -\hline \verb'\+tci' & template class implementation \hfill (n,i)\\ -\hline \verb'\+tcni'& template class (using \verb'new') impl. \hfill (n,i)\\ -\hline \verb'\+tmi' & template method implementation \hfill (n,i)\\ -\hline \verb'\+tai' & template accessor implementation \hfill (n,i)\\ -\hline \verb'\+tf' & template function \hfill (n,i)\\ -\hline \verb'\+ec' & error class \hfill (n,i)\\ -\hline \verb'\+tr' & \verb'try' \dots \verb'catch' \hfill (n,v,i)\\ -\hline \verb'\+ca' & \verb'catch' \hfill (n,v,i)\\ -\hline \verb'\+c.' & \verb'catch(...)' \hfill (n,v,i)\\ -\hline -%%---------------------------------------------------------------------- -%% run menu -%%---------------------------------------------------------------------- -\hline -\multicolumn{2}{|r|}{\textsl{\textbf{R}un}} \\ -\hline \verb'\rc' & save and compile \hfill (n,i)\\ -\hline \verb'\rl' & link \hfill (n,i)\\ -\hline \verb'\rr' & run \hfill (n,i)\\ -\hline \verb'\ra' & set comand line arguments \hfill (n,i)\\ -\hline \verb'\rm' & run \texttt{make} \hfill (n,i)\\ -\hline \verb'\rma' & cmd.\ line arg.\ for \texttt{make} \hfill (n,i)\\ -% -\hline \verb'\rp' & run \texttt{splint}$^1$ \hfill (n,i)\\ -\hline \verb'\rpa' & cmd.\ line arg.\ for \texttt{splint} \hfill (n,i)\\ -% -\hline \verb'\rk' & run \texttt{CodeCheck}$^2$ \hfill (n,i)\\ -\hline \verb'\rka' & cmd.\ line arg.\ for \texttt{CodeCheck} \hfill (n,i)\\ -% -\hline \verb'\rd' & run \texttt{indent} \hfill (n,i)\\ -\hline \verb'\rh' & hardcopy buffer \hfill (n,i,v)\\ -\hline \verb'\rs' & show plugin settings \hfill (n,i)\\ -\hline \verb'\rx' & set xterm size \hfill (n,i, only Unix \& GUI)\\ -\hline \verb'\ro' & change output destination \hfill (n,i)\\ -\hline -\end{tabular} -% -%%---------------------------------------------------------------------- -%% load / unload menu entry -%%---------------------------------------------------------------------- -\begin{tabular}[]{|p{12mm}|p{52mm}|} -\hline -%\multicolumn{2}{|r|}{\textsl{Menu(s)}}\\ -%%---------------------------------------------------------------------- -%% show plugin help -%%---------------------------------------------------------------------- -%\hline -\multicolumn{2}{|r|}{\textsl{\textbf{H}elp and Menus}}\\ -\hline \verb'\hm' & show manual \hfill (n,i)\\ -\hline \verb'\hp' & help (c-support) \hfill (n,i)\\ -\hline \verb'\lcs' & load Menus\hfill \scriptsize{(n \& GUI only)}\\ -\hline \verb'\ucs' & unload Menus\hfill \scriptsize{(n \& GUI only)}\\ -\hline -\end{tabular} -%%~~~~~ TABULAR : end ~~~~~~~~~~ -% -% -\begin{minipage}[b]{66mm}% -\vspace{10mm} -% -\begin{flushleft} -% -\textit{Ex commands:} -\begin{description} -% -\item [CFileSection] -C/C++--file sections (same as \verb'\ccs') -% -\item [HFileSection] -H--file sections (same as \verb'\chs') -% -\item [KeywordComment] -keyword comment (same as \verb'\ckc') -% -\item [SpecialComment] -special comment (same as \verb'\csc') -% -\item [IncludeStdLibrary] -standard library includes (same as \verb'\ps') -% -\item [IncludeC99Library] -C99 includes (same as \verb'\pc') -% -\item [IncludeCppLibrary] -STL includes (same as \verb'\+ps') -% -\item [IncludeCppCLibrary] -C includes (same as \verb'\+pc') -% -\item [CStyle] -C99 include (same as \verb'\nts') -% -\end{description} -% -Use tab expansion to show the items to choose from. -% -\end{flushleft} -% -\end{minipage}\\ -% -\begin{minipage}[b]{64mm}% -\scriptsize{% -\vspace{10mm} -\hrulefill\\ -$^1$ {www.splint.org}\\ -$^2$ \textbf{CodeCheck}$^{TM}$ is a product of Abraxas Software, Inc. -}% -\end{minipage}\\ -% -\begin{minipage}[b]{64mm}% - -\setlength{\fboxsep}{.25mm} -%%---------------------------------------------------------------------- -%% Additional Mappings -%%---------------------------------------------------------------------- -\begin{spacing}{1.2} -\begin{tabular}[]{|p{12mm}|p{56mm}|} -\hline -\multicolumn{2}{|r|}{\textsl{Additional Mappings}}\\ -\hline -\hline \textbf{typing} & \textbf{expansion}\\ -\hline \verb'/*' & \verb'/* */' \hfill (i)\\ -\hline \verb'/*' & \verb'/* '\fbox{\small{(multiline) marked text}}\verb' */' \hfill (v)\\ -\hline \verb'/*' & \verb'/*'\hfill (i)\newline\verb' * |'\newline\verb' */'\\ -\hline \verb'{' & \verb'{'\hfill (i)\newline\verb' |'\newline\verb'}' \\ -\hline \verb'{' & \verb'{'\hfill (v)\newline\verb' '\fbox{\small{(multiline) marked text}}\newline\verb'}'\\ -\hline -\end{tabular} -\end{spacing} -%%~~~~~ TABULAR : end ~~~~~~~~~~ -% -\end{minipage}% -% -\end{center} -\end{multicols} -\end{document} diff --git a/vim_old/c-support/rc/customization.ctags b/vim_old/c-support/rc/customization.ctags deleted file mode 100644 index 323cbbc..0000000 --- a/vim_old/c-support/rc/customization.ctags +++ /dev/null @@ -1,8 +0,0 @@ - ---regex-make=/^([^:# \t]+)[ \t]*:($|[^=]+)/\1/t,targets/ ---regex-make=/^include[ \t]+(.+)/\1/i,includes/ - ---langdef=qmake ---langmap=qmake:+.pro ---regex-qmake=/^([[:upper:]_]+)/\1/t,SystemVariables/ - diff --git a/vim_old/c-support/rc/customization.gvimrc b/vim_old/c-support/rc/customization.gvimrc deleted file mode 100644 index 31befe7..0000000 --- a/vim_old/c-support/rc/customization.gvimrc +++ /dev/null @@ -1,57 +0,0 @@ -"=================================================================================== -" FILE: .gvimrc -" DESCRIPTION: suggestion for a personal configuration file ~/.gvimrc -" AUTHOR: Dr.-Ing. Fritz Mehner -" VERSION: 1.0 -" CREATED: 04.04.2009 -" REVISION: $Id: customization.gvimrc,v 1.3 2009/04/04 08:26:21 mehner Exp $ -"=================================================================================== -" -"=================================================================================== -" GENERAL SETTINGS -"=================================================================================== -set cmdheight=2 " Make command line two lines high -set mousehide " Hide the mouse when typing text - -highlight Normal guibg=grey90 -highlight Cursor guibg=Blue guifg=NONE -highlight lCursor guibg=Cyan guifg=NONE -highlight NonText guibg=grey80 -highlight Constant gui=NONE guibg=grey95 -highlight Special gui=NONE guibg=grey95 -" -let c_comment_strings=1 " highlight strings inside C comments -" -"------------------------------------------------------------------------------- -" Moving cursor to other windows -" -" shift down : change window focus to lower one (cyclic) -" shift up : change window focus to upper one (cyclic) -" shift left : change window focus to one on left -" shift right : change window focus to one on right -"------------------------------------------------------------------------------- -nmap w -nmap W -nmap h -nmap l -" -"------------------------------------------------------------------------------- -" some additional hot keys -"------------------------------------------------------------------------------- -" S-F3 - call gvim file browser -"------------------------------------------------------------------------------- - map :silent browse confirm e -imap :silent browse confirm e -" -"------------------------------------------------------------------------------- -" toggle insert mode <--> 'normal mode with the -key -"------------------------------------------------------------------------------- -" -nmap -imap -" -"------------------------------------------------------------------------------- -" use font with clearly distinguishable brackets : ()[]{} -"------------------------------------------------------------------------------- -"set guifont=Luxi\ Mono\ 14 -" diff --git a/vim_old/c-support/rc/customization.indent.pro b/vim_old/c-support/rc/customization.indent.pro deleted file mode 100644 index 95f6081..0000000 --- a/vim_old/c-support/rc/customization.indent.pro +++ /dev/null @@ -1,8 +0,0 @@ ---blank-lines-after-procedures ---brace-indent0 ---comment-indentation49 ---declaration-comment-column49 ---declaration-indentation10 ---space-after-parentheses ---swallow-optional-blank-lines ---tab-size2 diff --git a/vim_old/c-support/rc/customization.vimrc b/vim_old/c-support/rc/customization.vimrc deleted file mode 100644 index 917018a..0000000 --- a/vim_old/c-support/rc/customization.vimrc +++ /dev/null @@ -1,222 +0,0 @@ -"=================================================================================== -" FILE: .vimrc -" DESCRIPTION: suggestion for a personal configuration file ~/.vimrc -" AUTHOR: Dr.-Ing. Fritz Mehner -" CREATED: 04.04.2009 -" REVISION: $Id: customization.vimrc,v 1.6 2009/10/03 12:24:30 mehner Exp $ -"=================================================================================== -" -"=================================================================================== -" GENERAL SETTINGS -"=================================================================================== - -"------------------------------------------------------------------------------- -" Use Vim settings, rather then Vi settings. -" This must be first, because it changes other options as a side effect. -"------------------------------------------------------------------------------- -set nocompatible -" -"------------------------------------------------------------------------------- -" Enable file type detection. Use the default filetype settings. -" Also load indent files, to automatically do language-dependent indenting. -"------------------------------------------------------------------------------- -filetype plugin on -filetype indent on -" -"------------------------------------------------------------------------------- -" Switch syntax highlighting on. -"------------------------------------------------------------------------------- -syntax on -" -" Platform specific items: -" - central backup directory (has to be created) -" - default dictionary -" Uncomment your choice. -if has("win16") || has("win32") || has("win64") || - \ has("win95") || has("win32unix") - " -" runtime mswin.vim -" set backupdir =$VIM\vimfiles\backupdir -" set dictionary=$VIM\vimfiles\wordlists/german.list -else -" set backupdir =$HOME/.vim.backupdir -" set dictionary=$HOME/.vim/wordlists/german.list -endif -" -" Using a backupdir under UNIX/Linux: you may want to include a line similar to -" find $HOME/.vim.backupdir -name "*" -type f -mtime +60 -exec rm -f {} \; -" in one of your shell startup files (e.g. $HOME/.profile) -" -"------------------------------------------------------------------------------- -" Various settings -"------------------------------------------------------------------------------- -set autoindent " copy indent from current line -set autoread " read open files again when changed outside Vim -set autowrite " write a modified buffer on each :next , ... -set backspace=indent,eol,start " backspacing over everything in insert mode -set backup " keep a backup file -set browsedir=current " which directory to use for the file browser -set complete+=k " scan the files given with the 'dictionary' option -set history=50 " keep 50 lines of command line history -set hlsearch " highlight the last used search pattern -set incsearch " do incremental searching -set listchars=tab:>.,eol:\$ " strings to use in 'list' mode -set mouse=a " enable the use of the mouse -set nowrap " do not wrap lines -set popt=left:8pc,right:3pc " print options -set ruler " show the cursor position all the time -set shiftwidth=2 " number of spaces to use for each step of indent -set showcmd " display incomplete commands -set smartindent " smart autoindenting when starting a new line -set tabstop=2 " number of spaces that a counts for -set visualbell " visual bell instead of beeping -set wildignore=*.bak,*.o,*.e,*~ " wildmenu: ignore these extensions -set wildmenu " command-line completion in an enhanced mode -" -"=================================================================================== -" BUFFERS, WINDOWS -"=================================================================================== -" -"------------------------------------------------------------------------------- -" The current directory is the directory of the file in the current window. -"------------------------------------------------------------------------------- -if has("autocmd") - autocmd BufEnter * :lchdir %:p:h -endif -" -"------------------------------------------------------------------------------- -" close window (conflicts with the KDE setting for calling the process manager) -"------------------------------------------------------------------------------- - noremap :close -inoremap :close -" -"------------------------------------------------------------------------------- -" Fast switching between buffers -" The current buffer will be saved before switching to the next one. -" Choose :bprevious or :bnext -"------------------------------------------------------------------------------- - noremap :if &modifiable && !&readonly && - \ &modified :write :endif:bprevious -inoremap :if &modifiable && !&readonly && - \ &modified :write :endif:bprevious -" -"------------------------------------------------------------------------------- -" Leave the editor with Ctrl-q (KDE): Write all changed buffers and exit Vim -"------------------------------------------------------------------------------- -nnoremap :wqall -" -"------------------------------------------------------------------------------- -" When editing a file, always jump to the last known cursor position. -" Don't do it when the position is invalid or when inside an event handler -" (happens when dropping a file on gvim). -"------------------------------------------------------------------------------- -if has("autocmd") - autocmd BufReadPost * - \ if line("'\"") > 0 && line("'\"") <= line("$") | - \ exe "normal! g`\"" | - \ endif -endif " has("autocmd") -" -"------------------------------------------------------------------------------- -" some additional hot keys -"------------------------------------------------------------------------------- -" F2 - write file without confirmation -" F3 - call file explorer Ex -" F4 - show tag under curser in the preview window (tagfile must exist!) -" F5 - open quickfix error window -" F6 - close quickfix error window -" F7 - display previous error -" F8 - display next error -"------------------------------------------------------------------------------- -" -map :write -map :Explore -nmap :exe ":ptag ".expand("") -map :copen -map :cclose -map :cp -map :cn -" -imap :write -imap :Explore -imap :exe ":ptag ".expand("") -imap :copen -imap :cclose -imap :cp -imap :cn -" -"------------------------------------------------------------------------------- -" Fast switching between buffers -" The current buffer will be saved before switching to the next one. -" Choose :bprevious or :bnext -"------------------------------------------------------------------------------- -" - map :if &modifiable && !&readonly && - \ &modified :write :endif:bprevious -imap :if &modifiable && !&readonly && - \ &modified :write :endif:bprevious -" -"------------------------------------------------------------------------------- -" Leave the editor with Ctrl-q : Write all changed buffers and exit Vim -"------------------------------------------------------------------------------- -nmap :wqa -" -"------------------------------------------------------------------------------- -" comma always followed by a space -"------------------------------------------------------------------------------- -inoremap , , -" -"------------------------------------------------------------------------------- -" autocomplete parenthesis, brackets and braces -"------------------------------------------------------------------------------- -inoremap ( () -inoremap [ [] -inoremap { {} -" -vnoremap ( s()P% -vnoremap [ s[]P% -vnoremap { s{}P% -" -"------------------------------------------------------------------------------- -" autocomplete quotes (visual and select mode) -"------------------------------------------------------------------------------- -xnoremap ' s''P -xnoremap " s""P -xnoremap ` s``P -" -"------------------------------------------------------------------------------- -" Change the working directory to the directory containing the current file -"------------------------------------------------------------------------------- -if has("autocmd") - autocmd BufEnter * :lchdir %:p:h -endif " has("autocmd") -" -"=================================================================================== -" VARIOUS PLUGIN CONFIGURATIONS -"=================================================================================== -" -"------------------------------------------------------------------------------- -" c.vim -"------------------------------------------------------------------------------- -" -" --empty -- -" -"------------------------------------------------------------------------------- -" taglist.vim : toggle the taglist window -" taglist.vim : define the title texts for make -" taglist.vim : define the title texts for qmake -"------------------------------------------------------------------------------- - noremap :Tlist -inoremap :Tlist - -let Tlist_GainFocus_On_ToggleOpen = 1 -let Tlist_Close_On_Select = 1 - -let tlist_make_settings = 'make;m:makros;t:targets' -let tlist_qmake_settings = 'qmake;t:SystemVariables' - -if has("autocmd") - " ---------- qmake : set filetype for *.pro ---------- - autocmd BufNewFile,BufRead *.pro set filetype=qmake -endif " has("autocmd") - diff --git a/vim_old/c-support/scripts/wrapper.sh b/vim_old/c-support/scripts/wrapper.sh deleted file mode 100755 index f78861c..0000000 --- a/vim_old/c-support/scripts/wrapper.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -#=============================================================================== -# FILE: wrapper.sh -# USAGE: ./wrapper.sh executable [cmd-line-args] -# DESCRIPTION: Wraps the execution of a programm or script. -# Use with xterm: xterm -e wrapper.sh executable cmd-line-args -# This script is used by the plugins c.vim -# OPTIONS: --- -# REQUIREMENTS: --- -# BUGS: --- -# NOTES: --- -# AUTHOR: Dr.-Ing. Fritz Mehner (Mn), mehner@fh-swf.de -# COMPANY: Fachhochschule Südwestfalen, Iserlohn -# CREATED: 23.11.2004 18:04:01 CET -# REVISION: $Id: wrapper.sh,v 1.5 2009/06/03 17:47:06 mehner Exp $ -#=============================================================================== - -executable="${1}" # name of the executable - -if [ ${#} -ge 1 ] && [ -x "$executable" ] -then - "${@}" - returncode=$? - [ $returncode -ne 0 ] && printf "'${@}' returned ${returncode}\n" -else - printf "\n !! file \"${executable}\" does not exist or is not executable !!\n" - returncode=126 # command invoked cannot execute -fi -read -p " ... press return key ... " dummy -exit $returncode diff --git a/vim_old/c-support/templates/Templates b/vim_old/c-support/templates/Templates deleted file mode 100644 index 6e73780..0000000 --- a/vim_old/c-support/templates/Templates +++ /dev/null @@ -1,29 +0,0 @@ -$ -$ ============================================================= -$ ========== USER MACROS ====================================== -$ ============================================================= -$ -|AUTHOR| = Dustin Swan -|AUTHORREF| = DDS -|EMAIL| = dustinswan@gmail.com -|COPYRIGHT| = Copyright (c) |YEAR|, |AUTHOR| -|STYLE| = default -$ -$ ============================================================= -$ ========== FILE INCLUDES ==================================== -$ ============================================================= -$ -|includefile| = c.comments.template -|includefile| = c.cpp.template -|includefile| = c.idioms.template -|includefile| = c.preprocessor.template -|includefile| = c.statements.template -$ -== IF |STYLE| IS CPP == -|includefile| = cpp.comments.template -|includefile| = cpp.cpp.template -|includefile| = cpp.idioms.template -|includefile| = cpp.preprocessor.template -|includefile| = cpp.statements.template -== ENDIF == -$ diff --git a/vim_old/c-support/templates/c.comments.template b/vim_old/c-support/templates/c.comments.template deleted file mode 100644 index b70f9b2..0000000 --- a/vim_old/c-support/templates/c.comments.template +++ /dev/null @@ -1,178 +0,0 @@ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.end-of-line-comment == append == -/* */ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.frame == -/*----------------------------------------------------------------------------- - * - *-----------------------------------------------------------------------------*/ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.function == -/* - * === FUNCTION ====================================================================== - * Name: |?FUNCTION_NAME| - * Description: - * ===================================================================================== - */ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.method == -/* - *-------------------------------------------------------------------------------------- - * Class: |?CLASSNAME| - * Method: |?CLASSNAME| :: |?METHODNAME| - * Description: - *-------------------------------------------------------------------------------------- - */ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.class == -/* - * ===================================================================================== - * Class: |?CLASSNAME| - * Description: - * ===================================================================================== - */ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-description == start == -/* - * ===================================================================================== - * - * Filename: |FILENAME| - * - * Description: - * - * Version: 1.0 - * Created: |DATE| |TIME| - * Revision: none - * Compiler: gcc - * - * Author: |AUTHOR| (|AUTHORREF|), |EMAIL| - * Company: |COMPANY| - * - * ===================================================================================== - */ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-description-header == start == -/* - * ===================================================================================== - * - * Filename: |FILENAME| - * - * Description: - * - * Version: 1.0 - * Created: |DATE| |TIME| - * Revision: none - * Compiler: gcc - * - * Author: |AUTHOR| (|AUTHORREF|), |EMAIL| - * Company: |COMPANY| - * - * ===================================================================================== - */ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-cpp-header-includes == -/* ##### HEADER FILE INCLUDES ################################################### */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-cpp-macros == -/* ##### MACROS - LOCAL TO THIS SOURCE FILE ################################### */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-cpp-typedefs == -/* ##### TYPE DEFINITIONS - LOCAL TO THIS SOURCE FILE ######################### */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-cpp-data-types == -/* ##### DATA TYPES - LOCAL TO THIS SOURCE FILE ############################### */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-cpp-class-defs == -/* ##### CLASS DEFINITIONS - LOCAL TO THIS SOURCE FILE ######################## */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-cpp-local-variables == -/* ##### VARIABLES - LOCAL TO THIS SOURCE FILE ################################ */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-cpp-prototypes == -/* ##### PROTOTYPES - LOCAL TO THIS SOURCE FILE ############################### */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-cpp-function-defs-exported == -/* ##### FUNCTION DEFINITIONS - EXPORTED FUNCTIONS ############################ */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-cpp-function-defs-local == -/* ##### FUNCTION DEFINITIONS - LOCAL TO THIS SOURCE FILE ##################### */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-cpp-class-implementations-exported == -/* ##### CLASS IMPLEMENTATIONS - EXPORTED CLASSES ############################# */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-cpp-class-implementations-local == -/* ##### CLASS IMPLEMENTATIONS - LOCAL CLASSES ################################ */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-hpp-header-includes == -/* ##### HEADER FILE INCLUDES ################################################### */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-hpp-macros == -/* ##### EXPORTED MACROS ######################################################## */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-hpp-exported-typedefs == -/* ##### EXPORTED TYPE DEFINITIONS ############################################## */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-hpp-exported-data-types == -/* ##### EXPORTED DATA TYPES #################################################### */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-hpp-exported-class-defs == -/* ##### EXPORTED CLASS DEFINITIONS ############################################# */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-hpp-exported-variables == -/* ##### EXPORTED VARIABLES ##################################################### */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-hpp-exported-function-declarations == -/* ##### EXPORTED FUNCTION DECLARATIONS ######################################### */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.keyword-bug == append == - /* :BUG:|DATE| |TIME|:|AUTHORREF|: */ -== comment.keyword-compiler == append == - /* :COMPILER:|DATE| |TIME|:|AUTHORREF|: */ -== comment.keyword-todo == append == - /* :TODO:|DATE| |TIME|:|AUTHORREF|: */ -== comment.keyword-tricky == append == - /* :TRICKY:|DATE| |TIME|:|AUTHORREF|: */ -== comment.keyword-warning == append == - /* :WARNING:|DATE| |TIME|:|AUTHORREF|: */ -== comment.keyword-workaround == append == - /* :WORKAROUND:|DATE| |TIME|:|AUTHORREF|: */ -== comment.keyword-keyword == append == - /* :|?KEYWORD:u|:|DATE| |TIME|:|AUTHORREF|: */ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.special-empty == append == - /* EMPTY */ -== comment.special-fall-through == append == - /* FALL THROUGH */ -== comment.special-implicit-type-conversion == append == - /* IMPLICIT TYPE CONVERSION */ -== comment.special-no-return == append == - /* NO RETURN */ -== comment.special-not-reached == append == - /* NOT REACHED */ -== comment.special-remains-to-be-implemented == append == - /* REMAINS TO BE IMPLEMENTED */ -== comment.special-constant-type-is-long == append == - /* constant type is long */ -== comment.special-constant-type-is-unsigned == append == - /* constant type is unsigned */ -== comment.special-constant-type-is-unsigned-long == append == - /* constant type is unsigned long */ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/vim_old/c-support/templates/c.cpp.template b/vim_old/c-support/templates/c.cpp.template deleted file mode 100644 index c7c298a..0000000 --- a/vim_old/c-support/templates/c.cpp.template +++ /dev/null @@ -1,487 +0,0 @@ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -$ -== cpp.cin == -cin >> ; -$ -== cpp.cout == -cout << << endl; -$ -== cpp.cout-operator == insert == -<< "" -$ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.output-manipulator-boolalpha == insert == -<< boolalpha -== cpp.output-manipulator-dec == insert == -<< dec -== cpp.output-manipulator-endl == insert == -<< endl -== cpp.output-manipulator-fixed == insert == -<< fixed -== cpp.output-manipulator-flush == insert == -<< flush -== cpp.output-manipulator-hex == insert == -<< hex -== cpp.output-manipulator-internal == insert == -<< internal -== cpp.output-manipulator-left == insert == -<< left -== cpp.output-manipulator-oct == insert == -<< oct -== cpp.output-manipulator-right == insert == -<< right -== cpp.output-manipulator-scientific == insert == -<< scientific -== cpp.output-manipulator-setbase == insert == -<< setbase(10) -== cpp.output-manipulator-setfill == insert == -<< setfill() -== cpp.output-manipulator-setiosflag == insert == -<< setiosflags() -== cpp.output-manipulator-setprecision == insert == -<< setprecision(6) -== cpp.output-manipulator-setw == insert == -<< setw(0) -== cpp.output-manipulator-showbase == insert == -<< showbase -== cpp.output-manipulator-showpoint == insert == -<< showpoint -== cpp.output-manipulator-showpos == insert == -<< showpos -== cpp.output-manipulator-uppercase == insert == -<< uppercase -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.method-implementation == -void -|?CLASSNAME|::|?METHODNAME| ( <+argument list+> ) -{ - return ; -} /* ----- end of method |CLASSNAME|::|?METHODNAME| ----- */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.accessor-implementation == -/* - *-------------------------------------------------------------------------------------- - * Class: |?CLASSNAME| - * Method: get_|?ATTRIBUTE| - *-------------------------------------------------------------------------------------- - */ -inline int -|CLASSNAME|::get_|ATTRIBUTE| ( ) -{ - return |ATTRIBUTE|; -} /* ----- end of method |CLASSNAME|::get_|ATTRIBUTE| ----- */ - -/* - *-------------------------------------------------------------------------------------- - * Class: |CLASSNAME| - * Method: set_|ATTRIBUTE| - *-------------------------------------------------------------------------------------- - */ -inline void -|CLASSNAME|::set_|ATTRIBUTE| ( <+argument list+> ) -{ - |ATTRIBUTE| = value; - return ; -} /* ----- end of method |CLASSNAME|::set_|ATTRIBUTE| ----- */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.class-definition == -/* - * ===================================================================================== - * Class: |?CLASSNAME:c| - * Description: - * ===================================================================================== - */ -class |CLASSNAME| -{ - public: - /* ==================== LIFECYCLE ======================================= */ - |CLASSNAME| (); /* constructor */ - - /* ==================== ACCESSORS ======================================= */ - - /* ==================== MUTATORS ======================================= */ - - /* ==================== OPERATORS ======================================= */ - - protected: - /* ==================== DATA MEMBERS ======================================= */ - - private: - /* ==================== DATA MEMBERS ======================================= */ - -}; /* ----- end of class |CLASSNAME| ----- */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.class-implementation == -/* - *-------------------------------------------------------------------------------------- - * Class: |?CLASSNAME:c| - * Method: |CLASSNAME| - * Description: constructor - *-------------------------------------------------------------------------------------- - */ -|CLASSNAME|::|CLASSNAME| () -{ -} /* ----- end of method |CLASSNAME|::|CLASSNAME| (constructor) ----- */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.class-using-new-definition == -/* - * ===================================================================================== - * Class: |?CLASSNAME:c| - * Description: - * ===================================================================================== - */ -class |CLASSNAME| -{ - public: - - /* ==================== LIFECYCLE ======================================= */ - |CLASSNAME| (); /* constructor */ - |CLASSNAME| ( const |CLASSNAME| &other ); /* copy constructor */ - ~|CLASSNAME| (); /* destructor */ - - /* ==================== ACCESSORS ======================================= */ - - /* ==================== MUTATORS ======================================= */ - - /* ==================== OPERATORS ======================================= */ - - |CLASSNAME|& operator = ( const |CLASSNAME| &other ); /* assignment operator */ - - protected: - /* ==================== DATA MEMBERS ======================================= */ - - private: - /* ==================== DATA MEMBERS ======================================= */ - -}; /* ----- end of class |CLASSNAME| ----- */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.class-using-new-implementation == -/* - *-------------------------------------------------------------------------------------- - * Class: |?CLASSNAME:c| - * Method: |CLASSNAME| - * Description: constructor - *-------------------------------------------------------------------------------------- - */ -|CLASSNAME|::|CLASSNAME| () -{ -} /* ----- end of method |CLASSNAME|::|CLASSNAME| (constructor) ----- */ - -/* - *-------------------------------------------------------------------------------------- - * Class: |CLASSNAME| - * Method: |CLASSNAME| - * Description: copy constructor - *-------------------------------------------------------------------------------------- - */ -|CLASSNAME|::|CLASSNAME| ( const |CLASSNAME| &other ) -{ -} /* ----- end of method |CLASSNAME|::|CLASSNAME| (copy constructor) ----- */ - -/* - *-------------------------------------------------------------------------------------- - * Class: |CLASSNAME| - * Method: ~|CLASSNAME| - * Description: destructor - *-------------------------------------------------------------------------------------- - */ -|CLASSNAME|::~|CLASSNAME| () -{ -} /* ----- end of method |CLASSNAME|::~|CLASSNAME| (destructor) ----- */ - -/* - *-------------------------------------------------------------------------------------- - * Class: |CLASSNAME| - * Method: operator = - * Description: assignment operator - *-------------------------------------------------------------------------------------- - */ -|CLASSNAME|& -|CLASSNAME|::operator = ( const |CLASSNAME| &other ) -{ - if ( this != &other ) { - } - return *this; -} /* ----- end of method |CLASSNAME|::operator = (assignment operator) ----- */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.error-class == -/* - * ===================================================================================== - * Class: |?CLASSNAME:c| - * Description: - * ===================================================================================== - */ -class |CLASSNAME| -{ - public: |CLASSNAME| ( string msg = "|CLASSNAME|" ):message(msg) { } - virtual ~|CLASSNAME| ( ) { } - virtual string what ( ) const throw ( ) { return message; } - protected: string message; -}; /* ----- end of class |CLASSNAME| ----- */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.template-method-implementation == -template < class T > -void |?CLASSNAME|::|?METHODNAME| ( <+argument list+> ) -{ - return ; -} /* ----- end of method |CLASSNAME|::|METHODNAME| ----- */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.template-accessor-implementation == -/* - *-------------------------------------------------------------------------------------- - * Class: |?CLASSNAME| - * Method: get_|?ATTRIBUTE| - *-------------------------------------------------------------------------------------- - */ -template < class T > -inline int |CLASSNAME|::get_|ATTRIBUTE| ( ) -{ - return |ATTRIBUTE|; -} /* ----- end of method |CLASSNAME|::get_|ATTRIBUTE| ----- */ - -/* - *-------------------------------------------------------------------------------------- - * Class: |CLASSNAME| - * Method: set_|ATTRIBUTE| - *-------------------------------------------------------------------------------------- - */ -template < class T > -inline void |CLASSNAME|::set_|ATTRIBUTE| ( <+argument list+> ) -{ - |ATTRIBUTE| = value; - return ; -} /* ----- end of method |CLASSNAME|::set_|ATTRIBUTE| ----- */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.template-class-definition == -/* - * ===================================================================================== - * Class: |?CLASSNAME:c| - * Description: - * ===================================================================================== - */ -template < class T > -class |CLASSNAME| -{ - public: - - /* ==================== LIFECYCLE ======================================= */ - |CLASSNAME| (); /* constructor */ - - /* ==================== ACCESSORS ======================================= */ - - /* ==================== MUTATORS ======================================= */ - - /* ==================== OPERATORS ======================================= */ - - protected: - /* ==================== DATA MEMBERS ======================================= */ - - private: - /* ==================== DATA MEMBERS ======================================= */ - -}; /* ---------- end of template class |CLASSNAME| ---------- */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.template-class-implementation == -/* - *-------------------------------------------------------------------------------------- - * Class: |?CLASSNAME:c| - * Method: |CLASSNAME| - * Description: - *-------------------------------------------------------------------------------------- - */ -template < class T > -|CLASSNAME| < T >::|CLASSNAME| () -{ -} /* ---------- end of constructor of template class |CLASSNAME| ---------- */ - - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.template-class-using-new-definition == -/* - * ===================================================================================== - * Class: |?CLASSNAME:c| - * Description: - * ===================================================================================== - */ - -template < class T > -class |CLASSNAME| -{ - public: - - // ==================== LIFECYCLE ======================================= - |CLASSNAME| (); /* constructor */ - |CLASSNAME| ( const |CLASSNAME| &other ); /* copy constructor */ - ~|CLASSNAME| (); /* destructor */ - - /* ==================== ACCESSORS ======================================= */ - - /* ==================== MUTATORS ======================================= */ - - /* ==================== OPERATORS ======================================= */ - - |CLASSNAME|& operator = ( const |CLASSNAME| &other ); // assignment operator - - protected: - /* ==================== DATA MEMBERS ======================================= */ - - private: - /* ==================== DATA MEMBERS ======================================= */ - -}; /* ----- end of template class |CLASSNAME| ----- */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.template-class-using-new-implementation == -/* - *-------------------------------------------------------------------------------------- - * Class: |?CLASSNAME:c| - * Method: |CLASSNAME| - * Description: constructor - *-------------------------------------------------------------------------------------- - */ -template < class T > -|CLASSNAME|< T >::|CLASSNAME| () -{ -} /* ---------- end of constructor of template class |CLASSNAME| ---------- */ - -/* - *-------------------------------------------------------------------------------------- - * Class: |CLASSNAME| - * Method: |CLASSNAME| - * Description: copy constructor - *-------------------------------------------------------------------------------------- - */ -template < class T > -|CLASSNAME|< T >::|CLASSNAME| ( const |CLASSNAME| &other ) -{ -} /* ---------- end of copy constructor of template class |CLASSNAME| ---------- */ - -/* - *-------------------------------------------------------------------------------------- - * Class: |CLASSNAME| - * Method: ~|CLASSNAME| - * Description: destructor - *-------------------------------------------------------------------------------------- - */ -template < class T > -|CLASSNAME|< T >::~|CLASSNAME| () -{ -} /* ---------- end of destructor of template class |CLASSNAME| ---------- */ - -/* - *-------------------------------------------------------------------------------------- - * Class: |CLASSNAME| - * Method: operator = - * Description: assignment operator - *-------------------------------------------------------------------------------------- - */ -template < class T > -|CLASSNAME|< T >& |CLASSNAME|< T >::operator = ( const |CLASSNAME| &other ) -{ - return *this; -} /* ---------- end of assignment operator of template class |CLASSNAME| ---------- */ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.template-function == -template -void |?TEMPALTE_FUNCTION_NAME| ( <+argument list+> ) -{ - return ; -} /* ----- end of template function |?TEMPALTE_FUNCTION_NAME| ----- */ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.operator-in == -ostream & -operator << ( ostream & os, const |?CLASSNAME| & obj ) -{ - os << obj. ; - return os; -} /* ----- end of function operator << ----- */ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.operator-out == -istream & -operator >> ( istream & is, |?CLASSNAME| & obj ) -{ - is >> obj. ; - return is; -} /* ----- end of function operator >> ----- */ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.try-catch == -try { -} -catch ( const &ExceptObj ) { /* handle exception: */ -} -catch (...) { /* handle exception: unspecified */ -} - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.catch == -catch ( const &ExceptObj ) { /* handle exception: */ -} -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.catch-points == -catch (...) { /* handle exception: */ -} -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.extern == -extern "C" { -} -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.open-input-file == -char *ifs_file_name = ""; /* input file name */ -ifstream ifs; /* create ifstream object */ - -ifs.open (ifs_file_name); /* open ifstream */ -if (!ifs) { - cerr << "\nERROR : failed to open input file " << ifs_file_name << endl; - exit (EXIT_FAILURE); -} -{-continue here-} -ifs.close (); /* close ifstream */ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.open-output-file == -char *ofs_file_name = ""; /* output file name */ -ofstream ofs; /* create ofstream object */ - -ofs.open (ofs_file_name); /* open ofstream */ -if (!ofs) { - cerr << "\nERROR : failed to open output file " << ofs_file_name << endl; - exit (EXIT_FAILURE); -} -{-continue here-} -ofs.close (); /* close ofstream */ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.namespace-std == -using namespace std; -== cpp.namespace == -using namespace |?NAMESPACE|; -== cpp.namespace-block == -namespace |?NAMESPACE| { -} /* ----- end of namespace |NAMESPACE| ----- */ -== cpp.namespace-alias == -namespace |?NAMESPACE_ALIAS| = {-original namespace name-}; -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.rtti-typeid == insert == -typeid() -$ -== cpp.rtti-static-cast == insert == -static_cast<>() -$ -== cpp.rtti-const-cast == insert == -const_cast<>() -$ -== cpp.rtti-reinterpret-cast == insert == -reinterpret_cast<>() -$ -== cpp.rtti-dynamic-cast == insert == -dynamic_cast<>() -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/vim_old/c-support/templates/c.idioms.template b/vim_old/c-support/templates/c.idioms.template deleted file mode 100644 index 4565fab..0000000 --- a/vim_old/c-support/templates/c.idioms.template +++ /dev/null @@ -1,133 +0,0 @@ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.function == -/* - * === FUNCTION ====================================================================== - * Name: |?FUNCTION_NAME| - * Description: - * ===================================================================================== - */ -void -|FUNCTION_NAME| ( <+argument list+> ) -{ - return <+return value+>; -} /* ----- end of function |FUNCTION_NAME| ----- */ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.function-static == -/* - * === FUNCTION ====================================================================== - * Name: |?FUNCTION_NAME| - * Description: - * ===================================================================================== - */ -static void -|FUNCTION_NAME| ( <+argument list+> ) -{ - return <+return value+>; -} /* ----- end of static function |FUNCTION_NAME| ----- */ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.main == -#include - -/* - * === FUNCTION ====================================================================== - * Name: main - * Description: - * ===================================================================================== - */ -int -main ( int argc, char *argv[] ) -{ - return EXIT_SUCCESS; -} /* ---------- end of function main ---------- */ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.enum == -enum |?ENUM_NAME| { -}; /* ---------- end of enum |ENUM_NAME| ---------- */ - -typedef enum |ENUM_NAME| |ENUM_NAME:c|; -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.struct == -struct |?STRUCT_NAME| { -}; /* ---------- end of struct |STRUCT_NAME| ---------- */ - -typedef struct |STRUCT_NAME| |STRUCT_NAME:c|; -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.union == -union |?UNION_NAME| { -}; /* ---------- end of union |UNION_NAME| ---------- */ - -typedef union |UNION_NAME| |UNION_NAME:c|; -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.printf == insert == -printf ( "\n" ); -== idioms.scanf == insert == -scanf ( "", & ); -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.calloc == -|?POINTER| = calloc ( (size_t)(<+COUNT+>), sizeof(<+TYPE+>) ); -if ( |POINTER|==NULL ) { - fprintf ( stderr, "\ndynamic memory allocation failed\n" ); - exit (EXIT_FAILURE); -} - -free (|POINTER|); -|POINTER| = NULL; - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.malloc == -|?POINTER| = malloc ( sizeof(<+TYPE+>) ); -if ( |POINTER|==NULL ) { - fprintf ( stderr, "\ndynamic memory allocation failed\n" ); - exit (EXIT_FAILURE); -} - -free (|POINTER|); -|POINTER| = NULL; - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.sizeof == insert == -sizeof() -== idioms.assert == insert == -assert(); -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.open-input-file == -FILE *|?FILEPOINTER|; /* input-file pointer */ -char *|FILEPOINTER|_file_name = ""; /* input-file name */ - -|FILEPOINTER| = fopen( |FILEPOINTER|_file_name, "r" ); -if ( |FILEPOINTER| == NULL ) { - fprintf ( stderr, "couldn't open file '%s'; %s\n", - |FILEPOINTER|_file_name, strerror(errno) ); - exit (EXIT_FAILURE); -} -{-continue here-} -if( fclose(|FILEPOINTER|) == EOF ) { /* close input file */ - fprintf ( stderr, "couldn't close file '%s'; %s\n", - |FILEPOINTER|_file_name, strerror(errno) ); - exit (EXIT_FAILURE); -} - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.open-output-file == -FILE *|?FILEPOINTER|; /* output-file pointer */ -char *|FILEPOINTER|_file_name = ""; /* output-file name */ - -|FILEPOINTER| = fopen( |FILEPOINTER|_file_name, "w" ); -if ( |FILEPOINTER| == NULL ) { - fprintf ( stderr, "couldn't open file '%s'; %s\n", - |FILEPOINTER|_file_name, strerror(errno) ); - exit (EXIT_FAILURE); -} -{-continue here-} -if( fclose(|FILEPOINTER|) == EOF ) { /* close output file */ - fprintf ( stderr, "couldn't close file '%s'; %s\n", - |FILEPOINTER|_file_name, strerror(errno) ); - exit (EXIT_FAILURE); -} - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.fprintf == insert == -fprintf ( |?FILEPOINTER|, "\n", ); -== idioms.fscanf == insert == -fscanf ( |?FILEPOINTER|, "", & ); -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/vim_old/c-support/templates/c.preprocessor.template b/vim_old/c-support/templates/c.preprocessor.template deleted file mode 100644 index f3aa127..0000000 --- a/vim_old/c-support/templates/c.preprocessor.template +++ /dev/null @@ -1,49 +0,0 @@ -$------------------------------------------------------------------------- -== preprocessor.include-global == -#include <> -$------------------------------------------------------------------------- -== preprocessor.include-local == -#include "" -$------------------------------------------------------------------------- -== preprocessor.define == -#define /* */ -$------------------------------------------------------------------------- -== preprocessor.undefine == -#undef /* */ -$------------------------------------------------------------------------- -== preprocessor.if-else-endif == -#if |?CONDITION:u| - -#else /* ----- not |CONDITION| ----- */ -<+ELSE PART+> -#endif /* ----- not |CONDITION| ----- */ -$------------------------------------------------------------------------- -== preprocessor.ifdef-else-endif == -#ifdef |?CONDITION:u| - -#else /* ----- not |CONDITION| ----- */ -<+ELSE PART+> -#endif /* ----- not |CONDITION| ----- */ -$------------------------------------------------------------------------- -== preprocessor.ifndef-else-endif == -#ifndef |?CONDITION:u| - -#else /* ----- not |CONDITION| ----- */ -<+ELSE PART+> -#endif /* ----- not |CONDITION| ----- */ -$------------------------------------------------------------------------- -== preprocessor.ifndef-def-endif == -#ifndef |?BASENAME:L|_INC -#define |BASENAME|_INC - -#endif /* ----- #ifndef |BASENAME|_INC ----- */ -$------------------------------------------------------------------------- -== preprocessor.error == -#error "" /* */ -$------------------------------------------------------------------------- -== preprocessor.line == -#line /* */ -$------------------------------------------------------------------------- -== preprocessor.pragma == -#pragma /* */ -$------------------------------------------------------------------------- diff --git a/vim_old/c-support/templates/c.statements.template b/vim_old/c-support/templates/c.statements.template deleted file mode 100644 index 574366d..0000000 --- a/vim_old/c-support/templates/c.statements.template +++ /dev/null @@ -1,69 +0,0 @@ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.do-while == -do { -} while ( ); /* ----- end do-while ----- */ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.for == -for ( ; ; ) -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.for-block == -for ( ; ; ) { -} -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.if == -if ( ) -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.if-block == -if ( ) { -<-IF PART-> -} -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.if-else == -if ( ) -else -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.if-block-else == -if ( ) { -<-IF PART-> -} -else { -<-ELSE PART-> -} -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.else-block == -else { - -} -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.while == -while ( ) -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.while-block == -while ( ) { -} -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.switch == -switch ( ) { - case <-LABEL->: - break; - - case <-LABEL->: - break; - - case <-LABEL->: - break; - - default: - break; -} /* ----- end switch ----- */ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.case == -case : -break; - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.block == -{ - -} -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/vim_old/c-support/templates/cpp.comments.template b/vim_old/c-support/templates/cpp.comments.template deleted file mode 100644 index b91ed44..0000000 --- a/vim_old/c-support/templates/cpp.comments.template +++ /dev/null @@ -1,168 +0,0 @@ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.end-of-line-comment == append == -// -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.frame == -//---------------------------------------------------------------------- -// -//---------------------------------------------------------------------- -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.function == -// === FUNCTION ====================================================================== -// Name: |?FUNCTION_NAME| -// Description: -// ===================================================================================== -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.method == -//-------------------------------------------------------------------------------------- -// Class: |?CLASSNAME| -// Method: |?METHODNAME| -// Description: -//-------------------------------------------------------------------------------------- -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.class == -// ===================================================================================== -// Class: |?CLASSNAME| -// Description: -// ===================================================================================== -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-description == start == -// ===================================================================================== -// -// Filename: |FILENAME| -// -// Description: -// -// Version: 1.0 -// Created: |DATE| |TIME| -// Revision: none -// Compiler: g++ -// -// Author: |AUTHOR| (|AUTHORREF|), |EMAIL| -// Company: |COMPANY| -// -// ===================================================================================== -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-description-header == start == -// ===================================================================================== -// -// Filename: |FILENAME| -// -// Description: -// -// Version: 1.0 -// Created: |DATE| |TIME| -// Revision: none -// Compiler: g++ -// -// Author: |AUTHOR| (|AUTHORREF|), |EMAIL| -// Company: |COMPANY| -// -// ===================================================================================== -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-cpp-header-includes == -// ##### HEADER FILE INCLUDES ################################################### - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-cpp-macros == -// ##### MACROS - LOCAL TO THIS SOURCE FILE ################################### - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-cpp-typedefs == -// ##### TYPE DEFINITIONS - LOCAL TO THIS SOURCE FILE ######################### - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-cpp-data-types == -// ##### DATA TYPES - LOCAL TO THIS SOURCE FILE ############################### - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-cpp-class-defs == -// ##### CLASS DEFINITIONS - LOCAL TO THIS SOURCE FILE ######################## - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-cpp-local-variables == -// ##### VARIABLES - LOCAL TO THIS SOURCE FILE ################################ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-cpp-prototypes == -// ##### PROTOTYPES - LOCAL TO THIS SOURCE FILE ############################### - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-cpp-function-defs-exported == -// ##### FUNCTION DEFINITIONS - EXPORTED FUNCTIONS ############################ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-cpp-function-defs-local == -// ##### FUNCTION DEFINITIONS - LOCAL TO THIS SOURCE FILE ##################### - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-cpp-class-implementations-exported == -// ##### CLASS IMPLEMENTATIONS - EXPORTED CLASSES ############################# - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-cpp-class-implementations-local == -// ##### CLASS IMPLEMENTATIONS - LOCAL CLASSES ################################ - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-hpp-header-includes == -// ##### HEADER FILE INCLUDES ################################################### - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-hpp-macros == -// ##### EXPORTED MACROS ######################################################## - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-hpp-exported-typedefs == -// ##### EXPORTED TYPE DEFINITIONS ############################################## - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-hpp-exported-data-types == -// ##### EXPORTED DATA TYPES #################################################### - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-hpp-exported-class-defs == -// ##### EXPORTED CLASS DEFINITIONS ############################################# - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-hpp-exported-variables == -// ##### EXPORTED VARIABLES ##################################################### - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.file-section-hpp-exported-function-declarations == -// ##### EXPORTED FUNCTION DECLARATIONS ######################################### - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.keyword-bug == append == - // :BUG:|DATE| |TIME|:|AUTHORREF|: -== comment.keyword-compiler == append == - // :COMPILER:|DATE| |TIME|:|AUTHORREF|: -== comment.keyword-todo == append == - // :TODO:|DATE| |TIME|:|AUTHORREF|: -== comment.keyword-tricky == append == - // :TRICKY:|DATE| |TIME|:|AUTHORREF|: -== comment.keyword-warning == append == - // :WARNING:|DATE| |TIME|:|AUTHORREF|: -== comment.keyword-workaround == append == - // :WORKAROUND:|DATE| |TIME|:|AUTHORREF|: -== comment.keyword-keyword == append == - // :|?KEYWORD:u|:|DATE| |TIME|:|AUTHORREF|: -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== comment.special-empty == append == - // EMPTY -== comment.special-fall-through == append == - // FALL THROUGH -== comment.special-implicit-type-conversion == append == - // IMPLICIT TYPE CONVERSION -== comment.special-no-return == append == - // NO RETURN -== comment.special-not-reached == append == - // NOT REACHED -== comment.special-remains-to-be-implemented == append == - // REMAINS TO BE IMPLEMENTED -== comment.special-constant-type-is-long == append == - // constant type is long -== comment.special-constant-type-is-unsigned == append == - // constant type is unsigned -== comment.special-constant-type-is-unsigned-long == append == - // constant type is unsigned long -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/vim_old/c-support/templates/cpp.cpp.template b/vim_old/c-support/templates/cpp.cpp.template deleted file mode 100644 index 6bdbe8b..0000000 --- a/vim_old/c-support/templates/cpp.cpp.template +++ /dev/null @@ -1,450 +0,0 @@ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -$ -== cpp.cin == -cin >> ; -$ -== cpp.cout == -cout << << endl; -$ -== cpp.cout-operator == insert == -<< "" -$ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.output-manipulator-boolalpha == insert == -<< boolalpha -== cpp.output-manipulator-dec == insert == -<< dec -== cpp.output-manipulator-endl == insert == -<< endl -== cpp.output-manipulator-fixed == insert == -<< fixed -== cpp.output-manipulator-flush == insert == -<< flush -== cpp.output-manipulator-hex == insert == -<< hex -== cpp.output-manipulator-internal == insert == -<< internal -== cpp.output-manipulator-left == insert == -<< left -== cpp.output-manipulator-oct == insert == -<< oct -== cpp.output-manipulator-right == insert == -<< right -== cpp.output-manipulator-scientific == insert == -<< scientific -== cpp.output-manipulator-setbase == insert == -<< setbase(10) -== cpp.output-manipulator-setfill == insert == -<< setfill() -== cpp.output-manipulator-setiosflag == insert == -<< setiosflags() -== cpp.output-manipulator-setprecision == insert == -<< setprecision(6) -== cpp.output-manipulator-setw == insert == -<< setw(0) -== cpp.output-manipulator-showbase == insert == -<< showbase -== cpp.output-manipulator-showpoint == insert == -<< showpoint -== cpp.output-manipulator-showpos == insert == -<< showpos -== cpp.output-manipulator-uppercase == insert == -<< uppercase -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.method-implementation == -void -|?CLASSNAME|::|?METHODNAME| ( <+argument list+> ) -{ - return ; -} // ----- end of method |CLASSNAME|::|METHODNAME| ----- - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.accessor-implementation == -//-------------------------------------------------------------------------------------- -// Class: |?CLASSNAME| -// Method: get_|?ATTRIBUTE| -//-------------------------------------------------------------------------------------- -inline int -|CLASSNAME|::get_|ATTRIBUTE| ( ) -{ - return |ATTRIBUTE|; -} // ----- end of method |CLASSNAME|::get_|ATTRIBUTE| ----- - -//-------------------------------------------------------------------------------------- -// Class: |CLASSNAME| -// Method: set_|ATTRIBUTE| -//-------------------------------------------------------------------------------------- -inline void -|CLASSNAME|::set_|ATTRIBUTE| ( <+argument list+> ) -{ - |ATTRIBUTE| = value; - return ; -} // ----- end of method |CLASSNAME|::set_|ATTRIBUTE| ----- - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.class-definition == -// ===================================================================================== -// Class: |?CLASSNAME:c| -// Description: -// ===================================================================================== -class |CLASSNAME| -{ - public: - - // ==================== LIFECYCLE ======================================= - |CLASSNAME| (); // constructor - - // ==================== ACCESSORS ======================================= - - // ==================== MUTATORS ======================================= - - // ==================== OPERATORS ======================================= - - protected: - // ==================== DATA MEMBERS ======================================= - - private: - // ==================== DATA MEMBERS ======================================= - -}; // ----- end of class |CLASSNAME| ----- - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.class-implementation == -//-------------------------------------------------------------------------------------- -// Class: |?CLASSNAME| -// Method: |CLASSNAME| -// Description: constructor -//-------------------------------------------------------------------------------------- -|CLASSNAME|::|CLASSNAME| () -{ -} // ----- end of method |CLASSNAME|::|CLASSNAME| (constructor) ----- - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.class-using-new-definition == -// ===================================================================================== -// Class: |?CLASSNAME:c| -// Description: -// ===================================================================================== -class |CLASSNAME| -{ - public: - - // ==================== LIFECYCLE ======================================= - |CLASSNAME| (); // constructor - |CLASSNAME| ( const |CLASSNAME| &other ); // copy constructor - ~|CLASSNAME| (); // destructor - - // ==================== ACCESSORS ======================================= - - // ==================== MUTATORS ======================================= - - // ==================== OPERATORS ======================================= - - |CLASSNAME|& operator = ( const |CLASSNAME| &other ); // assignment operator - - protected: - // ==================== DATA MEMBERS ======================================= - - private: - // ==================== DATA MEMBERS ======================================= - -}; // ----- end of class |CLASSNAME| ----- - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.class-using-new-implementation == -//-------------------------------------------------------------------------------------- -// Class: |?CLASSNAME| -// Method: |CLASSNAME| -// Description: constructor -//-------------------------------------------------------------------------------------- -|CLASSNAME|::|CLASSNAME| () -{ -} // ----- end of method |CLASSNAME|::|CLASSNAME| (constructor) ----- - -//-------------------------------------------------------------------------------------- -// Class: |CLASSNAME| -// Method: |CLASSNAME| -// Description: copy constructor -//-------------------------------------------------------------------------------------- -|CLASSNAME|::|CLASSNAME| ( const |CLASSNAME| &other ) -{ -} // ----- end of method |CLASSNAME|::|CLASSNAME| (copy constructor) ----- - -//-------------------------------------------------------------------------------------- -// Class: |CLASSNAME| -// Method: ~|CLASSNAME| -// Description: destructor -//-------------------------------------------------------------------------------------- -|CLASSNAME|::~|CLASSNAME| () -{ -} // ----- end of method |CLASSNAME|::~|CLASSNAME| (destructor) ----- - -//-------------------------------------------------------------------------------------- -// Class: |CLASSNAME| -// Method: operator = -// Description: assignment operator -//-------------------------------------------------------------------------------------- -|CLASSNAME|& -|CLASSNAME|::operator = ( const |CLASSNAME| &other ) -{ - if ( this != &other ) { - } - return *this; -} // ----- end of method |CLASSNAME|::operator = (assignment operator) ----- - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.error-class == -// ===================================================================================== -// Class: |?CLASSNAME:c| -// Description: -// ===================================================================================== -class |CLASSNAME| -{ - public: |CLASSNAME| ( string msg = "|CLASSNAME|" ):message(msg) { } - virtual ~|CLASSNAME| ( ) { } - virtual string what ( ) const throw ( ) { return message; } - protected: string message; -}; // ---------- end of class |CLASSNAME| ---------- - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.template-method-implementation == -template < class T > -void |?CLASSNAME|::|?METHODNAME| ( <+argument list+> ) -{ - return ; -} // ----- end of method |CLASSNAME|::|METHODNAME| ----- -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.template-accessor-implementation == -//-------------------------------------------------------------------------------------- -// Class: |?CLASSNAME| -// Method: get_|?ATTRIBUTE| -//-------------------------------------------------------------------------------------- -template < class T > -inline int |CLASSNAME|::get_|ATTRIBUTE| ( ) -{ - return |ATTRIBUTE|; -} // ----- end of method |CLASSNAME|::get_|ATTRIBUTE| ----- - -//-------------------------------------------------------------------------------------- -// Class: |CLASSNAME| -// Method: set_|ATTRIBUTE| -//-------------------------------------------------------------------------------------- -template < class T > -inline void |CLASSNAME|::set_|ATTRIBUTE| ( <+argument list+> ) -{ - |ATTRIBUTE| = value; - return ; -} // ----- end of method |CLASSNAME|::set_|ATTRIBUTE| ----- -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.template-class-definition == -// ===================================================================================== -// Class: |?CLASSNAME:c| -// Description: -// ===================================================================================== - -template < class T > -class |CLASSNAME| -{ - public: - - // ==================== LIFECYCLE ======================================= - |CLASSNAME| (); // constructor - - // ==================== ACCESSORS ======================================= - - // ==================== MUTATORS ======================================= - - // ==================== OPERATORS ======================================= - - protected: - // ==================== DATA MEMBERS ======================================= - - private: - // ==================== DATA MEMBERS ======================================= - -}; // ----- end of template class |CLASSNAME| ----- - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.template-class-implementation == -//-------------------------------------------------------------------------------------- -// Class: |?CLASSNAME| -// Method: |CLASSNAME| -// Description: constructor -//-------------------------------------------------------------------------------------- -template < class T > -|CLASSNAME| :: |CLASSNAME| () -{ -} // ----- end of constructor of template class |CLASSNAME| ----- - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.template-class-using-new-definition == -// ===================================================================================== -// Class: |?CLASSNAME:c| -// Description: -// ===================================================================================== - -template < class T > -class |CLASSNAME| -{ - public: - - // ==================== LIFECYCLE ======================================= - |CLASSNAME| (); // constructor - |CLASSNAME| ( const |CLASSNAME| &other ); // copy constructor - ~|CLASSNAME| (); // destructor - - // ==================== ACCESSORS ======================================= - - // ==================== MUTATORS ======================================= - - // ==================== OPERATORS ======================================= - - |CLASSNAME|& operator = ( const |CLASSNAME| &other ); // assignment operator - - protected: - // ==================== DATA MEMBERS ======================================= - - private: - // ==================== DATA MEMBERS ======================================= - -}; // ----- end of template class |CLASSNAME| ----- - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.template-class-using-new-implementation == -//-------------------------------------------------------------------------------------- -// Class: |?CLASSNAME| -// Method: |CLASSNAME| -// Description: constructor -//-------------------------------------------------------------------------------------- -template < class T > -|CLASSNAME|::|CLASSNAME| () -{ -} // ----- end of constructor of template class |CLASSNAME| ----- - -//-------------------------------------------------------------------------------------- -// Class: |CLASSNAME| -// Method: |CLASSNAME| -// Description: copy constructor -//-------------------------------------------------------------------------------------- -template < class T > -|CLASSNAME|::|CLASSNAME| ( const |CLASSNAME| &other ) -{ -} // ----- end of copy constructor of template class |CLASSNAME| ----- - -//-------------------------------------------------------------------------------------- -// Class: |CLASSNAME| -// Method: ~|CLASSNAME| -// Description: destructor -//-------------------------------------------------------------------------------------- -template < class T > -|CLASSNAME|::~|CLASSNAME| () -{ -} // ----- end of destructor of template class |CLASSNAME| ----- - -//-------------------------------------------------------------------------------------- -// Class: |CLASSNAME| -// Method: operator = -// Description: assignment operator -//-------------------------------------------------------------------------------------- -template < class T > -|CLASSNAME|& |CLASSNAME|::operator = ( const |CLASSNAME| &other ) -{ - if ( this != &other ) { - } - return *this; -} // ----- end of assignment operator of template class |CLASSNAME| ----- - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.template-function == -template -void |?TEMPALTE_FUNCTION_NAME| ( <+argument list+> ) -{ - return ; -} // ----- end of template function |?TEMPALTE_FUNCTION_NAME| ----- -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.operator-in == -ostream & -operator << ( ostream & os, const |?CLASSNAME| & obj ) -{ - os << obj. ; - return os; -} // ----- end of function operator << ----- -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.operator-out == -istream & -operator >> ( istream & is, |?CLASSNAME| & obj ) -{ - is >> obj. ; - return is; -} // ----- end of function operator >> ----- -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.try-catch == -try { -} -catch ( const &ExceptObj ) { // handle exception: -} -catch (...) { // handle exception: unspecified -} - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.catch == -catch ( const &ExceptObj ) { // handle exception: -} -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.catch-points == -catch (...) { // handle exception: -} -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.extern == -extern "C" { -} -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.open-input-file == -string ifs_file_name = ""; // input file name -ifstream ifs; // create ifstream object - -ifs.open ( ifs_file_name.c_str() ); // open ifstream -if (!ifs) { - cerr << "\nERROR : failed to open input file " << ifs_file_name << endl; - exit (EXIT_FAILURE); -} -{-continue here-} -ifs.close (); // close ifstream -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.open-output-file == -string ofs_file_name = ""; // input file name -ofstream ofs; // create ofstream object - -ofs.open ( ofs_file_name.c_str() ); // open ofstream -if (!ofs) { - cerr << "\nERROR : failed to open output file " << ofs_file_name << endl; - exit (EXIT_FAILURE); -} -{-continue here-} -ofs.close (); // close ofstream -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.namespace-std == -using namespace std; -== cpp.namespace == -using namespace |?NAMESPACE|; -== cpp.namespace-block == -namespace |?NAMESPACE| { -} // ----- end of namespace |NAMESPACE| ----- -== cpp.namespace-alias == -namespace |?NAMESPACE_ALIAS| = {-original namespace name-}; -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== cpp.rtti-typeid == insert == -typeid() -$ -== cpp.rtti-static-cast == insert == -static_cast<>() -$ -== cpp.rtti-const-cast == insert == -const_cast<>() -$ -== cpp.rtti-reinterpret-cast == insert == -reinterpret_cast<>() -$ -== cpp.rtti-dynamic-cast == insert == -dynamic_cast<>() -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/vim_old/c-support/templates/cpp.idioms.template b/vim_old/c-support/templates/cpp.idioms.template deleted file mode 100644 index fa09ba8..0000000 --- a/vim_old/c-support/templates/cpp.idioms.template +++ /dev/null @@ -1,109 +0,0 @@ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.function == -void -|?FUNCTION_NAME| ( <+argument list+> ) -{ - return <+return value+>; -} // ----- end of function |FUNCTION_NAME| ----- -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.function-static == -static void -|?FUNCTION_NAME| ( <+argument list+> ) -{ - return <+return value+>; -} // ----- end of static function |FUNCTION_NAME| ----- -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.main == -#include - -int -main ( int argc, char *argv[] ) -{ - return EXIT_SUCCESS; -} // ---------- end of function main ---------- -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.enum == -enum |?ENUM_NAME| { -}; // ---------- end of enum |ENUM_NAME| ---------- -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.struct == -struct |?STRUCT_NAME| { -}; // ---------- end of struct |STRUCT_NAME| ---------- -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.union == -union |?UNION_NAME| { -}; // ---------- end of union |UNION_NAME| ---------- -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.printf == insert == -printf ( "\n" ); -== idioms.scanf == insert == -scanf ( "", & ); -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.calloc == -|?POINTER| = calloc ( (size_t)(<+COUNT+>), sizeof(<+TYPE+>) ); -if ( |POINTER|==NULL ) { - fprintf ( stderr, "\ndynamic memory allocation failed\n" ); - exit (EXIT_FAILURE); -} - -free (|POINTER|); -|POINTER| = NULL; - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.malloc == -|?POINTER| = malloc ( sizeof(<+TYPE+>) ); -if ( |POINTER|==NULL ) { - fprintf ( stderr, "\ndynamic memory allocation failed\n" ); - exit (EXIT_FAILURE); -} - -free (|POINTER|); -|POINTER| = NULL; - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.sizeof == insert == -sizeof() -== idioms.assert == insert == -assert(); -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.open-input-file == -FILE *|?FILEPOINTER|; // input-file pointer -char *|FILEPOINTER|_file_name = ""; // input-file name - -|FILEPOINTER| = fopen( |FILEPOINTER|_file_name, "r" ); -if ( |FILEPOINTER| == NULL ) { - fprintf ( stderr, "couldn't open file '%s'; %s\n", - |FILEPOINTER|_file_name, strerror(errno) ); - exit (EXIT_FAILURE); -} -{-continue here-} -if( fclose(|FILEPOINTER|) == EOF ) { // close input file - fprintf ( stderr, "couldn't close file '%s'; %s\n", - |FILEPOINTER|_file_name, strerror(errno) ); - exit (EXIT_FAILURE); -} - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.open-output-file == -FILE *|?FILEPOINTER|; // output-file pointer -char *|FILEPOINTER|_file_name = ""; // output-file name - -|FILEPOINTER| = fopen( |FILEPOINTER|_file_name, "w" ); -if ( |FILEPOINTER| == NULL ) { - fprintf ( stderr, "couldn't open file '%s'; %s\n", - |FILEPOINTER|_file_name, strerror(errno) ); - exit (EXIT_FAILURE); -} -{-continue here-} -if( fclose(|FILEPOINTER|) == EOF ) { // close output file - fprintf ( stderr, "couldn't close file '%s'; %s\n", - |FILEPOINTER|_file_name, strerror(errno) ); - exit (EXIT_FAILURE); -} - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== idioms.fprintf == insert == -fprintf ( |?FILEPOINTER|, "\n", ); -== idioms.fscanf == insert == -fscanf ( |?FILEPOINTER|, "", & ); -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/vim_old/c-support/templates/cpp.preprocessor.template b/vim_old/c-support/templates/cpp.preprocessor.template deleted file mode 100644 index 68de87f..0000000 --- a/vim_old/c-support/templates/cpp.preprocessor.template +++ /dev/null @@ -1,50 +0,0 @@ -$------------------------------------------------------------------------- -== preprocessor.include-global == -#include <> -$------------------------------------------------------------------------- -== preprocessor.include-local == -#include "" -$------------------------------------------------------------------------- -== preprocessor.define == -#define // -$------------------------------------------------------------------------- -== preprocessor.undefine == -#undef // -$------------------------------------------------------------------------- -== preprocessor.if-else-endif == -#if |?CONDITION:u| - -#else // ----- not |CONDITION| ----- -<+ELSE PART+> - -#endif // ----- not |CONDITION| ----- -$------------------------------------------------------------------------- -== preprocessor.ifdef-else-endif == -#ifdef |?CONDITION:u| - -#else // ----- not |CONDITION| ----- -<+ELSE PART+> -#endif // ----- not |CONDITION| ----- -$------------------------------------------------------------------------- -== preprocessor.ifndef-else-endif == -#ifndef |?CONDITION:u| - -#else // ----- not |CONDITION| ----- -<+ELSE PART+> -#endif // ----- not |CONDITION| ----- -$------------------------------------------------------------------------- -== preprocessor.ifndef-def-endif == -#ifndef |?BASENAME:L|_INC -#define |BASENAME|_INC - -#endif // ----- #ifndef |BASENAME|_INC ----- -$------------------------------------------------------------------------- -== preprocessor.error == -#error "" // -$------------------------------------------------------------------------- -== preprocessor.line == -#line // -$------------------------------------------------------------------------- -== preprocessor.pragma == -#pragma // -$------------------------------------------------------------------------- diff --git a/vim_old/c-support/templates/cpp.statements.template b/vim_old/c-support/templates/cpp.statements.template deleted file mode 100644 index c2fdecb..0000000 --- a/vim_old/c-support/templates/cpp.statements.template +++ /dev/null @@ -1,72 +0,0 @@ -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.do-while == -do { -} while ( ); // ----- end do-while ----- -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.for == -for ( ; ; ) -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.for-block == -for ( ; ; ) { -} -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.if == -if ( ) -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.if-block == -if ( ) { -<-IF PART-> -} -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.if-else == -if ( ) -else -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.if-block-else == -if ( ) { -<-IF PART-> -} -else { -<+ELSE PART+> -} -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.else-block == -else { - -} -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.while == -while ( ) -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.while-block == -while ( ) { -} -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.switch == -switch ( ) { - case 1: - break; - - case 2: - break; - - case 3: - break; - - case 4: - break; - - default: - break; -} // ----- end switch ----- -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.case == -case : -break; - -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -== statements.block == -{ - -} -$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/vim_old/c-support/wordlists/c-c++-keywords.list b/vim_old/c-support/wordlists/c-c++-keywords.list deleted file mode 100644 index 5a97dd6..0000000 --- a/vim_old/c-support/wordlists/c-c++-keywords.list +++ /dev/null @@ -1,209 +0,0 @@ -adjustfield -basefield -boolalpha -floatfield -internal -scientific -setbase -setiosflags -setprecision -showbase -showpoint -showpos -uppercase - -auto -break -case -char -const -continue -default -double -else -enum -extern -float -goto -inline -long -register -restrict -return -short -signed -sizeof -static -struct -switch -typedef -union -unsigned -void -volatile -while -_Bool -_Complex -_Imaginary -EXIT_FAILURE -EXIT_SUCCESS - -bool -catch -class -const_cast -delete -dynamic_cast -explicit -export -false -friend -mutable -namespace -operator -private -protected -public -reinterpret_cast -static_cast -template -this -throw -true -typeid -typename -using -virtual -wchar_t - -and_eq -bitand -bitor -compl -not_eq -or_eq -xor_eq - -define -defined -elif -endif -error -ifdef -ifndef -include -pragma -undef - -exception -bad_alloc -bad_exception -bad_cast -bad_typeid -ios_base::failure -logic_error -domain_error -invalid_argument -length_error -out_of_range -runtime_error -range_error -overflow_error -underflow_error -uncaught_exception - -__DATE__ -__FILE__ -__LINE__ -__STDC__ -__STDC_HOSTED__ -__STDC_IEC_559__ -__STDC_IEC_559_COMPLEX__ -__STDC_ISO_10646__ -__STDC_VERSION__ -__TIME__ -__func__ -__cplusplus - -__BORLANDC__ -__CYGWIN__ -__CYGWIN32__ -__GNUC__ -__WIN32__ -__WINDOWS__ - -assert -ctype -errno -float -limits -locale -math -setjmp -signal -stdarg -stddef -stdio -stdlib -string -time - -complex -fenv -inttypes -iso646 -stdbool -stdint -tgmath -wchar -wctype - -algorithm -bitset -complex -deque -exception -fstream -functional -iomanip -ios -iosfwd -iostream -istream -iterator -limits -list -locale - -map -memory -new -numeric -ostream -queue -set -sstream -stack -stdexcept -streambuf -string -typeinfo -utility -valarray -vector - -cassert -cctype -cerrno -cfloat -climits -clocale -cmath -csetjmp -csignal -cstdarg -cstddef -cstdio -cstdlib -cstring -ctime diff --git a/vim_old/c-support/wordlists/k+r.list b/vim_old/c-support/wordlists/k+r.list deleted file mode 100644 index 805756a..0000000 --- a/vim_old/c-support/wordlists/k+r.list +++ /dev/null @@ -1,108 +0,0 @@ -address -allocator -allocation -argument -arithmetic -array -assignement -bitwise -block -character -command -condition -conditional -constant -conversion -declaration -decrement -defined -definition -descriptor -description -dimension -evaluation -expression -external -format -formatted -function -global -handling -identifier -implementation -increment -initialization -input -interface -label -lexical -local -logical -lookup -loop -lvalue -miscellaneous -notation -numerical -operator -operation -output -pointer -precedence -preprocessor -preprocessing -program -random -recursion -recursive -reference -referential -relational -scope -standard -statement -string -structure -system -undefined -variable - -abstract -algorithm -alignment -application -assignment -asynchronous -binary -buffer -component -constructor -container -destructor -difference -enumeration -exception -floating-point -horizontal -inheritance -instantiation -integer -internal -invariant -iterator -localization -overflow -overload -override -overwrite -polymorphic -portability -position -postcondition -precision -precondition -prototype -subscript -underflow -vertical -whitespace diff --git a/vim_old/c-support/wordlists/stl_index.list b/vim_old/c-support/wordlists/stl_index.list deleted file mode 100644 index b5d98a3..0000000 --- a/vim_old/c-support/wordlists/stl_index.list +++ /dev/null @@ -1,202 +0,0 @@ -accumulate -adjacent_difference -adjacent_find -advance -append -assign -auto_ptr -back -back_inserter -basic_string -bidirectional_iterator -bidirectional_iterator_tag -binary_compose -binary_function -binary_negate -binary_search -bind1st -bind2nd -bit_vector -bitset -capacity -char_producer -char_traits -char_type -compare -construct -copy -copy_backward -copy_n -count -count_if -deque -destroy -distance -distance_type -divides -equal -equal_range -equal_to -erase -fill -fill_n -find -find_end -find_first_not_of -find_first_of -find_if -find_last_not_of -find_last_of -for_each -forward_iterator -forward_iterator_tag -front -front_inserter -generate -generate_n -get_temporary_buffer -greater -greater_equal -hash -hash_map -hash_multimap -hash_multiset -hash_set -identity -includes -inner_product -inplace_merge -input_iterator -input_iterator_tag -insert -insert_iterator -inserter -int_type -iota -is_heap -is_sorted -istream_iterator -istream_type -istreambuf_iterator -iter_swap -iterator_category -iterator_traits -less -less_equal -lexicographical_compare -lexicographical_compare_3way -list -logical_and -logical_not -logical_or -lower_bound -make_heap -make_pair -map -max -max_element -mem_fun1_ref_t -mem_fun1_t -mem_fun_ref_t -mem_fun_t -merge -min -min_element -minus -mismatch -modulus -multimap -multiplies -multiset -negate -next_permutation -not_equal_to -nth_element -operator -ostream_iterator -ostreambuf_iterator -output_iterator -output_iterator_tag -pair -partial_sort -partial_sort_copy -partial_sum -partition -plus -pointer_to_binary_function -pointer_to_unary_function -pop_back -pop_front -pop_heap -power -prev_permutation -priority_queue -project1st -project2nd -ptr_fun -push_back -push_front -push_heap -queue -random_access_iterator -random_access_iterator_tag -random_sample -random_sample_n -random_shuffle -raw_storage_iterator -release -remove -remove_copy -remove_copy_if -remove_if -replace -replace_copy -replace_copy_if -replace_if -reset -resize -return_temporary_buffer -reverse -reverse_bidirectional_iterator -reverse_copy -reverse_iterator -rfind -rope -rotate -rotate_copy -search -search_n -select1st -select2nd -sequence_buffer -set -set_difference -set_intersection -set_symmetric_difference -set_union -slist -sort -sort_heap -stable_partition -stable_sort -stack -streambuf_type -substr -subtractive_rng -swap -swap_ranges -temporary_buffer -transform -unary_compose -unary_function -unary_negate -uninitialized_copy -uninitialized_copy_n -uninitialized_fill -uninitialized_fill_n -unique -unique_copy -upper_bound -value_comp -value_type -vector diff --git a/vim_old/doc/acp.jax b/vim_old/doc/acp.jax deleted file mode 100644 index 12e55ce..0000000 --- a/vim_old/doc/acp.jax +++ /dev/null @@ -1,298 +0,0 @@ -*acp.txt* 補完メニューの自動ポップアップ - - Copyright (c) 2007-2009 Takeshi NISHIDA - -AutoComplPop *autocomplpop* *acp* - -概要 |acp-introduction| -インストール |acp-installation| -使い方 |acp-usage| -コマンド |acp-commands| -オプション |acp-options| -SPECIAL THANKS |acp-thanks| -CHANGELOG |acp-changelog| -あばうと |acp-about| - - -============================================================================== -概要 *acp-introduction* - -このプラグインは、インサートモードで文字を入力したりカーソルを動かしたときに補 -完メニューを自動的に開くようにします。しかし、続けて文字を入力するのを妨げたり -はしません。 - - -============================================================================== -インストール *acp-installation* - -ZIPファイルをランタイムディレクトリに展開します。 - -以下のようにファイルが配置されるはずです。 -> - /plugin/acp.vim - /doc/acp.txt - ... -< -もしランタイムディレクトリが他のプラグインとごた混ぜになるのが嫌なら、ファイル -を新規ディレクトリに配置し、そのディレクトリのパスを 'runtimepath' に追加して -ください。アンインストールも楽になります。 - -その後 FuzzyFinder のヘルプを有効にするためにタグファイルを更新してください。 -詳しくは|add-local-help|を参照してください。 - - -============================================================================== -使い方 *acp-usage* - -このプラグインがインストールされていれば、自動ポップアップは vim の開始時から -有効になります。 - -カーソル直前のテキストに応じて、利用する補完の種類を切り替えます。デフォルトの -補完動作は次の通りです: - - 補完モード filetype カーソル直前のテキスト ~ - キーワード補完 * 2文字のキーワード文字 - ファイル名補完 * ファイル名文字 + パスセパレータ - + 0文字以上のファイル名文字 - オムニ補完 ruby ".", "::" or 単語を構成する文字以外 + ":" - オムニ補完 python "." - オムニ補完 xml "<", ""以外の文字列 + " ") - オムニ補完 html/xhtml "<", ""以外の文字列 + " ") - オムニ補完 css (":", ";", "{", "^", "@", or "!") - + 0個または1個のスペース - -さらに、設定を行うことで、ユーザー定義補完と snipMate トリガー補完 -(|acp-snipMate|) を自動ポップアップさせることができます。 - -これらの補完動作はカスタマイズ可能です。 - - *acp-snipMate* -snipMate トリガー補完 ~ - -snipMate トリガー補完では、snipMate プラグイン -(http://www.vim.org/scripts/script.php?script_id=2540) が提供するスニペットの -トリガーを補完してそれを展開することができます。 - -この自動ポップアップを有効にするには、次の関数を plugin/snipMate.vim に追加す -る必要があります: -> - fun! GetSnipsInCurrentScope() - let snips = {} - for scope in [bufnr('%')] + split(&ft, '\.') + ['_'] - call extend(snips, get(s:snippets, scope, {}), 'keep') - call extend(snips, get(s:multi_snips, scope, {}), 'keep') - endfor - return snips - endf -< -そして|g:acp_behaviorSnipmateLength|オプションを 1 にしてください。 - -この自動ポップアップには制限があり、カーソル直前の単語は大文字英字だけで構成さ -れていなければなりません。 - - *acp-perl-omni* -Perl オムニ補完 ~ - -AutoComplPop は perl-completion.vim -(http://www.vim.org/scripts/script.php?script_id=2852) をサポートしています。 - -この自動ポップアップを有効にするには、|g:acp_behaviorPerlOmniLength|オプション -を 0 以上にしてください。 - - -============================================================================== -コマンド *acp-commands* - - *:AcpEnable* -:AcpEnable - 自動ポップアップを有効にします。 - - *:AcpDisable* -:AcpDisable - 自動ポップアップを無効にします。 - - *:AcpLock* -:AcpLock - 自動ポップアップを一時的に停止します。 - - 別のスクリプトへの干渉を回避する目的なら、このコマンドと|:AcpUnlock| - を利用することを、|:AcpDisable|と|:AcpEnable| を利用するよりも推奨しま - す。 - - *:AcpUnlock* -:AcpUnlock - |:AcpLock| で停止された自動ポップアップを再開します。 - - -============================================================================== -オプション *acp-options* - - *g:acp_enableAtStartup* > - let g:acp_enableAtStartup = 1 -< - 真なら vim 開始時から自動ポップアップが有効になります。 - - *g:acp_mappingDriven* > - let g:acp_mappingDriven = 0 -< - 真なら|CursorMovedI|イベントではなくキーマッピングで自動ポップアップを - 行うようにします。カーソルを移動するたびに補完が行われることで重いなど - の不都合がある場合に利用してください。ただし他のプラグインとの相性問題 - や日本語入力での不具合が発生する可能性があります。(逆も然り。) - - *g:acp_ignorecaseOption* > - let g:acp_ignorecaseOption = 1 -< - 自動ポップアップ時に、'ignorecase' に一時的に設定する値 - - *g:acp_completeOption* > - let g:acp_completeOption = '.,w,b,k' -< - 自動ポップアップ時に、'complete' に一時的に設定する値 - - *g:acp_completeoptPreview* > - let g:acp_completeoptPreview = 0 -< - 真なら自動ポップアップ時に、 'completeopt' へ "preview" を追加します。 - - *g:acp_behaviorUserDefinedFunction* > - let g:acp_behaviorUserDefinedFunction = '' -< - ユーザー定義補完の|g:acp_behavior-completefunc|。空ならこの補完は行わ - れません。。 - - *g:acp_behaviorUserDefinedMeets* > - let g:acp_behaviorUserDefinedMeets = '' -< - ユーザー定義補完の|g:acp_behavior-meets|。空ならこの補完は行われません - 。 - - *g:acp_behaviorSnipmateLength* > - let g:acp_behaviorSnipmateLength = -1 -< - snipMate トリガー補完の自動ポップアップを行うのに必要なカーソルの直前 - のパターン。 - - *g:acp_behaviorKeywordCommand* > - let g:acp_behaviorKeywordCommand = "\" -< - キーワード補完のコマンド。このオプションには普通 "\" か "\" - を設定します。 - - *g:acp_behaviorKeywordLength* > - let g:acp_behaviorKeywordLength = 2 -< - キーワード補完の自動ポップアップを行うのに必要なカーソルの直前のキーワ - ード文字数。負数ならこの補完は行われません。 - - *g:acp_behaviorKeywordIgnores* > - let g:acp_behaviorKeywordIgnores = [] -< - 文字列のリスト。カーソル直前の単語がこれらの内いずれかの先頭部分にマッ - チする場合、この補完は行われません。 - - 例えば、 "get" で始まる補完キーワードが多過ぎて、"g", "ge", "get" を入 - 力したときの自動ポップアップがレスポンスの低下を引き起こしている場合、 - このオプションに ["get"] を設定することでそれを回避することができます。 - - *g:acp_behaviorFileLength* > - let g:acp_behaviorFileLength = 0 -< - ファイル名補完の自動ポップアップを行うのに必要なカーソルの直前のキーワ - ード文字数。負数ならこの補完は行われません。 - - *g:acp_behaviorRubyOmniMethodLength* > - let g:acp_behaviorRubyOmniMethodLength = 0 -< - メソッド補完のための、Ruby オムニ補完の自動ポップアップを行うのに必要 - なカーソルの直前のキーワード文字数。負数ならこの補完は行われません。 - - *g:acp_behaviorRubyOmniSymbolLength* > - let g:acp_behaviorRubyOmniSymbolLength = 1 -< - シンボル補完のための、Ruby オムニ補完の自動ポップアップを行うのに必要 - なカーソルの直前のキーワード文字数。負数ならこの補完は行われません。 - - *g:acp_behaviorPythonOmniLength* > - let g:acp_behaviorPythonOmniLength = 0 -< - Python オムニ補完の自動ポップアップを行うのに必要なカーソルの直前のキ - ーワード文字数。負数ならこの補完は行われません。 - - *g:acp_behaviorPerlOmniLength* > - let g:acp_behaviorPerlOmniLength = -1 -< - Perl オムニ補完の自動ポップアップを行うのに必要なカーソルの直前のキー - ワード文字数。負数ならこの補完は行われません。 - - See also: |acp-perl-omni| - - *g:acp_behaviorXmlOmniLength* > - let g:acp_behaviorXmlOmniLength = 0 -< - XML オムニ補完の自動ポップアップを行うのに必要なカーソルの直前のキーワ - ード文字数。負数ならこの補完は行われません。 - - *g:acp_behaviorHtmlOmniLength* > - let g:acp_behaviorHtmlOmniLength = 0 -< - HTML オムニ補完の自動ポップアップを行うのに必要なカーソルの直前のキー - ワード文字数。負数ならこの補完は行われません。 - - *g:acp_behaviorCssOmniPropertyLength* > - let g:acp_behaviorCssOmniPropertyLength = 1 -< - プロパティ補完のための、CSS オムニ補完の自動ポップアップを行うのに必要 - なカーソルの直前のキーワード文字数。負数ならこの補完は行われません。 - - *g:acp_behaviorCssOmniValueLength* > - let g:acp_behaviorCssOmniValueLength = 0 -< - 値補完のための、CSS オムニ補完の自動ポップアップを行うのに必要なカーソ - ルの直前のキーワード文字数。負数ならこの補完は行われません。 - - *g:acp_behavior* > - let g:acp_behavior = {} -< - - これは内部仕様がわかっている人向けのオプションで、他のオプションでの設 - 定より優先されます。 - - |Dictionary|型で、キーはファイルタイプに対応します。 '*' はデフォルト - を表します。値はリスト型です。補完候補が得られるまでリストの先頭アイテ - ムから順に評価します。各要素は|Dictionary|で詳細は次の通り: - - "command": *g:acp_behavior-command* - 補完メニューをポップアップするためのコマンド。 - - "completefunc": *g:acp_behavior-completefunc* - 'completefunc' に設定する関数。 "command" が "" のときだけ - 意味があります。 - - "meets": *g:acp_behavior-meets* - この補完を行うかどうかを判断する関数の名前。この関数はカーソル直前の - テキストを引数に取り、補完を行うなら非 0 の値を返します。 - - "onPopupClose": *g:acp_behavior-onPopupClose* - この補完のポップアップメニューが閉じられたときに呼ばれる関数の名前。 - この関数が 0 を返した場合、続いて行われる予定の補完は抑制されます。 - - "repeat": *g:acp_behavior-repeat* - 真なら最後の補完が自動的に繰り返されます。 - - -============================================================================== -あばうと *acp-about* *acp-contact* *acp-author* - -作者: Takeshi NISHIDA -ライセンス: MIT Licence -URL: http://www.vim.org/scripts/script.php?script_id=1879 - http://bitbucket.org/ns9tks/vim-autocomplpop/ - -バグや要望など ~ - -こちらへどうぞ: http://bitbucket.org/ns9tks/vim-autocomplpop/issues/ - -============================================================================== - vim:tw=78:ts=8:ft=help:norl: - diff --git a/vim_old/doc/acp.txt b/vim_old/doc/acp.txt deleted file mode 100644 index 324c88b..0000000 --- a/vim_old/doc/acp.txt +++ /dev/null @@ -1,512 +0,0 @@ -*acp.txt* Automatically opens popup menu for completions. - - Copyright (c) 2007-2009 Takeshi NISHIDA - -AutoComplPop *autocomplpop* *acp* - -INTRODUCTION |acp-introduction| -INSTALLATION |acp-installation| -USAGE |acp-usage| -COMMANDS |acp-commands| -OPTIONS |acp-options| -SPECIAL THANKS |acp-thanks| -CHANGELOG |acp-changelog| -ABOUT |acp-about| - - -============================================================================== -INTRODUCTION *acp-introduction* - -With this plugin, your vim comes to automatically opens popup menu for -completions when you enter characters or move the cursor in Insert mode. It -won't prevent you continuing entering characters. - - -============================================================================== -INSTALLATION *acp-installation* - -Put all files into your runtime directory. If you have the zip file, extract -it to your runtime directory. - -You should place the files as follows: -> - /plugin/acp.vim - /doc/acp.txt - ... -< -If you disgust to jumble up this plugin and other plugins in your runtime -directory, put the files into new directory and just add the directory path to -'runtimepath'. It's easy to uninstall the plugin. - -And then update your help tags files to enable fuzzyfinder help. See -|add-local-help| for details. - - -============================================================================== -USAGE *acp-usage* - -Once this plugin is installed, auto-popup is enabled at startup by default. - -Which completion method is used depends on the text before the cursor. The -default behavior is as follows: - - kind filetype text before the cursor ~ - Keyword * two keyword characters - Filename * a filename character + a path separator - + 0 or more filename character - Omni ruby ".", "::" or non-word character + ":" - (|+ruby| required.) - Omni python "." (|+python| required.) - Omni xml "<", "" characters + " ") - Omni html/xhtml "<", "" characters + " ") - Omni css (":", ";", "{", "^", "@", or "!") - + 0 or 1 space - -Also, you can make user-defined completion and snipMate's trigger completion -(|acp-snipMate|) auto-popup if the options are set. - -These behavior are customizable. - - *acp-snipMate* -snipMate's Trigger Completion ~ - -snipMate's trigger completion enables you to complete a snippet trigger -provided by snipMate plugin -(http://www.vim.org/scripts/script.php?script_id=2540) and expand it. - - -To enable auto-popup for this completion, add following function to -plugin/snipMate.vim: -> - fun! GetSnipsInCurrentScope() - let snips = {} - for scope in [bufnr('%')] + split(&ft, '\.') + ['_'] - call extend(snips, get(s:snippets, scope, {}), 'keep') - call extend(snips, get(s:multi_snips, scope, {}), 'keep') - endfor - return snips - endf -< -And set |g:acp_behaviorSnipmateLength| option to 1. - -There is the restriction on this auto-popup, that the word before cursor must -consist only of uppercase characters. - - *acp-perl-omni* -Perl Omni-Completion ~ - -AutoComplPop supports perl-completion.vim -(http://www.vim.org/scripts/script.php?script_id=2852). - -To enable auto-popup for this completion, set |g:acp_behaviorPerlOmniLength| -option to 0 or more. - - -============================================================================== -COMMANDS *acp-commands* - - *:AcpEnable* -:AcpEnable - enables auto-popup. - - *:AcpDisable* -:AcpDisable - disables auto-popup. - - *:AcpLock* -:AcpLock - suspends auto-popup temporarily. - - For the purpose of avoiding interruption to another script, it is - recommended to insert this command and |:AcpUnlock| than |:AcpDisable| - and |:AcpEnable| . - - *:AcpUnlock* -:AcpUnlock - resumes auto-popup suspended by |:AcpLock| . - - -============================================================================== -OPTIONS *acp-options* - - *g:acp_enableAtStartup* > - let g:acp_enableAtStartup = 1 -< - If non-zero, auto-popup is enabled at startup. - - *g:acp_mappingDriven* > - let g:acp_mappingDriven = 0 -< - If non-zero, auto-popup is triggered by key mappings instead of - |CursorMovedI| event. This is useful to avoid auto-popup by moving - cursor in Insert mode. - - *g:acp_ignorecaseOption* > - let g:acp_ignorecaseOption = 1 -< - Value set to 'ignorecase' temporarily when auto-popup. - - *g:acp_completeOption* > - let g:acp_completeOption = '.,w,b,k' -< - Value set to 'complete' temporarily when auto-popup. - - *g:acp_completeoptPreview* > - let g:acp_completeoptPreview = 0 -< - If non-zero, "preview" is added to 'completeopt' when auto-popup. - - *g:acp_behaviorUserDefinedFunction* > - let g:acp_behaviorUserDefinedFunction = '' -< - |g:acp_behavior-completefunc| for user-defined completion. If empty, - this completion will be never attempted. - - *g:acp_behaviorUserDefinedMeets* > - let g:acp_behaviorUserDefinedMeets = '' -< - |g:acp_behavior-meets| for user-defined completion. If empty, this - completion will be never attempted. - - *g:acp_behaviorSnipmateLength* > - let g:acp_behaviorSnipmateLength = -1 -< - Pattern before the cursor, which are needed to attempt - snipMate-trigger completion. - - *g:acp_behaviorKeywordCommand* > - let g:acp_behaviorKeywordCommand = "\" -< - Command for keyword completion. This option is usually set "\" or - "\". - - *g:acp_behaviorKeywordLength* > - let g:acp_behaviorKeywordLength = 2 -< - Length of keyword characters before the cursor, which are needed to - attempt keyword completion. If negative value, this completion will be - never attempted. - - *g:acp_behaviorKeywordIgnores* > - let g:acp_behaviorKeywordIgnores = [] -< - List of string. If a word before the cursor matches to the front part - of one of them, keyword completion won't be attempted. - - E.g., when there are too many keywords beginning with "get" for the - completion and auto-popup by entering "g", "ge", or "get" causes - response degradation, set ["get"] to this option and avoid it. - - *g:acp_behaviorFileLength* > - let g:acp_behaviorFileLength = 0 -< - Length of filename characters before the cursor, which are needed to - attempt filename completion. If negative value, this completion will - be never attempted. - - *g:acp_behaviorRubyOmniMethodLength* > - let g:acp_behaviorRubyOmniMethodLength = 0 -< - Length of keyword characters before the cursor, which are needed to - attempt ruby omni-completion for methods. If negative value, this - completion will be never attempted. - - *g:acp_behaviorRubyOmniSymbolLength* > - let g:acp_behaviorRubyOmniSymbolLength = 1 -< - Length of keyword characters before the cursor, which are needed to - attempt ruby omni-completion for symbols. If negative value, this - completion will be never attempted. - - *g:acp_behaviorPythonOmniLength* > - let g:acp_behaviorPythonOmniLength = 0 -< - Length of keyword characters before the cursor, which are needed to - attempt python omni-completion. If negative value, this completion - will be never attempted. - - *g:acp_behaviorPerlOmniLength* > - let g:acp_behaviorPerlOmniLength = -1 -< - Length of keyword characters before the cursor, which are needed to - attempt perl omni-completion. If negative value, this completion will - be never attempted. - - See also: |acp-perl-omni| - - *g:acp_behaviorXmlOmniLength* > - let g:acp_behaviorXmlOmniLength = 0 -< - Length of keyword characters before the cursor, which are needed to - attempt XML omni-completion. If negative value, this completion will - be never attempted. - - *g:acp_behaviorHtmlOmniLength* > - let g:acp_behaviorHtmlOmniLength = 0 -< - Length of keyword characters before the cursor, which are needed to - attempt HTML omni-completion. If negative value, this completion will - be never attempted. - - *g:acp_behaviorCssOmniPropertyLength* > - let g:acp_behaviorCssOmniPropertyLength = 1 -< - Length of keyword characters before the cursor, which are needed to - attempt CSS omni-completion for properties. If negative value, this - completion will be never attempted. - - *g:acp_behaviorCssOmniValueLength* > - let g:acp_behaviorCssOmniValueLength = 0 -< - Length of keyword characters before the cursor, which are needed to - attempt CSS omni-completion for values. If negative value, this - completion will be never attempted. - - *g:acp_behavior* > - let g:acp_behavior = {} -< - This option is for advanced users. This setting overrides other - behavior options. This is a |Dictionary|. Each key corresponds to a - filetype. '*' is default. Each value is a list. These are attempted in - sequence until completion item is found. Each element is a - |Dictionary| which has following items: - - "command": *g:acp_behavior-command* - Command to be fed to open popup menu for completions. - - "completefunc": *g:acp_behavior-completefunc* - 'completefunc' will be set to this user-provided function during the - completion. Only makes sense when "command" is "". - - "meets": *g:acp_behavior-meets* - Name of the function which dicides whether or not to attempt this - completion. It will be attempted if this function returns non-zero. - This function takes a text before the cursor. - - "onPopupClose": *g:acp_behavior-onPopupClose* - Name of the function which is called when popup menu for this - completion is closed. Following completions will be suppressed if - this function returns zero. - - "repeat": *g:acp_behavior-repeat* - If non-zero, the last completion is automatically repeated. - - -============================================================================== -SPECIAL THANKS *acp-thanks* - -- Daniel Schierbeck -- Ingo Karkat - - -============================================================================== -CHANGELOG *acp-changelog* - -2.14.1 - - Changed the way of auto-popup for avoiding an issue about filename - completion. - - Fixed a bug that popup menu was opened twice when auto-popup was done. - -2.14 - - Added the support for perl-completion.vim. - -2.13 - - Changed to sort snipMate's triggers. - - Fixed a bug that a wasted character was inserted after snipMate's trigger - completion. - -2.12.1 - - Changed to avoid a strange behavior with Microsoft IME. - -2.12 - - Added g:acp_behaviorKeywordIgnores option. - - Added g:acp_behaviorUserDefinedMeets option and removed - g:acp_behaviorUserDefinedPattern. - - Changed to do auto-popup only when a buffer is modified. - - Changed the structure of g:acp_behavior option. - - Changed to reflect a change of behavior options (named g:acp_behavior*) - any time it is done. - - Fixed a bug that completions after omni completions or snipMate's trigger - completion were never attempted when no candidate for the former - completions was found. - -2.11.1 - - Fixed a bug that a snipMate's trigger could not be expanded when it was - completed. - -2.11 - - Implemented experimental feature which is snipMate's trigger completion. - -2.10 - - Improved the response by changing not to attempt any completion when - keyword characters are entered after a word which has been found that it - has no completion candidate at the last attempt of completions. - - Improved the response by changing to close popup menu when was - pressed and the text before the cursor would not match with the pattern of - current behavior. - -2.9 - - Changed default behavior to support XML omni completion. - - Changed default value of g:acp_behaviorKeywordCommand option. - The option with "\" cause a problem which inserts a match without - when 'dictionary' has been set and keyword completion is done. - - Changed to show error message when incompatible with a installed vim. - -2.8.1 - - Fixed a bug which inserted a selected match to the next line when - auto-wrapping (enabled with 'formatoptions') was performed. - -2.8 - - Added g:acp_behaviorUserDefinedFunction option and - g:acp_behaviorUserDefinedPattern option for users who want to make custom - completion auto-popup. - - Fixed a bug that setting 'spell' on a new buffer made typing go crazy. - -2.7 - - Changed naming conventions for filenames, functions, commands, and options - and thus renamed them. - - Added g:acp_behaviorKeywordCommand option. If you prefer the previous - behavior for keyword completion, set this option "\". - - Changed default value of g:acp_ignorecaseOption option. - - The following were done by Ingo Karkat: - - - ENH: Added support for setting a user-provided 'completefunc' during the - completion, configurable via g:acp_behavior. - - BUG: When the configured completion is or , the command to - restore the original text (in on_popup_post()) must be reverted, too. - - BUG: When using a custom completion function () that also uses - an s:...() function name, the s:GetSidPrefix() function dynamically - determines the wrong SID. Now calling s:DetermineSidPrefix() once during - sourcing and caching the value in s:SID. - - BUG: Should not use custom defined completion mappings. Now - consistently using unmapped completion commands everywhere. (Beforehand, - s:PopupFeeder.feed() used mappings via feedkeys(..., 'm'), but - s:PopupFeeder.on_popup_post() did not due to its invocation via - :map-expr.) - -2.6: - - Improved the behavior of omni completion for HTML/XHTML. - -2.5: - - Added some options to customize behavior easily: - g:AutoComplPop_BehaviorKeywordLength - g:AutoComplPop_BehaviorFileLength - g:AutoComplPop_BehaviorRubyOmniMethodLength - g:AutoComplPop_BehaviorRubyOmniSymbolLength - g:AutoComplPop_BehaviorPythonOmniLength - g:AutoComplPop_BehaviorHtmlOmniLength - g:AutoComplPop_BehaviorCssOmniPropertyLength - g:AutoComplPop_BehaviorCssOmniValueLength - -2.4: - - Added g:AutoComplPop_MappingDriven option. - -2.3.1: - - Changed to set 'lazyredraw' while a popup menu is visible to avoid - flickering. - - Changed a behavior for CSS. - - Added support for GetLatestVimScripts. - -2.3: - - Added a behavior for Python to support omni completion. - - Added a behavior for CSS to support omni completion. - -2.2: - - Changed not to work when 'paste' option is set. - - Fixed AutoComplPopEnable command and AutoComplPopDisable command to - map/unmap "i" and "R". - -2.1: - - Fixed the problem caused by "." command in Normal mode. - - Changed to map "i" and "R" to feed completion command after starting - Insert mode. - - Avoided the problem caused by Windows IME. - -2.0: - - Changed to use CursorMovedI event to feed a completion command instead of - key mapping. Now the auto-popup is triggered by moving the cursor. - - Changed to feed completion command after starting Insert mode. - - Removed g:AutoComplPop_MapList option. - -1.7: - - Added behaviors for HTML/XHTML. Now supports the omni completion for - HTML/XHTML. - - Changed not to show expressions for CTRL-R =. - - Changed not to set 'nolazyredraw' while a popup menu is visible. - -1.6.1: - - Changed not to trigger the filename completion by a text which has - multi-byte characters. - -1.6: - - Redesigned g:AutoComplPop_Behavior option. - - Changed default value of g:AutoComplPop_CompleteOption option. - - Changed default value of g:AutoComplPop_MapList option. - -1.5: - - Implemented continuous-completion for the filename completion. And added - new option to g:AutoComplPop_Behavior. - -1.4: - - Fixed the bug that the auto-popup was not suspended in fuzzyfinder. - - Fixed the bug that an error has occurred with Ruby-omni-completion unless - Ruby interface. - -1.3: - - Supported Ruby-omni-completion by default. - - Supported filename completion by default. - - Added g:AutoComplPop_Behavior option. - - Added g:AutoComplPop_CompleteoptPreview option. - - Removed g:AutoComplPop_MinLength option. - - Removed g:AutoComplPop_MaxLength option. - - Removed g:AutoComplPop_PopupCmd option. - -1.2: - - Fixed bugs related to 'completeopt'. - -1.1: - - Added g:AutoComplPop_IgnoreCaseOption option. - - Added g:AutoComplPop_NotEnableAtStartup option. - - Removed g:AutoComplPop_LoadAndEnable option. -1.0: - - g:AutoComplPop_LoadAndEnable option for a startup activation is added. - - AutoComplPopLock command and AutoComplPopUnlock command are added to - suspend and resume. - - 'completeopt' and 'complete' options are changed temporarily while - completing by this script. - -0.4: - - The first match are selected when the popup menu is Opened. You can insert - the first match with CTRL-Y. - -0.3: - - Fixed the problem that the original text is not restored if 'longest' is - not set in 'completeopt'. Now the plugin works whether or not 'longest' is - set in 'completeopt', and also 'menuone'. - -0.2: - - When completion matches are not found, insert CTRL-E to stop completion. - - Clear the echo area. - - Fixed the problem in case of dividing words by symbols, popup menu is - not opened. - -0.1: - - First release. - - -============================================================================== -ABOUT *acp-about* *acp-contact* *acp-author* - -Author: Takeshi NISHIDA -Licence: MIT Licence -URL: http://www.vim.org/scripts/script.php?script_id=1879 - http://bitbucket.org/ns9tks/vim-autocomplpop/ - -Bugs/Issues/Suggestions/Improvements ~ - -Please submit to http://bitbucket.org/ns9tks/vim-autocomplpop/issues/ . - -============================================================================== - vim:tw=78:ts=8:ft=help:norl: - diff --git a/vim_old/doc/csupport.txt b/vim_old/doc/csupport.txt deleted file mode 100644 index 8d55323..0000000 --- a/vim_old/doc/csupport.txt +++ /dev/null @@ -1,2160 +0,0 @@ -*csupport.txt* C/C++ Support May 14 2010 - -C/C++ Support *c-support* *csupport* - Plugin version 5.11 - for Vim version 7.0 and above - Fritz Mehner - -C/C++-IDE for Vim/gVim. It is written to considerably speed up writing code in -a consistent style. This is done by inserting complete statements,idioms, -code snippets, templates, and comments. Syntax checking, compiling, running -a program, running a code checker or a reformatter can be done with a -keystroke. - - 1. Usage |csupport-usage-gvim| - 1.1 Menu 'Comments' |csupport-comm| - 1.1.1 Append aligned comments |csupport-comm-aligned| - 1.1.2 Adjust end-of-line comments |csupport-comm-realign| - 1.1.3 Code to comment |csupport-code-to-comm| - 1.1.4 Comment to code |csupport-comm-to-code| - 1.1.5 Frame comments, file header, ... |csupport-comm-frame| - 1.1.6 File section comments .. |csupport-comm-sections| - 1.1.7 Keyword comment, special comment |csupport-comm-keyword| - 1.1.8 Tags (plugin) |csupport-comm-tags| - 1.1.9 Date and date+time |csupport-comm-date| - 1.1.10 C to C++ comments and vice versa |csupport-comm-c-cpp| - 1.2 Menu 'Statements' |csupport-stat| - 1.2.1 Normal mode, insert mode. |csupport-stat-normal-mode| - 1.2.2 Visual mode. |csupport-stat-visual-mode| - 1.3 Menu 'Preprocessor' |csupport-prep| - 1.3.1 Normal mode, insert mode. |csupport-prep-normal-mode| - 1.3.2 Visual mode. |csupport-prep-visual-mode| - 1.3.3 Block out code with #if 0 .. #endif |csupport-prep-if0| - 1.3.4 Ex-commands |csupport-prep-ex| - 1.4 Menu 'Idioms' |csupport-idioms| - 1.4.1 Item 'function' |csupport-idioms-function| - 1.4.2 for-loop control |csupport-idioms-for-loop| - 1.4.3 Item 'open input file' |csupport-idioms-input| - 1.4.4 Item 'open output file' |csupport-idioms-output| - 1.5 Menu 'Snippets' |csupport-snippets| - 1.5.1 Code snippets |csupport-snippets| - 1.5.2 Picking up prototypes |csupport-proto| - 1.5.3 Code templates |csupport-templates-menu| - 1.6 Menu 'C++' |csupport-c++| - 1.6.1 Normal mode, insert mode. |csupport-c++-normal-mode| - 1.6.2 Visual mode. |csupport-c++-visual-mode| - 1.6.3 Method implementation |csupport-c++-method-impl| - 1.6.4 Ex commands |csupport-c++-ex| - 1.7 Menu 'Run' |csupport-run| - 1.7.1 Minimal make functionality |csupport-run-buffer| - 1.7.2 Command line arguments |csupport-run-cmdline-args| - 1.7.3 Run make |csupport-run-make| - 1.7.4 Command line arguments for make |csupport-run-make-args| - 1.7.5 Splint |csupport-run-splint| - 1.7.6 CodeCheck |csupport-run-codecheck| - 1.7.7 Indent |csupport-run-indent| - 1.7.8 Hardcopy |csupport-run-hardcopy| - 1.7.9 Rebuild templates |csupport-run-templates| - 1.7.10 Xterm size |csupport-run-xterm| - 1.7.11 Output redirection |csupport-run-output| - 1.8 Help |csupport-help| - - 2. Usage without GUI |csupport-usage-vim| - 3. Hotkeys |csupport-hotkeys| - 4. Customization and configuration |csupport-custom| - 4.1 Global variables |csupport-custom-glob-vars| - 4.2 The root menu |csupport-custom-root-menu| - 4.3 System-wide installation |csupport-system-wide| - 5. Template files and tags |csupport-templates| - 5.1 Template files |csupport-templates-files| - 5.2 Macros |csupport-templates-macros| - 5.2.1 User defined formats for date and time |csupport-templates-date| - 5.3 Templates |csupport-templates-names| - 5.3.1 Template names |csupport-templates-names| - 5.3.2 Template definition |csupport-templates-definition| - 5.3.3 Template expansion |csupport-templates-expansion| - 5.3.4 The macros <+text+> etc. |csupport-templates-jump| - 5.3.5 Command Ctrl-j |csupport-Ctrl-j| - 5.4 Switching between template sets |csupport-templates-sets| - 5.5 Binding a style to a file extension |csupport-templates-bind| - 6. C/C++ Dictionaries |csupport-dictionary| - 7. Extend ctags |csupport-ctags| - 7.1 Make and qmake |csupport-ctags-make| - 7.2 Templates |csupport-ctags-templates| - 8. Folding |csupport-folding| - 9 Additional Mappings |csupport-ad-mappings| - 10. Windows particularities |csupport-windows| - 11. Additional tips |csupport-tips| - 12. Troubleshooting |csupport-troubleshooting| - 13. Release Notes /Change Log |csupport-release-notes| - - How to add this help file to Vim's help |add-local-help| - - -============================================================================== -1. USAGE WITH GUI (gVim) *csupport-usage-gvim* -============================================================================== - -If the root menu 'C/C++' is not visible call it with the item "Load C Support" -from the standard Tools-menu. -The item "Load C Support" can also be used to unload the C/C++-root menu. - -Nearly all menu entries insert code snippets or comments. All these stuff is -taken from template files and can be changed by the user to meet his -requirements (see|csupport-templates|). - ------------------------------------------------------------------------------- -1.1 MENU 'Comments' *csupport-comm* ------------------------------------------------------------------------------- - -1.1.1 APPEND ALIGNED COMMENTS TO CONSECUTIVE LINES *csupport-comm-aligned* - -In NORMAL MODE the menu items 'end-of-line comment' will append an comment to -the current line. -In VISUAL MODE these item will append aligned comments to all marked lines. -Marking the first 4 lines - - print_double_array ( double array[], - int n, - int columns, - char* arrayname - ) - -and choosing 'end-of-line com. /**/' will yield. - - print_double_array ( double array[], /* */ - int n, /* */ - int columns, /* */ - char* arrayname /* */ - ) /* */ - -If one ore more lines go beyond the starting column (s.below) the comments -will start at the 2. column after the longest line. The cursor will be -positioned inside the first comment. - -The default starting column is 49 ( = (multiple of 2,4, or 8) + 1 ). This can -be changed by setting a global variable in the file ~/.vimrc , e.g. : - - let g:C_LineEndCommColDefault = 45 - -The starting column can also be set by the menu item -'Comments->set end-of-line com. col' . Just position the cursor in an -arbitrary column (column number is shown in the Vim status line) and choose -this menu item. This setting is buffer related. - -If the cursor was at the end of a line you will be asked for a column number -because this position is most likely not the desired starting column. -Your choice will be confirmed. - ------------------------------------------------------------------------------- - -1.1.2 ADJUST END-OF-LINE COMMENTS *csupport-comm-realign* - -After some changes end-of-line comments may be no longer aligned: - - print_double_array ( double array[], /* */ - long int n, /* */ - unsigned int columns, /* */ - char* a_name /* */ - ) /* */ - -Realignment can be achieved with the menu item 'adjust end-of-line com.' In -normal mode the comment (if any) in the current line will be aligned to the -end-of-line comment column (see above) if possible. In visual mode the -comments in the marked block will be aligned: - - print_double_array ( double array[], /* */ - long int n, /* */ - unsigned int columns, /* */ - char* a_name /* */ - ) /* */ - -The realignment will not be done for comments with nothing else than leading -whitespaces. These comments are usually captions: - - max = other.max; /* the maximum value */ - len = other.len; /* the length */ - /* ===== the next section ===== */ - pos = (x+y+z)/3.0; /* the next position */ - -After the alignment we have: - - max = other.max; /* the maximum value */ - len = other.len; /* the length */ - /* ===== the next section ===== */ - pos = (x+y+z)/3.0; /* the next position */ - ------------------------------------------------------------------------------- - -1.1.3 CODE TO COMMENT *csupport-code-to-comm* - -The marked block - -xxxxxxxx -xxxxxxxx -xxxxxxxx - -will be changed by the menu item 'code->comment /**/' into the multiline -comment (all (partially) marked lines): - -/* xxxxxxxx - * xxxxxxxx - * xxxxxxxx - */ - -The marked block will be changed by the menu item 'code->comment //' into the -multiline comment - -//xxxxxxxx -//xxxxxxxx -//xxxxxxxx - -The menu items works also for a single line. A single line needs not to be -marked. - ------------------------------------------------------------------------------- - -1.1.4 COMMENT TO CODE *csupport-comm-to-code* - -If one (or more) complete comment (i.e. all lines belonging to the comment) is -marked the item 'comment->code' will uncomment it. If the following lines -are marked - - * printf ("\n"); - */ - - printf ("\n"); - - // printf ("\n"); - // - - /* - * printf ("\n"); - */ - -uncommenting will yield - - * printf ("\n"); - */ - - printf ("\n"); - - printf ("\n"); - - - - printf ("\n"); - -The first 2 lines are only a part of a C-comment and remain unchanged. -A C-comment can start with /* , /** or /*! . - -The menu item works also for a single line with a leading // . A single line -needs not to be marked. - ------------------------------------------------------------------------------- - -1.1.5 FRAME COMMENTS, FILE HEADER, ... *csupport-comm-frame* - -Frame comments, file header comments and function, methods, class descriptions -are read as templates from the appropriate files (see |csupport-templates|). - -There are to file description templates (menu items 'file description (impl.)' -and 'file description (header)', see also |csupport-templates|): - - comment.file-description : files *.c *.cc *.cp *.cxx *.cpp *.CPP *.c++ - *.C *.i *.ii - - comment.file-description-header : everything else with filetype 'c' or 'cpp' - -The appropriate template will also be included into a new file. The plugin -decides on the basis of the file extension. The default is shown above. You -can change the list by setting a global variable in '~/.vimrc': - - au BufRead,BufNewFile *.XYZ set filetype=c - - let g:C_SourceCodeExtensions = 'XYZ c cc cp cxx cpp CPP c++ C i ii' - -A new file named 'test.XYZ' will now be considered a C implementation file. - ------------------------------------------------------------------------------- - -1.1.6 FILE SECTION COMMENTS *csupport-comm-sections* - -File section comments can be uses to separate typical C- and H-file sections -with comments of similar appearance, e.g. - -/* ##### HEADER FILE INCLUDES ################################################### */ - -/* ##### MACROS - LOCAL TO THIS SOURCE FILE ################################### */ - -/* ##### TYPE DEFINITIONS - LOCAL TO THIS SOURCE FILE ######################### */ - -These section comments can also be inserted using the hotkey \ccs for C/C++ -files, or \chs for H-files. These hotkeys will start the command -'CFileSection' or 'HFileSection' on the command line: - - :CFileSection - :HFileSection - -Now type a to start the selection menu to choose from. - ------------------------------------------------------------------------------- - -1.1.7 KEYWORD COMMENT, SPECIAL COMMENT *csupport-comm-keyword* - -Keword comments are end-of-line comments: - - /* :::: */ - -Keywords are - - BUG COMPILER TODO TRICKY WARNING WORKAROUND user-defined-keyword - -These are preliminary comments to document places where works will be resumed -shortly. They are usually not meant for the final documentation. These -comments are easily found by searching for the keyword. -The keyword comments can also be inserted using the hotkey \ckc . This hotkey -starts the command 'KeywordComment' on the command line: - - :KeywordComment - -Now type a to start the selection menu to choose from. - -Special comments are occasionally used to mark special features of a code -construct (e.g. a fall through cases in a switch statement, an empty loop): - - /* EMPTY */ - /* NOT REACHED */ - /* REMAINS TO BE IMPLEMENTED */ - .... - -The special comments can also be inserted using the hotkey \csc . This hotkey -starts the command 'SpecialComment' on the command line: - - :SpecialComment - -Now type a to start the selection menu to choose from. - ------------------------------------------------------------------------------- - -1.1.8 TAGS (PLUGIN) *csupport-comm-tags* - -The submenu 'tags (plugin)' let you insert the predefined macros from the -template system (see|csupport-templates-macros|). In visual mode the marked -string will be replaced by the macro. - ------------------------------------------------------------------------------- - -1.1.9 DATE AND DATE+TIME *csupport-comm-date* - -The format for 'date' and 'date time' can be defined by the user (see -|csupport-templates-date|). In visual mode the marked string will be replaced -by the macro (e.g. to update date and time). - ------------------------------------------------------------------------------- - -1.1.10 C TO C++ COMMENTS AND VICE VERSA *csupport-comm-c-cpp* - -The menu item '// xxx -> /* xxx */' changes a C++ comment into an C comment. -This is done for the current line in normal or insert mode and for a marked -area of lines in visual mode. -If there are multiple C comments only the first one will be changed: - printf ("\n"); /* one */ /* two */ /* three */ -will be changed into - printf ("\n"); // one /* two */ /* three */ - -The menu item '/* xxx */ -> // xxx' changes a C comment into an C++ comment. - ------------------------------------------------------------------------------- -1.2 MENU 'Statements' *csupport-stat* ------------------------------------------------------------------------------- - -1.2.1 NORMAL MODE, INSERT MODE. *csupport-stat-normal-mode* - -An empty statement will be inserted and properly indented. The item 'if{}' -will insert an if-statement: - -if ( ) -{ -} - - -1.2.2 VISUAL MODE. *csupport-stat-visual-mode* - -STATEMENTS WITH BLOCKS AND CASE LABEL. --------------------------------------- -The highlighted area - -xxxxx -xxxxx - -can be surrounded by one of the following statements: - - +----------------------------+-----------------------------+ - | if ( ) | if ( ) | - | { | { | - | xxxxx | xxxxx | - | xxxxx | xxxxx | - | } | } | - | | else | - | | { | - | | } | - +----------------------------+-----------------------------+ - | for ( ; ; ) | while ( ) | - | { | { | - | xxxxx | xxxxx | - | xxxxx | xxxxx | - | } | } | - +----------------------------+-----------------------------+ - | do | | - | { | { | - | xxxxx | xxxxx | - | xxxxx | xxxxx | - | } | } | - | while ( ); | | - +----------------------------+-----------------------------+ - | switch ( ) { | - | case : | - | break; | - | | - | case : | - | break; | - | | - | case : | - | break; | - | | - | case : | - | break; | - | | - | default: | - | break; | - | } | - +----------------------------+-----------------------------+ - -The whole statement will be indented after insertion. - - -STATEMENTS WITHOUT BLOCKS. --------------------------- -One of the following statements can be inserted: - - +-------------------------------+--------------------------+ - | if ( ) | for ( ; ; ) | - +-------------------------------+--------------------------+ - | if ( ) | while ( ) | - | else | | - +-------------------------------+--------------------------+ - | case : | | - | break; | | - +-------------------------------+--------------------------+ - - ------------------------------------------------------------------------------- -1.3 MENU 'Preprocessor' *csupport-prep* ------------------------------------------------------------------------------- - -1.3.1 NORMAL MODE, INSERT MODE. *csupport-prep-normal-mode* - -The preprocessor statements will be inserted and properly indented. - -1.3.2 VISUAL MODE. *csupport-prep-visual-mode* - -STATEMENTS WITH BLOCKS ----------------------- -The highlighted area - -xxxxx -xxxxx - -can be surrounded by one of the following statements: - - +----------------------------+-----------------------------+ - | #if CONDITION | - | xxxxx | - | xxxxx | - | #else /* ----- #if CONDITION ----- */ | - | | - | #endif /* ----- #if CONDITION ----- */ | - +----------------------------------------------------------+ - | #ifdef CONDITION | - | xxxxx | - | xxxxx | - | #else /* ----- #ifdef CONDITION ----- */ | - | | - | #endif /* ----- #ifdef CONDITION ----- */ | - +----------------------------------------------------------+ - | #ifndef CONDITION | - | xxxxx | - | xxxxx | - | #else /* ----- #ifndef CONDITION ----- */ | - | | - | #endif /* ----- #ifndef CONDITION ----- */ | - +----------------------------------------------------------+ - | #ifndef INC_TEST | - | #define INC_TEST | - | xxxxx | - | xxxxx | - | #endif /* ----- #ifndef INC_TEST ----- */ | - +----------------------------------------------------------+ - | #if 0 /* ----- #if 0 : If0Label_1 ----- */ | - | | - | #endif /* ----- #if 0 : If0Label_1 ----- */ | - +----------------------------------------------------------+ - -The macro name for an include guard (e.g. INC_TEST above) will be derived as a -suggestion from the file name. - -1.3.3 BLOCK OUT CODE WITH #if 0 ... #endif *csupport-prep-if0* - -The menu item #if 0 #endif inserts the lines - - #if 0 /* ----- #if 0 : If0Label_1 ----- */ - - #endif /* ----- #if 0 : If0Label_1 ----- */ - -In visual mode the marked block of lines will be surrounded by these lines. - -This is usually done to temporarily block out some code. The label names like -If0Label_1 are automatically inserted into the comments. The trailing numbers -are automatically incremented. These numbers can be changed by the user. The -next number will be one above the highest number found in the current buffer. - -A corresponding label can be found by searching with the vim star command (*). -All labels can be found with a global search like :g/If0Label_/ or -:g/If0Label_\d\+/. All corresponding lines can be deleted with :g/If0Label_/d . - - -REMOVE THE ENCLOSING #if 0 ... #endif -CONSTRUCT. - -The menu item 'remove #if #endif' removes such a construct if the cursor is -in the middle of such a section or on one of the two enclosing lines. Nested -constructs will be untouched. - -1.3.4 EX-COMMANDS *csupport-prep-ex* - -There are 4 additional Ex command which can be used to insert include -statements: - - Ex command hotkey includes - ------------------------------------------------------------------------- - :IncludeStdLibrary \ps C standard library - :IncludeC99Library \pc C99 library - :IncludeCppLibrary \+ps C++ standard library - :IncludeCppCLibrary \+pc C standard library ( #include ) - -Type :Inc and choose one of the commands. Now type an additional space -and a to show the whole list list or type a space and a few leading -characters to reduce this list. - ------------------------------------------------------------------------------- -1.4 MENU 'Idioms' *csupport-idioms* ------------------------------------------------------------------------------- - -1.4.1 Item 'function' *csupport-idioms-function* - -NORMAL MODE, INSERT MODE: -The name of the function is asked for and the following lines (for function -name "f") will be inserted: - - void - f ( ) - { - return ; - } /* ---------- end of function f ---------- */ - -VISUAL MODE: -Main or [static] function: the highlighted lines will go inside the new -function or main. -for-loops: the highlighted lines will be set in braces. - -1.4.2 for-loop control *csupport-idioms-for-loop* - -The menu items 'for( x=0; ... )' and 'for( x=n-1; ... )' can be used to write -the control statement for a for-loop counting upward or downward. These items -start an input dialog - - [TYPE (expand)] VARIABLE [START [END [INCR.]]] : - -asking for at least the name of the loop variable. The other parameters are -optional. The type is restricted to the following integral data types: - - char - int - long - long int - long long - long long int - short - short int - size_t - unsigned - unsigned char - unsigned int - unsigned long - unsigned long int - unsigned long long - unsigned long long int - unsigned short - unsigned short int - -One of these types can be specified by typing it completely or by typing zero -or more characters of its name and completing them to the full name by using -the tab key (tab completion). If the start of the type name is ambiguous (e.g. -'uns') a list of completion candidates is provided to choose from. - -1.4.3 Item 'open input file' *csupport-idioms-input* - -The item 'open input file' will create the statements to open and close an -input file (e.g. with the file pointer 'infile'). - -1.4.4 Item 'open output file' *csupport-idioms-output* - -The item 'open output file' will create the statements to open and close an -output file (e.g. with the file pointer 'outfile'). - ------------------------------------------------------------------------------- -1.5 MENU 'Snippets' *csupport-snippets* ------------------------------------------------------------------------------- - -1.5.1 CODE SNIPPETS - -Code snippets are pieces of code which are kept in separate files in a special -directory (e.g. a few lines of code or a complete template for a Makefile). -File names are used to identify the snippets. The snippet directory will be -created during the installation ( $HOME/.vim/codesnippets-c is the default). -Snippets are managed with the 3 items - - C/C++ -> Snippets -> read code snippet - C/C++ -> Snippets -> write code snippet - C/C++ -> Snippets -> edit code snippet - -from the Snippets submenu. - -CREATING A NEW SNIPPET -When nothing is marked, "write code snippet" will write the whole buffer -to a snippet file, otherwise the marked area will be written to a file. - -INSERT A SNIPPET -Select the appropriate file from the snippet directory ("read code snippet"). -The inserted lines will be indented. - -EDIT A SNIPPET -This is a normal edit. - -INDENTATION / NO INDENTATION -Code snippets are normally indented after insertion. To suppress indentation -add the file extension "ni" or "noindent" to the snippet file name, e.g. - - parameter_handling.c.noindent - -Snippet browser ---------------- -Under a GUI a file requester will be put up. Without GUI the filename will be -read from the command line. You can change this behavior by setting a global -variable in your ~/.vimrc : - - let g:C_GuiSnippetBrowser = 'commandline' - -The default value is 'gui'. - - -1.5.2 PICKING UP PROTOTYPES *csupport-proto* - -PICK UP PROTOTYPES. -To make a prototype from a function head mark the function head and choose -'Snippets -> pick up prototype'. From the first six lines of - - void - print_double_array ( double array[], /* array to print */ - int n, /* number of elements to print */ - int columns, /* number of elements per column */ - char* arrayname /* array name */ - ) - { - ... - } /* ---------- end of function print_double_array ---------- */ - -the prototype - - void print_double_array ( double array[], int n, int columns, char* arrayname ); - -is produced and put in an internal buffer. -- Leading and trailing whitespaces are removed. -- All inner whitespaces are squeezed. -- All comments will be discarded. -- Trailing parts of the function body (e.g a '{' ) will also be removed. -- The class name and the scope resolution operator will be removed (C++ method - implementations). -Further prototypes can be picked up and gathered in the buffer. - -For C++ methods namespace names and class names will be removed -(exception: 'std::' ). The first two lines of - - std::string - ROBOT::Robot::get_name ( void ) - { - return type_name; - } /* ----- end of method Robot::get_name ----- */ - -result in the prototype - - std::string get_name ( void ); - -Folding may help picking up prototypes (see |csupport-folding|). - - -INSERT PROTOTYPES -With 'Snippets -> insert prototype(s)' all picked up prototypes currently in -the buffer will be inserted below the cursor. -The prototype buffer will be cleared after insertion. - - -DISCARD PROTOTYPES -The prototype buffer can be cleared with 'Snippets -> clear prototype(s)' . - - -SHOW PROTOTYPES -The list of gathered prototypes can be shown with -'Snippets -> show prototype(s)'. The number and the filename are shown, e.g. - - (1) matrix.c # double** calloc_double_matrix ( int rows, int columns ); - (2) matrix.c # void free_double_matrix ( double **m ); - (3) foomain.c # void foo ( ); - - -REMARK. Generating prototypes this way is nice in a small project. You may -want to use an extractor like cextract or something else. - - -1.5.3 Code Templates *csupport-templates-menu* ---------------------- -Nearly all menu entries insert code snippets or comments. All these stuff is -taken from template files and can be changed by the user to meet his -requirements (see|csupport-templates|on how to use the template system). - -The menu item 'edit local templates' opens the main template file in a local -plugin installation. This is usually the file -'~/.vim/c-support/templates/Templates'. There may be dependent files -loaded from the main file. Now change whatever file you want, save it, and -click on the menu item 'reread templates' to read in the file(s) and to -rebuild the internal representation of the templates. - -The menu item 'edit global templates' opens the main template file in a -system-wide plugin installation (see |csupport-system-wide|). This is -usually the file '$VIM./vimfiles/c-support/templates/Templates'. - -Template browser ----------------- -Under a GUI a file requester will be put up. Without GUI the filename will be -read from the command line. You can change this behavior by setting a global -variable in your ~/.vimrc : - - let g:C_GuiTemplateBrowser = 'explorer' - -The default value is 'gui'. 'explorer' will start the file explorer -(see help|:Explore|). To use the commandline asign 'commandline'. - ------------------------------------------------------------------------------- -1.6 MENU 'C++' *csupport-c++* ------------------------------------------------------------------------------- - -1.6.1 NORMAL MODE, INSERT MODE. *csupport-c++-normal-mode* - -An empty statement will be inserted and in some cases properly indented. The -item 'try .. catch' will insert the following lines: - - try { - } - catch ( const &ExceptObj ) { // handle exception: - } - catch (...) { // handle exception: unspecified - } - -The cursor will go into the try block. - -1.6.2 VISUAL MODE. *csupport-c++-visual-mode* - -The highlighted area can be surrounded by one of the following statements: - - try - catch - catch - catch(...) - namespace { } - extern "C" { } - -The whole statement will be indented after insertion. - -1.6.3 METHOD IMPLEMENTATION *csupport-c++-method-impl* - -The menu item 'method implement.' asks for a method name. If this item is -called the first time you will see just an scope resolution operator. If you -specify the scope this is used the next time you call this item. If you use -one of the menu items to generate a class (see |csupport-templates|) the -scope will be extracted and used for the next method. - -1.6.4 EX COMMANDS *csupport-c++-ex* - -There are 4 additional Ex command which can be used to insert include -statements. Please see |csupport-prep-ex|. - ------------------------------------------------------------------------------- -1.7 MENU 'Run' *csupport-run* ------------------------------------------------------------------------------- - -1.7.1 MINIMAL MAKE FUNCTIONALITY *csupport-run-buffer* - -The 'Run' menu provides a minimal make functionality for single file projects -(e.g. in education) : - -SAVE AND COMPILE -'save and compile' saves the buffer and run the compiler with the given -options (see |csupport-custom-glob-vars|). - -An error window will be opened if the compiler reports errors and/or warnings. -Quickfix commands can now be used to jump to an error location. - -Consider using maps like - map :cprevious - map :cnext -in your ~/.vimrc file to jump over the error locations and make navigation -easier. The error list and the error locations in your source buffer will be -synchronized. - - -LINK -'link' makes an executable from the current buffer. If the buffer is not -saved, or no object is available or the object is older then the source step -'save and compile' is executed first. - -The behavior of the compiler / linker is determined by the options assigned to -the variables described in |csupport-custom-glob-vars| (4.group). - -RUN -'run' runs the executable with the same name (extension .e) as the current -buffer. If the buffer is not saved, or no executable is available or the -executable is older then the source steps 'save and compile' and 'link' are -executed first. - - -1.7.2 COMMAND LINE ARGUMENTS *csupport-run-cmdline-args* - -The item 'command line arguments' calls an input dialog which asks for command -line arguments. These arguments are forwarded to the program which is run by -the 'run' item. The arguments are kept until you change them. -For the first and only the first argument file name expansion will work (use -the Tab-key). Only the first string of the input can be expanded due to a -restriction of the Vim input function. To expand two or more filenames -specify them in reverse order: type the first characters of the last filename -and expand them. Go to the start of the input and type the beginning of the -last but one filename and expand it. - -The arguments belong to the current buffer (that is, each buffer can have its -own arguments). -If the buffer gets a new name with "save as" the arguments will now belong to -the buffer with the new name. - -The command line arguments can be followed by pipes and redirections: - - 11 22 | sort -rn | head -10 > out - -Caveat: If you look for the current arguments by calling this menu item again -be sure to leave it with a CR (not Esc !). Due to a limitation of an internal -Vim function CR will keep the arguments, Esc will discard them. - - -1.7.3 RUN make *csupport-run-make* - -The item 'make' runs the external make program. - - -1.7.4 COMMAND LINE ARGUMENTS FOR make *csupport-run-make-args* - -The item 'command line arguments for make' calls an input dialog which asks -for command line arguments for make. These arguments are forwarded to make -when called by the item 'make'. -For the first and only the first argument the file name expansion will work -(use the Tab-key). - - -1.7.5 SPLINT *csupport-run-splint* - -Splint is a tool for statically checking C programs (see http://www.splint.org). -Of course it has to be installed in order to be used within Vim. The menu -item 'Run->splint' will run the current buffer through splint. - -An error window will be opened if splint has something to complain about. -Quickfix commands can now be used to jump to an error location. For easier -navigation see tip under 'SAVE AND COMPILE' |csupport-run-buffer|. - -Splint has many options. Presumably the best way is to keep the options in an -option file (~/.splintrc). For a quick try you can use the menu item -'Run->cmd. line arg. for splint' to specify some buffer related options. - -When vim is started this plugin will check whether splint is executable. If -not, the menu item will *NOT' be visible. - - -1.7.6 CODECHECK *csupport-run-codecheck* - -CodeCheck (TM) is a commercial code analyzing tool produced by Abraxas -Software, Inc. (www.abraxas-software.com). -Of course it has to be installed in order to be used within Vim. The menu -item 'Run->CodeCheck' will run the current buffer through CodeCheck. - -An error window will be opened if CodeCheck has something to complain about. -Quickfix commands can now be used to jump to an error location. For easier -navigation see tip under 'SAVE AND COMPILE' |csupport-run-buffer|. - -CodeCheck has many options. For a quick try you can use the menu item -'Run->cmd. line arg. for CodeCheck' to specify some buffer related options. - -CodeCheck will be run with default options (see |csupport-custom-glob-vars|). -The default options can be overwritten by placing a global variable in -~/.vimrc , e.g. - - let g:C_CodeCheckOptions = "-K13 -Rmeyers" - -The default name for the executable is 'check'. There are other names in use -on different platforms. The name can be changed by placing a global variable -in ~/.vimrc , e.g. - - let g:C_CodeCheckExeName = "chknt.exe" - -When vim is started this plugin will check whether CodeCheck is executable. If -not, the menu item will *NOT' be visible. - - -1.7.7 INDENT *csupport-run-indent* - -The formatter 'indent' can be run over the whole buffer. Before formatting a -buffer this buffer will be saved to disk and you will be asked for a -confirmation. - -Indent has many options. These are kept in the file '.indent.pro' in your home -directory. See the indent manual for more information. - - -1.7.8 HARDCOPY *csupport-run-hardcopy* - -Generates a PostScript file from the whole buffer or from a marked region. -On a Windows system a printer dialog is displayed. -The hardcopy goes to the current working directory. If the buffer contains -documentation or other material from non-writable directories the hardcopy -goes to the HOME directory. The output destination will be shown in a message. - -The print header contains date and time for the current locale. The definition -used is - - let s:C_Printheader = "%<%f%h%m%< %=%{strftime('%x %X')} Page %N" - -The current locale can be overwritten by changing the language, e.g. - - :language C - -or by setting a global variable in the file ~/.vimrc , e.g. : - - let g:C_Printheader = "%<%f%h%m%< %=%{strftime('%x %X')} SEITE %N" - -See :h printheader and :h strftime() for more details. - - -1.7.9 REBUILD TEMPLATES *csupport-run-templates* - -After editing one or more template files a click on this item rereads the -template files and rebuilds all templates. - - -1.7.10 XTERM SIZE *csupport-run-xterm* - -The size of the xterm used for running a program (below) can be set by this -menu item. The default is 80 columns with 24 lines. -This feature is not available under Windows. - - -1.7.11 OUTPUT REDIRECTION *csupport-run-output* - -Running a program can be done in one of three ways: -(1) Run the program from the gVim command line. - This is for interactive programs with little input and output. -(2) Run the program and direct the output into a window with name "C-Output". - The buffer and its content will disappear when the window is closed and - reused otherwise. - This is for non-interactive programs with little to very much output. - You have unlimited line length, regex search, navigation, ... - The tabstop value will be set to 8 for "C-Output". -(3) Run the program in an xterm. - -The output method can be chosen from the menu item 'Run->output: ...'. -This menu has three states: - - output: VIM->buffer->xterm - output: BUFFER->xterm->vim - output: XTERM->vim->buffer - -The first (uppercase) item shows the current method. The default is 'vim'. -This can be changed by setting the variable g:C_OutputGvim to another value. -Possible values are 'vim', 'buffer' and 'xterm' . - -The xterm defaults can be set in ~/.vimrc by the variable g:C_XtermDefaults . -The default is "-fa courier -fs 12 -geometry 80x24" : - font name : -fa courier - font size : -fs 12 - terminal size : -geometry 80x24 -See 'xterm -help' for more options. Xterms are not available under Windows. - ------------------------------------------------------------------------------- -1.8 'help' *csupport-help* ------------------------------------------------------------------------------- -Plugin help ------------ -The root menu item 'help (plugin)' shows this plugin help in a help window. -The help tags must have been generated with - :helptags ~/.vim/doc -The hotkey is \hp (for "help plugin"). - -Displaying a manual -------------------- -The root menu item 'show manual' shows the manual for the word under the -cursor. If there is more than one manual a selection list will be presented. -If there is no word under the cursor you can type in a name. An interface to -the on-line reference manuals must be installed (usually man(1) for -Linux/Unix, see|csupport-custom-glob-vars|). -The hotkey is \hm (for "help manual"). - -============================================================================== -2. USAGE WITHOUT GUI (Vim) *csupport-usage-vim* -============================================================================== - -The frequently used constructs can be inserted with key mappings. The -mappings are also described in the document c-hot-keys.pdf (reference card, -part of this package). -Hint: Typing speed matters. The combination of a leader ('\') and the -following character(s) will only be recognized for a short time. -The insert mode mappings start with ` (backtick). - -Legend: (i) insert mode, (n) normal mode, (v) visual mode - - -- Help --------------------------------------------------------------- - - \hm show manual for word under the cursor (n,i) - \hp show plugin help (n,i) - - -- Comments ----------------------------------------------------------- - - \cl end-of-line comment (n,v,i) - \cj adjust end-of-line comment(s) (n,v,i) - \cs set end-of-line comment column (n) - \c* code -> comment /* */ (n,v) - \cc code -> comment // (n,v) - \co comment -> code (n,v) - \cfr frame comment (n,i) - \cfu function comment (n,i) - \cme method description (n,i) - \ccl class description (n,i) - \cfdi file description (implementation) (n,i) - \cfdh file description (header) (n,i) - \ccs C/C++-file section (tab. compl.) (n,i) - \chs H-file section (tab. compl.) (n,i) - \ckc keyword comment (tab. compl.) (n,i) - \csc special comment (tab. compl.) (n,i) - \cd date (n,v,i) - \ct date \& time (n,v,i) - - -- Statements --------------------------------------------------------- - - \sd do { } while (n,v,i) - \sf for (n,i) - \sfo for { } (n,v,i) - \si if (n,i) - \sif if { } (n,v,i) - \sie if else (n,v,i) - \sife if { } else { } (n,v,i) - \se else { } (n,v,i) - \sw while (n,i) - \swh while { } (n,v,i) - \ss switch (n,v,i) - \sc case (n,i) - \s{ \sb { } (n,v,i) - - -- Preprocessor ------------------------------------------------------- - - \ps choose a standard library include (n,i) - \pc choose a C99 include (n,i) - \p< #include <> (n,i) - \p" #include "" (n,i) - \pd #define (n,i) - \pu #undef (n,i) - \pie #if #else #endif (n,v,i) - \pid #ifdef #else #endif (n,v,i) - \pin #ifndef #else #endif (n,v,i) - \pind #ifndef #def #endif (n,v,i) - \pi0 #if 0 #endif (n,v,i) - \pr0 remove #if 0 #endif (n,i) - \pe #error (n,i) - \pl #line (n,i) - \pp #pragma (n,i) - - -- Idioms ------------------------------------------------------------- - - \if function (n,v,i) - \isf static function (n,v,i) - \im main() (n,v,i) - \i0 for( x=0; x=0; x-=1 ) (n,v,i) - \ie enum + typedef (n,i) - \is struct + typedef (n,i) - \iu union + typedef (n,i) - \ip printf() (n,i) - \isc scanf() (n,i) - \ica p=calloc() (n,i) - \ima p=malloc() (n,i) - \isi sizeof() (n,v,i) - \ias assert() (n,v) - \ii open input file (n,i) - \io open output file (n,i) - - -- Snippets ----------------------------------------------------------- - - \nr read code snippet (n,i) - \nw write code snippet (n,v,i) - \ne edit code snippet (n,i) - \np pick up prototype (n,v,i) - \ni insert prototype(s) (n,i) - \nc clear prototype(s) (n,i) - \ns show prototype(s) (n,i) - \ntl edit local templates (n,i) - \ntg edit global templates (n,i) - \ntr rebuild templates (n,i) - - -- C++ ---------------------------------------------------------------- - - \+co cout << << endl; (n,i) - \+c class (n,i) - \+ps #include <...> STL (n,i) - \+pc #include C (n,i) - \+cn class (using new) (n,i) - \+ci class implementation (n,i) - \+cni class (using new) implementation (n,i) - \+mi method implementation (n,i) - \+ai accessor implementation (n,i) - - \+tc template class (n,i) - \+tcn template class (using new) (n,i) - \+tci template class implementation (n,i) - \+tcni template class (using new) impl. (n,i) - \+tmi template method implementation (n,i) - \+tai template accessor implementation (n,i) - - \+tf template function (n,i) - \+ec error class (n,i) - \+tr try ... catch (n,v,i) - \+ca catch (n,v,i) - \+c. catch(...) (n,v,i) - - -- Run ---------------------------------------------------------------- - - \rc save and compile (n,i) - \rl link (n,i) - \rr run (n,i) - \ra set comand line arguments (n,i) - \rm run make (n,i) - \rma cmd. line arg. for make (n,i) - \rp run splint (n,i) - \rpa cmd. line arg. for splint (n,i) - \rk run CodeCheck (TM) (n,i) - \rka cmd. line arg. for CodeCheck (TM) (n,i) - \rd run indent (n,v,i) - \rh hardcopy buffer (n,v,i) - \rs show plugin settings (n,i) - \rx set xterm size (n, only Linux/UNIX & GUI) - \ro change output destination (n,i) - - -- Load / Unload C/C++ Support ---------------------------------------- - - \lcs Load C/C++ Support Menus (n, GUI only) - \ucs Unload C/C++ Support Menus (n, GUI only) - -The hotkeys are defined in the file type plugin c.vim (part of this csupport -plugin package) and described in the document c-hot-keys.pdf - -Changing the default map leader '\' ------------------------------------ -The map leader can be changed by the user by setting a global variable in the -file .vimrc - - let g:C_MapLeader = ',' - -The map leader is now a comma. The 'line end comment' command is now defined -as ',cl'. This setting will be used as a so called local leader and influences -only files with filetype 'c' and 'cpp'. - -============================================================================== -3. HOTKEYS *csupport-hotkeys* -============================================================================== - -The following hotkeys are defined in normal, visual and insert mode: - - F9 compile and link - Alt-F9 write buffer and compile - Ctrl-F9 run executable - Shift-F9 set command line arguments - - Shift-F2 switch between source files and header files - -The hotkeys are defined in the file type plugin c.vim. All hotkeys from the -non-GUI mode also work for gVim (see |csupport-usage-vim|). - -Shift-F2 can be used to switch between source files and header files if the -plugin a.vim (http://vim.sourceforge.net/scripts/script.php?script_id=31) is -present. To suppress the creation of a new header file when switching from a -source file the file ~/.vimrc should contain a line - - let g:alternateNoDefaultAlternate = 1 - -A header file will only be opened if it already exists. - -The Shift-key is dead when you are working with Vim in a console terminal -(non-Gui). You could add - - noremap \a :A - inoremap \a :A - -to get a hot key for this case. - -============================================================================== -4. CUSTOMIZATION *csupport-custom* -============================================================================== - ------------------------------------------------------------------------------- -4.1 GLOBAL VARIABLES *csupport-custom-glob-vars* ------------------------------------------------------------------------------- - -Several global variables are checked by the script to customize it: - - ---------------------------------------------------------------------------- - GLOBAL VARIABLE DEFAULT VALUE TAG (see below) - ---------------------------------------------------------------------------- - g:C_GlobalTemplateFile plugin_dir.'c-support/templates/Templates' - g:C_LocalTemplateFile $HOME.'/.vim/c-support/templates/Templates' - g:C_TemplateOverwrittenMsg 'yes' - g:C_Ctrl_j 'on' - - g:C_CodeSnippets plugin_dir."/c-support/codesnippets/" - g:C_Dictionary_File "" - g:C_LoadMenus "yes" - g:C_MenuHeader "yes" - g:C_OutputGvim "vim" - g:C_XtermDefaults "-fa courier -fs 12 -geometry 80x24" - g:C_Printheader "%<%f%h%m%< %=%{strftime('%x %X')} Page %N" - g:C_MapLeader '\' - g:C_GuiSnippetBrowser 'gui' - g:C_GuiTemplateBrowser 'gui' - - Linux/UNIX: - g:C_ObjExtension ".o" - g:C_ExeExtension "" - g:C_CCompiler "gcc" - g:C_CplusCompiler "g++" - g:C_Man "man" - Windows: - g:C_ObjExtension ".obj" - g:C_ExeExtension ".exe" - g:C_CCompiler "gcc.exe" - g:C_CplusCompiler "g++.exe" - g:C_Man "man.exe" - g:C_CFlags "-Wall -g -O0 -c" - g:C_LFlags "-Wall -g -O0" - g:C_Libs "-lm" - g:C_LineEndCommColDefault 49 - g:C_CExtension "c" - g:C_TypeOfH "cpp" - g:C_SourceCodeExtensions "c cc cp cxx cpp CPP c++ C i ii" - - g:C_CodeCheckExeName "check" - g:C_CodeCheckOptions "-K13" - -The variable plugin_dir will automatically be set to one of the following values: - $HOME.'/.vim/' for Linux/Unix - $VIM.'/vimfiles/' for Windows - - ---------------------------------------------------------------------------- - - 1. group: g:C_GlobalTemplateFile : Sets the master template file (see|csupport-templates|) - g:C_LocalTemplateFile : Sets the local template file (see|csupport-templates|) - g:C_TemplateOverwrittenMsg : message if template is overwritten - g:C_Ctrl_j : hotkey Ctrl-j 'on'/'off' (see|csupport-Ctrl-j|) - - 2. group: g:C_CodeSnippets : The name of the code snippet directory - (see |csupport-snippets|). - g:C_Dictionary_File : The name(s) of the dictionary file(s) used for - word completion (see also |csupport-dictionary|) - g:C_Root : the name of the root menu of this plugin - g:C_LoadMenus : Load menus and mappings ("yes", "no") at startup. - g:C_MenuHeader : Switch the submenu header on/off. - g:C_OutputGvim : when program is running output goes to the vim - command line ("vim"), to a buffer ("buffer") or to - an xterm ("xterm"). - g:C_XtermDefaults : the xterm defaults - g:C_Printheader : hardcopy: definition of the page header - g:C_MapLeader : the map leader for hotkeys (see|csupport-usage-vim|) - g:C_GuiSnippetBrowser : code snippet browser: 'gui', 'commandline' - g:C_GuiTemplateBrowser : code template browser: 'gui', 'explorer', 'commandline' - - 3. group: g:C_CExtension : Extension of C files. Everything else is C++. - g:C_TypeOfH : filetype of header files with extension 'h' (c,cpp) - g:C_SourceCodeExtensions : filename extensions for C/C++ - implementation files - g:C_CCompiler : The name of the C compiler. - g:C_CplusCompiler : The name of the C++ compiler. - g:C_Man : The name of the man utility. - g:C_CFlags : Compiler flags used for a compilation. - g:C_LFlags : Compiler flags used for linkage. - g:C_Libs : Libraries to link with. - g:C_ObjExtension : C/C+ file extension for objects - (leading point required if not empty) - g:C_ExeExtension : C/C+ file extension for executables - (leading point required if not empty) - g:C_LineEndCommColDefault : Default starting column for end-of-line comments. - g:C_CodeCheckExeName : The name of the CodeCheck (TM) executable - (the default is 'check') - g:C_CodeCheckOptions : Default options for CodeCheck (TM) - (see |csupport-run-codecheck|). - -To override the default add appropriate assignments to ~/.vimrc . - ------------------------------------------------------------------------------- -4.2 THE ROOT MENU *csupport-custom-root-menu* ------------------------------------------------------------------------------- - -The variable g:C_Root, if set (in ~/.vimrc or in ~/.gvimrc), gives the name of -the single Vim root menu item in which the C/C++ submenus will be put. The -default is - '&C\/C\+\+.' -Note the terminating dot. A single root menu can be used if the screen is -limited or several plugins are used in parallel. - -If set to "", this single root menu item will not appear. Now all submenus -are put into the Vim root menu. This is nice for beginners in a lab -installation or for C-only programmers. - ------------------------------------------------------------------------------- -4.3 SYSTEM-WIDE INSTALLATION *csupport-system-wide* ------------------------------------------------------------------------------- - -A system-wide installation (one installation for all users) is done as -follows. - -As *** SUPERUSER *** : - -(1) Find the Vim installation directory. -The Vim Ex command ':echo $VIM' gives '/usr/local/share/vim' or something like -that. Beyond this directory you will find the Vim installation, e.g. in -'/usr/local/share/vim/vim71' if Vim version 7.1 has been installed. - -(2) Create a new subdirectory 'vimfiles', e.g. '/usr/local/share/vim/vimfiles'. - -(3) Install C/C++ Support -Copy the archive cvim.zip to this new directory and unpack it: - unzip cvim.zip - -(4) Generate the help tags: - :helptags $VIM/vimfiles/doc - - -As *** USER *** : - -Create your private snippet directory: - - mkdir --parents ~/.vim/c-support/codesnippets - -You may want to copy the snippets coming with this plugin (in -$VIM/vimfiles/c-support/codesnippets) into the new directory or to set a -link to the global directory. - -Create your private template directory: - - mkdir --parents ~/.vim/c-support/template - -Create a private template file 'Templates' in this directory to overwrite some -macros, e.g. - - *|AUTHOR|* = your name - *|AUTHORREF|* = ... - *|EMAIL|* = ... - *|COMPANY|* = ... - *|COPYRIGHT|* = ... - -You can also have local templates which overwrite the global ones. To suppress -the messages in this case set a global variable in '~/.vimrc' : - - let g:C_TemplateOverwrittenMsg= 'no' - -The default is 'yes'. - -============================================================================== -5. TEMPLATE FILES AND TAGS *csupport-templates* -============================================================================== - ------------------------------------------------------------------------------- -5.1 TEMPLATE FILES *csupport-templates-files* ------------------------------------------------------------------------------- - -Nearly all menu entries insert code snippets or comments. All these stuff is -taken from template files and can be changed by the user to meet his -requirements. - -The master template file is '$HOME/.vim/c-support/templates/Templates' for a -user installation and '$VIM/vimfiles/c-support/templates/Templates' for a -system-wide installation (see|csupport-system-wide|). - -The master template file starts with a macro section followed by templates for -single menu items or better by including other template files grouping the -templates according to the menu structure of this plugin. The master file -could look like this: - - $ - $ ============================================================= - $ ========== USER MACROS ====================================== - $ ============================================================= - $ - *|AUTHOR|* = Dr. Fritz Mehner - *|AUTHORREF|* = mn - *|EMAIL|* = mehner@fh-swf.de - *|COMPANY|* = FH Südwestfalen, Iserlohn - *|COPYRIGHT|* = Copyright (c)*|YEAR|,|AUTHOR|* - $ - $ ============================================================= - $ ========== FILE INCLUDES ==================================== - $ ============================================================= - $ - *|includefile|* = c.comments.template - *|includefile|* = c.cpp.template - *|includefile|* = c.idioms.template - *|includefile|* = c.preprocessor.template - *|includefile|* = c.statements.template - -Lines starting with a dollar sign are comments. The section starting -with *|AUTHOR|* assigns values to predefined tags -(see|csupport-templates-macros|) to personalize some templates. Other -predefined tags with given default values can be used (e.g. *|YEAR|* ). - -User defined tags are possible. They have the following syntax: - - *|macroname|* = replacement - -A macroname starts with a letter (uppercase or lowercase) followed by zero or -more letters, digits or underscores. - ------------------------------------------------------------------------------- -5.2 MACROS *csupport-templates-macros* ------------------------------------------------------------------------------- - -The following macro names are predefined. The first group is used to -personalize templates. - - ---------------------------------------------------------------------------- - PREDEFINED MACROS DEFAULT VALUE - ---------------------------------------------------------------------------- -*|AUTHOR|* "" -*|AUTHORREF|* "" -*|EMAIL|* "" -*|COMPANY|* "" -*|PROJECT|* "" -*|COPYRIGHTHOLDER|* "" -*|STYLE|* "" -*|includefile|* "" - -*|BASENAME|* filename without path and suffix -*|DATE|* the preferred date representation for the current locale - without the time -*|FILENAME|* filename without path -*|PATH|* path without filename -*|SUFFIX|* filename suffix -*|TIME|* the preferred time representation for the current locale - without the date and the time zone or name or abbreviation -*|YEAR|* the year as a decimal number including the century - -The macro *|includefile|* can be used to include an additional template file. -A file will be included only once. Commenting and uncommenting include macros -is a simple way to switch between several sets of templates (see also -|csupport-run-templates|). Overwriting existing macros and templates is -possible. - - ---------------------------------------------------------------------------- - PREDEFINED TAGS - ---------------------------------------------------------------------------- - ,{CURSOR} The cursor position after insertion of a template - <+text+>,<-text->, Jump targets in templates. Jump with Ctrl-j. - {+text+},{-text-} See |csupport-templates-jump|. - - The split point when inserting in visual mode - (see|csupport-templates-definition|) - -A dependent template file can start with its own macro section. There is no -need to have all user defined macros in the master file. -When the first template definition is found (see below) macro definitions are -no longer recognized. -Use the tag variant with curly braces if the indentation of the following line -is wrong after template insertion. - ------------------------------------------------------------------------------- -5.2.1 USER DEFINED FORMATS FOR DATE AND TIME *csupport-templates-date* ------------------------------------------------------------------------------- -The format for *|DATE|* ,*|TIME|* , and*|YEAR|* can be set by the user. The -defaults are - *|DATE|* '%x' - *|TIME|* '%X' - *|YEAR|* '%Y' -See the manual page of the C function strftime() for the format. The accepted -format depends on your system, thus this is not portable! The maximum length -of the result is 80 characters. - -User defined formats can be set using the following global variables in -~/.vimrc , e.g. - let g:C_FormatDate = '%D' - let g:C_FormatTime = '%H:%M' - let g:C_FormatYear = 'year %Y' - ------------------------------------------------------------------------------- -5.3 TEMPLATES *csupport-templates-names* ------------------------------------------------------------------------------- - -5.3.1 Template names - -The template behind a menu entry is identified by a given name. The first part -of the name identifies the menu, the second part identifies the item. The -modes are also hard coded (see|csupport-templates-definition|for the use of -). - - TEMPLATE NAME MODES - -------------------------------------------------------------------------- - - comment.class normal - comment.end-of-line-comment normal - comment.file-description normal - comment.file-description-header normal - comment.file-section-cpp-class-defs normal - comment.file-section-cpp-class-implementations-exported normal - comment.file-section-cpp-class-implementations-local normal - comment.file-section-cpp-data-types normal - comment.file-section-cpp-function-defs-exported normal - comment.file-section-cpp-function-defs-local normal - comment.file-section-cpp-header-includes normal - comment.file-section-cpp-local-variables normal - comment.file-section-cpp-macros normal - comment.file-section-cpp-prototypes normal - comment.file-section-cpp-typedefs normal - comment.file-section-hpp-exported-class-defs normal - comment.file-section-hpp-exported-data-types normal - comment.file-section-hpp-exported-function-declarations normal - comment.file-section-hpp-exported-typedefs normal - comment.file-section-hpp-exported-variables normal - comment.file-section-hpp-header-includes normal - comment.file-section-hpp-macros normal - comment.frame normal - comment.function normal - comment.keyword-bug normal - comment.keyword-compiler normal - comment.keyword-keyword normal - comment.keyword-todo normal - comment.keyword-tricky normal - comment.keyword-warning normal - comment.keyword-workaround normal - comment.method normal - comment.special-constant-type-is-long normal - comment.special-constant-type-is-unsigned-long normal - comment.special-constant-type-is-unsigned normal - comment.special-empty normal - comment.special-fall-through normal - comment.special-implicit-type-conversion normal - comment.special-no-return normal - comment.special-not-reached normal - comment.special-remains-to-be-implemented normal - - cpp.accessor-implementation normal - cpp.catch normal, visual - cpp.catch-points normal, visual - cpp.cin normal - cpp.class-definition normal - cpp.class-implementation normal - cpp.class-using-new-definition normal - cpp.class-using-new-implementation normal - cpp.cout-operator normal - cpp.cout normal - cpp.error-class normal - cpp.extern normal, visual - cpp.method-implementation normal - cpp.namespace-block normal, visual - cpp.namespace normal - cpp.namespace-std normal - cpp.open-input-file normal - cpp.open-output-file normal - cpp.operator-in normal - cpp.operator-out normal - cpp.output-manipulator-boolalpha normal - cpp.output-manipulator-dec normal - cpp.output-manipulator-endl normal - cpp.output-manipulator-fixed normal - cpp.output-manipulator-flush normal - cpp.output-manipulator-hex normal - cpp.output-manipulator-internal normal - cpp.output-manipulator-left normal - cpp.output-manipulator-oct normal - cpp.output-manipulator-right normal - cpp.output-manipulator-scientific normal - cpp.output-manipulator-setbase normal - cpp.output-manipulator-setfill normal - cpp.output-manipulator-setiosflag normal - cpp.output-manipulator-setprecision normal - cpp.output-manipulator-setw normal - cpp.output-manipulator-showbase normal - cpp.output-manipulator-showpoint normal - cpp.output-manipulator-showpos normal - cpp.output-manipulator-uppercase normal - cpp.rtti-const-cast normal - cpp.rtti-dynamic-cast normal - cpp.rtti-reinterpret-cast normal - cpp.rtti-static-cast normal - cpp.rtti-typeid normal - cpp.template-accessor-implementation normal - cpp.template-class-definition normal - cpp.template-class-implementation normal - cpp.template-class-using-new-definition normal - cpp.template-class-using-new-implementation normal - cpp.template-function normal - cpp.template-method-implementation normal - cpp.try-catch normal, visual - - idioms.assert normal - idioms.calloc normal - idioms.enum normal, visual - idioms.fprintf normal - idioms.fscanf normal - idioms.function normal, visual - idioms.function-static normal, visual - idioms.main normal, visual - idioms.malloc normal - idioms.open-input-file normal - idioms.open-output-file normal - idioms.printf normal - idioms.scanf normal - idioms.sizeof normal - idioms.struct normal, visual - idioms.union normal, visual - - preprocessor.define normal - preprocessor.ifdef-else-endif normal, visual - preprocessor.if-else-endif normal, visual - preprocessor.ifndef-def-endif normal, visual - preprocessor.ifndef-else-endif normal, visual - preprocessor.include-global normal - preprocessor.include-local normal - preprocessor.undefine normal - - statements.block normal, visual - statements.case normal - statements.do-while normal, visual - statements.for-block normal - statements.for normal - statements.if-block-else normal, visual - statements.if-block normal, visual - statements.if-else normal, visual - statements.if normal - statements.switch normal, visual - statements.while-block normal, visual - statements.while normal - - -5.3.2 Template definition *csupport-templates-definition* - -A template definition starts with a template head line with the following -syntax: - - == templatename == [ position == ] - -The templatename is one of the above template identifiers. The position -attribute is optional. Possible attribute values are: - - above insert the template before the current line - append append the template to the current line - below insert the template below the current line - insert insert the template at the cursor position - start insert the template before the first line of the buffer - -An example: - - == comment.function == - /* - * === FUNCTION ======================================================= - * Name: - * Description: - * ====================================================================== - */ - -The definition of a template ends at the next head line or at the end of the -file. - -Templates for the visual mode can use . The text before will -than be inserted above the marked area, the text after will be -inserted behind the marked area. An example: - - == statements.if-block-else == - if ( ) { - } else { - } - -If applied to the marked block - - xxxxxxxxxxx - xxxxxxxxxxx - -this template yields - - if ( ) { - xxxxxxxxxxx - xxxxxxxxxxx - } else { - } - -The templates with a visual mode are shown in the table under -|csupport-templates-names|. - -5.3.3 Template expansion *csupport-templates-expansion* - -There are additional ways to control the expansion of a template. - -USER INPUT ----------- -If the usage of a yet undefined user macro starts with a question mark the -user will be asked for the replacement first, e.g. with the following template - - == idioms.function == - void - *|?FUNCTION_NAME|* ( ) - { - return ; - } /* ----- end of function*|FUNCTION_NAME|* ----- */ - -The user can specify the function name which then will be applied twice. If -the macro was already in use the old value will be suggested as default. - -MACRO MANIPULATION ------------------- - -A macro expansion can be controlled by the following attributes - - :l change macro text to lowercase - :u change macro text to uppercase - :c capitalize macro text - :L legalize name - -The include guard template is an example for the use of ':L' : - - == preprocessor.ifndef-def-endif == - #ifndef *|?BASENAME:L|_INC* - #define *|BASENAME|_INC* - - #endif // ----- #ifndef*|BASENAME|_INC* ----- - -The base name of the file shall be used as part of the include guard name. -The predefined macro*|BASENAME|* is used to ask for this part because this -macro has already a defined value. That value can accepted or replaced by the -user. For the filename 'test test++test.h' the legalized base name -'TEST_TEST_TEST' will be suggested. - -Legalization means: - - replace all whitespaces by underscores - - replace all non-word characters by underscores - - replace '+' and '-' by underscore - -5.3.4 The macros <+text+> etc. *csupport-templates-jump* - -There are four macro types which can be used as jump targets in templates: - - <+text+> Can be jumped to by hitting Ctrl-j. - {+text+} Same as <+text+>. Used in cases where indentation gives unwanted - results with the first one. - - <-text-> Same as the two above. Will be removed if the template is used - {-text-} in visual mode. - -The text inside the brackets is userdefined and can be empty. The text -can be composed from letters (uppercase and lowercase), digits, underscores -and blanks. After the insertion of an template these jump targets will be -highlighted. - -5.3.5 Command Ctrl-j *csupport-Ctrl-j* - -Use the command Ctrl-j to jump to the next target. The target will be removed -and the mode will switched to insertion. Ctrl-j works in normal and in insert -mode. - -The template for a function can be written as follows: - - == idioms.function == - void - |?FUNCTION_NAME| ( <+argument list+> ) - { - return <+return value+>; - } /* ----- end of function |FUNCTION_NAME| ----- */ - -The cursor will be set behind 'void'. You can remove 'void' easily with -Ctrl-w (delete word before cursor) and insert a new type. A Ctrl-j leads you -to the argument list. The target disappears and you can type on. When the -function body is written a final Ctrl-j brings you to the return statement. - -The following example shows the usage of the type {-text-}. The idiom for the -opening of a file marks the line before the file is closed. This is also the -line where the template will be split to surround a marked area. In this case -(visual mode) the target is not needed and therefore removed (minus signs as -mnemonic). In normal and insert mode the target is meaningful and will be -therefore be present. The form <-...-> would result in a wrong indentation of -the file close statement. The brace type will be handled as a block and the -indentation will be correct. - - == cpp.open-input-file == - char *ifs_file_name = ""; /* input file name */ - ifstream ifs; /* create ifstream object */ - - ifs.open (ifs_file_name); /* open ifstream */ - if (!ifs) { - cerr << "\nERROR : failed to open input file " << ifs_file_name << endl; - exit (EXIT_FAILURE); - } - {-continue here-} - ifs.close (); /* close ifstream */ - -Extra feature of Ctrl-j ------------------------ -If none of the above described targets is left Ctrl-j can be used to jump -behind closing brackets, parenthesis, braces, or string terminators ('"`). -This feature is limited to the current line. Ctrl-j does not jump behind the -last character in a line. - - -How to switch the mapping for Ctrl-j off ----------------------------------------- -The original meaning of Ctrl-j is 'move [n] lines downward' (see |CTRL-j|). -If you are accustomed to use the deafult and don't like these jump targets you -can switch them off. Put the following line in the file .vimrc : - - let g:C_Ctrl_j = 'off' - -The default value of g:C_Ctrl_j is 'on'. You do not have to change the -template files. All jump targets will be removed before a template will be -inserted. - -============================================================================== -5.4 SWITCHING BETWEEN TEMPLATE SETS *csupport-templates-sets* -============================================================================== - -This plugin comes with two sets of templates. These are suggestions. You may -want to have additional sets for different projects or occasionally want to -use doxygen style comments. To facilitate switching use the macro*|STYLE|* -(|csupport-templates-files|) to define a unique name and the -IF-ENDIF-construct to choose a particular set of files for example: - - ... - - *|STYLE|* = C - $ - $ ============================================================= - $ ========== FILE INCLUDES ==================================== - $ ============================================================= - $ - == IF *|STYLE|* IS C == - $ - |includefile| = c.comments.template - |includefile| = c.cpp.template - |includefile| = c.idioms.template - |includefile| = c.preprocessor.template - |includefile| = c.statements.template - $ - == ENDIF == - - ... - -The syntax is as follows: - - == IF macro_name IS macro_value == - - == ENDIF == - -Includes outside an IF-ENDIF construct are associated with the default style -'default'. A style set does not have to a complete set of templates. For an -incomplete set the other templates are taken from the default style. - -IF, IS, and ENDIF are keywords. - -HINT. Use these constructs to avoid overwriting your templates when updating -csupport. Copy and rename the set of files you want to change and surround the -includes with an appropriate IF-construct: - - *|STYLE|* = MY_C - $ - ... - $ - == IF *|STYLE|* IS MY_C == - |includefile| = my_c.comments.template - |includefile| = my_c.cpp.template - |includefile| = my_c.idioms.template - |includefile| = my_c.preprocessor.template - |includefile| = my_c.statements.template - == ENDIF == - -Keep a copy of the main template file 'Templates' because this file will be -overwritten if you do not update manually. - -============================================================================== -5.5 BINDING A STYLE TO A FILE EXTENSION *csupport-templates-bind* -============================================================================== - -You can bind the existing styles to one or more filename extensions. To do so -assign a Dictionary to the global variable g:C_Styles in '~/.vimrc' : - -let g:C_Styles = { '*.c,*.h' : 'default', '*.cc,*.cpp,*.hh' : 'CPP' } - -A Dictionary is created with a comma separated list of entries in curly -braces. Each entry has a key and a value, separated by a colon. Each key can -only appear once. The keys are themselves a comma separated list of filename -pattern. The values are existing styles defined in the template files. -The given style will be set automatically when switching to a buffer or -opening a new buffer with the associated filename pattern and supersedes the -macro *|STYLE|* . - -============================================================================== -6. C/C++ DICTIONARY *csupport-dictionary* -============================================================================== - -The files - - c-c++-keywords.list - k+r.list - stl_index.list - -are a part of this plugin and can be used (together with your own lists) as -dictionaries for automatic word completion. This feature is enabled by -default. The default word lists are - - plugin_dir/c-support/wordlists/c-c++-keywords.list - plugin_dir/c-support/wordlists/k+r.list - plugin_dir/c-support/wordlists/stl_index.list - -The variable plugin_dir will automatically be set by the plugin to one of the -following values: - $HOME.'/.vim/' for Linux/Unix - $VIM.'/vimfiles/' for Windows -If you want to use an additional list MyC.list put the following lines into - ~/.vimrc : - - let g:C_Dictionary_File = PLUGIN_DIR.'/c-support/wordlists/c-c++-keywords.list,'. - \ PLUGIN_DIR.'/c-support/wordlists/k+r.list,'. - \ PLUGIN_DIR.'/c-support/wordlists/stl_index.list,'. - \ PLUGIN_DIR.'/c-support/wordlists/MyC.list' - -When in file ~/.vimrc the name PLUGIN_DIR has to be replaced by $HOME or -$VIM (see above). Whitespaces in the pathnames have to be escaped with a -backslash. -The right side is a comma separated list of files. Note the point at the end -of the first line (string concatenation) and the backslash in front of the -second line (continuation line). -You can use Vim's dictionary feature CTRL-X, CTRL-K (and CTRL-P, CTRL-N). - -============================================================================== -7. EXTENDING ctags *csupport-ctags* -============================================================================== - ------------------------------------------------------------------------------- -7.1 make AND qmake *csupport-ctags-make* ------------------------------------------------------------------------------- - -The use of the Vim plugin taglist.vim (Author: Yegappan Lakshmanan) is highly -recommended. It uses the program ctags which generates tag files for 3 dozen -languages (Exuberant Ctags, Darren Hiebert, http://ctags.sourceforge.net). -With the following extensions the list of targets in a makefile can be shown -in the taglist window. - - 1) Append the file customization.ctags to the file $HOME/.ctags . - - 2) Add the following lines (from customization.vimrc) to $HOME/.vimrc : - - " - "------------------------------------------------------------------- - " taglist.vim : toggle the taglist window - " taglist.vim : define the title texts for make - " taglist.vim : define the title texts for qmake - "------------------------------------------------------------------- - noremap :Tlist - inoremap :Tlist - - let tlist_make_settings = 'make;m:makros;t:targets;i:includes' - let tlist_qmake_settings = 'qmake;t:SystemVariables' - - if has("autocmd") - " ---------- qmake : set file type for *.pro ---------- - autocmd BufNewFile,BufRead *.pro set filetype=qmake - endif " has("autocmd") - - 3) restart vim/gvim - -The two maps will toggle the taglist window (hotkey F11) in all editing modes. -The two assignments define the headings for the (q)make sections in the -taglist window. The autocmd set the file type 'qmake' for the filename -extension 'pro' (ctags needs this). - ------------------------------------------------------------------------------- -7.2 TEMPLATES *csupport-ctags-templates* ------------------------------------------------------------------------------- - -If you frequently change the plugin templates and you are using the taglist -plugin (section above) you may want to use this plugin for navigation. This is -achieved in two steps. First add a new language definition to the file -$HOME/.ctags : - - --langdef=template - --langmap=template:.template,TEMPLATE - --regex-template=/^==\s+([^=]+)\s+==\s*(\s+==\s+([^=]+)\s+==)?/\1/t,template/ - -Now add the following lines to the file $HOME/.vimrc : - - let tlist_template_settings = 'template;t:template' - "--------------------------------------------------------------- - " plugin templates : set filetype for *.template - "--------------------------------------------------------------- - if has("autocmd") - autocmd BufNewFile,BufRead Templates set filetype=template - autocmd BufNewFile,BufRead *.template set filetype=template - endif " has("autocmd") - -The assignment defines the heading for the template section in the taglist -window. The autocmds set the file type 'template' for the main template file -'Templates' and the includefiles '*.template' (if any). - -============================================================================== -8. FOLDING *csupport-folding* -============================================================================== - -This plugin can be used together with folding. - -There are a few peculiarities when the cursor is on a closed fold before -inserting a template: - -Normal mode ------------ -Inserting blocks of complete lines below and above a fold (e.g. frame -comments) and inserting at the top of a buffer (e.g. file description) works -as usual. -Insertions which go to the end of a line (e.g. end-of-line comments) and -insertions which go to the cursor position (e.g. 'sizeof()') will be suppressed -and a warning will be shown. - -Visual mode ------------ -A range of lines containing closed folds can be surrounded by constructs which -have a visual mode, e.g. a for-loop: - - for ( ; ; ) { - +--- 4 lines: {------------------------------------------------------------ - } - -See |folding| for more information on folding. - -============================================================================== -9. Additional Mappings *csupport-ad-mappings* -============================================================================== - -There are a few additional filetype specific key mappings defined in -'~/.vim/ftplugin/c.vim'. - -Complete a classical C comment: '/*' => '/* | */' (modes: i,v). - -Complete a classical C multi-line comment (mode: i): - '/*' => /* - * | - */ - -Open a block (modes: i,v): - '{' => { - | - } -In visual mode the content of the new block will be indented. - -============================================================================== -10. WINDOWS PARTICULARITIES *csupport-windows* -============================================================================== - -The plugin should go into the directory structure below the local -installation directory $HOME/.vim/ for LINUX/UNIX and $VIM/vimfiles/ for -Windows. -The values of the two variables can be found from inside Vim: - :echo $VIM -or - :echo $HOME - -Configuration files: - - LINUX/UNIX : $HOME/.vimrc and $HOME/.gvimrc - Windows : $VIM/_vimrc and $VIM/_gvimrc - -Compiler settings: - -It could be necessary to add further settings for your compiler. To compile -C++-programs using a Dev-C++ installation (http://www.bloodshed.net) the -following item in $VIM/_vimrc is needed (depends on the Dev-C++ install -directory): - - let g:C_CFlags = '-Wall -g -o0 -c -I c:\programs\dev-c++\include\g++' - -============================================================================== -11. ADDITIONAL TIPS *csupport-tips* -============================================================================== - -(1) gVim. Toggle 'insert mode' <--> 'normal mode' with the right mouse button - (see mapping in file costumization.gvimrc). - -(2) gVim. Use tear off menus. - -(3) Try 'Focus under mouse' as window behavior (No mouse click when the mouse - pointer is back from the menu item). - -(4) Use Emulate3Buttons "on" (X11) even for a 3-button mouse. Pressing left - and right button at the same time without moving your fingers is faster - then moving a finger to the middle button (often a wheel). - -============================================================================== -12. TROUBLESHOOTING *csupport-troubleshooting* -============================================================================== - -* I do not see any new main menu item. - - Was the archive extracted into the right directory? - -* How can I see what was loaded? - - Use ':scriptnames' from the Vim command line. - -* No main menu item. - - Loading of plugin files must be enabled. If not use - :filetype plugin on - This is the minimal content of the file '$HOME/.vimrc'. Create one if there - is none, or better use customization.vimrc. - -* Most key mappings do not work. - - They are defined in a filetype plugin in '$HOME/.vim/ftplugin/'. Use - ':filetype' to check if filetype plugins are enabled. If not, add the line - filetype plugin on - to the file '~/.vimrc'. - -* Some hotkeys do not work. - - The hotkeys might be in use by your graphical desktop environment. Under - KDE Ctrl-F9 is the hotkey which let you switch to the 9. desktop. The key - settings can usually be redefined. - -* Splint and/or CodeCheck menu item not visible. - - The program is not installed or not found (path not set) or not executable. - -============================================================================== -13. RELEASE NOTES *csupport-release-notes* -============================================================================== -See file c-support/doc/ChangeLog . - -============================================================================== -vim:tw=78:noet:ts=2:ft=help:norl: diff --git a/vim_old/doc/snipMate.txt b/vim_old/doc/snipMate.txt deleted file mode 100644 index 704d44a..0000000 --- a/vim_old/doc/snipMate.txt +++ /dev/null @@ -1,286 +0,0 @@ -*snipMate.txt* Plugin for using TextMate-style snippets in Vim. - -snipMate *snippet* *snippets* *snipMate* -Last Change: July 13, 2009 - -|snipMate-description| Description -|snipMate-syntax| Snippet syntax -|snipMate-usage| Usage -|snipMate-settings| Settings -|snipMate-features| Features -|snipMate-disadvantages| Disadvantages to TextMate -|snipMate-contact| Contact - -For Vim version 7.0 or later. -This plugin only works if 'compatible' is not set. -{Vi does not have any of these features.} - -============================================================================== -DESCRIPTION *snipMate-description* - -snipMate.vim implements some of TextMate's snippets features in Vim. A -snippet is a piece of often-typed text that you can insert into your -document using a trigger word followed by a . - -For instance, in a C file using the default installation of snipMate.vim, if -you type "for" in insert mode, it will expand a typical for loop in C: > - - for (i = 0; i < count; i++) { - - } - - -To go to the next item in the loop, simply over to it; if there is -repeated code, such as the "i" variable in this example, you can simply -start typing once it's highlighted and all the matches specified in the -snippet will be updated. To go in reverse, use . - -============================================================================== -SYNTAX *snippet-syntax* - -Snippets can be defined in two ways. They can be in their own file, named -after their trigger in 'snippets//.snippet', or they can be -defined together in a 'snippets/.snippets' file. Note that dotted -'filetype' syntax is supported -- e.g., you can use > - - :set ft=html.eruby - -to activate snippets for both HTML and eRuby for the current file. - -The syntax for snippets in *.snippets files is the following: > - - snippet trigger - expanded text - more expanded text - -Note that the first hard tab after the snippet trigger is required, and not -expanded in the actual snippet. The syntax for *.snippet files is the same, -only without the trigger declaration and starting indentation. - -Also note that snippets must be defined using hard tabs. They can be expanded -to spaces later if desired (see |snipMate-indenting|). - -"#" is used as a line-comment character in *.snippets files; however, they can -only be used outside of a snippet declaration. E.g.: > - - # this is a correct comment - snippet trigger - expanded text - snippet another_trigger - # this isn't a comment! - expanded text -< -This should hopefully be obvious with the included syntax highlighting. - - *snipMate-${#}* -Tab stops ~ - -By default, the cursor is placed at the end of a snippet. To specify where the -cursor is to be placed next, use "${#}", where the # is the number of the tab -stop. E.g., to place the cursor first on the id of a
tag, and then allow -the user to press to go to the middle of it: - > - snippet div -
- ${2} -
-< - *snipMate-placeholders* *snipMate-${#:}* *snipMate-$#* -Placeholders ~ - -Placeholder text can be supplied using "${#:text}", where # is the number of -the tab stop. This text then can be copied throughout the snippet using "$#", -given # is the same number as used before. So, to make a C for loop: > - - snippet for - for (${2:i}; $2 < ${1:count}; $1++) { - ${4} - } - -This will cause "count" to first be selected and change if the user starts -typing. When is pressed, the "i" in ${2}'s position will be selected; -all $2 variables will default to "i" and automatically be updated if the user -starts typing. -NOTE: "$#" syntax is used only for variables, not for tab stops as in TextMate. - -Variables within variables are also possible. For instance: > - - snippet opt - - -Will, as usual, cause "option" to first be selected and update all the $1 -variables if the user starts typing. Since one of these variables is inside of -${2}, this text will then be used as a placeholder for the next tab stop, -allowing the user to change it if he wishes. - -To copy a value throughout a snippet without supplying default text, simply -use the "${#:}" construct without the text; e.g.: > - - snippet foo - ${1:}bar$1 -< *snipMate-commands* -Interpolated Vim Script ~ - -Snippets can also contain Vim script commands that are executed (via |eval()|) -when the snippet is inserted. Commands are given inside backticks (`...`); for -TextMates's functionality, use the |system()| function. E.g.: > - - snippet date - `system("date +%Y-%m-%d")` - -will insert the current date, assuming you are on a Unix system. Note that you -can also (and should) use |strftime()| for this example. - -Filename([{expr}] [, {defaultText}]) *snipMate-filename* *Filename()* - -Since the current filename is used often in snippets, a default function -has been defined for it in snipMate.vim, appropriately called Filename(). - -With no arguments, the default filename without an extension is returned; -the first argument specifies what to place before or after the filename, -and the second argument supplies the default text to be used if the file -has not been named. "$1" in the first argument is replaced with the filename; -if you only want the filename to be returned, the first argument can be left -blank. Examples: > - - snippet filename - `Filename()` - snippet filename_with_default - `Filename('', 'name')` - snippet filename_foo - `filename('$1_foo')` - -The first example returns the filename if it the file has been named, and an -empty string if it hasn't. The second returns the filename if it's been named, -and "name" if it hasn't. The third returns the filename followed by "_foo" if -it has been named, and an empty string if it hasn't. - - *multi_snip* -To specify that a snippet can have multiple matches in a *.snippets file, use -this syntax: > - - snippet trigger A description of snippet #1 - expand this text - snippet trigger A description of snippet #2 - expand THIS text! - -In this example, when "trigger" is typed, a numbered menu containing all -of the descriptions of the "trigger" will be shown; when the user presses the -corresponding number, that snippet will then be expanded. - -To create a snippet with multiple matches using *.snippet files, -simply place all the snippets in a subdirectory with the trigger name: -'snippets///.snippet'. - -============================================================================== -USAGE *snipMate-usage* - - *'snippets'* *g:snippets_dir* -Snippets are by default looked for any 'snippets' directory in your -'runtimepath'. Typically, it is located at '~/.vim/snippets/' on *nix or -'$HOME\vimfiles\snippets\' on Windows. To change that location or add another -one, change the g:snippets_dir variable in your |.vimrc| to your preferred -directory, or use the |ExtractSnips()|function. This will be used by the -|globpath()| function, and so accepts the same syntax as it (e.g., -comma-separated paths). - -ExtractSnipsFile({directory}, {filetype}) *ExtractSnipsFile()* *.snippets* - -ExtractSnipsFile() extracts the specified *.snippets file for the given -filetype. A .snippets file contains multiple snippet declarations for the -filetype. It is further explained above, in |snippet-syntax|. - -ExtractSnips({directory}, {filetype}) *ExtractSnips()* *.snippet* - -ExtractSnips() extracts *.snippet files from the specified directory and -defines them as snippets for the given filetype. The directory tree should -look like this: 'snippets//.snippet'. If the snippet has -multiple matches, it should look like this: -'snippets///.snippet' (see |multi_snip|). - - *ResetSnippets()* -The ResetSnippets() function removes all snippets from memory. This is useful -to put at the top of a snippet setup file for if you would like to |:source| -it multiple times. - - *list-snippets* *i_CTRL-R_* -If you would like to see what snippets are available, simply type -in the current buffer to show a list via |popupmenu-completion|. - -============================================================================== -SETTINGS *snipMate-settings* *g:snips_author* - -The g:snips_author string (similar to $TM_FULLNAME in TextMate) should be set -to your name; it can then be used in snippets to automatically add it. E.g.: > - - let g:snips_author = 'Hubert Farnsworth' - snippet name - `g:snips_author` -< - *snipMate-expandtab* *snipMate-indenting* -If you would like your snippets to be expanded using spaces instead of tabs, -just enable 'expandtab' and set 'softtabstop' to your preferred amount of -spaces. If 'softtabstop' is not set, 'shiftwidth' is used instead. - - *snipMate-remap* -snipMate does not come with a setting to customize the trigger key, but you -can remap it easily in the two lines it's defined in the 'after' directory -under 'plugin/snipMate.vim'. For instance, to change the trigger key -to CTRL-J, just change this: > - - ino =TriggerSnippet() - snor i=TriggerSnippet() - -to this: > - ino =TriggerSnippet() - snor i=TriggerSnippet() - -============================================================================== -FEATURES *snipMate-features* - -snipMate.vim has the following features among others: - - The syntax of snippets is very similar to TextMate's, allowing - easy conversion. - - The position of the snippet is kept transparently (i.e. it does not use - markers/placeholders written to the buffer), which allows you to escape - out of an incomplete snippet, something particularly useful in Vim. - - Variables in snippets are updated as-you-type. - - Snippets can have multiple matches. - - Snippets can be out of order. For instance, in a do...while loop, the - condition can be added before the code. - - [New] File-based snippets are supported. - - [New] Triggers after non-word delimiters are expanded, e.g. "foo" - in "bar.foo". - - [New] can now be used to jump tab stops in reverse order. - -============================================================================== -DISADVANTAGES *snipMate-disadvantages* - -snipMate.vim currently has the following disadvantages to TextMate's snippets: - - There is no $0; the order of tab stops must be explicitly stated. - - Placeholders within placeholders are not possible. E.g.: > - - '${3}
' -< - In TextMate this would first highlight ' id="some_id"', and if - you hit delete it would automatically skip ${2} and go to ${3} - on the next , but if you didn't delete it it would highlight - "some_id" first. You cannot do this in snipMate.vim. - - Regex cannot be performed on variables, such as "${1/.*/\U&}" - - Placeholders cannot span multiple lines. - - Activating snippets in different scopes of the same file is - not possible. - -Perhaps some of these features will be added in a later release. - -============================================================================== -CONTACT *snipMate-contact* *snipMate-author* - -To contact the author (Michael Sanders), please email: - msanders42+snipmate gmail com - -I greatly appreciate any suggestions or improvements offered for the script. - -============================================================================== - -vim:tw=78:ts=8:ft=help:norl: diff --git a/vim_old/doc/taglist.txt b/vim_old/doc/taglist.txt deleted file mode 100755 index 6a62b39..0000000 --- a/vim_old/doc/taglist.txt +++ /dev/null @@ -1,1501 +0,0 @@ -*taglist.txt* Plugin for browsing source code - -Author: Yegappan Lakshmanan (yegappan AT yahoo DOT com) -For Vim version 6.0 and above -Last change: 2007 May 24 - -1. Overview |taglist-intro| -2. Taglist on the internet |taglist-internet| -3. Requirements |taglist-requirements| -4. Installation |taglist-install| -5. Usage |taglist-using| -6. Options |taglist-options| -7. Commands |taglist-commands| -8. Global functions |taglist-functions| -9. Extending |taglist-extend| -10. FAQ |taglist-faq| -11. License |taglist-license| -12. Todo |taglist-todo| - -============================================================================== - *taglist-intro* -1. Overview~ - -The "Tag List" plugin is a source code browser plugin for Vim. This plugin -allows you to efficiently browse through source code files for different -programming languages. The "Tag List" plugin provides the following features: - - * Displays the tags (functions, classes, structures, variables, etc.) - defined in a file in a vertically or horizontally split Vim window. - * In GUI Vim, optionally displays the tags in the Tags drop-down menu and - in the popup menu. - * Automatically updates the taglist window as you switch between - files/buffers. As you open new files, the tags defined in the new files - are added to the existing file list and the tags defined in all the - files are displayed grouped by the filename. - * When a tag name is selected from the taglist window, positions the - cursor at the definition of the tag in the source file. - * Automatically highlights the current tag name. - * Groups the tags by their type and displays them in a foldable tree. - * Can display the prototype and scope of a tag. - * Can optionally display the tag prototype instead of the tag name in the - taglist window. - * The tag list can be sorted either by name or by chronological order. - * Supports the following language files: Assembly, ASP, Awk, Beta, C, - C++, C#, Cobol, Eiffel, Erlang, Fortran, HTML, Java, Javascript, Lisp, - Lua, Make, Pascal, Perl, PHP, Python, Rexx, Ruby, Scheme, Shell, Slang, - SML, Sql, TCL, Verilog, Vim and Yacc. - * Can be easily extended to support new languages. Support for - existing languages can be modified easily. - * Provides functions to display the current tag name in the Vim status - line or the window title bar. - * The list of tags and files in the taglist can be saved and - restored across Vim sessions. - * Provides commands to get the name and prototype of the current tag. - * Runs in both console/terminal and GUI versions of Vim. - * Works with the winmanager plugin. Using the winmanager plugin, you - can use Vim plugins like the file explorer, buffer explorer and the - taglist plugin at the same time like an IDE. - * Can be used in both Unix and MS-Windows systems. - -============================================================================== - *taglist-internet* -2. Taglist on the internet~ - -The home page of the taglist plugin is at: -> - http://vim-taglist.sourceforge.net/ -< -You can subscribe to the taglist mailing list to post your questions or -suggestions for improvement or to send bug reports. Visit the following page -for subscribing to the mailing list: -> - http://groups.yahoo.com/group/taglist -< -============================================================================== - *taglist-requirements* -3. Requirements~ - -The taglist plugin requires the following: - - * Vim version 6.0 and above - * Exuberant ctags 5.0 and above - -The taglist plugin will work on all the platforms where the exuberant ctags -utility and Vim are supported (this includes MS-Windows and Unix based -systems). - -The taglist plugin relies on the exuberant ctags utility to dynamically -generate the tag listing. The exuberant ctags utility must be installed in -your system to use this plugin. The exuberant ctags utility is shipped with -most of the Linux distributions. You can download the exuberant ctags utility -from -> - http://ctags.sourceforge.net -< -The taglist plugin doesn't use or create a tags file and there is no need to -create a tags file to use this plugin. The taglist plugin will not work with -the GNU ctags or the Unix ctags utility. - -This plugin relies on the Vim "filetype" detection mechanism to determine the -type of the current file. You have to turn on the Vim filetype detection by -adding the following line to your .vimrc file: -> - filetype on -< -The taglist plugin will not work if you run Vim in the restricted mode (using -the -Z command-line argument). - -The taglist plugin uses the Vim system() function to invoke the exuberant -ctags utility. If Vim is compiled without the system() function then you -cannot use the taglist plugin. Some of the Linux distributions (Suse) compile -Vim without the system() function for security reasons. - -============================================================================== - *taglist-install* -4. Installation~ - -1. Download the taglist.zip file and unzip the files to the $HOME/.vim or the - $HOME/vimfiles or the $VIM/vimfiles directory. After this step, you should - have the following two files (the directory structure should be preserved): - - plugin/taglist.vim - main taglist plugin file - doc/taglist.txt - documentation (help) file - - Refer to the |add-plugin|and |'runtimepath'| Vim help pages for more - details about installing Vim plugins. -2. Change to the $HOME/.vim/doc or $HOME/vimfiles/doc or $VIM/vimfiles/doc - directory, start Vim and run the ":helptags ." command to process the - taglist help file. Without this step, you cannot jump to the taglist help - topics. -3. If the exuberant ctags utility is not present in one of the directories in - the PATH environment variable, then set the 'Tlist_Ctags_Cmd' variable to - point to the location of the exuberant ctags utility (not to the directory) - in the .vimrc file. -4. If you are running a terminal/console version of Vim and the terminal - doesn't support changing the window width then set the - 'Tlist_Inc_Winwidth' variable to 0 in the .vimrc file. -5. Restart Vim. -6. You can now use the ":TlistToggle" command to open/close the taglist - window. You can use the ":help taglist" command to get more information - about using the taglist plugin. - -To uninstall the taglist plugin, remove the plugin/taglist.vim and -doc/taglist.txt files from the $HOME/.vim or $HOME/vimfiles directory. - -============================================================================== - *taglist-using* -5. Usage~ - -The taglist plugin can be used in several different ways. - -1. You can keep the taglist window open during the entire editing session. On - opening the taglist window, the tags defined in all the files in the Vim - buffer list will be displayed in the taglist window. As you edit files, the - tags defined in them will be added to the taglist window. You can select a - tag from the taglist window and jump to it. The current tag will be - highlighted in the taglist window. You can close the taglist window when - you no longer need the window. -2. You can configure the taglist plugin to process the tags defined in all the - edited files always. In this configuration, even if the taglist window is - closed and the taglist menu is not displayed, the taglist plugin will - processes the tags defined in newly edited files. You can then open the - taglist window only when you need to select a tag and then automatically - close the taglist window after selecting the tag. -3. You can configure the taglist plugin to display only the tags defined in - the current file in the taglist window. By default, the taglist plugin - displays the tags defined in all the files in the Vim buffer list. As you - switch between files, the taglist window will be refreshed to display only - the tags defined in the current file. -4. In GUI Vim, you can use the Tags pull-down and popup menu created by the - taglist plugin to display the tags defined in the current file and select a - tag to jump to it. You can use the menu without opening the taglist window. - By default, the Tags menu is disabled. -5. You can configure the taglist plugin to display the name of the current tag - in the Vim window status line or in the Vim window title bar. For this to - work without the taglist window or menu, you need to configure the taglist - plugin to process the tags defined in a file always. -6. You can save the tags defined in multiple files to a taglist session file - and load it when needed. You can also configure the taglist plugin to not - update the taglist window when editing new files. You can then manually add - files to the taglist window. - -Opening the taglist window~ -You can open the taglist window using the ":TlistOpen" or the ":TlistToggle" -commands. The ":TlistOpen" command opens the taglist window and jumps to it. -The ":TlistToggle" command opens or closes (toggle) the taglist window and the -cursor remains in the current window. If the 'Tlist_GainFocus_On_ToggleOpen' -variable is set to 1, then the ":TlistToggle" command opens the taglist window -and moves the cursor to the taglist window. - -You can map a key to invoke these commands. For example, the following command -creates a normal mode mapping for the key to toggle the taglist window. -> - nnoremap :TlistToggle -< -Add the above mapping to your ~/.vimrc or $HOME/_vimrc file. - -To automatically open the taglist window on Vim startup, set the -'Tlist_Auto_Open' variable to 1. - -You can also open the taglist window on startup using the following command -line: -> - $ vim +TlistOpen -< -Closing the taglist window~ -You can close the taglist window from the taglist window by pressing 'q' or -using the Vim ":q" command. You can also use any of the Vim window commands to -close the taglist window. Invoking the ":TlistToggle" command when the taglist -window is opened, closes the taglist window. You can also use the -":TlistClose" command to close the taglist window. - -To automatically close the taglist window when a tag or file is selected, you -can set the 'Tlist_Close_On_Select' variable to 1. To exit Vim when only the -taglist window is present, set the 'Tlist_Exit_OnlyWindow' variable to 1. - -Jumping to a tag or a file~ -You can select a tag in the taglist window either by pressing the key -or by double clicking the tag name using the mouse. To jump to a tag on a -single mouse click set the 'Tlist_Use_SingleClick' variable to 1. - -If the selected file is already opened in a window, then the cursor is moved -to that window. If the file is not currently opened in a window then the file -is opened in the window used by the taglist plugin to show the previously -selected file. If there are no usable windows, then the file is opened in a -new window. The file is not opened in special windows like the quickfix -window, preview window and windows containing buffer with the 'buftype' option -set. - -To jump to the tag in a new window, press the 'o' key. To open the file in the -previous window (Ctrl-W_p) use the 'P' key. You can press the 'p' key to jump -to the tag but still keep the cursor in the taglist window (preview). - -To open the selected file in a tab, use the 't' key. If the file is already -present in a tab then the cursor is moved to that tab otherwise the file is -opened in a new tab. To jump to a tag in a new tab press Ctrl-t. The taglist -window is automatically opened in the newly created tab. - -Instead of jumping to a tag, you can open a file by pressing the key -or by double clicking the file name using the mouse. - -In the taglist window, you can use the [[ or key to jump to the -beginning of the previous file. You can use the ]] or key to jump to the -beginning of the next file. When you reach the first or last file, the search -wraps around and the jumps to the next/previous file. - -Highlighting the current tag~ -The taglist plugin automatically highlights the name of the current tag in the -taglist window. The Vim |CursorHold| autocmd event is used for this. If the -current tag name is not visible in the taglist window, then the taglist window -contents are scrolled to make that tag name visible. You can also use the -":TlistHighlightTag" command to force the highlighting of the current tag. - -The tag name is highlighted if no activity is performed for |'updatetime'| -milliseconds. The default value for this Vim option is 4 seconds. To avoid -unexpected problems, you should not set the |'updatetime'| option to a very -low value. - -To disable the automatic highlighting of the current tag name in the taglist -window, set the 'Tlist_Auto_Highlight_Tag' variable to zero. - -When entering a Vim buffer/window, the taglist plugin automatically highlights -the current tag in that buffer/window. If you like to disable the automatic -highlighting of the current tag when entering a buffer, set the -'Tlist_Highlight_Tag_On_BufEnter' variable to zero. - -Adding files to the taglist~ -When the taglist window is opened, all the files in the Vim buffer list are -processed and the supported files are added to the taglist. When you edit a -file in Vim, the taglist plugin automatically processes this file and adds it -to the taglist. If you close the taglist window, the tag information in the -taglist is retained. - -To process files even when the taglist window is not open, set the -'Tlist_Process_File_Always' variable to 1. - -You can manually add multiple files to the taglist without opening them using -the ":TlistAddFiles" and the ":TlistAddFilesRecursive" commands. - -For example, to add all the C files in the /my/project/dir directory to the -taglist, you can use the following command: -> - :TlistAddFiles /my/project/dir/*.c -< -Note that when adding several files with a large number of tags or a large -number of files, it will take several seconds to several minutes for the -taglist plugin to process all the files. You should not interrupt the taglist -plugin by pressing . - -You can recursively add multiple files from a directory tree using the -":TlistAddFilesRecursive" command: -> - :TlistAddFilesRecursive /my/project/dir *.c -< -This command takes two arguments. The first argument specifies the directory -from which to recursively add the files. The second optional argument -specifies the wildcard matching pattern for selecting the files to add. The -default pattern is * and all the files are added. - -Displaying tags for only one file~ -The taglist window displays the tags for all the files in the Vim buffer list -and all the manually added files. To display the tags for only the current -active buffer, set the 'Tlist_Show_One_File' variable to 1. - -Removing files from the taglist~ -You can remove a file from the taglist window, by pressing the 'd' key when the -cursor is on one of the tags listed for the file in the taglist window. The -removed file will no longer be displayed in the taglist window in the current -Vim session. To again display the tags for the file, open the file in a Vim -window and then use the ":TlistUpdate" command or use ":TlistAddFiles" command -to add the file to the taglist. - -When a buffer is removed from the Vim buffer list using the ":bdelete" or the -":bwipeout" command, the taglist is updated to remove the stored information -for this buffer. - -Updating the tags displayed for a file~ -The taglist plugin keeps track of the modification time of a file. When the -modification time changes (the file is modified), the taglist plugin -automatically updates the tags listed for that file. The modification time of -a file is checked when you enter a window containing that file or when you -load that file. - -You can also update or refresh the tags displayed for a file by pressing the -"u" key in the taglist window. If an existing file is modified, after the file -is saved, the taglist plugin automatically updates the tags displayed for the -file. - -You can also use the ":TlistUpdate" command to update the tags for the current -buffer after you made some changes to it. You should save the modified buffer -before you update the taglist window. Otherwise the listed tags will not -include the new tags created in the buffer. - -If you have deleted the tags displayed for a file in the taglist window using -the 'd' key, you can again display the tags for that file using the -":TlistUpdate" command. - -Controlling the taglist updates~ -To disable the automatic processing of new files or modified files, you can -set the 'Tlist_Auto_Update' variable to zero. When this variable is set to -zero, the taglist is updated only when you use the ":TlistUpdate" command or -the ":TlistAddFiles" or the ":TlistAddFilesRecursive" commands. You can use -this option to control which files are added to the taglist. - -You can use the ":TlistLock" command to lock the taglist contents. After this -command is executed, new files are not automatically added to the taglist. -When the taglist is locked, you can use the ":TlistUpdate" command to add the -current file or the ":TlistAddFiles" or ":TlistAddFilesRecursive" commands to -add new files to the taglist. To unlock the taglist, use the ":TlistUnlock" -command. - -Displaying the tag prototype~ -To display the prototype of the tag under the cursor in the taglist window, -press the space bar. If you place the cursor on a tag name in the taglist -window, then the tag prototype is displayed at the Vim status line after -|'updatetime'| milliseconds. The default value for the |'updatetime'| Vim -option is 4 seconds. - -You can get the name and prototype of a tag without opening the taglist window -and the taglist menu using the ":TlistShowTag" and the ":TlistShowPrototype" -commands. These commands will work only if the current file is already present -in the taglist. To use these commands without opening the taglist window, set -the 'Tlist_Process_File_Always' variable to 1. - -You can use the ":TlistShowTag" command to display the name of the tag at or -before the specified line number in the specified file. If the file name and -line number are not supplied, then this command will display the name of the -current tag. For example, -> - :TlistShowTag - :TlistShowTag myfile.java 100 -< -You can use the ":TlistShowPrototype" command to display the prototype of the -tag at or before the specified line number in the specified file. If the file -name and the line number are not supplied, then this command will display the -prototype of the current tag. For example, -> - :TlistShowPrototype - :TlistShowPrototype myfile.c 50 -< -In the taglist window, when the mouse is moved over a tag name, the tag -prototype is displayed in a balloon. This works only in GUI versions where -balloon evaluation is supported. - -Taglist window contents~ -The taglist window contains the tags defined in various files in the taglist -grouped by the filename and by the tag type (variable, function, class, etc.). -For tags with scope information (like class members, structures inside -structures, etc.), the scope information is displayed in square brackets "[]" -after the tag name. - -The contents of the taglist buffer/window are managed by the taglist plugin. -The |'filetype'| for the taglist buffer is set to 'taglist'. The Vim -|'modifiable'| option is turned off for the taglist buffer. You should not -manually edit the taglist buffer, by setting the |'modifiable'| flag. If you -manually edit the taglist buffer contents, then the taglist plugin will be out -of sync with the taglist buffer contents and the plugin will no longer work -correctly. To redisplay the taglist buffer contents again, close the taglist -window and reopen it. - -Opening and closing the tag and file tree~ -In the taglist window, the tag names are displayed as a foldable tree using -the Vim folding support. You can collapse the tree using the '-' key or using -the Vim |zc| fold command. You can open the tree using the '+' key or using -the Vim |zo| fold command. You can open all the folds using the '*' key or -using the Vim |zR| fold command. You can also use the mouse to open/close the -folds. You can close all the folds using the '=' key. You should not manually -create or delete the folds in the taglist window. - -To automatically close the fold for the inactive files/buffers and open only -the fold for the current buffer in the taglist window, set the -'Tlist_File_Fold_Auto_Close' variable to 1. - -Sorting the tags for a file~ -The tags displayed in the taglist window can be sorted either by their name or -by their chronological order. The default sorting method is by the order in -which the tags appear in a file. You can change the default sort method by -setting the 'Tlist_Sort_Type' variable to either "name" or "order". You can -sort the tags by their name by pressing the "s" key in the taglist window. You -can again sort the tags by their chronological order using the "s" key. Each -file in the taglist window can be sorted using different order. - -Zooming in and out of the taglist window~ -You can press the 'x' key in the taglist window to maximize the taglist -window width/height. The window will be maximized to the maximum possible -width/height without closing the other existing windows. You can again press -'x' to restore the taglist window to the default width/height. - - *taglist-session* -Taglist Session~ -A taglist session refers to the group of files and their tags stored in the -taglist in a Vim session. - -You can save and restore a taglist session (and all the displayed tags) using -the ":TlistSessionSave" and ":TlistSessionLoad" commands. - -To save the information about the tags and files in the taglist to a file, use -the ":TlistSessionSave" command and specify the filename: -> - :TlistSessionSave -< -To load a saved taglist session, use the ":TlistSessionLoad" command: > - - :TlistSessionLoad -< -When you load a taglist session file, the tags stored in the file will be -added to the tags already stored in the taglist. - -The taglist session feature can be used to save the tags for large files or a -group of frequently used files (like a project). By using the taglist session -file, you can minimize the amount to time it takes to load/refresh the taglist -for multiple files. - -You can create more than one taglist session file for multiple groups of -files. - -Displaying the tag name in the Vim status line or the window title bar~ -You can use the Tlist_Get_Tagname_By_Line() function provided by the taglist -plugin to display the current tag name in the Vim status line or the window -title bar. Similarly, you can use the Tlist_Get_Tag_Prototype_By_Line() -function to display the current tag prototype in the Vim status line or the -window title bar. - -For example, the following command can be used to display the current tag name -in the status line: -> - :set statusline=%<%f%=%([%{Tlist_Get_Tagname_By_Line()}]%) -< -The following command can be used to display the current tag name in the -window title bar: -> - :set title titlestring=%<%f\ %([%{Tlist_Get_Tagname_By_Line()}]%) -< -Note that the current tag name can be displayed only after the file is -processed by the taglist plugin. For this, you have to either set the -'Tlist_Process_File_Always' variable to 1 or open the taglist window or use -the taglist menu. For more information about configuring the Vim status line, -refer to the documentation for the Vim |'statusline'| option. - -Changing the taglist window highlighting~ -The following Vim highlight groups are defined and used to highlight the -various entities in the taglist window: - - TagListTagName - Used for tag names - TagListTagScope - Used for tag scope - TagListTitle - Used for tag titles - TagListComment - Used for comments - TagListFileName - Used for filenames - -By default, these highlight groups are linked to the standard Vim highlight -groups. If you want to change the colors used for these highlight groups, -prefix the highlight group name with 'My' and define it in your .vimrc or -.gvimrc file: MyTagListTagName, MyTagListTagScope, MyTagListTitle, -MyTagListComment and MyTagListFileName. For example, to change the colors -used for tag names, you can use the following command: -> - :highlight MyTagListTagName guifg=blue ctermfg=blue -< -Controlling the taglist window~ -To use a horizontally split taglist window, instead of a vertically split -window, set the 'Tlist_Use_Horiz_Window' variable to 1. - -To use a vertically split taglist window on the rightmost side of the Vim -window, set the 'Tlist_Use_Right_Window' variable to 1. - -You can specify the width of the vertically split taglist window, by setting -the 'Tlist_WinWidth' variable. You can specify the height of the horizontally -split taglist window, by setting the 'Tlist_WinHeight' variable. - -When opening a vertically split taglist window, the Vim window width is -increased to accommodate the new taglist window. When the taglist window is -closed, the Vim window is reduced. To disable this, set the -'Tlist_Inc_Winwidth' variable to zero. - -To reduce the number of empty lines in the taglist window, set the -'Tlist_Compact_Format' variable to 1. - -To not display the Vim fold column in the taglist window, set the -'Tlist_Enable_Fold_Column' variable to zero. - -To display the tag prototypes instead of the tag names in the taglist window, -set the 'Tlist_Display_Prototype' variable to 1. - -To not display the scope of the tags next to the tag names, set the -'Tlist_Display_Tag_Scope' variable to zero. - - *taglist-keys* -Taglist window key list~ -The following table lists the description of the keys that can be used -in the taglist window. - - Key Description~ - - Jump to the location where the tag under cursor is - defined. - o Jump to the location where the tag under cursor is - defined in a new window. - P Jump to the tag in the previous (Ctrl-W_p) window. - p Display the tag definition in the file window and - keep the cursor in the taglist window itself. - t Jump to the tag in a new tab. If the file is already - opened in a tab, move to that tab. - Ctrl-t Jump to the tag in a new tab. - Display the prototype of the tag under the cursor. - For file names, display the full path to the file, - file type and the number of tags. For tag types, display the - tag type and the number of tags. - u Update the tags listed in the taglist window - s Change the sort order of the tags (by name or by order) - d Remove the tags for the file under the cursor - x Zoom-in or Zoom-out the taglist window - + Open a fold - - Close a fold - * Open all folds - = Close all folds - [[ Jump to the beginning of the previous file - Jump to the beginning of the previous file - ]] Jump to the beginning of the next file - Jump to the beginning of the next file - q Close the taglist window - Display help - -The above keys will work in both the normal mode and the insert mode. - - *taglist-menu* -Taglist menu~ -When using GUI Vim, the taglist plugin can display the tags defined in the -current file in the drop-down menu and the popup menu. By default, this -feature is turned off. To turn on this feature, set the 'Tlist_Show_Menu' -variable to 1. - -You can jump to a tag by selecting the tag name from the menu. You can use the -taglist menu independent of the taglist window i.e. you don't need to open the -taglist window to get the taglist menu. - -When you switch between files/buffers, the taglist menu is automatically -updated to display the tags defined in the current file/buffer. - -The tags are grouped by their type (variables, functions, classes, methods, -etc.) and displayed as a separate sub-menu for each type. If all the tags -defined in a file are of the same type (e.g. functions), then the sub-menu is -not used. - -If the number of items in a tag type submenu exceeds the value specified by -the 'Tlist_Max_Submenu_Items' variable, then the submenu will be split into -multiple submenus. The default setting for 'Tlist_Max_Submenu_Items' is 25. -The first and last tag names in the submenu are used to form the submenu name. -The menu items are prefixed by alpha-numeric characters for easy selection by -keyboard. - -If the popup menu support is enabled (the |'mousemodel'| option contains -"popup"), then the tags menu is added to the popup menu. You can access -the popup menu by right clicking on the GUI window. - -You can regenerate the tags menu by selecting the 'Tags->Refresh menu' entry. -You can sort the tags listed in the menu either by name or by order by -selecting the 'Tags->Sort menu by->Name/Order' menu entry. - -You can tear-off the Tags menu and keep it on the side of the Vim window -for quickly locating the tags. - -Using the taglist plugin with the winmanager plugin~ -You can use the taglist plugin with the winmanager plugin. This will allow you -to use the file explorer, buffer explorer and the taglist plugin at the same -time in different windows. To use the taglist plugin with the winmanager -plugin, set 'TagList' in the 'winManagerWindowLayout' variable. For example, -to use the file explorer plugin and the taglist plugin at the same time, use -the following setting: > - - let winManagerWindowLayout = 'FileExplorer|TagList' -< -Getting help~ -If you have installed the taglist help file (this file), then you can use the -Vim ":help taglist-" command to get help on the various taglist -topics. - -You can press the key in the taglist window to display the help -information about using the taglist window. If you again press the key, -the help information is removed from the taglist window. - - *taglist-debug* -Debugging the taglist plugin~ -You can use the ":TlistDebug" command to enable logging of the debug messages -from the taglist plugin. To display the logged debug messages, you can use the -":TlistMessages" command. To disable the logging of the debug messages, use -the ":TlistUndebug" command. - -You can specify a file name to the ":TlistDebug" command to log the debug -messages to a file. Otherwise, the debug messages are stored in a script-local -variable. In the later case, to minimize memory usage, only the last 3000 -characters from the debug messages are stored. - -============================================================================== - *taglist-options* -6. Options~ - -A number of Vim variables control the behavior of the taglist plugin. These -variables are initialized to a default value. By changing these variables you -can change the behavior of the taglist plugin. You need to change these -settings only if you want to change the behavior of the taglist plugin. You -should use the |:let| command in your .vimrc file to change the setting of any -of these variables. - -The configurable taglist variables are listed below. For a detailed -description of these variables refer to the text below this table. - -|'Tlist_Auto_Highlight_Tag'| Automatically highlight the current tag in the - taglist. -|'Tlist_Auto_Open'| Open the taglist window when Vim starts. -|'Tlist_Auto_Update'| Automatically update the taglist to include - newly edited files. -|'Tlist_Close_On_Select'| Close the taglist window when a file or tag is - selected. -|'Tlist_Compact_Format'| Remove extra information and blank lines from - the taglist window. -|'Tlist_Ctags_Cmd'| Specifies the path to the ctags utility. -|'Tlist_Display_Prototype'| Show prototypes and not tags in the taglist - window. -|'Tlist_Display_Tag_Scope'| Show tag scope next to the tag name. -|'Tlist_Enable_Fold_Column'| Show the fold indicator column in the taglist - window. -|'Tlist_Exit_OnlyWindow'| Close Vim if the taglist is the only window. -|'Tlist_File_Fold_Auto_Close'| Close tag folds for inactive buffers. -|'Tlist_GainFocus_On_ToggleOpen'| - Jump to taglist window on open. -|'Tlist_Highlight_Tag_On_BufEnter'| - On entering a buffer, automatically highlight - the current tag. -|'Tlist_Inc_Winwidth'| Increase the Vim window width to accommodate - the taglist window. -|'Tlist_Max_Submenu_Items'| Maximum number of items in a tags sub-menu. -|'Tlist_Max_Tag_Length'| Maximum tag length used in a tag menu entry. -|'Tlist_Process_File_Always'| Process files even when the taglist window is - closed. -|'Tlist_Show_Menu'| Display the tags menu. -|'Tlist_Show_One_File'| Show tags for the current buffer only. -|'Tlist_Sort_Type'| Sort method used for arranging the tags. -|'Tlist_Use_Horiz_Window'| Use a horizontally split window for the - taglist window. -|'Tlist_Use_Right_Window'| Place the taglist window on the right side. -|'Tlist_Use_SingleClick'| Single click on a tag jumps to it. -|'Tlist_WinHeight'| Horizontally split taglist window height. -|'Tlist_WinWidth'| Vertically split taglist window width. - - *'Tlist_Auto_Highlight_Tag'* -Tlist_Auto_Highlight_Tag~ -The taglist plugin will automatically highlight the current tag in the taglist -window. If you want to disable this, then you can set the -'Tlist_Auto_Highlight_Tag' variable to zero. Note that even though the current -tag highlighting is disabled, the tags for a new file will still be added to -the taglist window. -> - let Tlist_Auto_Highlight_Tag = 0 -< -With the above variable set to 1, you can use the ":TlistHighlightTag" command -to highlight the current tag. - - *'Tlist_Auto_Open'* -Tlist_Auto_Open~ -To automatically open the taglist window, when you start Vim, you can set the -'Tlist_Auto_Open' variable to 1. By default, this variable is set to zero and -the taglist window will not be opened automatically on Vim startup. -> - let Tlist_Auto_Open = 1 -< -The taglist window is opened only when a supported type of file is opened on -Vim startup. For example, if you open text files, then the taglist window will -not be opened. - - *'Tlist_Auto_Update'* -Tlist_Auto_Update~ -When a new file is edited, the tags defined in the file are automatically -processed and added to the taglist. To stop adding new files to the taglist, -set the 'Tlist_Auto_Update' variable to zero. By default, this variable is set -to 1. -> - let Tlist_Auto_Update = 0 -< -With the above variable set to 1, you can use the ":TlistUpdate" command to -add the tags defined in the current file to the taglist. - - *'Tlist_Close_On_Select'* -Tlist_Close_On_Select~ -If you want to close the taglist window when a file or tag is selected, then -set the 'Tlist_Close_On_Select' variable to 1. By default, this variable is -set zero and when you select a tag or file from the taglist window, the window -is not closed. -> - let Tlist_Close_On_Select = 1 -< - *'Tlist_Compact_Format'* -Tlist_Compact_Format~ -By default, empty lines are used to separate different tag types displayed for -a file and the tags displayed for different files in the taglist window. If -you want to display as many tags as possible in the taglist window, you can -set the 'Tlist_Compact_Format' variable to 1 to get a compact display. -> - let Tlist_Compact_Format = 1 -< - *'Tlist_Ctags_Cmd'* -Tlist_Ctags_Cmd~ -The 'Tlist_Ctags_Cmd' variable specifies the location (path) of the exuberant -ctags utility. If exuberant ctags is present in any one of the directories in -the PATH environment variable, then there is no need to set this variable. - -The exuberant ctags tool can be installed under different names. When the -taglist plugin starts up, if the 'Tlist_Ctags_Cmd' variable is not set, it -checks for the names exuberant-ctags, exctags, ctags, ctags.exe and tags in -the PATH environment variable. If any one of the named executable is found, -then the Tlist_Ctags_Cmd variable is set to that name. - -If exuberant ctags is not present in one of the directories specified in the -PATH environment variable, then set this variable to point to the location of -the ctags utility in your system. Note that this variable should point to the -fully qualified exuberant ctags location and NOT to the directory in which -exuberant ctags is installed. If the exuberant ctags tool is not found in -either PATH or in the specified location, then the taglist plugin will not be -loaded. Examples: -> - let Tlist_Ctags_Cmd = 'd:\tools\ctags.exe' - let Tlist_Ctags_Cmd = '/usr/local/bin/ctags' -< - *'Tlist_Display_Prototype'* -Tlist_Display_Prototype~ -By default, only the tag name will be displayed in the taglist window. If you -like to see tag prototypes instead of names, set the 'Tlist_Display_Prototype' -variable to 1. By default, this variable is set to zero and only tag names -will be displayed. -> - let Tlist_Display_Prototype = 1 -< - *'Tlist_Display_Tag_Scope'* -Tlist_Display_Tag_Scope~ -By default, the scope of a tag (like a C++ class) will be displayed in -square brackets next to the tag name. If you don't want the tag scopes -to be displayed, then set the 'Tlist_Display_Tag_Scope' to zero. By default, -this variable is set to 1 and the tag scopes will be displayed. -> - let Tlist_Display_Tag_Scope = 0 -< - *'Tlist_Enable_Fold_Column'* -Tlist_Enable_Fold_Column~ -By default, the Vim fold column is enabled and displayed in the taglist -window. If you wish to disable this (for example, when you are working with a -narrow Vim window or terminal), you can set the 'Tlist_Enable_Fold_Column' -variable to zero. -> - let Tlist_Enable_Fold_Column = 1 -< - *'Tlist_Exit_OnlyWindow'* -Tlist_Exit_OnlyWindow~ -If you want to exit Vim if only the taglist window is currently opened, then -set the 'Tlist_Exit_OnlyWindow' variable to 1. By default, this variable is -set to zero and the Vim instance will not be closed if only the taglist window -is present. -> - let Tlist_Exit_OnlyWindow = 1 -< - *'Tlist_File_Fold_Auto_Close'* -Tlist_File_Fold_Auto_Close~ -By default, the tags tree displayed in the taglist window for all the files is -opened. You can close/fold the tags tree for the files manually. To -automatically close the tags tree for inactive files, you can set the -'Tlist_File_Fold_Auto_Close' variable to 1. When this variable is set to 1, -the tags tree for the current buffer is automatically opened and for all the -other buffers is closed. -> - let Tlist_File_Fold_Auto_Close = 1 -< - *'Tlist_GainFocus_On_ToggleOpen'* -Tlist_GainFocus_On_ToggleOpen~ -When the taglist window is opened using the ':TlistToggle' command, this -option controls whether the cursor is moved to the taglist window or remains -in the current window. By default, this option is set to 0 and the cursor -remains in the current window. When this variable is set to 1, the cursor -moves to the taglist window after opening the taglist window. -> - let Tlist_GainFocus_On_ToggleOpen = 1 -< - *'Tlist_Highlight_Tag_On_BufEnter'* -Tlist_Highlight_Tag_On_BufEnter~ -When you enter a Vim buffer/window, the current tag in that buffer/window is -automatically highlighted in the taglist window. If the current tag name is -not visible in the taglist window, then the taglist window contents are -scrolled to make that tag name visible. If you like to disable the automatic -highlighting of the current tag when entering a buffer, you can set the -'Tlist_Highlight_Tag_On_BufEnter' variable to zero. The default setting for -this variable is 1. -> - let Tlist_Highlight_Tag_On_BufEnter = 0 -< - *'Tlist_Inc_Winwidth'* -Tlist_Inc_Winwidth~ -By default, when the width of the window is less than 100 and a new taglist -window is opened vertically, then the window width is increased by the value -set in the 'Tlist_WinWidth' variable to accommodate the new window. The value -of this variable is used only if you are using a vertically split taglist -window. - -If your terminal doesn't support changing the window width from Vim (older -version of xterm running in a Unix system) or if you see any weird problems in -the screen due to the change in the window width or if you prefer not to -adjust the window width then set the 'Tlist_Inc_Winwidth' variable to zero. -CAUTION: If you are using the MS-Windows version of Vim in a MS-DOS command -window then you must set this variable to zero, otherwise the system may hang -due to a Vim limitation (explained in :help win32-problems) -> - let Tlist_Inc_Winwidth = 0 -< - *'Tlist_Max_Submenu_Items'* -Tlist_Max_Submenu_Items~ -If a file contains too many tags of a particular type (function, variable, -class, etc.), greater than that specified by the 'Tlist_Max_Submenu_Items' -variable, then the menu for that tag type will be split into multiple -sub-menus. The default setting for the 'Tlist_Max_Submenu_Items' variable is -25. This can be changed by setting the 'Tlist_Max_Submenu_Items' variable: -> - let Tlist_Max_Submenu_Items = 20 -< -The name of the submenu is formed using the names of the first and the last -tag entries in that submenu. - - *'Tlist_Max_Tag_Length'* -Tlist_Max_Tag_Length~ -Only the first 'Tlist_Max_Tag_Length' characters from the tag names will be -used to form the tag type submenu name. The default value for this variable is -10. Change the 'Tlist_Max_Tag_Length' setting if you want to include more or -less characters: -> - let Tlist_Max_Tag_Length = 10 -< - *'Tlist_Process_File_Always'* -Tlist_Process_File_Always~ -By default, the taglist plugin will generate and process the tags defined in -the newly opened files only when the taglist window is opened or when the -taglist menu is enabled. When the taglist window is closed, the taglist plugin -will stop processing the tags for newly opened files. - -You can set the 'Tlist_Process_File_Always' variable to 1 to generate the list -of tags for new files even when the taglist window is closed and the taglist -menu is disabled. -> - let Tlist_Process_File_Always = 1 -< -To use the ":TlistShowTag" and the ":TlistShowPrototype" commands without the -taglist window and the taglist menu, you should set this variable to 1. - - *'Tlist_Show_Menu'* -Tlist_Show_Menu~ -When using GUI Vim, you can display the tags defined in the current file in a -menu named "Tags". By default, this feature is turned off. To turn on this -feature, set the 'Tlist_Show_Menu' variable to 1: -> - let Tlist_Show_Menu = 1 -< - *'Tlist_Show_One_File'* -Tlist_Show_One_File~ -By default, the taglist plugin will display the tags defined in all the loaded -buffers in the taglist window. If you prefer to display the tags defined only -in the current buffer, then you can set the 'Tlist_Show_One_File' to 1. When -this variable is set to 1, as you switch between buffers, the taglist window -will be refreshed to display the tags for the current buffer and the tags for -the previous buffer will be removed. -> - let Tlist_Show_One_File = 1 -< - *'Tlist_Sort_Type'* -Tlist_Sort_Type~ -The 'Tlist_Sort_Type' variable specifies the sort order for the tags in the -taglist window. The tags can be sorted either alphabetically by their name or -by the order of their appearance in the file (chronological order). By -default, the tag names will be listed by the order in which they are defined -in the file. You can change the sort type (from name to order or from order to -name) by pressing the "s" key in the taglist window. You can also change the -default sort order by setting 'Tlist_Sort_Type' to "name" or "order": -> - let Tlist_Sort_Type = "name" -< - *'Tlist_Use_Horiz_Window'* -Tlist_Use_Horiz_Window~ -Be default, the tag names are displayed in a vertically split window. If you -prefer a horizontally split window, then set the 'Tlist_Use_Horiz_Window' -variable to 1. If you are running MS-Windows version of Vim in a MS-DOS -command window, then you should use a horizontally split window instead of a -vertically split window. Also, if you are using an older version of xterm in a -Unix system that doesn't support changing the xterm window width, you should -use a horizontally split window. -> - let Tlist_Use_Horiz_Window = 1 -< - *'Tlist_Use_Right_Window'* -Tlist_Use_Right_Window~ -By default, the vertically split taglist window will appear on the left hand -side. If you prefer to open the window on the right hand side, you can set the -'Tlist_Use_Right_Window' variable to 1: -> - let Tlist_Use_Right_Window = 1 -< - *'Tlist_Use_SingleClick'* -Tlist_Use_SingleClick~ -By default, when you double click on the tag name using the left mouse -button, the cursor will be positioned at the definition of the tag. You -can set the 'Tlist_Use_SingleClick' variable to 1 to jump to a tag when -you single click on the tag name using the mouse. By default this variable -is set to zero. -> - let Tlist_Use_SingleClick = 1 -< -Due to a bug in Vim, if you set 'Tlist_Use_SingleClick' to 1 and try to resize -the taglist window using the mouse, then Vim will crash. This problem is fixed -in Vim 6.3 and above. In the meantime, instead of resizing the taglist window -using the mouse, you can use normal Vim window resizing commands to resize the -taglist window. - - *'Tlist_WinHeight'* -Tlist_WinHeight~ -The default height of the horizontally split taglist window is 10. This can be -changed by modifying the 'Tlist_WinHeight' variable: -> - let Tlist_WinHeight = 20 -< -The |'winfixheight'| option is set for the taglist window, to maintain the -height of the taglist window, when new Vim windows are opened and existing -windows are closed. - - *'Tlist_WinWidth'* -Tlist_WinWidth~ -The default width of the vertically split taglist window is 30. This can be -changed by modifying the 'Tlist_WinWidth' variable: -> - let Tlist_WinWidth = 20 -< -Note that the value of the |'winwidth'| option setting determines the minimum -width of the current window. If you set the 'Tlist_WinWidth' variable to a -value less than that of the |'winwidth'| option setting, then Vim will use the -value of the |'winwidth'| option. - -When new Vim windows are opened and existing windows are closed, the taglist -plugin will try to maintain the width of the taglist window to the size -specified by the 'Tlist_WinWidth' variable. - -============================================================================== - *taglist-commands* -7. Commands~ - -The taglist plugin provides the following ex-mode commands: - -|:TlistAddFiles| Add multiple files to the taglist. -|:TlistAddFilesRecursive| - Add files recursively to the taglist. -|:TlistClose| Close the taglist window. -|:TlistDebug| Start logging of taglist debug messages. -|:TlistLock| Stop adding new files to the taglist. -|:TlistMessages| Display the logged taglist plugin debug messages. -|:TlistOpen| Open and jump to the taglist window. -|:TlistSessionSave| Save the information about files and tags in the - taglist to a session file. -|:TlistSessionLoad| Load the information about files and tags stored - in a session file to taglist. -|:TlistShowPrototype| Display the prototype of the tag at or before the - specified line number. -|:TlistShowTag| Display the name of the tag defined at or before the - specified line number. -|:TlistHighlightTag| Highlight the current tag in the taglist window. -|:TlistToggle| Open or close (toggle) the taglist window. -|:TlistUndebug| Stop logging of taglist debug messages. -|:TlistUnlock| Start adding new files to the taglist. -|:TlistUpdate| Update the tags for the current buffer. - - *:TlistAddFiles* -:TlistAddFiles {file(s)} [file(s) ...] - Add one or more specified files to the taglist. You can - specify multiple filenames using wildcards. To specify a - file name with space character, you should escape the space - character with a backslash. - Examples: -> - :TlistAddFiles *.c *.cpp - :TlistAddFiles file1.html file2.html -< - If you specify a large number of files, then it will take some - time for the taglist plugin to process all of them. The - specified files will not be edited in a Vim window and will - not be added to the Vim buffer list. - - *:TlistAddFilesRecursive* -:TlistAddFilesRecursive {directory} [ {pattern} ] - Add files matching {pattern} recursively from the specified - {directory} to the taglist. If {pattern} is not specified, - then '*' is assumed. To specify the current directory, use "." - for {directory}. To specify a directory name with space - character, you should escape the space character with a - backslash. - Examples: -> - :TlistAddFilesRecursive myproject *.java - :TlistAddFilesRecursive smallproject -< - If large number of files are present in the specified - directory tree, then it will take some time for the taglist - plugin to process all of them. - - *:TlistClose* -:TlistClose Close the taglist window. This command can be used from any - one of the Vim windows. - - *:TlistDebug* -:TlistDebug [filename] - Start logging of debug messages from the taglist plugin. - If {filename} is specified, then the debug messages are stored - in the specified file. Otherwise, the debug messages are - stored in a script local variable. If the file {filename} is - already present, then it is overwritten. - - *:TlistLock* -:TlistLock - Lock the taglist and don't process new files. After this - command is executed, newly edited files will not be added to - the taglist. - - *:TlistMessages* -:TlistMessages - Display the logged debug messages from the taglist plugin - in a window. This command works only when logging to a - script-local variable. - - *:TlistOpen* -:TlistOpen Open and jump to the taglist window. Creates the taglist - window, if the window is not opened currently. After executing - this command, the cursor is moved to the taglist window. When - the taglist window is opened for the first time, all the files - in the buffer list are processed and the tags defined in them - are displayed in the taglist window. - - *:TlistSessionSave* -:TlistSessionSave {filename} - Saves the information about files and tags in the taglist to - the specified file. This command can be used to save and - restore the taglist contents across Vim sessions. - - *:TlistSessionLoad* -:TlistSessionLoad {filename} - Load the information about files and tags stored in the - specified session file to the taglist. - - *:TlistShowPrototype* -:TlistShowPrototype [filename] [linenumber] - Display the prototype of the tag at or before the specified - line number. If the file name and the line number are not - specified, then the current file name and line number are - used. A tag spans multiple lines starting from the line where - it is defined to the line before the next tag. This command - displays the prototype for the tag for any line number in this - range. - - *:TlistShowTag* -:TlistShowTag [filename] [linenumber] - Display the name of the tag defined at or before the specified - line number. If the file name and the line number are not - specified, then the current file name and line number are - used. A tag spans multiple lines starting from the line where - it is defined to the line before the next tag. This command - displays the tag name for any line number in this range. - - *:TlistHighlightTag* -:TlistHighlightTag - Highlight the current tag in the taglist window. By default, - the taglist plugin periodically updates the taglist window to - highlight the current tag. This command can be used to force - the taglist plugin to highlight the current tag. - - *:TlistToggle* -:TlistToggle Open or close (toggle) the taglist window. Opens the taglist - window, if the window is not opened currently. Closes the - taglist window, if the taglist window is already opened. When - the taglist window is opened for the first time, all the files - in the buffer list are processed and the tags are displayed in - the taglist window. After executing this command, the cursor - is not moved from the current window to the taglist window. - - *:TlistUndebug* -:TlistUndebug - Stop logging of debug messages from the taglist plugin. - - *:TlistUnlock* -:TlistUnlock - Unlock the taglist and start processing newly edited files. - - *:TlistUpdate* -:TlistUpdate Update the tags information for the current buffer. This - command can be used to re-process the current file/buffer and - get the tags information. As the taglist plugin uses the file - saved in the disk (instead of the file displayed in a Vim - buffer), you should save a modified buffer before you update - the taglist. Otherwise the listed tags will not include the - new tags created in the buffer. You can use this command even - when the taglist window is not opened. - -============================================================================== - *taglist-functions* -8. Global functions~ - -The taglist plugin provides several global functions that can be used from -other Vim plugins to interact with the taglist plugin. These functions are -described below. - -|Tlist_Update_File_Tags()| Update the tags for the specified file -|Tlist_Get_Tag_Prototype_By_Line()| Return the prototype of the tag at or - before the specified line number in the - specified file. -|Tlist_Get_Tagname_By_Line()| Return the name of the tag at or - before the specified line number in - the specified file. -|Tlist_Set_App()| Set the name of the application - controlling the taglist window. - - *Tlist_Update_File_Tags()* -Tlist_Update_File_Tags({filename}, {filetype}) - Update the tags for the file {filename}. The second argument - specifies the Vim filetype for the file. If the taglist plugin - has not processed the file previously, then the exuberant - ctags tool is invoked to generate the tags for the file. - - *Tlist_Get_Tag_Prototype_By_Line()* -Tlist_Get_Tag_Prototype_By_Line([{filename}, {linenumber}]) - Return the prototype of the tag at or before the specified - line number in the specified file. If the filename and line - number are not specified, then the current buffer name and the - current line number are used. - - *Tlist_Get_Tagname_By_Line()* -Tlist_Get_Tagname_By_Line([{filename}, {linenumber}]) - Return the name of the tag at or before the specified line - number in the specified file. If the filename and line number - are not specified, then the current buffer name and the - current line number are used. - - *Tlist_Set_App()* -Tlist_Set_App({appname}) - Set the name of the plugin that controls the taglist plugin - window and buffer. This can be used to integrate the taglist - plugin with other Vim plugins. - - For example, the winmanager plugin and the Cream package use - this function and specify the appname as "winmanager" and - "cream" respectively. - - By default, the taglist plugin is a stand-alone plugin and - controls the taglist window and buffer. If the taglist window - is controlled by an external plugin, then the appname should - be set appropriately. - -============================================================================== - *taglist-extend* -9. Extending~ - -The taglist plugin supports all the languages supported by the exuberant ctags -tool, which includes the following languages: Assembly, ASP, Awk, Beta, C, -C++, C#, Cobol, Eiffel, Erlang, Fortran, HTML, Java, Javascript, Lisp, Lua, -Make, Pascal, Perl, PHP, Python, Rexx, Ruby, Scheme, Shell, Slang, SML, Sql, -TCL, Verilog, Vim and Yacc. - -You can extend the taglist plugin to add support for new languages and also -modify the support for the above listed languages. - -You should NOT make modifications to the taglist plugin script file to add -support for new languages. You will lose these changes when you upgrade to the -next version of the taglist plugin. Instead you should follow the below -described instructions to extend the taglist plugin. - -You can extend the taglist plugin by setting variables in the .vimrc or _vimrc -file. The name of these variables depends on the language name and is -described below. - -Modifying support for an existing language~ -To modify the support for an already supported language, you have to set the -tlist_xxx_settings variable in the ~/.vimrc or $HOME/_vimrc file. Replace xxx -with the Vim filetype name for the language file. For example, to modify the -support for the perl language files, you have to set the tlist_perl_settings -variable. To modify the support for java files, you have to set the -tlist_java_settings variable. - -To determine the filetype name used by Vim for a file, use the following -command in the buffer containing the file: - - :set filetype - -The above command will display the Vim filetype for the current buffer. - -The format of the value set in the tlist_xxx_settings variable is - - ;flag1:name1;flag2:name2;flag3:name3 - -The different fields in the value are separated by the ';' character. - -The first field 'language_name' is the name used by exuberant ctags to refer -to this language file. This name can be different from the file type name used -by Vim. For example, for C++, the language name used by ctags is 'c++' but the -filetype name used by Vim is 'cpp'. To get the list of language names -supported by exuberant ctags, use the following command: - - $ ctags --list-maps=all - -The remaining fields follow the format "flag:name". The sub-field 'flag' is -the language specific flag used by exuberant ctags to generate the -corresponding tags. For example, for the C language, to list only the -functions, the 'f' flag is used. To get the list of flags supported by -exuberant ctags for the various languages use the following command: - - $ ctags --list-kinds=all - -The sub-field 'name' specifies the title text to use for displaying the tags -of a particular type. For example, 'name' can be set to 'functions'. This -field can be set to any text string name. - -For example, to list only the classes and functions defined in a C++ language -file, add the following line to your .vimrc file: - - let tlist_cpp_settings = 'c++;c:class;f:function' - -In the above setting, 'cpp' is the Vim filetype name and 'c++' is the name -used by the exuberant ctags tool. 'c' and 'f' are the flags passed to -exuberant ctags to list C++ classes and functions and 'class' is the title -used for the class tags and 'function' is the title used for the function tags -in the taglist window. - -For example, to display only functions defined in a C file and to use "My -Functions" as the title for the function tags, use - - let tlist_c_settings = 'c;f:My Functions' - -When you set the tlist_xxx_settings variable, you will override the default -setting used by the taglist plugin for the 'xxx' language. You cannot add to -the default options used by the taglist plugin for a particular file type. To -add to the options used by the taglist plugin for a language, copy the option -values from the taglist plugin file to your .vimrc file and modify it. - -Adding support for a new language~ -If you want to add support for a new language to the taglist plugin, you need -to first extend the exuberant ctags tool. For more information about extending -exuberant ctags, visit the following page: - - http://ctags.sourceforge.net/EXTENDING.html - -To add support for a new language, set the tlist_xxx_settings variable in the -~/.vimrc file appropriately as described above. Replace 'xxx' in the variable -name with the Vim filetype name for the new language. - -For example, to extend the taglist plugin to support the latex language, you -can use the following line (assuming, you have already extended exuberant -ctags to support the latex language): - - let tlist_tex_settings='latex;b:bibitem;c:command;l:label' - -With the above line, when you edit files of filetype "tex" in Vim, the taglist -plugin will invoke the exuberant ctags tool passing the "latex" filetype and -the flags b, c and l to generate the tags. The text heading 'bibitem', -'command' and 'label' will be used in the taglist window for the tags which -are generated for the flags b, c and l respectively. - -============================================================================== - *taglist-faq* -10. Frequently Asked Questions~ - -Q. The taglist plugin doesn't work. The taglist window is empty and the tags - defined in a file are not displayed. -A. Are you using Vim version 6.0 and above? The taglist plugin relies on the - features supported by Vim version 6.0 and above. You can use the following - command to get the Vim version: -> - $ vim --version -< - Are you using exuberant ctags version 5.0 and above? The taglist plugin - relies on the features supported by exuberant ctags and will not work with - GNU ctags or the Unix ctags utility. You can use the following command to - determine whether the ctags installed in your system is exuberant ctags: -> - $ ctags --version -< - Is exuberant ctags present in one of the directories in your PATH? If not, - you need to set the Tlist_Ctags_Cmd variable to point to the location of - exuberant ctags. Use the following Vim command to verify that this is setup - correctly: -> - :echo system(Tlist_Ctags_Cmd . ' --version') -< - The above command should display the version information for exuberant - ctags. - - Did you turn on the Vim filetype detection? The taglist plugin relies on - the filetype detected by Vim and passes the filetype to the exuberant ctags - utility to parse the tags. Check the output of the following Vim command: -> - :filetype -< - The output of the above command should contain "filetype detection:ON". - To turn on the filetype detection, add the following line to the .vimrc or - _vimrc file: -> - filetype on -< - Is your version of Vim compiled with the support for the system() function? - The following Vim command should display 1: -> - :echo exists('*system') -< - In some Linux distributions (particularly Suse Linux), the default Vim - installation is built without the support for the system() function. The - taglist plugin uses the system() function to invoke the exuberant ctags - utility. You need to rebuild Vim after enabling the support for the - system() function. If you use the default build options, the system() - function will be supported. - - Do you have the |'shellslash'| option set? You can try disabling the - |'shellslash'| option. When the taglist plugin invokes the exuberant ctags - utility with the path to the file, if the incorrect slashes are used, then - you will see errors. - - Check the shell related Vim options values using the following command: -> - :set shell? shellcmdflag? shellpipe? - :set shellquote? shellredir? shellxquote? -< - If these options are set in your .vimrc or _vimrc file, try removing those - lines. - - Are you using a Unix shell in a MS-Windows environment? For example, - the Unix shell from the MKS-toolkit. Do you have the SHELL environment - set to point to this shell? You can try resetting the SHELL environment - variable. - - If you are using a Unix shell on MS-Windows, you should try to use - exuberant ctags that is compiled for Unix-like environments so that - exuberant ctags will understand path names with forward slash characters. - - Is your filetype supported by the exuberant ctags utility? The file types - supported by the exuberant ctags utility are listed in the ctags help. If a - file type is not supported, you have to extend exuberant ctags. You can use - the following command to list the filetypes supported by exuberant ctags: -> - ctags --list-languages -< - Run the following command from the shell prompt and check whether the tags - defined in your file are listed in the output from exuberant ctags: -> - ctags -f - --format=2 --excmd=pattern --fields=nks -< - If you see your tags in the output from the above command, then the - exuberant ctags utility is properly parsing your file. - - Do you have the .ctags or _ctags or the ctags.cnf file in your home - directory for specifying default options or for extending exuberant ctags? - If you do have this file, check the options in this file and make sure - these options are not interfering with the operation of the taglist plugin. - - If you are using MS-Windows, check the value of the TEMP and TMP - environment variables. If these environment variables are set to a path - with space characters in the name, then try using the DOS 8.3 short name - for the path or set them to a path without the space characters in the - name. For example, if the temporary directory name is "C:\Documents and - Settings\xyz\Local Settings\Temp", then try setting the TEMP variable to - the following: -> - set TEMP=C:\DOCUMEN~1\xyz\LOCALS~1\Temp -< - If exuberant ctags is installed in a directory with space characters in the - name, then try adding the directory to the PATH environment variable or try - setting the 'Tlist_Ctags_Cmd' variable to the shortest path name to ctags - or try copying the exuberant ctags to a path without space characters in - the name. For example, if exuberant ctags is installed in the directory - "C:\Program Files\Ctags", then try setting the 'Tlist_Ctags_Cmd' variable - as below: -> - let Tlist_Ctags_Cmd='C:\Progra~1\Ctags\ctags.exe' -< - If you are using a cygwin compiled version of exuberant ctags on MS-Windows, - make sure that either you have the cygwin compiled sort utility installed - and available in your PATH or compile exuberant ctags with internal sort - support. Otherwise, when exuberant ctags sorts the tags output by invoking - the sort utility, it may end up invoking the MS-Windows version of - sort.exe, thereby resulting in failure. - -Q. When I try to open the taglist window, I am seeing the following error - message. How do I fix this problem? - - Taglist: Failed to generate tags for /my/path/to/file - ctags: illegal option -- -^@usage: ctags [-BFadtuwvx] [-f tagsfile] file ... - -A. The taglist plugin will work only with the exuberant ctags tool. You - cannot use the GNU ctags or the Unix ctags program with the taglist plugin. - You will see an error message similar to the one shown above, if you try - use a non-exuberant ctags program with Vim. To fix this problem, either add - the exuberant ctags tool location to the PATH environment variable or set - the 'Tlist_Ctags_Cmd' variable. - -Q. A file has more than one tag with the same name. When I select a tag name - from the taglist window, the cursor is positioned at the incorrect tag - location. -A. The taglist plugin uses the search pattern generated by the exuberant ctags - utility to position the cursor at the location of a tag definition. If a - file has more than one tag with the same name and same prototype, then the - search pattern will be the same. In this case, when searching for the tag - pattern, the cursor may be positioned at the incorrect location. - -Q. I have made some modifications to my file and introduced new - functions/classes/variables. I have not yet saved my file. The taglist - plugin is not displaying the new tags when I update the taglist window. -A. The exuberant ctags utility will process only files that are present in the - disk. To list the tags defined in a file, you have to save the file and - then update the taglist window. - -Q. I have created a ctags file using the exuberant ctags utility for my source - tree. How do I configure the taglist plugin to use this tags file? -A. The taglist plugin doesn't use a tags file stored in disk. For every opened - file, the taglist plugin invokes the exuberant ctags utility to get the - list of tags dynamically. The Vim system() function is used to invoke - exuberant ctags and get the ctags output. This function internally uses a - temporary file to store the output. This file is deleted after the output - from the command is read. So you will never see the file that contains the - output of exuberant ctags. - -Q. When I set the |'updatetime'| option to a low value (less than 1000) and if - I keep pressing a key with the taglist window open, the current buffer - contents are changed. Why is this? -A. The taglist plugin uses the |CursorHold| autocmd to highlight the current - tag. The CursorHold autocmd triggers for every |'updatetime'| milliseconds. - If the |'updatetime'| option is set to a low value, then the CursorHold - autocmd will be triggered frequently. As the taglist plugin changes - the focus to the taglist window to highlight the current tag, this could - interfere with the key movement resulting in changing the contents of - the current buffer. The workaround for this problem is to not set the - |'updatetime'| option to a low value. - -============================================================================== - *taglist-license* -11. License~ -Permission is hereby granted to use and distribute the taglist plugin, with or -without modifications, provided that this copyright notice is copied with it. -Like anything else that's free, taglist.vim is provided *as is* and comes with -no warranty of any kind, either expressed or implied. In no event will the -copyright holder be liable for any damamges resulting from the use of this -software. - -============================================================================== - *taglist-todo* -12. Todo~ - -1. Group tags according to the scope and display them. For example, - group all the tags belonging to a C++/Java class -2. Support for displaying tags in a modified (not-yet-saved) file. -3. Automatically open the taglist window only for selected filetypes. - For other filetypes, close the taglist window. -4. When using the shell from the MKS toolkit, the taglist plugin - doesn't work. -5. The taglist plugin doesn't work with files edited remotely using the - netrw plugin. The exuberant ctags utility cannot process files over - scp/rcp/ftp, etc. - -============================================================================== - -vim:tw=78:ts=8:noet:ft=help: diff --git a/vim_old/doc/tags b/vim_old/doc/tags deleted file mode 100644 index 6015793..0000000 --- a/vim_old/doc/tags +++ /dev/null @@ -1,171 +0,0 @@ -'Tlist_Auto_Highlight_Tag' taglist.txt /*'Tlist_Auto_Highlight_Tag'* -'Tlist_Auto_Open' taglist.txt /*'Tlist_Auto_Open'* -'Tlist_Auto_Update' taglist.txt /*'Tlist_Auto_Update'* -'Tlist_Close_On_Select' taglist.txt /*'Tlist_Close_On_Select'* -'Tlist_Compact_Format' taglist.txt /*'Tlist_Compact_Format'* -'Tlist_Ctags_Cmd' taglist.txt /*'Tlist_Ctags_Cmd'* -'Tlist_Display_Prototype' taglist.txt /*'Tlist_Display_Prototype'* -'Tlist_Display_Tag_Scope' taglist.txt /*'Tlist_Display_Tag_Scope'* -'Tlist_Enable_Fold_Column' taglist.txt /*'Tlist_Enable_Fold_Column'* -'Tlist_Exit_OnlyWindow' taglist.txt /*'Tlist_Exit_OnlyWindow'* -'Tlist_File_Fold_Auto_Close' taglist.txt /*'Tlist_File_Fold_Auto_Close'* -'Tlist_GainFocus_On_ToggleOpen' taglist.txt /*'Tlist_GainFocus_On_ToggleOpen'* -'Tlist_Highlight_Tag_On_BufEnter' taglist.txt /*'Tlist_Highlight_Tag_On_BufEnter'* -'Tlist_Inc_Winwidth' taglist.txt /*'Tlist_Inc_Winwidth'* -'Tlist_Max_Submenu_Items' taglist.txt /*'Tlist_Max_Submenu_Items'* -'Tlist_Max_Tag_Length' taglist.txt /*'Tlist_Max_Tag_Length'* -'Tlist_Process_File_Always' taglist.txt /*'Tlist_Process_File_Always'* -'Tlist_Show_Menu' taglist.txt /*'Tlist_Show_Menu'* -'Tlist_Show_One_File' taglist.txt /*'Tlist_Show_One_File'* -'Tlist_Sort_Type' taglist.txt /*'Tlist_Sort_Type'* -'Tlist_Use_Horiz_Window' taglist.txt /*'Tlist_Use_Horiz_Window'* -'Tlist_Use_Right_Window' taglist.txt /*'Tlist_Use_Right_Window'* -'Tlist_Use_SingleClick' taglist.txt /*'Tlist_Use_SingleClick'* -'Tlist_WinHeight' taglist.txt /*'Tlist_WinHeight'* -'Tlist_WinWidth' taglist.txt /*'Tlist_WinWidth'* -'snippets' snipMate.txt /*'snippets'* -.snippet snipMate.txt /*.snippet* -.snippets snipMate.txt /*.snippets* -:TlistAddFiles taglist.txt /*:TlistAddFiles* -:TlistAddFilesRecursive taglist.txt /*:TlistAddFilesRecursive* -:TlistClose taglist.txt /*:TlistClose* -:TlistDebug taglist.txt /*:TlistDebug* -:TlistHighlightTag taglist.txt /*:TlistHighlightTag* -:TlistLock taglist.txt /*:TlistLock* -:TlistMessages taglist.txt /*:TlistMessages* -:TlistOpen taglist.txt /*:TlistOpen* -:TlistSessionLoad taglist.txt /*:TlistSessionLoad* -:TlistSessionSave taglist.txt /*:TlistSessionSave* -:TlistShowPrototype taglist.txt /*:TlistShowPrototype* -:TlistShowTag taglist.txt /*:TlistShowTag* -:TlistToggle taglist.txt /*:TlistToggle* -:TlistUndebug taglist.txt /*:TlistUndebug* -:TlistUnlock taglist.txt /*:TlistUnlock* -:TlistUpdate taglist.txt /*:TlistUpdate* -ExtractSnips() snipMate.txt /*ExtractSnips()* -ExtractSnipsFile() snipMate.txt /*ExtractSnipsFile()* -Filename() snipMate.txt /*Filename()* -ResetSnippets() snipMate.txt /*ResetSnippets()* -Tlist_Get_Tag_Prototype_By_Line() taglist.txt /*Tlist_Get_Tag_Prototype_By_Line()* -Tlist_Get_Tagname_By_Line() taglist.txt /*Tlist_Get_Tagname_By_Line()* -Tlist_Set_App() taglist.txt /*Tlist_Set_App()* -Tlist_Update_File_Tags() taglist.txt /*Tlist_Update_File_Tags()* -c-support csupport.txt /*c-support* -csupport csupport.txt /*csupport* -csupport-Ctrl-j csupport.txt /*csupport-Ctrl-j* -csupport-ad-mappings csupport.txt /*csupport-ad-mappings* -csupport-c++ csupport.txt /*csupport-c++* -csupport-c++-ex csupport.txt /*csupport-c++-ex* -csupport-c++-method-impl csupport.txt /*csupport-c++-method-impl* -csupport-c++-normal-mode csupport.txt /*csupport-c++-normal-mode* -csupport-c++-visual-mode csupport.txt /*csupport-c++-visual-mode* -csupport-code-to-comm csupport.txt /*csupport-code-to-comm* -csupport-comm csupport.txt /*csupport-comm* -csupport-comm-aligned csupport.txt /*csupport-comm-aligned* -csupport-comm-c-cpp csupport.txt /*csupport-comm-c-cpp* -csupport-comm-date csupport.txt /*csupport-comm-date* -csupport-comm-frame csupport.txt /*csupport-comm-frame* -csupport-comm-keyword csupport.txt /*csupport-comm-keyword* -csupport-comm-realign csupport.txt /*csupport-comm-realign* -csupport-comm-sections csupport.txt /*csupport-comm-sections* -csupport-comm-tags csupport.txt /*csupport-comm-tags* -csupport-comm-to-code csupport.txt /*csupport-comm-to-code* -csupport-ctags csupport.txt /*csupport-ctags* -csupport-ctags-make csupport.txt /*csupport-ctags-make* -csupport-ctags-templates csupport.txt /*csupport-ctags-templates* -csupport-custom csupport.txt /*csupport-custom* -csupport-custom-glob-vars csupport.txt /*csupport-custom-glob-vars* -csupport-custom-root-menu csupport.txt /*csupport-custom-root-menu* -csupport-dictionary csupport.txt /*csupport-dictionary* -csupport-folding csupport.txt /*csupport-folding* -csupport-help csupport.txt /*csupport-help* -csupport-hotkeys csupport.txt /*csupport-hotkeys* -csupport-idioms csupport.txt /*csupport-idioms* -csupport-idioms-for-loop csupport.txt /*csupport-idioms-for-loop* -csupport-idioms-function csupport.txt /*csupport-idioms-function* -csupport-idioms-input csupport.txt /*csupport-idioms-input* -csupport-idioms-output csupport.txt /*csupport-idioms-output* -csupport-prep csupport.txt /*csupport-prep* -csupport-prep-ex csupport.txt /*csupport-prep-ex* -csupport-prep-if0 csupport.txt /*csupport-prep-if0* -csupport-prep-normal-mode csupport.txt /*csupport-prep-normal-mode* -csupport-prep-visual-mode csupport.txt /*csupport-prep-visual-mode* -csupport-proto csupport.txt /*csupport-proto* -csupport-release-notes csupport.txt /*csupport-release-notes* -csupport-run csupport.txt /*csupport-run* -csupport-run-buffer csupport.txt /*csupport-run-buffer* -csupport-run-cmdline-args csupport.txt /*csupport-run-cmdline-args* -csupport-run-codecheck csupport.txt /*csupport-run-codecheck* -csupport-run-hardcopy csupport.txt /*csupport-run-hardcopy* -csupport-run-indent csupport.txt /*csupport-run-indent* -csupport-run-make csupport.txt /*csupport-run-make* -csupport-run-make-args csupport.txt /*csupport-run-make-args* -csupport-run-output csupport.txt /*csupport-run-output* -csupport-run-splint csupport.txt /*csupport-run-splint* -csupport-run-templates csupport.txt /*csupport-run-templates* -csupport-run-xterm csupport.txt /*csupport-run-xterm* -csupport-snippets csupport.txt /*csupport-snippets* -csupport-stat csupport.txt /*csupport-stat* -csupport-stat-normal-mode csupport.txt /*csupport-stat-normal-mode* -csupport-stat-visual-mode csupport.txt /*csupport-stat-visual-mode* -csupport-system-wide csupport.txt /*csupport-system-wide* -csupport-templates csupport.txt /*csupport-templates* -csupport-templates-bind csupport.txt /*csupport-templates-bind* -csupport-templates-date csupport.txt /*csupport-templates-date* -csupport-templates-definition csupport.txt /*csupport-templates-definition* -csupport-templates-expansion csupport.txt /*csupport-templates-expansion* -csupport-templates-files csupport.txt /*csupport-templates-files* -csupport-templates-jump csupport.txt /*csupport-templates-jump* -csupport-templates-macros csupport.txt /*csupport-templates-macros* -csupport-templates-menu csupport.txt /*csupport-templates-menu* -csupport-templates-names csupport.txt /*csupport-templates-names* -csupport-templates-sets csupport.txt /*csupport-templates-sets* -csupport-tips csupport.txt /*csupport-tips* -csupport-troubleshooting csupport.txt /*csupport-troubleshooting* -csupport-usage-gvim csupport.txt /*csupport-usage-gvim* -csupport-usage-vim csupport.txt /*csupport-usage-vim* -csupport-windows csupport.txt /*csupport-windows* -csupport.txt csupport.txt /*csupport.txt* -g:snippets_dir snipMate.txt /*g:snippets_dir* -g:snips_author snipMate.txt /*g:snips_author* -i_CTRL-R_ snipMate.txt /*i_CTRL-R_* -list-snippets snipMate.txt /*list-snippets* -multi_snip snipMate.txt /*multi_snip* -snipMate snipMate.txt /*snipMate* -snipMate-$# snipMate.txt /*snipMate-$#* -snipMate-${#:} snipMate.txt /*snipMate-${#:}* -snipMate-${#} snipMate.txt /*snipMate-${#}* -snipMate-author snipMate.txt /*snipMate-author* -snipMate-commands snipMate.txt /*snipMate-commands* -snipMate-contact snipMate.txt /*snipMate-contact* -snipMate-description snipMate.txt /*snipMate-description* -snipMate-disadvantages snipMate.txt /*snipMate-disadvantages* -snipMate-expandtab snipMate.txt /*snipMate-expandtab* -snipMate-features snipMate.txt /*snipMate-features* -snipMate-filename snipMate.txt /*snipMate-filename* -snipMate-indenting snipMate.txt /*snipMate-indenting* -snipMate-placeholders snipMate.txt /*snipMate-placeholders* -snipMate-remap snipMate.txt /*snipMate-remap* -snipMate-settings snipMate.txt /*snipMate-settings* -snipMate-usage snipMate.txt /*snipMate-usage* -snipMate.txt snipMate.txt /*snipMate.txt* -snippet snipMate.txt /*snippet* -snippet-syntax snipMate.txt /*snippet-syntax* -snippets snipMate.txt /*snippets* -taglist-commands taglist.txt /*taglist-commands* -taglist-debug taglist.txt /*taglist-debug* -taglist-extend taglist.txt /*taglist-extend* -taglist-faq taglist.txt /*taglist-faq* -taglist-functions taglist.txt /*taglist-functions* -taglist-install taglist.txt /*taglist-install* -taglist-internet taglist.txt /*taglist-internet* -taglist-intro taglist.txt /*taglist-intro* -taglist-keys taglist.txt /*taglist-keys* -taglist-license taglist.txt /*taglist-license* -taglist-menu taglist.txt /*taglist-menu* -taglist-options taglist.txt /*taglist-options* -taglist-requirements taglist.txt /*taglist-requirements* -taglist-session taglist.txt /*taglist-session* -taglist-todo taglist.txt /*taglist-todo* -taglist-using taglist.txt /*taglist-using* -taglist.txt taglist.txt /*taglist.txt* diff --git a/vim_old/ftdetect/jade.vim b/vim_old/ftdetect/jade.vim deleted file mode 100644 index c21dcff..0000000 --- a/vim_old/ftdetect/jade.vim +++ /dev/null @@ -1,2 +0,0 @@ -" Jade -autocmd BufNewFile,BufReadPost *.jade set filetype=jade diff --git a/vim_old/ftplugin/c.vim b/vim_old/ftplugin/c.vim deleted file mode 100644 index d6bef13..0000000 --- a/vim_old/ftplugin/c.vim +++ /dev/null @@ -1,436 +0,0 @@ -" ------------------------------------------------------------------------------ -" -" Vim filetype plugin file -" -" Language : C / C++ -" Plugin : c.vim -" Maintainer : Fritz Mehner -" Revision : $Id: c.vim,v 1.58 2010/05/14 19:13:40 mehner Exp $ -" -" ------------------------------------------------------------------------------ -" -" Only do this when not done yet for this buffer -" -if exists("b:did_C_ftplugin") - finish -endif -let b:did_C_ftplugin = 1 -" -" ---------- Do we have a mapleader other than '\' ? ------------ -" -if exists("g:C_MapLeader") - let maplocalleader = g:C_MapLeader -endif -" -" ---------- C/C++ dictionary ----------------------------------- -" This will enable keyword completion for C and C++ -" using Vim's dictionary feature |i_CTRL-X_CTRL-K|. -" Set the new dictionaries in front of the existing ones -" -if exists("g:C_Dictionary_File") - let save=&dictionary - silent! exe 'setlocal dictionary='.g:C_Dictionary_File - silent! exe 'setlocal dictionary+='.save -endif -" -" ---------- F-key mappings ------------------------------------ -" -" Alt-F9 write buffer and compile -" F9 compile and link -" Ctrl-F9 run executable -" Shift-F9 command line arguments -" - map :call C_Compile():call C_HlMessage() -imap :call C_Compile():call C_HlMessage() -" - map :call C_Link():call C_HlMessage() -imap :call C_Link():call C_HlMessage() -" - map :call C_Run() -imap :call C_Run() -" - map :call C_Arguments() -imap :call C_Arguments() -" -" ---------- alternate file plugin (a.vim) ---------------------- -" -if exists("loaded_alternateFile") - map :A -imap :A -endif -" -command! -nargs=1 -complete=customlist,C_CFileSectionList CFileSection call C_CFileSectionListInsert () -command! -nargs=1 -complete=customlist,C_HFileSectionList HFileSection call C_HFileSectionListInsert () -command! -nargs=1 -complete=customlist,C_KeywordCommentList KeywordComment call C_KeywordCommentListInsert () -command! -nargs=1 -complete=customlist,C_SpecialCommentList SpecialComment call C_SpecialCommentListInsert () -command! -nargs=1 -complete=customlist,C_StdLibraryIncludesList IncludeStdLibrary call C_StdLibraryIncludesInsert () -command! -nargs=1 -complete=customlist,C_C99LibraryIncludesList IncludeC99Library call C_C99LibraryIncludesInsert () -command! -nargs=1 -complete=customlist,C_CppLibraryIncludesList IncludeCppLibrary call C_CppLibraryIncludesInsert () -command! -nargs=1 -complete=customlist,C_CppCLibraryIncludesList IncludeCppCLibrary call C_CppCLibraryIncludesInsert() -command! -nargs=1 -complete=customlist,C_StyleList CStyle call C_Style () - -" ---------- KEY MAPPINGS : MENU ENTRIES ------------------------------------- -" ---------- comments menu ------------------------------------------------ -" - noremap cl :call C_LineEndComment() -inoremap cl :call C_LineEndComment() -vnoremap cl :call C_MultiLineEndComments()a - noremap cj :call C_AdjustLineEndComm("a") -vnoremap cj :call C_AdjustLineEndComm("v") -inoremap cj :call C_AdjustLineEndComm("a")a - noremap cs :call C_GetLineEndCommCol() - - noremap c* :call C_CodeComment("a","yes"):nohlsearchj -vnoremap c* :call C_CodeComment("v","yes"):nohlsearchj - - noremap cc :call C_CodeComment("a","no"):nohlsearchj -vnoremap cc :call C_CodeComment("v","no"):nohlsearchj - noremap co :call C_CommentCode("a"):nohlsearch -vnoremap co :call C_CommentCode("v"):nohlsearch - - noremap cfr :call C_InsertTemplate("comment.frame") - noremap cfu :call C_InsertTemplate("comment.function") - noremap cme :call C_InsertTemplate("comment.method") - noremap ccl :call C_InsertTemplate("comment.class") - noremap cfdi :call C_InsertTemplate("comment.file-description") - noremap cfdh :call C_InsertTemplate("comment.file-description-header") - -inoremap cfr :call C_InsertTemplate("comment.frame") -inoremap cfu :call C_InsertTemplate("comment.function") -inoremap cme :call C_InsertTemplate("comment.method") -inoremap ccl :call C_InsertTemplate("comment.class") -inoremap cfdi :call C_InsertTemplate("comment.file-description") -inoremap cfdh :call C_InsertTemplate("comment.file-description-header") - - noremap cd :call C_InsertDateAndTime('d') -inoremap cd :call C_InsertDateAndTime('d')a -vnoremap cd s:call C_InsertDateAndTime('d')a - noremap ct :call C_InsertDateAndTime('dt') -inoremap ct :call C_InsertDateAndTime('dt')a -vnoremap ct s:call C_InsertDateAndTime('dt')a -" -" call the above defined commands: -" - noremap ccs :CFileSection - noremap chs :HFileSection - noremap ckc :KeywordComment - noremap csc :SpecialComment -" -inoremap ccs :CFileSection -inoremap chs :HFileSection -inoremap ckc :KeywordComment -inoremap csc :SpecialComment -" -" ---------- statements menu ------------------------------------------------ -" - noremap sd :call C_InsertTemplate("statements.do-while") -vnoremap sd :call C_InsertTemplate("statements.do-while", "v") -inoremap sd :call C_InsertTemplate("statements.do-while") - - noremap sf :call C_InsertTemplate("statements.for") -inoremap sf :call C_InsertTemplate("statements.for") - - noremap sfo :call C_InsertTemplate("statements.for-block") -vnoremap sfo :call C_InsertTemplate("statements.for-block", "v") -inoremap sfo :call C_InsertTemplate("statements.for-block") - - noremap si :call C_InsertTemplate("statements.if") -inoremap si :call C_InsertTemplate("statements.if") - - noremap sif :call C_InsertTemplate("statements.if-block") -vnoremap sif :call C_InsertTemplate("statements.if-block", "v") -inoremap sif :call C_InsertTemplate("statements.if-block") - - noremap sie :call C_InsertTemplate("statements.if-else") -vnoremap sie :call C_InsertTemplate("statements.if-else", "v") -inoremap sie :call C_InsertTemplate("statements.if-else") - - noremap sife :call C_InsertTemplate("statements.if-block-else") -vnoremap sife :call C_InsertTemplate("statements.if-block-else", "v") -inoremap sife :call C_InsertTemplate("statements.if-block-else") - - noremap se :call C_InsertTemplate("statements.else-block") -vnoremap se :call C_InsertTemplate("statements.else-block", "v") -inoremap se :call C_InsertTemplate("statements.else-block") - - noremap sw :call C_InsertTemplate("statements.while") -inoremap sw :call C_InsertTemplate("statements.while") - - noremap swh :call C_InsertTemplate("statements.while-block") -vnoremap swh :call C_InsertTemplate("statements.while-block", "v") -inoremap swh :call C_InsertTemplate("statements.while-block") - - noremap ss :call C_InsertTemplate("statements.switch") -vnoremap ss :call C_InsertTemplate("statements.switch", "v") -inoremap ss :call C_InsertTemplate("statements.switch") - - noremap sc :call C_InsertTemplate("statements.case") -inoremap sc :call C_InsertTemplate("statements.case") - - noremap s{ :call C_InsertTemplate("statements.block") -vnoremap s{ :call C_InsertTemplate("statements.block", "v") -inoremap s{ :call C_InsertTemplate("statements.block") - - noremap sb :call C_InsertTemplate("statements.block") -vnoremap sb :call C_InsertTemplate("statements.block", "v") -inoremap sb :call C_InsertTemplate("statements.block") -" -" ---------- preprocessor menu ---------------------------------------------- -"" - noremap ps :IncludeStdLibrary -inoremap ps :IncludeStdLibrary - noremap pc :IncludeC99Library -inoremap pc :IncludeC99Library - noremap +ps :IncludeCppLibrary -inoremap +ps :IncludeCppLibrary - noremap +pc :IncludeCppCLibrary -inoremap +pc :IncludeCppC9Library -" - noremap p< :call C_InsertTemplate("preprocessor.include-global") - noremap p" :call C_InsertTemplate("preprocessor.include-local") - noremap pd :call C_InsertTemplate("preprocessor.define") - noremap pu :call C_InsertTemplate("preprocessor.undefine") -" -inoremap p< :call C_InsertTemplate("preprocessor.include-global") -inoremap p" :call C_InsertTemplate("preprocessor.include-local") -inoremap pd :call C_InsertTemplate("preprocessor.define") -inoremap pu :call C_InsertTemplate("preprocessor.undefine") - - noremap pie :call C_InsertTemplate("preprocessor.if-else-endif") - noremap pid :call C_InsertTemplate("preprocessor.ifdef-else-endif") - noremap pin :call C_InsertTemplate("preprocessor.ifndef-else-endif") - noremap pind :call C_InsertTemplate("preprocessor.ifndef-def-endif") - -vnoremap pie :call C_InsertTemplate("preprocessor.if-else-endif", "v") -vnoremap pid :call C_InsertTemplate("preprocessor.ifdef-else-endif", "v") -vnoremap pin :call C_InsertTemplate("preprocessor.ifndef-else-endif", "v") -vnoremap pind :call C_InsertTemplate("preprocessor.ifndef-def-endif", "v") - -inoremap pie :call C_InsertTemplate("preprocessor.if-else-endif") -inoremap pid :call C_InsertTemplate("preprocessor.ifdef-else-endif") -inoremap pin :call C_InsertTemplate("preprocessor.ifndef-else-endif") -inoremap pind :call C_InsertTemplate("preprocessor.ifndef-def-endif") - - noremap pi0 :call C_PPIf0("a")2ji -inoremap pi0 :call C_PPIf0("a")2ji -vnoremap pi0 :call C_PPIf0("v") - - noremap pr0 :call C_PPIf0Remove() -inoremap pr0 :call C_PPIf0Remove() -" - noremap pe :call C_InsertTemplate("preprocessor.error") - noremap pl :call C_InsertTemplate("preprocessor.line") - noremap pp :call C_InsertTemplate("preprocessor.pragma") -" -inoremap pe :call C_InsertTemplate("preprocessor.error") -inoremap pl :call C_InsertTemplate("preprocessor.line") -inoremap pp :call C_InsertTemplate("preprocessor.pragma") -" -" ---------- idioms menu ---------------------------------------------------- -" - noremap if :call C_InsertTemplate("idioms.function") -vnoremap if :call C_InsertTemplate("idioms.function", "v") -inoremap if :call C_InsertTemplate("idioms.function") - noremap isf :call C_InsertTemplate("idioms.function-static") -vnoremap isf :call C_InsertTemplate("idioms.function-static", "v") -inoremap isf :call C_InsertTemplate("idioms.function-static") - noremap im :call C_InsertTemplate("idioms.main") -vnoremap im :call C_InsertTemplate("idioms.main", "v") -inoremap im :call C_InsertTemplate("idioms.main") -" - noremap i0 :call C_CodeFor("up" , "a") -vnoremap i0 :call C_CodeFor("up" , "v") -inoremap i0 :call C_CodeFor("up" , "a")i - noremap in :call C_CodeFor("down", "a") -vnoremap in :call C_CodeFor("down", "v") -inoremap in :call C_CodeFor("down", "a")i -" - noremap ie :call C_InsertTemplate("idioms.enum") -vnoremap ie :call C_InsertTemplate("idioms.enum" , "v") -inoremap ie :call C_InsertTemplate("idioms.enum") - noremap is :call C_InsertTemplate("idioms.struct") -vnoremap is :call C_InsertTemplate("idioms.struct", "v") -inoremap is :call C_InsertTemplate("idioms.struct") - noremap iu :call C_InsertTemplate("idioms.union") -vnoremap iu :call C_InsertTemplate("idioms.union" , "v") -inoremap iu :call C_InsertTemplate("idioms.union") -" - noremap ip :call C_InsertTemplate("idioms.printf") -inoremap ip :call C_InsertTemplate("idioms.printf") - noremap isc :call C_InsertTemplate("idioms.scanf") -inoremap isc :call C_InsertTemplate("idioms.scanf") -" - noremap ica :call C_InsertTemplate("idioms.calloc") -inoremap ica :call C_InsertTemplate("idioms.calloc") - noremap ima :call C_InsertTemplate("idioms.malloc") -inoremap ima :call C_InsertTemplate("idioms.malloc") -" - noremap isi :call C_InsertTemplate("idioms.sizeof") -inoremap isi :call C_InsertTemplate("idioms.sizeof") -vnoremap isi :call C_InsertTemplate("idioms.sizeof", "v") - - noremap ias :call C_InsertTemplate("idioms.assert") -vnoremap ias :call C_InsertTemplate("idioms.assert", "v") -inoremap ias :call C_InsertTemplate("idioms.assert") -" - noremap ii :call C_InsertTemplate("idioms.open-input-file") -inoremap ii :call C_InsertTemplate("idioms.open-input-file") -vnoremap ii :call C_InsertTemplate("idioms.open-input-file", "v") - noremap io :call C_InsertTemplate("idioms.open-output-file") -inoremap io :call C_InsertTemplate("idioms.open-output-file") -vnoremap io :call C_InsertTemplate("idioms.open-output-file", "v") -" -" ---------- snippet menu ---------------------------------------------------- -" - noremap nr :call C_CodeSnippet("r") - noremap nw :call C_CodeSnippet("w") -vnoremap nw :call C_CodeSnippet("wv") - noremap ne :call C_CodeSnippet("e") -" -inoremap nr :call C_CodeSnippet("r") -inoremap nw :call C_CodeSnippet("w") -inoremap ne :call C_CodeSnippet("e") -" - noremap np :call C_ProtoPick("n") -vnoremap np :call C_ProtoPick("v") - noremap ni :call C_ProtoInsert() - noremap nc :call C_ProtoClear() - noremap ns :call C_ProtoShow() -" -inoremap np :call C_ProtoPick("n") -inoremap ni :call C_ProtoInsert() -inoremap nc :call C_ProtoClear() -inoremap ns :call C_ProtoShow() -" - noremap ntl :call C_EditTemplates("local") - noremap ntg :call C_EditTemplates("global") - noremap ntr :call C_RereadTemplates() - noremap nts :CStyle -" -" ---------- C++ menu ---------------------------------------------------- -" - noremap +co :call C_InsertTemplate("cpp.cout") -inoremap +co :call C_InsertTemplate("cpp.cout") -" - noremap +c :call C_InsertTemplate("cpp.class-definition") -inoremap +c :call C_InsertTemplate("cpp.class-definition") - noremap +cn :call C_InsertTemplate("cpp.class-using-new-definition") -inoremap +cn :call C_InsertTemplate("cpp.class-using-new-definition") - - noremap +ci :call C_InsertTemplate("cpp.class-implementation") -inoremap +ci :call C_InsertTemplate("cpp.class-implementation") - noremap +cni :call C_InsertTemplate("cpp.class-using-new-implementation") -inoremap +cni :call C_InsertTemplate("cpp.class-using-new-implementation") - - noremap +mi :call C_InsertTemplate("cpp.method-implementation") -inoremap +mi :call C_InsertTemplate("cpp.method-implementation") - noremap +ai :call C_InsertTemplate("cpp.accessor-implementation") -inoremap +ai :call C_InsertTemplate("cpp.accessor-implementation") - - noremap +tc :call C_InsertTemplate("cpp.template-class-definition") -inoremap +tc :call C_InsertTemplate("cpp.template-class-definition") - noremap +tcn :call C_InsertTemplate("cpp.template-class-using-new-definition") -inoremap +tcn :call C_InsertTemplate("cpp.template-class-using-new-definition") - - noremap +tci :call C_InsertTemplate("cpp.template-class-implementation") -inoremap +tci :call C_InsertTemplate("cpp.template-class-implementation") - noremap +tcni :call C_InsertTemplate("cpp.template-class-using-new-implementation") -inoremap +tcni :call C_InsertTemplate("cpp.template-class-using-new-implementation") - - noremap +tmi :call C_InsertTemplate("cpp.template-method-implementation") -inoremap +tmi :call C_InsertTemplate("cpp.template-method-implementation") - noremap +tai :call C_InsertTemplate("cpp.template-accessor-implementation") -inoremap +tai :call C_InsertTemplate("cpp.template-accessor-implementation") - - noremap +tf :call C_InsertTemplate("cpp.template-function") -inoremap +tf :call C_InsertTemplate("cpp.template-function") - - noremap +ec :call C_InsertTemplate("cpp.error-class") -inoremap +ec :call C_InsertTemplate("cpp.error-class") - - noremap +tr :call C_InsertTemplate("cpp.try-catch") -vnoremap +tr :call C_InsertTemplate("cpp.try-catch", "v") -inoremap +tr :call C_InsertTemplate("cpp.try-catch") - - noremap +ca :call C_InsertTemplate("cpp.catch") -vnoremap +ca :call C_InsertTemplate("cpp.catch", "v") -inoremap +ca :call C_InsertTemplate("cpp.catch") - - noremap +c. :call C_InsertTemplate("cpp.catch-points") -vnoremap +c. :call C_InsertTemplate("cpp.catch-points", "v") -inoremap +c. :call C_InsertTemplate("cpp.catch-points") -" -" ---------- run menu -------------------------------------------------------- -" - map rc :call C_Compile():call C_HlMessage() - map rl :call C_Link():call C_HlMessage() - map rr :call C_Run() - map ra :call C_Arguments() - map rm :call C_Make() - map rma :call C_MakeArguments() - map rp :call C_SplintCheck():call C_HlMessage() - map rpa :call C_SplintArguments() - map rd :call C_Indent() - map rh :call C_Hardcopy("n") - map rs :call C_Settings() -" -vmap rh :call C_Hardcopy("v") -" -imap rc :call C_Compile():call C_HlMessage() -imap rl :call C_Link():call C_HlMessage() -imap rr :call C_Run() -imap ra :call C_Arguments() -imap rm :call C_Make() -imap rma :call C_MakeArguments() -imap rp :call C_SplintCheck():call C_HlMessage() -imap rpa :call C_SplintArguments() -imap rd :call C_Indent() -imap rh :call C_Hardcopy("n") -imap rs :call C_Settings() - if has("unix") - map rx :call C_XtermSize() - imap rx :call C_XtermSize() - endif - map ro :call C_Toggle_Gvim_Xterm() -imap ro :call C_Toggle_Gvim_Xterm() -" -" Abraxas CodeCheck (R) -" -if executable("check") - map rk :call C_CodeCheck():call C_HlMessage() - map rka :call C_CodeCheckArguments() - imap rk :call C_CodeCheck():call C_HlMessage() - imap rka :call C_CodeCheckArguments() -endif -" ---------- plugin help ----------------------------------------------------- -" - map hp :call C_HelpCsupport() -imap hp :call C_HelpCsupport() - map hm :call C_Help("m") -imap hm :call C_Help("m") -" -"------------------------------------------------------------------------------- -" additional mapping : complete a classical C comment: '/*' => '/* | */' -"------------------------------------------------------------------------------- -inoremap /* /**/ -vnoremap /* s/**/p -" -"------------------------------------------------------------------------------- -" additional mapping : complete a classical C multi-line comment: -" '/*' => /* -" * | -" */ -"------------------------------------------------------------------------------- -inoremap /* /*/kA -" -"------------------------------------------------------------------------------- -" additional mapping : { always opens a block -"------------------------------------------------------------------------------- -inoremap { {}O -vnoremap { S{}Pk=iB -" -" -if !exists("g:C_Ctrl_j") || ( exists("g:C_Ctrl_j") && g:C_Ctrl_j != 'off' ) - nmap i=C_JumpCtrlJ() - imap =C_JumpCtrlJ() -endif diff --git a/vim_old/ftplugin/html_snip_helper.vim b/vim_old/ftplugin/html_snip_helper.vim deleted file mode 100644 index 2e54570..0000000 --- a/vim_old/ftplugin/html_snip_helper.vim +++ /dev/null @@ -1,10 +0,0 @@ -" Helper function for (x)html snippets -if exists('s:did_snip_helper') || &cp || !exists('loaded_snips') - finish -endif -let s:did_snip_helper = 1 - -" Automatically closes tag if in xhtml -fun! Close() - return stridx(&ft, 'xhtml') == -1 ? '' : ' /' -endf diff --git a/vim_old/ftplugin/jade.vim b/vim_old/ftplugin/jade.vim deleted file mode 100644 index 84d8ba5..0000000 --- a/vim_old/ftplugin/jade.vim +++ /dev/null @@ -1,53 +0,0 @@ -" Vim filetype plugin -" Language: Jade -" Maintainer: Joshua Borton -" Credits: Tim Pope - -" Only do this when not done yet for this buffer -if exists("b:did_ftplugin") - finish -endif - -let s:save_cpo = &cpo -set cpo-=C - -" Define some defaults in case the included ftplugins don't set them. -let s:undo_ftplugin = "" -let s:browsefilter = "All Files (*.*)\t*.*\n" -let s:match_words = "" - -runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim -unlet! b:did_ftplugin - -" Override our defaults if these were set by an included ftplugin. -if exists("b:undo_ftplugin") - let s:undo_ftplugin = b:undo_ftplugin - unlet b:undo_ftplugin -endif -if exists("b:browsefilter") - let s:browsefilter = b:browsefilter - unlet b:browsefilter -endif -if exists("b:match_words") - let s:match_words = b:match_words - unlet b:match_words -endif - -" Change the browse dialog on Win32 to show mainly Haml-related files -if has("gui_win32") - let b:browsefilter="Jade Files (*.jade)\t*.jade\n" . s:browsefilter -endif - -" Load the combined list of match_words for matchit.vim -if exists("loaded_matchit") - let b:match_words = s:match_words -endif - -setlocal comments= commentstring=-#\ %s - -let b:undo_ftplugin = "setl cms< com< " - \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin - -let &cpo = s:save_cpo - -" vim:set sw=2: diff --git a/vim_old/indent/jade.vim b/vim_old/indent/jade.vim deleted file mode 100644 index 7fb3a10..0000000 --- a/vim_old/indent/jade.vim +++ /dev/null @@ -1,70 +0,0 @@ -" Vim indent file -" Language: Jade -" Maintainer: Joshua Borton -" Credits: Tim Pope (vim-jade) -" Last Change: 2010 Sep 22 - -if exists("b:did_indent") - finish -endif - -unlet! b:did_indent -let b:did_indent = 1 - -setlocal autoindent sw=2 et -setlocal indentexpr=GetJadeIndent() -setlocal indentkeys=o,O,*,},],0),!^F - -" Only define the function once. -if exists("*GetJadeIndent") - finish -endif - -let s:attributes = '\%((.\{-\})\)' -let s:tag = '\([%.#][[:alnum:]_-]\+\|'.s:attributes.'\)*[<>]*' - -if !exists('g:jade_self_closing_tags') - let g:jade_self_closing_tags = 'meta|link|img|hr|br' -endif - -setlocal formatoptions+=r -setlocal comments+=n:\| - -function! GetJadeIndent() - let lnum = prevnonblank(v:lnum-1) - if lnum == 0 - return 0 - endif - let line = substitute(getline(lnum),'\s\+$','','') - let cline = substitute(substitute(getline(v:lnum),'\s\+$','',''),'^\s\+','','') - let lastcol = strlen(line) - let line = substitute(line,'^\s\+','','') - let indent = indent(lnum) - let cindent = indent(v:lnum) - let increase = indent + &sw - if indent == indent(lnum) - let indent = cindent <= indent ? -1 : increase - endif - - let group = synIDattr(synID(lnum,lastcol,1),'name') - - if line =~ '^!!!' - return indent - elseif line =~ '^/\%(\[[^]]*\]\)\=$' - return increase - elseif group == 'jadeFilter' - return increase - elseif line =~ '^'.s:tag.'[&!]\=[=~-].*,\s*$' - return increase - elseif line == '-#' - return increase - elseif line =~? '^\v%('.g:jade_self_closing_tags.')>' - return indent - elseif group =~? '\v^%(jadeTag|jadeAttributesDelimiter|jadeClass|jadeId|htmlTagName|htmlSpecialTagName)$' - return increase - else - return indent - endif -endfunction - -" vim:set sw=2: diff --git a/vim_old/indent/php.vim b/vim_old/indent/php.vim deleted file mode 100644 index 8d05e49..0000000 --- a/vim_old/indent/php.vim +++ /dev/null @@ -1,1213 +0,0 @@ -" Vim indent file -" Language: PHP -" Author: John Wellesz -" URL: http://www.2072productions.com/vim/indent/php.vim -" Last Change: 2008 November 22nd -" Newsletter: http://www.2072productions.com/?to=php-indent-for-vim-newsletter.php -" Version: 1.30 -" -" -" Changes: 1.30 - Fixed empty case/default identation again :/ -" - The ResetOptions() function will be called each time -" the ftplugin calls this script, previously it was -" executed on BufWinEnter and Syntax events. -" -" -" Changes: 1.29 - Fixed php file detection for ResetOptions() used for -" comments formatting. It now uses the same tests as -" filetype.vim. ResetOptions() will be correctly -" called for *.phtml, *.ctp and *.inc files. -" -" -" Changes: 1.28 - End HEREDOC delimiters were not considered as such -" if they were not followed by a ';'. -" - Added support for NOWDOC tags ($foo = <<<'bar') -" -" -" Changes: 1.27 - if a "case" was preceded by another "case" on the -" previous line, the second "case" was indented incorrectly. -" -" Changes: 1.26 - '/*' character sequences found on a line -" starting by a '#' were not dismissed by the indenting algorithm -" and could cause indentation problem in some cases. -" -" -" Changes: 1.25 - Fix some indentation errors on multi line conditions -" and multi line statements. -" - Fix when array indenting is broken and a closing -" ');' is placed at the start of the line, following -" lines will be indented correctly. -" - New option: PHP_vintage_case_default_indent (default off) -" - Minor fixes and optimizations. -" -" -" Changes: 1.24 - Added compatibility with the latest version of -" php.vim syntax file by Peter Hodge (http://www.vim.org/scripts/script.php?script_id=1571) -" This fixes wrong indentation and ultra-slow indenting -" on large php files... -" - Fixed spelling in comments. -" -" -" Changes: 1.23 - html tag was preceded by a "?>" it wasn't indented. -" - Some other minor corrections and improvements. -" -" -" Changes: 1.16 - Now starting and ending '*' of multiline '/* */' comments are aligned -" on the '*' of the '/*' comment starter. -" - Some code improvements that make indentation faster. -" -" Changes: 1.15 - Corrected some problems with the indentation of -" multiline "array()" declarations. -" -" Changes: 1.14 - Added auto-formatting for comments (using the Vim option formatoptions=qroc). -" - Added the script option PHP_BracesAtCodeLevel to -" indent the '{' and '}' at the same level than the -" code they contain. -" -" Changes: 1.13 - Some code cleaning and typo corrections (Thanks to -" Emanuele Giaquinta for his patches) -" -" Changes: 1.12 - The bug involving searchpair() and utf-8 encoding in Vim 6.3 will -" not make this script to hang but you'll have to be -" careful to not write '/* */' comments with other '/*' -" inside the comments else the indentation won't be correct. -" NOTE: This is true only if you are using utf-8 and vim 6.3. -" -" Changes: 1.11 - If the "case" of a "switch" wasn't alone on its line -" and if the "switch" was at col 0 (or at default indenting) -" the lines following the "case" were not indented. -" -" Changes: 1.10 - Lines beginning by a single or double quote were -" not indented in some cases. -" -" Changes: 1.09 - JavaScript code was not always directly indented. -" -" Changes: 1.08 - End comment tags '*/' are indented like start tags '/*'. -" - When typing a multiline comment, '}' are indented -" according to other commented '{'. -" - Added a new option 'PHP_removeCRwhenUnix' to -" automatically remove CR at end of lines when the file -" format is Unix. -" - Changed the file format of this very file to Unix. -" - This version seems to correct several issues some people -" had with 1.07. -" -" Changes: 1.07 - Added support for "Here document" tags: -" - HereDoc end tags are indented properly. -" - HereDoc content remains unchanged. -" - All the code that is outside PHP delimiters remains -" unchanged. -" - New feature: The content of html tags is considered as PHP -" and indented according to the surrounding PHP code. -" - "else if" are detected as "elseif". -" - Multiline /**/ are indented when the user types it but -" remain unchanged when indenting from their beginning. -" - Fixed indenting of // and # comments. -" - php_sync_method option is set to 0 (fromstart). -" This is required for complex PHP scripts else the indent -" may fail. -" - Files with non PHP code at the beginning could alter the indent -" of the following PHP code. -" - Other minor improvements and corrections. -" -" Changes: 1.06: - Switch block were no longer indented correctly... -" - Added an option to use a default indenting instead of 0. -" (whereas I still can't find any good reason to use it!) -" - A problem with ^\s*);\= lines where ending a non '{}' -" structure. -" - Changed script local variable to be buffer local -" variable instead. -" -" Changes: 1.05: - Lines containing "" and "?> ,=?>,=\)\@!\|]*>\%(.*<\/script>\)\@!' -"setlocal debug=msg " XXX - - -function! GetLastRealCodeLNum(startline) " {{{ - "Inspired from the function SkipJavaBlanksAndComments by Toby Allsopp for indent/java.vim - - let lnum = a:startline - - " Used to indent html tag correctly - if b:GetLastRealCodeLNum_ADD && b:GetLastRealCodeLNum_ADD == lnum + 1 - let lnum = b:GetLastRealCodeLNum_ADD - endif - - let old_lnum = lnum - - while lnum > 1 - let lnum = prevnonblank(lnum) - let lastline = getline(lnum) - - " if we are inside an html ' - let b:InPHPcode = 0 - let b:InPHPcode_tofind = s:PHP_startindenttag - " Note that b:InPHPcode_and_script is still true so that the - " can be indented correctly - endif - endif " }}} - - - " Non PHP code is let as it is - if !b:InPHPcode && !b:InPHPcode_and_script - return -1 - endif - " Align correctly multi // or # lines - - " Indent successive // or # comment the same way the first is {{{ - if cline =~ '^\s*\%(//\|#\|/\*.*\*/\s*$\)' - if b:PHP_LastIndentedWasComment == 1 - return indent(real_PHP_lastindented) - endif - let b:PHP_LastIndentedWasComment = 1 - else - let b:PHP_LastIndentedWasComment = 0 - endif " }}} - - " Indent multiline /* comments correctly {{{ - - "if we are on the start of a MULTI * beginning comment or if the user is - "currently typing a /* beginning comment. - if b:PHP_InsideMultilineComment || b:UserIsTypingComment - if cline =~ '^\s*\*\%(\/\)\@!' - " if cline == '*' - if last_line =~ '^\s*/\*' - " if last_line == '/*' - return indent(lnum) + 1 - else - return indent(lnum) - endif - else - let b:PHP_InsideMultilineComment = 0 - endif - endif - - if !b:PHP_InsideMultilineComment && cline =~ '^\s*/\*' && cline !~ '\*/\s*$' - " if cline == '/*' - if getline(v:lnum + 1) !~ '^\s*\*' - return -1 - endif - let b:PHP_InsideMultilineComment = 1 - endif " }}} - - " Some tags are always indented to col 1 - - " Things always indented at col 1 (PHP delimiter: , Heredoc end) {{{ - " PHP start tags are always at col 1, useless to indent unless the end tag - " is on the same line - if cline =~# '^\s*' - return 0 - endif - - " PHP end tags are always at col 1, useless to indent unless if it's - " followed by a start tag on the same line - if cline =~ '^\s*?>' && cline !~# '\)\=\|<<<''\=\a\w*''\=$\|^\s*}\)'.endline " XXX 0607 - " What is a terminated line? - " - a line terminated by a ";" optionally followed by a "?>" - " - a HEREDOC starter line (the content of such block is never seen by this script) - " - a "}" not followed by a "{" - - let unstated = '\%(^\s*'.s:blockstart.'.*)\|\%(//.*\)\@\)'.endline - " What is an unstated line? - " - an "else" at the end of line - " - a s:blockstart (if while etc...) followed by anything but a ";" at - " the end of line - - " if the current line is an 'else' starting line - " (to match an 'else' preceded by a '}' is irrelevant and futile - see - " code above) - if ind != b:PHP_default_indenting && cline =~# '^\s*else\%(if\)\=\>' - " prevent optimized to work at next call - let b:PHP_CurrentIndentLevel = b:PHP_default_indenting - return indent(FindTheIfOfAnElse(v:lnum, 1)) - elseif cline =~ '^\s*)\=\s*{' - let previous_line = last_line - let last_line_num = lnum - - " let's find the indent of the block starter (if, while, for, etc...) - while last_line_num > 1 - - if previous_line =~ '^\s*\%(' . s:blockstart . '\|\%([a-zA-Z]\s*\)*function\)' - - let ind = indent(last_line_num) - - " If the PHP_BracesAtCodeLevel is set then indent the '{' - if b:PHP_BracesAtCodeLevel - let ind = ind + &sw - endif - - return ind - endif - - let last_line_num = last_line_num - 1 - let previous_line = getline(last_line_num) - endwhile - - elseif last_line =~# unstated && cline !~ '^\s*);\='.endline - let ind = ind + &sw " we indent one level further when the preceding line is not stated - "echo "42" - "call getchar() - return ind - - " If the last line is terminated by ';' or if it's a closing '}' - " We need to check if this isn't the end of a multilevel non '{}' - " structure such as: - " Exemple: - " if ($truc) - " echo 'truc'; - " - " OR - " - " if ($truc) - " while ($truc) { - " lkhlkh(); - " echo 'infinite loop\n'; - " } - " - " OR even (ADDED for version 1.17 - no modification required ) - " - " $thing = - " "something"; - elseif (ind != b:PHP_default_indenting || last_line =~ '^)' ) && last_line =~ terminated " Added || last_line =~ '^)' on 2007-12-30 (array indenting [rpblem broke other things) - " If we are here it means that the previous line is: - " - a *;$ line - " - a [beginning-blanck] } followed by anything but a { $ - let previous_line = last_line - let last_line_num = lnum - let LastLineClosed = 1 - " The idea here is to check if the current line is after a non '{}' - " structure so we can indent it like the top of that structure. - " The top of that structure is characterized by a if (ff)$ style line - " preceded by a stated line. If there is no such structure then we - " just have to find two 'normal' lines following each other with the - " same indentation and with the first of these two lines terminated by - " a ; or by a }... - - while 1 - " let's skip '{}' blocks - if previous_line =~ '^\s*}' - " find the opening '{' - let last_line_num = FindOpenBracket(last_line_num) - - " if the '{' is alone on the line get the line before - if getline(last_line_num) =~ '^\s*{' - let last_line_num = GetLastRealCodeLNum(last_line_num - 1) - endif - - let previous_line = getline(last_line_num) - - continue - else - " At this point we know that the previous_line isn't a closing - " '}' so we can check if we really are in such a structure. - - " it's not a '}' but it could be an else alone... - if getline(last_line_num) =~# '^\s*else\%(if\)\=\>' - let last_line_num = FindTheIfOfAnElse(last_line_num, 0) - " re-run the loop (we could find a '}' again) - continue - endif - - " So now it's ok we can check :-) - " A good quality is to have confidence in oneself so to know - " if yes or no we are in that struct lets test the indent of - " last_line_num and of last_line_num - 1! - " If those are == then we are almost done. - " - " That isn't sufficient, we need to test how the first of the - " 2 lines is ended... - - " Remember the 'topest' line we found so far - let last_match = last_line_num - - let one_ahead_indent = indent(last_line_num) - let last_line_num = GetLastRealCodeLNum(last_line_num - 1) - let two_ahead_indent = indent(last_line_num) - let after_previous_line = previous_line - let previous_line = getline(last_line_num) - - - " If we find a '{' or a case/default then we are inside that block so lets - " indent properly... Like the line following that block starter - if previous_line =~# defaultORcase.'\|{'.endline - break - endif - - " The 3 lines below are not necessary for the script to work - " but it makes it work a little more faster in some (rare) cases. - " We verify if we are at the top of a non '{}' struct. - if after_previous_line=~# '^\s*'.s:blockstart.'.*)'.endline && previous_line =~# '[;}]'.endline - break - endif - - if one_ahead_indent == two_ahead_indent || last_line_num < 1 - " So the previous line and the line before are at the same - " col. Now we just have to check if the line before is a ;$ or [}]$ ended line - " we always check the most ahead line of the 2 lines so - " it's useless to match ')$' since the lines couldn't have - " the same indent... - if previous_line =~# '\%(;\|^\s*}\)'.endline || last_line_num < 1 - break - endif - endif - endif - endwhile - - if indent(last_match) != ind - " let's use the indent of the last line matched by the algorithm above - let ind = indent(last_match) - " line added in version 1.02 to prevent optimized mode - " from acting in some special cases - let b:PHP_CurrentIndentLevel = b:PHP_default_indenting - - " case and default are indented 1 level below the surrounding code - if cline =~# defaultORcase - let ind = ind - &sw - endif - return ind - endif - " if nothing was done lets the old script continue - endif - - let plinnum = GetLastRealCodeLNum(lnum - 1) - " previous to last line - let pline = getline(plinnum) - - " REMOVE comments at end of line before treatment - " the first part of the regex removes // from the end of line when they are - " followed by a number of '"' which is a multiple of 2. The second part - " removes // that are not followed by any '"' - " Sorry for this unreadable thing... - let last_line = substitute(last_line,"\\(//\\|#\\)\\(\\(\\([^\"']*\\([\"']\\)[^\"']*\\5\\)\\+[^\"']*$\\)\\|\\([^\"']*$\\)\\)",'','') - - - if ind == b:PHP_default_indenting - if last_line =~ terminated - let LastLineClosed = 1 - endif - endif - - " Indent blocks enclosed by {} or () (default indenting) - if !LastLineClosed - "echo "start" - "call getchar() - - " the last line isn't a .*; or a }$ line - " Indent correctly multilevel and multiline '(.*)' things - - " if the last line is a [{(]$ or a multiline function call (or array - " declaration) with already one parameter on the opening ( line - if last_line =~# '[{(]'.endline || last_line =~? '\h\w*\s*(.*,$' && pline !~ '[,(]'.endline - - if !b:PHP_BracesAtCodeLevel || last_line !~# '^\s*{' - let ind = ind + &sw - endif - - " echo "43" - " call getchar() - if b:PHP_BracesAtCodeLevel || b:PHP_vintage_case_default_indent == 1 || cline !~# defaultORcase - " case and default are not indented inside blocks - let b:PHP_CurrentIndentLevel = ind - - return ind - endif - - " If the last line isn't empty and ends with a '),' then check if the - " ')' was opened on the same line, if not it means it closes a - " multiline '(.*)' thing and that the current line need to be - " de-indented one time. - elseif last_line =~ '\S\+\s*),'.endline - call cursor(lnum, 1) - call search('),'.endline, 'W') - let openedparent = searchpair('(', '', ')', 'bW', 'Skippmatch()') - if openedparent != lnum - let ind = indent(openedparent) - endif - " if the line before starts a block then we need to indent the - " current line. - elseif last_line =~ '^\s*'.s:blockstart - let ind = ind + &sw - - elseif last_line =~# defaultORcase && cline !~# defaultORcase - let ind = ind + &sw - "echo cline. " --test 1-- " . ind - "call getchar() - - " In all other cases if the last line isn't terminated indent 1 - " level higher but only if the last line wasn't already indented - " for the same "code event"/reason. IE: if the line before the - " last is terminated. - " - " 2nd explanation: - " - Test if the line before the previous is terminated or is - " a default/case if yes indent else let since it must have - " been indented correctly already - - "elseif cline !~ '^\s*{' && pline =~ '\%(;\%(\s*?>\)\=\|<<<\a\w*\|{\|^\s*'.s:blockstart.'.*)\)'.endline.'\|^\s*}\|'.defaultORcase - elseif pline =~ '\%(;\%(\s*?>\)\=\|<<<''\=\a\w*''\=$\|^\s*}\|{\)'.endline . '\|' . defaultORcase && cline !~# defaultORcase - - "echo pline. " " . ind - "call getchar() - let ind = ind + &sw - "echo pline. " --test 2-- " . ind - "call getchar() - endif - - endif - - "echo "end" - "call getchar() - " If the current line closes a multiline function call or array def - if cline =~ '^\s*);\=' - let ind = ind - &sw - " CASE and DEFAULT are indented a level below the surrounding code. - elseif cline =~# defaultORcase && last_line !~# defaultORcase - let ind = ind - &sw - "echom "fuck!" - "call getchar() - - endif - - let b:PHP_CurrentIndentLevel = ind - return ind -endfunction - -" vim: set ts=8 sw=4 sts=4: diff --git a/vim_old/plugin/acp.vim b/vim_old/plugin/acp.vim deleted file mode 100644 index 0c01a31..0000000 --- a/vim_old/plugin/acp.vim +++ /dev/null @@ -1,170 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA -" -" GetLatestVimScripts: 1879 1 :AutoInstall: AutoComplPop -"============================================================================= -" LOAD GUARD {{{1 - -if exists('g:loaded_acp') - finish -elseif v:version < 702 - echoerr 'AutoComplPop does not support this version of vim (' . v:version . ').' - finish -endif -let g:loaded_acp = 1 - -" }}}1 -"============================================================================= -" FUNCTION: {{{1 - -" -function s:defineOption(name, default) - if !exists(a:name) - let {a:name} = a:default - endif -endfunction - -" -function s:makeDefaultBehavior() - let behavs = { - \ '*' : [], - \ 'ruby' : [], - \ 'python' : [], - \ 'perl' : [], - \ 'xml' : [], - \ 'html' : [], - \ 'xhtml' : [], - \ 'css' : [], - \ } - "--------------------------------------------------------------------------- - if !empty(g:acp_behaviorUserDefinedFunction) && - \ !empty(g:acp_behaviorUserDefinedMeets) - for key in keys(behavs) - call add(behavs[key], { - \ 'command' : "\\", - \ 'completefunc' : g:acp_behaviorUserDefinedFunction, - \ 'meets' : g:acp_behaviorUserDefinedMeets, - \ 'repeat' : 0, - \ }) - endfor - endif - "--------------------------------------------------------------------------- - for key in keys(behavs) - call add(behavs[key], { - \ 'command' : "\\", - \ 'completefunc' : 'acp#completeSnipmate', - \ 'meets' : 'acp#meetsForSnipmate', - \ 'onPopupClose' : 'acp#onPopupCloseSnipmate', - \ 'repeat' : 0, - \ }) - endfor - "--------------------------------------------------------------------------- - for key in keys(behavs) - call add(behavs[key], { - \ 'command' : g:acp_behaviorKeywordCommand, - \ 'meets' : 'acp#meetsForKeyword', - \ 'repeat' : 0, - \ }) - endfor - "--------------------------------------------------------------------------- - for key in keys(behavs) - call add(behavs[key], { - \ 'command' : "\\", - \ 'meets' : 'acp#meetsForFile', - \ 'repeat' : 1, - \ }) - endfor - "--------------------------------------------------------------------------- - call add(behavs.ruby, { - \ 'command' : "\\", - \ 'meets' : 'acp#meetsForRubyOmni', - \ 'repeat' : 0, - \ }) - "--------------------------------------------------------------------------- - call add(behavs.python, { - \ 'command' : "\\", - \ 'meets' : 'acp#meetsForPythonOmni', - \ 'repeat' : 0, - \ }) - "--------------------------------------------------------------------------- - call add(behavs.perl, { - \ 'command' : "\\", - \ 'meets' : 'acp#meetsForPerlOmni', - \ 'repeat' : 0, - \ }) - "--------------------------------------------------------------------------- - call add(behavs.xml, { - \ 'command' : "\\", - \ 'meets' : 'acp#meetsForXmlOmni', - \ 'repeat' : 1, - \ }) - "--------------------------------------------------------------------------- - call add(behavs.html, { - \ 'command' : "\\", - \ 'meets' : 'acp#meetsForHtmlOmni', - \ 'repeat' : 1, - \ }) - "--------------------------------------------------------------------------- - call add(behavs.xhtml, { - \ 'command' : "\\", - \ 'meets' : 'acp#meetsForHtmlOmni', - \ 'repeat' : 1, - \ }) - "--------------------------------------------------------------------------- - call add(behavs.css, { - \ 'command' : "\\", - \ 'meets' : 'acp#meetsForCssOmni', - \ 'repeat' : 0, - \ }) - "--------------------------------------------------------------------------- - return behavs -endfunction - -" }}}1 -"============================================================================= -" INITIALIZATION {{{1 - -"----------------------------------------------------------------------------- -call s:defineOption('g:acp_enableAtStartup', 1) -call s:defineOption('g:acp_mappingDriven', 0) -call s:defineOption('g:acp_ignorecaseOption', 1) -call s:defineOption('g:acp_completeOption', '.,w,b,k') -call s:defineOption('g:acp_completeoptPreview', 0) -call s:defineOption('g:acp_behaviorUserDefinedFunction', '') -call s:defineOption('g:acp_behaviorUserDefinedMeets', '') -call s:defineOption('g:acp_behaviorSnipmateLength', -1) -call s:defineOption('g:acp_behaviorKeywordCommand', "\") -call s:defineOption('g:acp_behaviorKeywordLength', 2) -call s:defineOption('g:acp_behaviorKeywordIgnores', []) -call s:defineOption('g:acp_behaviorFileLength', 0) -call s:defineOption('g:acp_behaviorRubyOmniMethodLength', 0) -call s:defineOption('g:acp_behaviorRubyOmniSymbolLength', 1) -call s:defineOption('g:acp_behaviorPythonOmniLength', 0) -call s:defineOption('g:acp_behaviorPerlOmniLength', -1) -call s:defineOption('g:acp_behaviorXmlOmniLength', 0) -call s:defineOption('g:acp_behaviorHtmlOmniLength', 0) -call s:defineOption('g:acp_behaviorCssOmniPropertyLength', 1) -call s:defineOption('g:acp_behaviorCssOmniValueLength', 0) -call s:defineOption('g:acp_behavior', {}) -"----------------------------------------------------------------------------- -call extend(g:acp_behavior, s:makeDefaultBehavior(), 'keep') -"----------------------------------------------------------------------------- -command! -bar -narg=0 AcpEnable call acp#enable() -command! -bar -narg=0 AcpDisable call acp#disable() -command! -bar -narg=0 AcpLock call acp#lock() -command! -bar -narg=0 AcpUnlock call acp#unlock() -"----------------------------------------------------------------------------- -" legacy commands -command! -bar -narg=0 AutoComplPopEnable AcpEnable -command! -bar -narg=0 AutoComplPopDisable AcpDisable -command! -bar -narg=0 AutoComplPopLock AcpLock -command! -bar -narg=0 AutoComplPopUnlock AcpUnlock -"----------------------------------------------------------------------------- -if g:acp_enableAtStartup - AcpEnable -endif -"----------------------------------------------------------------------------- - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/vim_old/plugin/c.vim b/vim_old/plugin/c.vim deleted file mode 100644 index 9470ee6..0000000 --- a/vim_old/plugin/c.vim +++ /dev/null @@ -1,3553 +0,0 @@ -"################################################################################# -" -" Filename: c.vim -" -" Description: C/C++-IDE. Write programs by inserting complete statements, -" comments, idioms, code snippets, templates and comments. -" Compile, link and run one-file-programs without a makefile. -" See also help file csupport.txt . -" -" GVIM Version: 7.0+ -" -" Configuration: There are some personal details which should be configured -" (see the files README.csupport and csupport.txt). -" -" Author: Dr.-Ing. Fritz Mehner, FH Südwestfalen, 58644 Iserlohn, Germany -" Email: mehner@fh-swf.de -" -" Version: see variable g:C_Version below -" Created: 04.11.2000 -" License: Copyright (c) 2000-2010, Fritz Mehner -" This program is free software; you can redistribute it and/or -" modify it under the terms of the GNU General Public License as -" published by the Free Software Foundation, version 2 of the -" License. -" This program is distributed in the hope that it will be -" useful, but WITHOUT ANY WARRANTY; without even the implied -" warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -" PURPOSE. -" See the GNU General Public License version 2 for more details. -" Revision: $Id: c.vim,v 1.115 2010/05/31 11:08:21 mehner Exp $ -" -"------------------------------------------------------------------------------ -" -if v:version < 700 - echohl WarningMsg | echo 'The plugin c-support.vim needs Vim version >= 7 .'| echohl None - finish -endif -" -" Prevent duplicate loading: -" -if exists("g:C_Version") || &cp - finish -endif -let g:C_Version= "5.11" " version number of this script; do not change -" -"################################################################################# -" -" Global variables (with default values) which can be overridden. -" -" Platform specific items: {{{1 -" - root directory -" - characters that must be escaped for filenames -" -let s:MSWIN = has("win16") || has("win32") || has("win64") || has("win95") -" -if s:MSWIN - " - let s:escfilename = '' - let s:plugin_dir = $VIM.'\vimfiles\' - let s:C_CodeSnippets = s:plugin_dir.'c-support/codesnippets/' - let s:C_IndentErrorLog = $HOME.'.indent.errorlog' - let s:installation = 'system' - " - let s:C_Display = '' - " -else - " - let s:escfilename = ' \%#[]' - let s:installation = 'local' - " - " user / system wide installation (Linux/Unix) - " - if match( expand(""), $VIM ) == 0 - " system wide installation - let s:plugin_dir = $VIM.'/vimfiles/' - let s:installation = 'system' - else - " user installation assumed - let s:plugin_dir = $HOME.'/.vim/' - endif - " - let s:C_CodeSnippets = $HOME.'/.vim/c-support/codesnippets/' - let s:C_IndentErrorLog = $HOME.'/.indent.errorlog' - " - let s:C_Display = system("echo -n $DISPLAY") - " -endif -" Use of dictionaries {{{1 -" Key word completion is enabled by the filetype plugin 'c.vim' -" g:C_Dictionary_File must be global -" -if !exists("g:C_Dictionary_File") - let g:C_Dictionary_File = s:plugin_dir.'c-support/wordlists/c-c++-keywords.list,'. - \ s:plugin_dir.'c-support/wordlists/k+r.list,'. - \ s:plugin_dir.'c-support/wordlists/stl_index.list' -endif -" -" Modul global variables (with default values) which can be overridden. {{{1 -" -if s:MSWIN - let s:C_CCompiler = 'gcc.exe' " the C compiler - let s:C_CplusCompiler = 'g++.exe' " the C++ compiler - let s:C_ExeExtension = '.exe' " file extension for executables (leading point required) - let s:C_ObjExtension = '.obj' " file extension for objects (leading point required) - let s:C_Man = 'man.exe' " the manual program -else - let s:C_CCompiler = 'gcc' " the C compiler - let s:C_CplusCompiler = 'g++' " the C++ compiler - let s:C_ExeExtension = '' " file extension for executables (leading point required) - let s:C_ObjExtension = '.o' " file extension for objects (leading point required) - let s:C_Man = 'man' " the manual program -endif -" -let s:C_CExtension = 'c' " C file extension; everything else is C++ -let s:C_CFlags = '-Wall -g -O0 -c' " compiler flags: compile, don't optimize -let s:C_CodeCheckExeName = 'check' -let s:C_CodeCheckOptions = '-K13' -let s:C_LFlags = '-Wall -g -O0' " compiler flags: link , don't optimize -let s:C_Libs = '-lm' " libraries to use -let s:C_LineEndCommColDefault = 49 -let s:C_LoadMenus = 'yes' -let s:C_MenuHeader = 'yes' -let s:C_OutputGvim = 'vim' -let s:C_Printheader = "%<%f%h%m%< %=%{strftime('%x %X')} Page %N" -let s:C_Root = '&C\/C\+\+.' " the name of the root menu of this plugin -let s:C_TypeOfH = 'cpp' -let s:C_Wrapper = s:plugin_dir.'c-support/scripts/wrapper.sh' -let s:C_XtermDefaults = '-fa courier -fs 12 -geometry 80x24' -let s:C_GuiSnippetBrowser = 'gui' " gui / commandline -let s:C_GuiTemplateBrowser = 'gui' " gui / explorer / commandline -" -let s:C_GlobalTemplateFile = s:plugin_dir.'c-support/templates/Templates' -let s:C_GlobalTemplateDir = fnamemodify( s:C_GlobalTemplateFile, ":p:h" ).'/' -let s:C_LocalTemplateFile = $HOME.'/.vim/c-support/templates/Templates' -let s:C_LocalTemplateDir = fnamemodify( s:C_LocalTemplateFile, ":p:h" ).'/' -let s:C_TemplateOverwrittenMsg= 'yes' -let s:C_Ctrl_j = 'on' -" -let s:C_FormatDate = '%x' -let s:C_FormatTime = '%X' -let s:C_FormatYear = '%Y' -let s:C_SourceCodeExtensions = 'c cc cp cxx cpp CPP c++ C i ii' -" -"------------------------------------------------------------------------------ -" -" Look for global variables (if any), to override the defaults. -" -function! C_CheckGlobal ( name ) - if exists('g:'.a:name) - exe 'let s:'.a:name.' = g:'.a:name - endif -endfunction " ---------- end of function C_CheckGlobal ---------- -" -call C_CheckGlobal('C_CCompiler ') -call C_CheckGlobal('C_CExtension ') -call C_CheckGlobal('C_CFlags ') -call C_CheckGlobal('C_CodeCheckExeName ') -call C_CheckGlobal('C_CodeCheckOptions ') -call C_CheckGlobal('C_CodeSnippets ') -call C_CheckGlobal('C_CplusCompiler ') -call C_CheckGlobal('C_Ctrl_j ') -call C_CheckGlobal('C_ExeExtension ') -call C_CheckGlobal('C_FormatDate ') -call C_CheckGlobal('C_FormatTime ') -call C_CheckGlobal('C_FormatYear ') -call C_CheckGlobal('C_GlobalTemplateFile ') -call C_CheckGlobal('C_GuiSnippetBrowser ') -call C_CheckGlobal('C_GuiTemplateBrowser ') -call C_CheckGlobal('C_IndentErrorLog ') -call C_CheckGlobal('C_LFlags ') -call C_CheckGlobal('C_Libs ') -call C_CheckGlobal('C_LineEndCommColDefault ') -call C_CheckGlobal('C_LoadMenus ') -call C_CheckGlobal('C_LocalTemplateFile ') -call C_CheckGlobal('C_Man ') -call C_CheckGlobal('C_MenuHeader ') -call C_CheckGlobal('C_ObjExtension ') -call C_CheckGlobal('C_OutputGvim ') -call C_CheckGlobal('C_Printheader ') -call C_CheckGlobal('C_Root ') -call C_CheckGlobal('C_SourceCodeExtensions ') -call C_CheckGlobal('C_TemplateOverwrittenMsg ') -call C_CheckGlobal('C_TypeOfH ') -call C_CheckGlobal('C_XtermDefaults ') -" -"----- some variables for internal use only ----------------------------------- -" -" -" set default geometry if not specified -" -if match( s:C_XtermDefaults, "-geometry\\s\\+\\d\\+x\\d\\+" ) < 0 - let s:C_XtermDefaults = s:C_XtermDefaults." -geometry 80x24" -endif -" -" escape the printheader -" -let s:C_Printheader = escape( s:C_Printheader, ' %' ) -" -let s:C_HlMessage = "" -" -" characters that must be escaped for filenames -" -let s:C_If0_Counter = 0 -let s:C_If0_Txt = "If0Label_" -" -let s:C_SplintIsExecutable = 0 -if executable( "splint" ) - let s:C_SplintIsExecutable = 1 -endif -" -let s:C_CodeCheckIsExecutable = 0 -if executable( s:C_CodeCheckExeName ) - let s:C_CodeCheckIsExecutable = 1 -endif -" -"------------------------------------------------------------------------------ -" Control variables (not user configurable) -"------------------------------------------------------------------------------ -let s:Attribute = { 'below':'', 'above':'', 'start':'', 'append':'', 'insert':'' } -let s:C_Attribute = {} -let s:C_ExpansionLimit = 10 -let s:C_FileVisited = [] -" -let s:C_MacroNameRegex = '\([a-zA-Z][a-zA-Z0-9_]*\)' -let s:C_MacroLineRegex = '^\s*|'.s:C_MacroNameRegex.'|\s*=\s*\(.*\)' -let s:C_MacroCommentRegex = '^\$' -let s:C_ExpansionRegex = '|?'.s:C_MacroNameRegex.'\(:\a\)\?|' -let s:C_NonExpansionRegex = '|'.s:C_MacroNameRegex.'\(:\a\)\?|' -" -let s:C_TemplateNameDelimiter = '-+_,\. ' -let s:C_TemplateLineRegex = '^==\s*\([a-zA-Z][0-9a-zA-Z'.s:C_TemplateNameDelimiter -let s:C_TemplateLineRegex .= ']\+\)\s*==\s*\([a-z]\+\s*==\)\?' -let s:C_TemplateIf = '^==\s*IF\s\+|STYLE|\s\+IS\s\+'.s:C_MacroNameRegex.'\s*==' -let s:C_TemplateEndif = '^==\s*ENDIF\s*==' -" -let s:C_ExpansionCounter = {} -let s:C_TJT = '[ 0-9a-zA-Z_]*' -let s:C_TemplateJumpTarget1 = '<+'.s:C_TJT.'+>\|{+'.s:C_TJT.'+}' -let s:C_TemplateJumpTarget2 = '<-'.s:C_TJT.'->\|{-'.s:C_TJT.'-}' -let s:C_Macro = {'|AUTHOR|' : 'first name surname', - \ '|AUTHORREF|' : '', - \ '|EMAIL|' : '', - \ '|COMPANY|' : '', - \ '|PROJECT|' : '', - \ '|COPYRIGHTHOLDER|': '', - \ '|STYLE|' : '' - \ } -let s:C_MacroFlag = { ':l' : 'lowercase' , - \ ':u' : 'uppercase' , - \ ':c' : 'capitalize' , - \ ':L' : 'legalize name' , - \ } -let s:C_ActualStyle = 'default' -let s:C_ActualStyleLast = s:C_ActualStyle -let s:C_Template = { 'default' : {} } - -let s:C_ForTypes = [ - \ 'char' , - \ 'int' , - \ 'long' , - \ 'long int' , - \ 'long long' , - \ 'long long int' , - \ 'short' , - \ 'short int' , - \ 'size_t' , - \ 'unsigned' , - \ 'unsigned char' , - \ 'unsigned int' , - \ 'unsigned long' , - \ 'unsigned long int' , - \ 'unsigned long long' , - \ 'unsigned long long int', - \ 'unsigned short' , - \ 'unsigned short int' , - \ ] - -let s:MsgInsNotAvail = "insertion not available for a fold" - -"------------------------------------------------------------------------------ - -let s:C_SourceCodeExtensionsList = split( s:C_SourceCodeExtensions, '\s\+' ) - -"------------------------------------------------------------------------------ - -"------------------------------------------------------------------------------ -" C : C_InitMenus {{{1 -" Initialization of C support menus -"------------------------------------------------------------------------------ -" -" the menu names -" -let s:Comments = s:C_Root.'&Comments' -let s:Statements = s:C_Root.'&Statements' -let s:Idioms = s:C_Root.'&Idioms' -let s:Preprocessor = s:C_Root.'&Preprocessor' -let s:Snippets = s:C_Root.'S&nippets' -let s:Cpp = s:C_Root.'C&++' -let s:Run = s:C_Root.'&Run' -" -function! C_InitMenus () - " - "=============================================================================================== - "----- Menu : C main menu entry ------------------------------------------- {{{2 - "=============================================================================================== - " - if s:C_Root != "" - if s:C_MenuHeader == 'yes' - exe "amenu ".s:C_Root.'C\/C\+\+ ' - exe "amenu ".s:C_Root.'-Sep00- ' - endif - endif - " - "=============================================================================================== - "----- Menu : C-Comments -------------------------------------------------- {{{2 - "=============================================================================================== - " - if s:C_MenuHeader == 'yes' - exe "amenu ".s:C_Root.'&Comments.&CommentsC\/C\+\+ ' - exe "amenu ".s:C_Root.'&Comments.-Sep00- ' - endif - exe "amenu ".s:Comments.'.end-of-&line\ comment\\cl :call C_LineEndComment( )' - exe "vmenu ".s:Comments.'.end-of-&line\ comment\\cl :call C_MultiLineEndComments( )a' - - exe "amenu ".s:Comments.'.ad&just\ end-of-line\ com\.\\cj :call C_AdjustLineEndComm("a")' - exe "vmenu ".s:Comments.'.ad&just\ end-of-line\ com\.\\cj :call C_AdjustLineEndComm("v")' - - exe "amenu ".s:Comments.'.&set\ end-of-line\ com\.\ col\.\\cs :call C_GetLineEndCommCol()' - - exe "amenu ".s:Comments.'.-SEP10- :' - exe "amenu ".s:Comments.'.code\ ->\ comment\ \/&*\ *\/\\c* :call C_CodeComment("a","yes"):nohlsearchj' - exe "vmenu ".s:Comments.'.code\ ->\ comment\ \/&*\ *\/\\c* :call C_CodeComment("v","yes"):nohlsearchj' - exe "amenu ".s:Comments.'.code\ ->\ comment\ &\/\/\\cc :call C_CodeComment("a","no"):nohlsearchj' - exe "vmenu ".s:Comments.'.code\ ->\ comment\ &\/\/\\cc :call C_CodeComment("v","no"):nohlsearchj' - exe "amenu ".s:Comments.'.c&omment\ ->\ code\\co :call C_CommentCode("a"):nohlsearch' - exe "vmenu ".s:Comments.'.c&omment\ ->\ code\\co :call C_CommentCode("v"):nohlsearch' - - exe "amenu ".s:Comments.'.-SEP0- :' - exe "amenu ".s:Comments.'.&frame\ comment\\cfr :call C_InsertTemplate("comment.frame")' - exe "amenu ".s:Comments.'.f&unction\ description\\cfu :call C_InsertTemplate("comment.function")' - exe "amenu ".s:Comments.'.-SEP1- :' - exe "amenu ".s:Comments.'.&method\ description\\cme :call C_InsertTemplate("comment.method")' - exe "amenu ".s:Comments.'.cl&ass\ description\\ccl :call C_InsertTemplate("comment.class")' - exe "amenu ".s:Comments.'.-SEP2- :' - exe "amenu ".s:Comments.'.file\ description\ \(impl\.\)\\cfdi :call C_InsertTemplate("comment.file-description")' - exe "amenu ".s:Comments.'.file\ description\ \(header\)\\cfdh :call C_InsertTemplate("comment.file-description-header")' - exe "amenu ".s:Comments.'.-SEP3- :' - " - "----- Submenu : C-Comments : file sections ------------------------------------------------------------- - " - exe "amenu ".s:Comments.'.&C\/C\+\+-file\ sections\\ccs.file\ sectionsC\/C\+\+ ' - exe "amenu ".s:Comments.'.&C\/C\+\+-file\ sections\\ccs.-Sep0- ' - " - exe "amenu ".s:Comments.'.&C\/C\+\+-file\ sections\\ccs.&Header\ File\ Includes :call C_InsertTemplate("comment.file-section-cpp-header-includes")' - exe "amenu ".s:Comments.'.&C\/C\+\+-file\ sections\\ccs.Local\ &Macros :call C_InsertTemplate("comment.file-section-cpp-macros")' - exe "amenu ".s:Comments.'.&C\/C\+\+-file\ sections\\ccs.Local\ &Type\ Def\. :call C_InsertTemplate("comment.file-section-cpp-typedefs")' - exe "amenu ".s:Comments.'.&C\/C\+\+-file\ sections\\ccs.Local\ &Data\ Types :call C_InsertTemplate("comment.file-section-cpp-data-types")' - exe "amenu ".s:Comments.'.&C\/C\+\+-file\ sections\\ccs.Local\ &Variables :call C_InsertTemplate("comment.file-section-cpp-local-variables")' - exe "amenu ".s:Comments.'.&C\/C\+\+-file\ sections\\ccs.Local\ &Prototypes :call C_InsertTemplate("comment.file-section-cpp-prototypes")' - exe "amenu ".s:Comments.'.&C\/C\+\+-file\ sections\\ccs.&Exp\.\ Function\ Def\. :call C_InsertTemplate("comment.file-section-cpp-function-defs-exported")' - exe "amenu ".s:Comments.'.&C\/C\+\+-file\ sections\\ccs.&Local\ Function\ Def\. :call C_InsertTemplate("comment.file-section-cpp-function-defs-local")' - exe "amenu ".s:Comments.'.&C\/C\+\+-file\ sections\\ccs.-SEP6- :' - exe "amenu ".s:Comments.'.&C\/C\+\+-file\ sections\\ccs.Local\ &Class\ Def\. :call C_InsertTemplate("comment.file-section-cpp-class-defs")' - exe "amenu ".s:Comments.'.&C\/C\+\+-file\ sections\\ccs.E&xp\.\ Class\ Impl\. :call C_InsertTemplate("comment.file-section-cpp-class-implementations-exported")' - exe "amenu ".s:Comments.'.&C\/C\+\+-file\ sections\\ccs.L&ocal\ Class\ Impl\. :call C_InsertTemplate("comment.file-section-cpp-class-implementations-local")' - exe "amenu ".s:Comments.'.&C\/C\+\+-file\ sections\\ccs.-SEP7- :' - exe "amenu ".s:Comments.'.&C\/C\+\+-file\ sections\\ccs.&All\ sections,\ C :call C_Comment_C_SectionAll("c")' - exe "amenu ".s:Comments.'.&C\/C\+\+-file\ sections\\ccs.All\ §ions,\ C++ :call C_Comment_C_SectionAll("cpp")' - " - "----- Submenu : H-Comments : file sections ------------------------------------------------------------- - " - exe "amenu ".s:Comments.'.&H-file\ sections\\chs.H-file\ sectionsC\/C\+\+ ' - exe "amenu ".s:Comments.'.&H-file\ sections\\chs.-Sep0- ' - "' - exe "amenu ".s:Comments.'.&H-file\ sections\\chs.&Header\ File\ Includes :call C_InsertTemplate("comment.file-section-hpp-header-includes")' - exe "amenu ".s:Comments.'.&H-file\ sections\\chs.Exported\ &Macros :call C_InsertTemplate("comment.file-section-hpp-macros")' - exe "amenu ".s:Comments.'.&H-file\ sections\\chs.Exported\ &Type\ Def\. :call C_InsertTemplate("comment.file-section-hpp-exported-typedefs")' - exe "amenu ".s:Comments.'.&H-file\ sections\\chs.Exported\ &Data\ Types :call C_InsertTemplate("comment.file-section-hpp-exported-data-types")' - exe "amenu ".s:Comments.'.&H-file\ sections\\chs.Exported\ &Variables :call C_InsertTemplate("comment.file-section-hpp-exported-variables")' - exe "amenu ".s:Comments.'.&H-file\ sections\\chs.Exported\ &Funct\.\ Decl\. :call C_InsertTemplate("comment.file-section-hpp-exported-function-declarations")' - exe "amenu ".s:Comments.'.&H-file\ sections\\chs.-SEP4- :' - exe "amenu ".s:Comments.'.&H-file\ sections\\chs.E&xported\ Class\ Def\. :call C_InsertTemplate("comment.file-section-hpp-exported-class-defs")' - - exe "amenu ".s:Comments.'.&H-file\ sections\\chs.-SEP5- :' - exe "amenu ".s:Comments.'.&H-file\ sections\\chs.&All\ sections,\ C :call C_Comment_H_SectionAll("c")' - exe "amenu ".s:Comments.'.&H-file\ sections\\chs.All\ §ions,\ C++ :call C_Comment_H_SectionAll("cpp")' - " - exe "amenu ".s:Comments.'.-SEP8- :' - " - "----- Submenu : C-Comments : keyword comments ---------------------------------------------------------- - " - exe "amenu ".s:Comments.'.&keyword\ comm\.\\ckc.keyw\.+comm\.C\/C\+\+ ' - exe "amenu ".s:Comments.'.&keyword\ comm\.\\ckc.-Sep0- ' -" - exe "amenu ".s:Comments.'.&keyword\ comm\.\\ckc.\:&BUG\: $:call C_InsertTemplate("comment.keyword-bug")' - exe "amenu ".s:Comments.'.&keyword\ comm\.\\ckc.\:&COMPILER\: $:call C_InsertTemplate("comment.keyword-compiler")' - exe "amenu ".s:Comments.'.&keyword\ comm\.\\ckc.\:&TODO\: $:call C_InsertTemplate("comment.keyword-todo")' - exe "amenu ".s:Comments.'.&keyword\ comm\.\\ckc.\:T&RICKY\: $:call C_InsertTemplate("comment.keyword-tricky")' - exe "amenu ".s:Comments.'.&keyword\ comm\.\\ckc.\:&WARNING\: $:call C_InsertTemplate("comment.keyword-warning")' - exe "amenu ".s:Comments.'.&keyword\ comm\.\\ckc.\:W&ORKAROUND\: $:call C_InsertTemplate("comment.keyword-workaround")' - exe "amenu ".s:Comments.'.&keyword\ comm\.\\ckc.\:&new\ keyword\: $:call C_InsertTemplate("comment.keyword-keyword")' -" - exe "imenu ".s:Comments.'.&keyword\ comm\.\\ckc.\:&BUG\: $:call C_InsertTemplate("comment.keyword-bug")' - exe "imenu ".s:Comments.'.&keyword\ comm\.\\ckc.\:&COMPILER\: $:call C_InsertTemplate("comment.keyword-compiler")' - exe "imenu ".s:Comments.'.&keyword\ comm\.\\ckc.\:&TODO\: $:call C_InsertTemplate("comment.keyword-todo")' - exe "imenu ".s:Comments.'.&keyword\ comm\.\\ckc.\:T&RICKY\: $:call C_InsertTemplate("comment.keyword-tricky")' - exe "imenu ".s:Comments.'.&keyword\ comm\.\\ckc.\:&WARNING\: $:call C_InsertTemplate("comment.keyword-warning")' - exe "imenu ".s:Comments.'.&keyword\ comm\.\\ckc.\:W&ORKAROUND\: $:call C_InsertTemplate("comment.keyword-workaround")' - exe "imenu ".s:Comments.'.&keyword\ comm\.\\ckc.\:&new\ keyword\: $:call C_InsertTemplate("comment.keyword-keyword")' - " - "----- Submenu : C-Comments : special comments ---------------------------------------------------------- - " - exe "amenu ".s:Comments.'.&special\ comm\.\\ckc.special\ comm\.C\/C\+\+ ' - exe "amenu ".s:Comments.'.&special\ comm\.\\ckc.-Sep0- ' - exe "amenu ".s:Comments.'.&special\ comm\.\\ckc.&EMPTY $:call C_InsertTemplate("comment.special-empty")' - exe "amenu ".s:Comments.'.&special\ comm\.\\ckc.&FALL\ THROUGH $:call C_InsertTemplate("comment.special-fall-through") ' - exe "amenu ".s:Comments.'.&special\ comm\.\\ckc.&IMPL\.\ TYPE\ CONV $:call C_InsertTemplate("comment.special-implicit-type-conversion") ' - exe "amenu ".s:Comments.'.&special\ comm\.\\ckc.&NO\ RETURN $:call C_InsertTemplate("comment.special-no-return") ' - exe "amenu ".s:Comments.'.&special\ comm\.\\ckc.NOT\ &REACHED $:call C_InsertTemplate("comment.special-not-reached") ' - exe "amenu ".s:Comments.'.&special\ comm\.\\ckc.&TO\ BE\ IMPL\. $:call C_InsertTemplate("comment.special-remains-to-be-implemented")' - exe "amenu ".s:Comments.'.&special\ comm\.\\ckc.-SEP81- :' - exe "amenu ".s:Comments.'.&special\ comm\.\\ckc.constant\ type\ is\ &long\ (L) $:call C_InsertTemplate("comment.special-constant-type-is-long")' - exe "amenu ".s:Comments.'.&special\ comm\.\\ckc.constant\ type\ is\ &unsigned\ (U) $:call C_InsertTemplate("comment.special-constant-type-is-unsigned")' - exe "amenu ".s:Comments.'.&special\ comm\.\\ckc.constant\ type\ is\ unsigned\ l&ong\ (UL) $:call C_InsertTemplate("comment.special-constant-type-is-unsigned-long")' - " - exe "imenu ".s:Comments.'.&special\ comm\.\\ckc.&EMPTY $:call C_InsertTemplate("comment.special-empty")' - exe "imenu ".s:Comments.'.&special\ comm\.\\ckc.&FALL\ THROUGH $:call C_InsertTemplate("comment.special-fall-through") ' - exe "imenu ".s:Comments.'.&special\ comm\.\\ckc.&IMPL\.\ TYPE\ CONV $:call C_InsertTemplate("comment.special-implicit-type-conversion") ' - exe "imenu ".s:Comments.'.&special\ comm\.\\ckc.&NO\ RETURN $:call C_InsertTemplate("comment.special-no-return") ' - exe "imenu ".s:Comments.'.&special\ comm\.\\ckc.NOT\ &REACHED $:call C_InsertTemplate("comment.special-not-reached") ' - exe "imenu ".s:Comments.'.&special\ comm\.\\ckc.&TO\ BE\ IMPL\. $:call C_InsertTemplate("comment.special-remains-to-be-implemented")' - exe "imenu ".s:Comments.'.&special\ comm\.\\ckc.-SEP81- :' - exe "imenu ".s:Comments.'.&special\ comm\.\\ckc.constant\ type\ is\ &long\ (L) $:call C_InsertTemplate("comment.special-constant-type-is-long")' - exe "imenu ".s:Comments.'.&special\ comm\.\\ckc.constant\ type\ is\ &unsigned\ (U) $:call C_InsertTemplate("comment.special-constant-type-is-unsigned")' - exe "imenu ".s:Comments.'.&special\ comm\.\\ckc.constant\ type\ is\ unsigned\ l&ong\ (UL) $:call C_InsertTemplate("comment.special-constant-type-is-unsigned-long")' - " - "----- Submenu : C-Comments : Tags ---------------------------------------------------------- - " - exe "amenu ".s:Comments.'.ta&gs\ (plugin).tags\ (plugin)C\/C\+\+ ' - exe "amenu ".s:Comments.'.ta&gs\ (plugin).-Sep0- ' - " - exe "anoremenu ".s:Comments.'.ta&gs\ (plugin).&AUTHOR :call C_InsertMacroValue("AUTHOR")' - exe "anoremenu ".s:Comments.'.ta&gs\ (plugin).AUTHOR&REF :call C_InsertMacroValue("AUTHORREF")' - exe "anoremenu ".s:Comments.'.ta&gs\ (plugin).&COMPANY :call C_InsertMacroValue("COMPANY")' - exe "anoremenu ".s:Comments.'.ta&gs\ (plugin).C&OPYRIGHTHOLDER :call C_InsertMacroValue("COPYRIGHTHOLDER")' - exe "anoremenu ".s:Comments.'.ta&gs\ (plugin).&EMAIL :call C_InsertMacroValue("EMAIL")' - exe "anoremenu ".s:Comments.'.ta&gs\ (plugin).&PROJECT :call C_InsertMacroValue("PROJECT")' - " - exe "inoremenu ".s:Comments.'.ta&gs\ (plugin).&AUTHOR :call C_InsertMacroValue("AUTHOR")a' - exe "inoremenu ".s:Comments.'.ta&gs\ (plugin).AUTHOR&REF :call C_InsertMacroValue("AUTHORREF")a' - exe "inoremenu ".s:Comments.'.ta&gs\ (plugin).&COMPANY :call C_InsertMacroValue("COMPANY")a' - exe "inoremenu ".s:Comments.'.ta&gs\ (plugin).C&OPYRIGHTHOLDER :call C_InsertMacroValue("COPYRIGHTHOLDER")a' - exe "inoremenu ".s:Comments.'.ta&gs\ (plugin).&EMAIL :call C_InsertMacroValue("EMAIL")a' - exe "inoremenu ".s:Comments.'.ta&gs\ (plugin).&PROJECT :call C_InsertMacroValue("PROJECT")a' - " - exe "vnoremenu ".s:Comments.'.ta&gs\ (plugin).&AUTHOR s:call C_InsertMacroValue("AUTHOR")a' - exe "vnoremenu ".s:Comments.'.ta&gs\ (plugin).AUTHOR&REF s:call C_InsertMacroValue("AUTHORREF")a' - exe "vnoremenu ".s:Comments.'.ta&gs\ (plugin).&COMPANY s:call C_InsertMacroValue("COMPANY")a' - exe "vnoremenu ".s:Comments.'.ta&gs\ (plugin).C&OPYRIGHTHOLDER s:call C_InsertMacroValue("COPYRIGHTHOLDER")a' - exe "vnoremenu ".s:Comments.'.ta&gs\ (plugin).&EMAIL s:call C_InsertMacroValue("EMAIL")a' - exe "vnoremenu ".s:Comments.'.ta&gs\ (plugin).&PROJECT s:call C_InsertMacroValue("PROJECT")a' - " - " - exe "amenu ".s:Comments.'.-SEP9- :' - " - exe " menu ".s:Comments.'.&date\\cd :call C_InsertDateAndTime("d")' - exe "imenu ".s:Comments.'.&date\\cd :call C_InsertDateAndTime("d")a' - exe "vmenu ".s:Comments.'.&date\\cd s:call C_InsertDateAndTime("d")a' - exe " menu ".s:Comments.'.date\ &time\\ct :call C_InsertDateAndTime("dt")' - exe "imenu ".s:Comments.'.date\ &time\\ct :call C_InsertDateAndTime("dt")a' - exe "vmenu ".s:Comments.'.date\ &time\\ct s:call C_InsertDateAndTime("dt")a' - - exe "amenu ".s:Comments.'.-SEP12- :' - exe "amenu ".s:Comments.'.\/\/\ xxx\ \ \ \ \ &->\ \ \/*\ xxx\ *\/ :call C_CommentCppToC()' - exe "vmenu ".s:Comments.'.\/\/\ xxx\ \ \ \ \ &->\ \ \/*\ xxx\ *\/ :'."'<,'>".'call C_CommentCppToC()' - exe "amenu ".s:Comments.'.\/*\ xxx\ *\/\ \ -&>\ \ \/\/\ xxx :call C_CommentCToCpp()' - exe "vmenu ".s:Comments.'.\/*\ xxx\ *\/\ \ -&>\ \ \/\/\ xxx :'."'<,'>".'call C_CommentCToCpp()' - " - "=============================================================================================== - "----- Menu : C-Statements------------------------------------------------- {{{2 - "=============================================================================================== - " - if s:C_MenuHeader == 'yes' - exe "amenu ".s:Statements.'.&StatementsC\/C\+\+ ' - exe "amenu ".s:Statements.'.-Sep00- ' - endif - " - exe "amenu ".s:Statements.'.&do\ \{\ \}\ while\\sd :call C_InsertTemplate("statements.do-while")' - exe "vmenu ".s:Statements.'.&do\ \{\ \}\ while\\sd :call C_InsertTemplate("statements.do-while", "v")' - exe "imenu ".s:Statements.'.&do\ \{\ \}\ while\\sd :call C_InsertTemplate("statements.do-while")' - " - exe "amenu ".s:Statements.'.f&or\\sf :call C_InsertTemplate("statements.for")' - exe "imenu ".s:Statements.'.f&or\\sf :call C_InsertTemplate("statements.for")' - " - exe "amenu ".s:Statements.'.fo&r\ \{\ \}\\sfo :call C_InsertTemplate("statements.for-block")' - exe "vmenu ".s:Statements.'.fo&r\ \{\ \}\\sfo :call C_InsertTemplate("statements.for-block", "v")' - exe "imenu ".s:Statements.'.fo&r\ \{\ \}\\sfo :call C_InsertTemplate("statements.for-block")' - " - exe "amenu ".s:Statements.'.&if\\si :call C_InsertTemplate("statements.if")' - exe "imenu ".s:Statements.'.&if\\si :call C_InsertTemplate("statements.if")' - " - exe "amenu ".s:Statements.'.i&f\ \{\ \}\\sif :call C_InsertTemplate("statements.if-block")' - exe "vmenu ".s:Statements.'.i&f\ \{\ \}\\sif :call C_InsertTemplate("statements.if-block", "v")' - exe "imenu ".s:Statements.'.i&f\ \{\ \}\\sif :call C_InsertTemplate("statements.if-block")' - - exe "amenu ".s:Statements.'.if\ &else\\sie :call C_InsertTemplate("statements.if-else")' - exe "vmenu ".s:Statements.'.if\ &else\\sie :call C_InsertTemplate("statements.if-else", "v")' - exe "imenu ".s:Statements.'.if\ &else\\sie :call C_InsertTemplate("statements.if-else")' - " - exe "amenu ".s:Statements.'.if\ \{\ \}\ e&lse\ \{\ \}\\sife :call C_InsertTemplate("statements.if-block-else")' - exe "vmenu ".s:Statements.'.if\ \{\ \}\ e&lse\ \{\ \}\\sife :call C_InsertTemplate("statements.if-block-else", "v")' - exe "imenu ".s:Statements.'.if\ \{\ \}\ e&lse\ \{\ \}\\sife :call C_InsertTemplate("statements.if-block-else")' - " - exe "amenu ".s:Statements.'.&else\ \{\ \}\\se :call C_InsertTemplate("statements.else-block")' - exe "vmenu ".s:Statements.'.&else\ \{\ \}\\se :call C_InsertTemplate("statements.else-block", "v")' - exe "imenu ".s:Statements.'.&else\ \{\ \}\\se :call C_InsertTemplate("statements.else-block")' - " - exe "amenu ".s:Statements.'.&while\\sw :call C_InsertTemplate("statements.while")' - exe "imenu ".s:Statements.'.&while\\sw :call C_InsertTemplate("statements.while")' - " - exe "amenu ".s:Statements.'.w&hile\ \{\ \}\\swh :call C_InsertTemplate("statements.while-block")' - exe "vmenu ".s:Statements.'.w&hile\ \{\ \}\\swh :call C_InsertTemplate("statements.while-block", "v")' - exe "imenu ".s:Statements.'.w&hile\ \{\ \}\\swh :call C_InsertTemplate("statements.while-block")' - " - exe "amenu ".s:Statements.'.&switch\ \{\ \}\\ss :call C_InsertTemplate("statements.switch")' - exe "vmenu ".s:Statements.'.&switch\ \{\ \}\\ss :call C_InsertTemplate("statements.switch", "v")' - exe "imenu ".s:Statements.'.&switch\ \{\ \}\\ss :call C_InsertTemplate("statements.switch")' - " - exe "amenu ".s:Statements.'.&case\ \.\.\.\ break\\sc :call C_InsertTemplate("statements.case")' - exe "imenu ".s:Statements.'.&case\ \.\.\.\ break\\sc :call C_InsertTemplate("statements.case")' - " - " - exe "amenu ".s:Statements.'.&\{\ \}\\sb :call C_InsertTemplate("statements.block")' - exe "vmenu ".s:Statements.'.&\{\ \}\\sb :call C_InsertTemplate("statements.block", "v")' - exe "imenu ".s:Statements.'.&\{\ \}\\sb :call C_InsertTemplate("statements.block")' - " - " - "=============================================================================================== - "----- Menu : C-Idioms ---------------------------------------------------- {{{2 - "=============================================================================================== - " - if s:C_MenuHeader == 'yes' - exe "amenu ".s:Idioms.'.&IdiomsC\/C\+\+ ' - exe "amenu ".s:Idioms.'.-Sep00- ' - endif - exe "amenu ".s:Idioms.'.&function\\if :call C_InsertTemplate("idioms.function")' - exe "vmenu ".s:Idioms.'.&function\\if :call C_InsertTemplate("idioms.function", "v")' - exe "imenu ".s:Idioms.'.&function\\if :call C_InsertTemplate("idioms.function")' - exe "amenu ".s:Idioms.'.s&tatic\ function\\isf :call C_InsertTemplate("idioms.function-static")' - exe "vmenu ".s:Idioms.'.s&tatic\ function\\isf :call C_InsertTemplate("idioms.function-static", "v")' - exe "imenu ".s:Idioms.'.s&tatic\ function\\isf :call C_InsertTemplate("idioms.function-static")' - exe "amenu ".s:Idioms.'.&main\\im :call C_InsertTemplate("idioms.main")' - exe "vmenu ".s:Idioms.'.&main\\im :call C_InsertTemplate("idioms.main", "v")' - exe "imenu ".s:Idioms.'.&main\\im :call C_InsertTemplate("idioms.main")' - - exe "amenu ".s:Idioms.'.-SEP1- :' - exe "amenu ".s:Idioms.'.for(x=&0;\ x\\i0 :call C_CodeFor("up" , "a")' - exe "vmenu ".s:Idioms.'.for(x=&0;\ x\\i0 :call C_CodeFor("up" , "v")' - exe "imenu ".s:Idioms.'.for(x=&0;\ x\\i0 :call C_CodeFor("up" , "a")i' - exe "amenu ".s:Idioms.'.for(x=&n-1;\ x>=0;\ x\-=1)\\in :call C_CodeFor("down", "a")' - exe "vmenu ".s:Idioms.'.for(x=&n-1;\ x>=0;\ x\-=1)\\in :call C_CodeFor("down", "v")' - exe "imenu ".s:Idioms.'.for(x=&n-1;\ x>=0;\ x\-=1)\\in :call C_CodeFor("down", "a")i' - - exe "amenu ".s:Idioms.'.-SEP2- :' - exe "amenu ".s:Idioms.'.&enum\\ie :call C_InsertTemplate("idioms.enum")' - exe "vmenu ".s:Idioms.'.&enum\\ie :call C_InsertTemplate("idioms.enum" , "v")' - exe "imenu ".s:Idioms.'.&enum\\ie :call C_InsertTemplate("idioms.enum" )' - exe "amenu ".s:Idioms.'.&struct\\is :call C_InsertTemplate("idioms.struct")' - exe "vmenu ".s:Idioms.'.&struct\\is :call C_InsertTemplate("idioms.struct", "v")' - exe "imenu ".s:Idioms.'.&struct\\is :call C_InsertTemplate("idioms.struct")' - exe "amenu ".s:Idioms.'.&union\\iu :call C_InsertTemplate("idioms.union")' - exe "vmenu ".s:Idioms.'.&union\\iu :call C_InsertTemplate("idioms.union" , "v")' - exe "imenu ".s:Idioms.'.&union\\iu :call C_InsertTemplate("idioms.union" )' - exe "amenu ".s:Idioms.'.-SEP3- :' - " - exe "amenu ".s:Idioms.'.scanf\\isc :call C_InsertTemplate("idioms.scanf")' - exe "imenu ".s:Idioms.'.scanf\\isc :call C_InsertTemplate("idioms.scanf")' - exe "amenu ".s:Idioms.'.printf\\ip :call C_InsertTemplate("idioms.printf")' - exe "imenu ".s:Idioms.'.printf\\ip :call C_InsertTemplate("idioms.printf")' - " - exe "amenu ".s:Idioms.'.-SEP4- :' - exe "amenu ".s:Idioms.'.p=ca&lloc\(n,sizeof(type)\)\\ica :call C_InsertTemplate("idioms.calloc")' - exe "imenu ".s:Idioms.'.p=ca&lloc\(n,sizeof(type)\)\\ica :call C_InsertTemplate("idioms.calloc")' - exe "amenu ".s:Idioms.'.p=m&alloc\(sizeof(type)\)\\ima :call C_InsertTemplate("idioms.malloc")' - exe "imenu ".s:Idioms.'.p=m&alloc\(sizeof(type)\)\\ima :call C_InsertTemplate("idioms.malloc")' - " - exe "anoremenu ".s:Idioms.'.si&zeof(\ \)\\isi :call C_InsertTemplate("idioms.sizeof")' - exe "inoremenu ".s:Idioms.'.si&zeof(\ \)\\isi :call C_InsertTemplate("idioms.sizeof")' - exe "vnoremenu ".s:Idioms.'.si&zeof(\ \)\\isi :call C_InsertTemplate("idioms.sizeof", "v")' - " - exe "anoremenu ".s:Idioms.'.asse&rt(\ \)\\ias :call C_InsertTemplate("idioms.assert")' - exe "inoremenu ".s:Idioms.'.asse&rt(\ \)\\ias :call C_InsertTemplate("idioms.assert")' - exe "vnoremenu ".s:Idioms.'.asse&rt(\ \)\\ias :call C_InsertTemplate("idioms.assert", "v")' - - exe "amenu ".s:Idioms.'.-SEP5- :' - exe "amenu ".s:Idioms.'.open\ &input\ file\\ii :call C_InsertTemplate("idioms.open-input-file")' - exe "imenu ".s:Idioms.'.open\ &input\ file\\ii :call C_InsertTemplate("idioms.open-input-file")' - exe "vmenu ".s:Idioms.'.open\ &input\ file\\ii :call C_InsertTemplate("idioms.open-input-file", "v")' - exe "amenu ".s:Idioms.'.open\ &output\ file\\io :call C_InsertTemplate("idioms.open-output-file")' - exe "imenu ".s:Idioms.'.open\ &output\ file\\io :call C_InsertTemplate("idioms.open-output-file")' - exe "vmenu ".s:Idioms.'.open\ &output\ file\\io :call C_InsertTemplate("idioms.open-output-file", "v")' - " - exe "amenu ".s:Idioms.'.fscanf :call C_InsertTemplate("idioms.fscanf")' - exe "imenu ".s:Idioms.'.fscanf :call C_InsertTemplate("idioms.fscanf")' - exe "amenu ".s:Idioms.'.fprintf :call C_InsertTemplate("idioms.fprintf")' - exe "imenu ".s:Idioms.'.fprintf :call C_InsertTemplate("idioms.fprintf")' - " - "=============================================================================================== - "----- Menu : C-Preprocessor ---------------------------------------------- {{{2 - "=============================================================================================== - " - if s:C_MenuHeader == 'yes' - exe "amenu ".s:Preprocessor.'.&PreprocessorC\/C\+\+ ' - exe "amenu ".s:Preprocessor.'.-Sep00- ' - endif - " - "----- Submenu : C-Idioms: standard library ------------------------------------------------------- - "' - exe "amenu ".s:Preprocessor.'.#include\ &Std\.Lib\.\\ps.Std\.Lib\.C\/C\+\+ ' - exe "amenu ".s:Preprocessor.'.#include\ &Std\.Lib\.\\ps.-Sep0- ' - call C_CIncludeMenus ( s:Preprocessor.'.#include\ &Std\.Lib\.\\ps', s:C_StandardLibs ) - " - exe "anoremenu ".s:Preprocessor.'.#include\ C&99\\pc.C99C\/C\+\+ ' - exe "anoremenu ".s:Preprocessor.'.#include\ C&99\\pc.-Sep0- ' - call C_CIncludeMenus ( s:Preprocessor.'.#include\ C&99\\pc', s:C_C99Libs ) - " - exe "amenu ".s:Preprocessor.'.-SEP2- :' - exe "anoremenu ".s:Preprocessor.'.#include\ &\<\.\.\.\>\\p< :call C_InsertTemplate("preprocessor.include-global")' - exe "inoremenu ".s:Preprocessor.'.#include\ &\<\.\.\.\>\\p< :call C_InsertTemplate("preprocessor.include-global")' - exe "anoremenu ".s:Preprocessor.'.#include\ &\"\.\.\.\"\\p" :call C_InsertTemplate("preprocessor.include-local")' - exe "inoremenu ".s:Preprocessor.'.#include\ &\"\.\.\.\"\\p" :call C_InsertTemplate("preprocessor.include-local")' - exe "amenu ".s:Preprocessor.'.#&define\\pd :call C_InsertTemplate("preprocessor.define")' - exe "imenu ".s:Preprocessor.'.#&define\\pd :call C_InsertTemplate("preprocessor.define")' - exe "amenu ".s:Preprocessor.'.&#undef\\pu :call C_InsertTemplate("preprocessor.undefine")' - exe "imenu ".s:Preprocessor.'.&#undef\\pu :call C_InsertTemplate("preprocessor.undefine")' - " - exe "amenu ".s:Preprocessor.'.#&if\ #else\ #endif\\pie :call C_InsertTemplate("preprocessor.if-else-endif")' - exe "imenu ".s:Preprocessor.'.#&if\ #else\ #endif\\pie :call C_InsertTemplate("preprocessor.if-else-endif")' - exe "vmenu ".s:Preprocessor.'.#&if\ #else\ #endif\\pie :call C_InsertTemplate("preprocessor.if-else-endif", "v")' - exe "amenu ".s:Preprocessor.'.#i&fdef\ #else\ #endif\\pid :call C_InsertTemplate("preprocessor.ifdef-else-endif")' - exe "imenu ".s:Preprocessor.'.#i&fdef\ #else\ #endif\\pid :call C_InsertTemplate("preprocessor.ifdef-else-endif")' - exe "vmenu ".s:Preprocessor.'.#i&fdef\ #else\ #endif\\pid :call C_InsertTemplate("preprocessor.ifdef-else-endif", "v")' - exe "amenu ".s:Preprocessor.'.#if&ndef\ #else\ #endif\\pin :call C_InsertTemplate("preprocessor.ifndef-else-endif")' - exe "imenu ".s:Preprocessor.'.#if&ndef\ #else\ #endif\\pin :call C_InsertTemplate("preprocessor.ifndef-else-endif")' - exe "vmenu ".s:Preprocessor.'.#if&ndef\ #else\ #endif\\pin :call C_InsertTemplate("preprocessor.ifndef-else-endif", "v")' - exe "amenu ".s:Preprocessor.'.#ifnd&ef\ #def\ #endif\\pind :call C_InsertTemplate("preprocessor.ifndef-def-endif")' - exe "imenu ".s:Preprocessor.'.#ifnd&ef\ #def\ #endif\\pind :call C_InsertTemplate("preprocessor.ifndef-def-endif")' - exe "vmenu ".s:Preprocessor.'.#ifnd&ef\ #def\ #endif\\pind :call C_InsertTemplate("preprocessor.ifndef-def-endif", "v")' - - exe "amenu ".s:Preprocessor.'.#if\ &0\ #endif\\pi0 :call C_PPIf0("a")2ji' - exe "imenu ".s:Preprocessor.'.#if\ &0\ #endif\\pi0 :call C_PPIf0("a")2ji' - exe "vmenu ".s:Preprocessor.'.#if\ &0\ #endif\\pi0 :call C_PPIf0("v")' - " - exe "amenu ".s:Preprocessor.'.&remove\ #if\ 0\ #endif\\pr0 :call C_PPIf0Remove()' - exe "imenu ".s:Preprocessor.'.&remove\ #if\ 0\ #endif\\pr0 :call C_PPIf0Remove()' - " - exe "amenu ".s:Preprocessor.'.#err&or\\pe :call C_InsertTemplate("preprocessor.error")' - exe "imenu ".s:Preprocessor.'.#err&or\\pe :call C_InsertTemplate("preprocessor.error")' - exe "amenu ".s:Preprocessor.'.#&line\\pl :call C_InsertTemplate("preprocessor.line")' - exe "imenu ".s:Preprocessor.'.#&line\\pl :call C_InsertTemplate("preprocessor.line")' - exe "amenu ".s:Preprocessor.'.#&pragma\\pp :call C_InsertTemplate("preprocessor.pragma")' - exe "imenu ".s:Preprocessor.'.#&pragma\\pp :call C_InsertTemplate("preprocessor.pragma")' - " - "=============================================================================================== - "----- Menu : Snippets ---------------------------------------------------- {{{2 - "=============================================================================================== - " - if s:C_MenuHeader == 'yes' - exe "amenu ".s:Snippets.'.S&nippetsC\/C\+\+ ' - exe "amenu ".s:Snippets.'.-Sep00- ' - endif - if s:C_CodeSnippets != "" - exe "amenu ".s:Snippets.'.&read\ code\ snippet\\nr :call C_CodeSnippet("r")' - exe "imenu ".s:Snippets.'.&read\ code\ snippet\\nr :call C_CodeSnippet("r")' - exe "amenu ".s:Snippets.'.&write\ code\ snippet\\nw :call C_CodeSnippet("w")' - exe "imenu ".s:Snippets.'.&write\ code\ snippet\\nw :call C_CodeSnippet("w")' - exe "vmenu ".s:Snippets.'.&write\ code\ snippet\\nw :call C_CodeSnippet("wv")' - exe "amenu ".s:Snippets.'.&edit\ code\ snippet\\ne :call C_CodeSnippet("e")' - exe "imenu ".s:Snippets.'.&edit\ code\ snippet\\ne :call C_CodeSnippet("e")' - exe " menu ".s:Snippets.'.-SEP1- :' - endif - exe " menu ".s:Snippets.'.&pick\ up\ prototype\\np :call C_ProtoPick("n")' - exe "imenu ".s:Snippets.'.&pick\ up\ prototype\\np :call C_ProtoPick("n")' - exe "vmenu ".s:Snippets.'.&pick\ up\ prototype\\np :call C_ProtoPick("v")' - exe " menu ".s:Snippets.'.&insert\ prototype(s)\\ni :call C_ProtoInsert()' - exe "imenu ".s:Snippets.'.&insert\ prototype(s)\\ni :call C_ProtoInsert()' - exe " menu ".s:Snippets.'.&clear\ prototype(s)\\nc :call C_ProtoClear()' - exe "imenu ".s:Snippets.'.&clear\ prototype(s)\\nc :call C_ProtoClear()' - exe " menu ".s:Snippets.'.&show\ prototype(s)\\ns :call C_ProtoShow()' - exe "imenu ".s:Snippets.'.&show\ prototype(s)\\ns :call C_ProtoShow()' - - exe " menu ".s:Snippets.'.-SEP2- :' - exe "amenu ".s:Snippets.'.edit\ &local\ templates\\ntl :call C_EditTemplates("local")' - exe "imenu ".s:Snippets.'.edit\ &local\ templates\\ntl :call C_EditTemplates("local")' - exe "amenu ".s:Snippets.'.edit\ &global\ templates\\ntg :call C_EditTemplates("global")' - exe "imenu ".s:Snippets.'.edit\ &global\ templates\\ntg :call C_EditTemplates("global")' - exe "amenu ".s:Snippets.'.reread\ &templates\\ntr :call C_RereadTemplates()' - exe "imenu ".s:Snippets.'.reread\ &templates\\ntr :call C_RereadTemplates()' - exe "amenu ".s:Snippets.'.switch\ template\ st&yle\\nts :CStyle' - exe "imenu ".s:Snippets.'.switch\ template\ st&yle\\nts :CStyle' - " - "=============================================================================================== - "----- Menu : C++ --------------------------------------------------------- {{{2 - "=============================================================================================== - " - if s:C_MenuHeader == 'yes' - exe "amenu ".s:Cpp.'.C&\+\+C\/C\+\+ ' - exe "amenu ".s:Cpp.'.-Sep00- ' - endif - exe "anoremenu ".s:Cpp.'.c&in :call C_InsertTemplate("cpp.cin")' - exe "inoremenu ".s:Cpp.'.c&in :call C_InsertTemplate("cpp.cin")' - exe "anoremenu ".s:Cpp.'.c&out\\+co :call C_InsertTemplate("cpp.cout")' - exe "inoremenu ".s:Cpp.'.c&out\\+co :call C_InsertTemplate("cpp.cout")' - exe "anoremenu ".s:Cpp.'.<<\ &\"\" :call C_InsertTemplate("cpp.cout-operator")' - exe "inoremenu ".s:Cpp.'.<<\ &\"\" :call C_InsertTemplate("cpp.cout-operator")' - " - "----- Submenu : C++ : output manipulators ------------------------------------------------------- - " - exe "amenu ".s:Cpp.'.&output\ manipulators.output\ manip\.C\/C\+\+ ' - exe "amenu ".s:Cpp.'.&output\ manipulators.-Sep0- ' - " - exe "anoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ &boolalpha :call C_InsertTemplate("cpp.output-manipulator-boolalpha")' - exe "anoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ &dec :call C_InsertTemplate("cpp.output-manipulator-dec")' - exe "anoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ &endl :call C_InsertTemplate("cpp.output-manipulator-endl")' - exe "anoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ &fixed :call C_InsertTemplate("cpp.output-manipulator-fixed")' - exe "anoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ fl&ush :call C_InsertTemplate("cpp.output-manipulator-flush")' - exe "anoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ &hex :call C_InsertTemplate("cpp.output-manipulator-hex")' - exe "anoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ &internal :call C_InsertTemplate("cpp.output-manipulator-internal")' - exe "anoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ &left :call C_InsertTemplate("cpp.output-manipulator-left")' - exe "anoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ &oct :call C_InsertTemplate("cpp.output-manipulator-oct")' - exe "anoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ &right :call C_InsertTemplate("cpp.output-manipulator-right")' - exe "anoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ s&cientific :call C_InsertTemplate("cpp.output-manipulator-scientific")' - exe "anoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ &setbase\(\ \) :call C_InsertTemplate("cpp.output-manipulator-setbase")' - exe "anoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ se&tfill\(\ \) :call C_InsertTemplate("cpp.output-manipulator-setfill")' - exe "anoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ setiosfla&g\(\ \) :call C_InsertTemplate("cpp.output-manipulator-setiosflags")' - exe "anoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ set&precision\(\ \) :call C_InsertTemplate("cpp.output-manipulator-setprecision")' - exe "anoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ set&w\(\ \) :call C_InsertTemplate("cpp.output-manipulator-setw")' - exe "anoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ showb&ase :call C_InsertTemplate("cpp.output-manipulator-showbase")' - exe "anoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ showpoi&nt :call C_InsertTemplate("cpp.output-manipulator-showpoint")' - exe "anoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ showpos\ \(&1\) :call C_InsertTemplate("cpp.output-manipulator-showpos")' - exe "anoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ uppercase\ \(&2\) :call C_InsertTemplate("cpp.output-manipulator-uppercase")' - " - exe "inoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ &boolalpha :call C_InsertTemplate("cpp.output-manipulator-boolalpha")' - exe "inoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ &dec :call C_InsertTemplate("cpp.output-manipulator-dec")' - exe "inoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ &endl :call C_InsertTemplate("cpp.output-manipulator-endl")' - exe "inoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ &fixed :call C_InsertTemplate("cpp.output-manipulator-fixed")' - exe "inoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ fl&ush :call C_InsertTemplate("cpp.output-manipulator-flush")' - exe "inoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ &hex :call C_InsertTemplate("cpp.output-manipulator-hex")' - exe "inoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ &internal :call C_InsertTemplate("cpp.output-manipulator-internal")' - exe "inoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ &left :call C_InsertTemplate("cpp.output-manipulator-left")' - exe "inoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ &oct :call C_InsertTemplate("cpp.output-manipulator-oct")' - exe "inoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ &right :call C_InsertTemplate("cpp.output-manipulator-right")' - exe "inoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ s&cientific :call C_InsertTemplate("cpp.output-manipulator-scientific")' - exe "inoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ &setbase\(\ \) :call C_InsertTemplate("cpp.output-manipulator-setbase")' - exe "inoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ se&tfill\(\ \) :call C_InsertTemplate("cpp.output-manipulator-setfill")' - exe "inoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ setiosfla&g\(\ \) :call C_InsertTemplate("cpp.output-manipulator-setiosflags")' - exe "inoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ set&precision\(\ \) :call C_InsertTemplate("cpp.output-manipulator-setprecision")' - exe "inoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ set&w\(\ \) :call C_InsertTemplate("cpp.output-manipulator-setw")' - exe "inoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ showb&ase :call C_InsertTemplate("cpp.output-manipulator-showbase")' - exe "inoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ showpoi&nt :call C_InsertTemplate("cpp.output-manipulator-showpoint")' - exe "inoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ showpos\ \(&1\) :call C_InsertTemplate("cpp.output-manipulator-showpos")' - exe "inoremenu ".s:Cpp.'.&output\ manipulators.\<\<\ uppercase\ \(&2\) :call C_InsertTemplate("cpp.output-manipulator-uppercase")' - " - "----- Submenu : C++ : ios flag bits ------------------------------------------------------------- - " - exe "amenu ".s:Cpp.'.ios\ flag&bits.ios\ flagsC\/C\+\+ ' - exe "amenu ".s:Cpp.'.ios\ flag&bits.-Sep0- ' - " - call C_CIosFlagMenus ( s:Cpp.'.ios\ flag&bits', s:Cpp_IosFlagBits ) - " - "----- Submenu : C++ library (algorithm - locale) ---------------------------------------------- - " - exe "amenu ".s:Cpp.'.&#include\ \\+ps.alg\.\.vecC\/C\+\+ ' - exe "amenu ".s:Cpp.'.&#include\ \\+ps.-Sep0- ' - call C_CIncludeMenus ( s:Cpp.'.&#include\ \\+ps', s:Cpp_StandardLibs ) - " - "----- Submenu : C library (cassert - ctime) ------------------------------------------------- - " - exe "amenu ".s:Cpp.'.&#include\ \\+pc.cXC\/C\+\+ ' - exe "amenu ".s:Cpp.'.&#include\ \\+pc.-Sep0- ' - call C_CIncludeMenus ( s:Cpp.'.&#include\ \\+pc', s:Cpp_CStandardLibs ) - " - "----- End Submenu : C library (cassert - ctime) --------------------------------------------- - " - exe "amenu ".s:Cpp.'.-SEP2- :' - - exe "amenu ".s:Cpp.'.&class\\+c :call C_InsertTemplate("cpp.class-definition")' - exe "imenu ".s:Cpp.'.&class\\+c :call C_InsertTemplate("cpp.class-definition")' - exe "amenu ".s:Cpp.'.class\ (w\.\ &new)\\+cn :call C_InsertTemplate("cpp.class-using-new-definition")' - exe "imenu ".s:Cpp.'.class\ (w\.\ &new)\\+cn :call C_InsertTemplate("cpp.class-using-new-definition")' - exe "amenu ".s:Cpp.'.&templ\.\ class\\+tc :call C_InsertTemplate("cpp.template-class-definition")' - exe "imenu ".s:Cpp.'.&templ\.\ class\\+tc :call C_InsertTemplate("cpp.template-class-definition")' - exe "amenu ".s:Cpp.'.templ\.\ class\ (w\.\ ne&w)\\+tcn :call C_InsertTemplate("cpp.template-class-using-new-definition")' - exe "imenu ".s:Cpp.'.templ\.\ class\ (w\.\ ne&w)\\+tcn :call C_InsertTemplate("cpp.template-class-using-new-definition")' - - " - "----- Submenu : C++ : IMPLEMENTATION ------------------------------------------------------- - " - exe "amenu ".s:Cpp.'.IM&PLEMENTATION.IMPLEMENT\.C\/C\+\+ ' - exe "amenu ".s:Cpp.'.IM&PLEMENTATION.-Sep0- ' - " - exe "amenu ".s:Cpp.'.IM&PLEMENTATION.&class\\+ci :call C_InsertTemplate("cpp.class-implementation")' - exe "imenu ".s:Cpp.'.IM&PLEMENTATION.&class\\+ci :call C_InsertTemplate("cpp.class-implementation")' - exe "amenu ".s:Cpp.'.IM&PLEMENTATION.class\ (w\.\ &new)\\+cni :call C_InsertTemplate("cpp.class-using-new-implementation")' - exe "imenu ".s:Cpp.'.IM&PLEMENTATION.class\ (w\.\ &new)\\+cni :call C_InsertTemplate("cpp.class-using-new-implementation")' - exe "amenu ".s:Cpp.'.IM&PLEMENTATION.&method\\+mi :call C_InsertTemplate("cpp.method-implementation")' - exe "imenu ".s:Cpp.'.IM&PLEMENTATION.&method\\+mi :call C_InsertTemplate("cpp.method-implementation")' - exe "amenu ".s:Cpp.'.IM&PLEMENTATION.&accessor\\+ai :call C_InsertTemplate("cpp.accessor-implementation")' - exe "imenu ".s:Cpp.'.IM&PLEMENTATION.&accessor\\+ai :call C_InsertTemplate("cpp.accessor-implementation")' - " - exe "amenu ".s:Cpp.'.IM&PLEMENTATION.-SEP21- :' - exe "imenu ".s:Cpp.'.IM&PLEMENTATION.&templ\.\ class\\+tci :call C_InsertTemplate("cpp.template-class-implementation")' - exe "amenu ".s:Cpp.'.IM&PLEMENTATION.&templ\.\ class\\+tci :call C_InsertTemplate("cpp.template-class-implementation")' - exe "imenu ".s:Cpp.'.IM&PLEMENTATION.templ\.\ class\ (w\.\ ne&w)\\+tcni :call C_InsertTemplate("cpp.template-class-using-new-implementation")' - exe "amenu ".s:Cpp.'.IM&PLEMENTATION.templ\.\ class\ (w\.\ ne&w)\\+tcni :call C_InsertTemplate("cpp.template-class-using-new-implementation")' - exe "amenu ".s:Cpp.'.IM&PLEMENTATION.templ\.\ mðod\\+tmi :call C_InsertTemplate("cpp.template-method-implementation")' - exe "imenu ".s:Cpp.'.IM&PLEMENTATION.templ\.\ mðod\\+tmi :call C_InsertTemplate("cpp.template-method-implementation")' - exe "amenu ".s:Cpp.'.IM&PLEMENTATION.templ\.\ a&ccessor\\+tai :call C_InsertTemplate("cpp.template-accessor-implementation")' - exe "imenu ".s:Cpp.'.IM&PLEMENTATION.templ\.\ a&ccessor\\+tai :call C_InsertTemplate("cpp.template-accessor-implementation")' - " - exe "amenu ".s:Cpp.'.IM&PLEMENTATION.-SEP22- :' - exe "amenu ".s:Cpp.'.IM&PLEMENTATION.operator\ &<< :call C_InsertTemplate("cpp.operator-in")' - exe "imenu ".s:Cpp.'.IM&PLEMENTATION.operator\ &<< :call C_InsertTemplate("cpp.operator-in")' - exe "amenu ".s:Cpp.'.IM&PLEMENTATION.operator\ &>> :call C_InsertTemplate("cpp.operator-out")' - exe "imenu ".s:Cpp.'.IM&PLEMENTATION.operator\ &>> :call C_InsertTemplate("cpp.operator-out")' - " - "----- End Submenu : C++ : IMPLEMENTATION ------------------------------------------------------- - " - exe "amenu ".s:Cpp.'.-SEP31- :' - exe "amenu ".s:Cpp.'.templ\.\ &function\\+tf :call C_InsertTemplate("cpp.template-function")' - exe "imenu ".s:Cpp.'.templ\.\ &function\\+tf :call C_InsertTemplate("cpp.template-function")' - exe "amenu ".s:Cpp.'.&error\ class\\+ec :call C_InsertTemplate("cpp.error-class")' - exe "imenu ".s:Cpp.'.&error\ class\\+ec :call C_InsertTemplate("cpp.error-class")' - - exe "amenu ".s:Cpp.'.-SEP5- :' - exe "amenu ".s:Cpp.'.tr&y\ \.\.\ catch\\+tr :call C_InsertTemplate("cpp.try-catch")' - exe "imenu ".s:Cpp.'.tr&y\ \.\.\ catch\\+tr :call C_InsertTemplate("cpp.try-catch")' - exe "vmenu ".s:Cpp.'.tr&y\ \.\.\ catch\\+tr :call C_InsertTemplate("cpp.try-catch", "v")' - exe "amenu ".s:Cpp.'.catc&h\\+ca :call C_InsertTemplate("cpp.catch")' - exe "imenu ".s:Cpp.'.catc&h\\+ca :call C_InsertTemplate("cpp.catch")' - exe "vmenu ".s:Cpp.'.catc&h\\+ca :call C_InsertTemplate("cpp.catch", "v")' - - exe "amenu ".s:Cpp.'.catch\(&\.\.\.\)\\+c\. :call C_InsertTemplate("cpp.catch-points")' - exe "imenu ".s:Cpp.'.catch\(&\.\.\.\)\\+c\. :call C_InsertTemplate("cpp.catch-points")' - exe "vmenu ".s:Cpp.'.catch\(&\.\.\.\)\\+c\. :call C_InsertTemplate("cpp.catch-points", "v")' - - exe "amenu ".s:Cpp.'.-SEP6- :' - exe "amenu ".s:Cpp.'.open\ input\ file\ \ \(&4\) :call C_InsertTemplate("cpp.open-input-file")' - exe "imenu ".s:Cpp.'.open\ input\ file\ \ \(&4\) :call C_InsertTemplate("cpp.open-input-file")' - exe "vmenu ".s:Cpp.'.open\ input\ file\ \ \(&4\) :call C_InsertTemplate("cpp.open-input-file", "v")' - exe "amenu ".s:Cpp.'.open\ output\ file\ \(&5\) :call C_InsertTemplate("cpp.open-output-file")' - exe "imenu ".s:Cpp.'.open\ output\ file\ \(&5\) :call C_InsertTemplate("cpp.open-output-file")' - exe "vmenu ".s:Cpp.'.open\ output\ file\ \(&5\) :call C_InsertTemplate("cpp.open-output-file", "v")' - exe "amenu ".s:Cpp.'.-SEP7- :' - - exe "amenu ".s:Cpp.'.&using\ namespace\ std; :call C_InsertTemplate("cpp.namespace-std")' - exe "imenu ".s:Cpp.'.&using\ namespace\ std; :call C_InsertTemplate("cpp.namespace-std")' - exe "amenu ".s:Cpp.'.u&sing\ namespace\ ???; :call C_InsertTemplate("cpp.namespace")' - exe "imenu ".s:Cpp.'.u&sing\ namespace\ ???; :call C_InsertTemplate("cpp.namespace")' - - exe "amenu ".s:Cpp.'.names&pace\ ???\ \{\ \} :call C_InsertTemplate("cpp.namespace-block")' - exe "imenu ".s:Cpp.'.names&pace\ ???\ \{\ \} :call C_InsertTemplate("cpp.namespace-block")' - exe "vmenu ".s:Cpp.'.names&pace\ ???\ \{\ \} :call C_InsertTemplate("cpp.namespace-block", "v")' - exe "amenu ".s:Cpp.'.namespace\ &alias\ =\ ??? :call C_InsertTemplate("cpp.namespace-alias")' - exe "imenu ".s:Cpp.'.namespace\ &alias\ =\ ??? :call C_InsertTemplate("cpp.namespace-alias")' - - exe "amenu ".s:Cpp.'.-SEP8- :' - " - "----- Submenu : RTTI ---------------------------------------------------------------------------- - " - exe "amenu ".s:Cpp.'.&RTTI.RTTIC\/C\+\+ ' - exe "amenu ".s:Cpp.'.&RTTI.-Sep0- ' - " - exe "anoremenu ".s:Cpp.'.&RTTI.&typeid :call C_InsertTemplate("cpp.rtti-typeid")' - exe "anoremenu ".s:Cpp.'.&RTTI.&static_cast :call C_InsertTemplate("cpp.rtti-static-cast")' - exe "anoremenu ".s:Cpp.'.&RTTI.&const_cast :call C_InsertTemplate("cpp.rtti-const-cast")' - exe "anoremenu ".s:Cpp.'.&RTTI.&reinterpret_cast :call C_InsertTemplate("cpp.rtti-reinterpret-cast")' - exe "anoremenu ".s:Cpp.'.&RTTI.&dynamic_cast :call C_InsertTemplate("cpp.rtti-dynamic-cast")' - " - exe "inoremenu ".s:Cpp.'.&RTTI.&typeid :call C_InsertTemplate("cpp.rtti-typeid")' - exe "inoremenu ".s:Cpp.'.&RTTI.&static_cast :call C_InsertTemplate("cpp.rtti-static-cast")' - exe "inoremenu ".s:Cpp.'.&RTTI.&const_cast :call C_InsertTemplate("cpp.rtti-const-cast")' - exe "inoremenu ".s:Cpp.'.&RTTI.&reinterpret_cast :call C_InsertTemplate("cpp.rtti-reinterpret-cast")' - exe "inoremenu ".s:Cpp.'.&RTTI.&dynamic_cast :call C_InsertTemplate("cpp.rtti-dynamic-cast")' - " - exe "vnoremenu ".s:Cpp.'.&RTTI.&typeid :call C_InsertTemplate("cpp.rtti-typeid", "v")' - exe "vnoremenu ".s:Cpp.'.&RTTI.&static_cast :call C_InsertTemplate("cpp.rtti-static-cast", "v")' - exe "vnoremenu ".s:Cpp.'.&RTTI.&const_cast :call C_InsertTemplate("cpp.rtti-const-cast", "v")' - exe "vnoremenu ".s:Cpp.'.&RTTI.&reinterpret_cast :call C_InsertTemplate("cpp.rtti-reinterpret-cast", "v")' - exe "vnoremenu ".s:Cpp.'.&RTTI.&dynamic_cast :call C_InsertTemplate("cpp.rtti-dynamic-cast", "v")' - " - "----- End Submenu : RTTI ------------------------------------------------------------------------ - " - exe "amenu ".s:Cpp.'.e&xtern\ \"C\"\ \{\ \} :call C_InsertTemplate("cpp.extern")' - exe "imenu ".s:Cpp.'.e&xtern\ \"C\"\ \{\ \} :call C_InsertTemplate("cpp.extern")' - exe "vmenu ".s:Cpp.'.e&xtern\ \"C\"\ \{\ \} :call C_InsertTemplate("cpp.extern", "v")' - " - "=============================================================================================== - "----- Menu : run ----- -------------------------------------------------- {{{2 - "=============================================================================================== - " - if s:C_MenuHeader == 'yes' - exe "amenu ".s:Run.'.&RunC\/C\+\+ ' - exe "amenu ".s:Run.'.-Sep00- ' - endif - " - exe "amenu ".s:Run.'.save\ and\ &compile\\rc\ \ \ :call C_Compile():call C_HlMessage()' - exe "imenu ".s:Run.'.save\ and\ &compile\\rc\ \ \ :call C_Compile():call C_HlMessage()' - exe "amenu ".s:Run.'.&link\\rl\ \ \ \ \ :call C_Link():call C_HlMessage()' - exe "imenu ".s:Run.'.&link\\rl\ \ \ \ \ :call C_Link():call C_HlMessage()' - exe "amenu ".s:Run.'.&run\\rr\ \ \ :call C_Run()' - exe "imenu ".s:Run.'.&run\\rr\ \ \ :call C_Run()' - exe "amenu ".s:Run.'.cmd\.\ line\ &arg\.\\ra\ \ \ :call C_Arguments()' - exe "imenu ".s:Run.'.cmd\.\ line\ &arg\.\\ra\ \ \ :call C_Arguments()' - " - exe "amenu ".s:Run.'.-SEP0- :' - exe "amenu ".s:Run.'.&make\\rm :call C_Make()' - exe "imenu ".s:Run.'.&make\\rm :call C_Make()' - exe "amenu ".s:Run.'.cmd\.\ line\ ar&g\.\ for\ make\\rma :call C_MakeArguments()' - exe "imenu ".s:Run.'.cmd\.\ line\ ar&g\.\ for\ make\\rma :call C_MakeArguments()' - " - exe "amenu ".s:Run.'.-SEP1- :' - " - if s:C_SplintIsExecutable==1 - exe "amenu ".s:Run.'.s&plint\\rp :call C_SplintCheck():call C_HlMessage()' - exe "imenu ".s:Run.'.s&plint\\rp :call C_SplintCheck():call C_HlMessage()' - exe "amenu ".s:Run.'.cmd\.\ line\ arg\.\ for\ spl&int\\rpa :call C_SplintArguments()' - exe "imenu ".s:Run.'.cmd\.\ line\ arg\.\ for\ spl&int\\rpa :call C_SplintArguments()' - exe "amenu ".s:Run.'.-SEP2- :' - endif - " - if s:C_CodeCheckIsExecutable==1 - exe "amenu ".s:Run.'.CodeChec&k\\rk :call C_CodeCheck():call C_HlMessage()' - exe "imenu ".s:Run.'.CodeChec&k\\rk :call C_CodeCheck():call C_HlMessage()' - exe "amenu ".s:Run.'.cmd\.\ line\ arg\.\ for\ Cod&eCheck\\rka :call C_CodeCheckArguments()' - exe "imenu ".s:Run.'.cmd\.\ line\ arg\.\ for\ Cod&eCheck\\rka :call C_CodeCheckArguments()' - exe "amenu ".s:Run.'.-SEP3- :' - endif - " - exe "amenu ".s:Run.'.in&dent\\rd :call C_Indent()' - exe "imenu ".s:Run.'.in&dent\\rd :call C_Indent()' - if s:MSWIN - exe "amenu ".s:Run.'.&hardcopy\ to\ printer\\rh :call C_Hardcopy("n")' - exe "imenu ".s:Run.'.&hardcopy\ to\ printer\\rh :call C_Hardcopy("n")' - exe "vmenu ".s:Run.'.&hardcopy\ to\ printer\\rh :call C_Hardcopy("v")' - else - exe "amenu ".s:Run.'.&hardcopy\ to\ FILENAME\.ps\\rh :call C_Hardcopy("n")' - exe "imenu ".s:Run.'.&hardcopy\ to\ FILENAME\.ps\\rh :call C_Hardcopy("n")' - exe "vmenu ".s:Run.'.&hardcopy\ to\ FILENAME\.ps\\rh :call C_Hardcopy("v")' - endif - exe "imenu ".s:Run.'.-SEP4- :' - - exe "amenu ".s:Run.'.&settings\\rs :call C_Settings()' - exe "imenu ".s:Run.'.&settings\\rs :call C_Settings()' - exe "imenu ".s:Run.'.-SEP5- :' - - if !s:MSWIN - exe "amenu ".s:Run.'.&xterm\ size\\rx :call C_XtermSize()' - exe "imenu ".s:Run.'.&xterm\ size\\rx :call C_XtermSize()' - endif - if s:C_OutputGvim == "vim" - exe "amenu ".s:Run.'.&output:\ VIM->buffer->xterm\\ro :call C_Toggle_Gvim_Xterm()' - exe "imenu ".s:Run.'.&output:\ VIM->buffer->xterm\\ro :call C_Toggle_Gvim_Xterm()' - else - if s:C_OutputGvim == "buffer" - exe "amenu ".s:Run.'.&output:\ BUFFER->xterm->vim\\ro :call C_Toggle_Gvim_Xterm()' - exe "imenu ".s:Run.'.&output:\ BUFFER->xterm->vim\\ro :call C_Toggle_Gvim_Xterm()' - else - exe "amenu ".s:Run.'.&output:\ XTERM->vim->buffer\\ro :call C_Toggle_Gvim_Xterm()' - exe "imenu ".s:Run.'.&output:\ XTERM->vim->buffer\\ro :call C_Toggle_Gvim_Xterm()' - endif - endif - " - "=============================================================================================== - "----- Menu : help ------------------------------------------------------- {{{2 - "=============================================================================================== - " - if s:C_Root != "" - exe " menu ".s:C_Root.'&help\ (C-Support)\\hp :call C_HelpCsupport()' - exe "imenu ".s:C_Root.'&help\ (C-Support)\\hp :call C_HelpCsupport()' - exe " menu ".s:C_Root.'show\ &manual\\hm :call C_Help("m")' - exe "imenu ".s:C_Root.'show\ &manual\\hm :call C_Help("m")' - endif - -endfunction " ---------- end of function C_InitMenus ---------- -" -"=============================================================================================== -"----- Menu Functions -------------------------------------------------------------------------- -"=============================================================================================== -" -let s:C_StandardLibs = [ - \ '&assert\.h' , '&ctype\.h' , '&errno\.h' , - \ '&float\.h' , '&limits\.h' , 'l&ocale\.h' , - \ '&math\.h' , 'set&jmp\.h' , 's&ignal\.h' , - \ 'stdar&g\.h' , 'st&ddef\.h' , '&stdio\.h' , - \ 'stdli&b\.h' , 'st&ring\.h' , '&time\.h' , - \ ] -" -let s:C_C99Libs = [ - \ '&complex\.h', '&fenv\.h', '&inttypes\.h', - \ 'is&o646\.h', '&stdbool\.h', 's&tdint\.h', - \ 'tg&math\.h', '&wchar\.h', 'wct&ype\.h', - \ ] -" -let s:Cpp_StandardLibs = [ - \ '&algorithm', '&bitset', '&complex', '&deque', - \ '&exception', '&fstream', 'f&unctional', 'iomani&p', - \ '&ios', 'iosf&wd', 'io&stream', 'istrea&m', - \ 'iterato&r', '&limits', 'lis&t', 'l&ocale', - \ '&map', 'memor&y', '&new', 'numeri&c', - \ '&ostream', '&queue', '&set', 'sst&ream', - \ 'st&ack', 'stde&xcept', 'stream&buf', 'str&ing', - \ '&typeinfo', '&utility', '&valarray', 'v&ector', - \ ] -" -let s:Cpp_CStandardLibs = [ - \ 'c&assert', 'c&ctype', 'c&errno', 'c&float', - \ 'c&limits', 'cl&ocale', 'c&math', 'cset&jmp', - \ 'cs&ignal', 'cstdar&g', 'cst&ddef', 'c&stdio', - \ 'cstdli&b', 'cst&ring', 'c&time', - \ ] - -let s:Cpp_IosFlagBits = [ - \ 'ios::&adjustfield', 'ios::bas&efield', 'ios::&boolalpha', - \ 'ios::&dec', 'ios::&fixed', 'ios::floa&tfield', - \ 'ios::&hex', 'ios::&internal', 'ios::&left', - \ 'ios::&oct', 'ios::&right', 'ios::s&cientific', - \ 'ios::sho&wbase', 'ios::showpoint\ \(&1\)', 'ios::show&pos', - \ 'ios::&skipws', 'ios::u&nitbuf', 'ios::&uppercase', - \ ] - -"------------------------------------------------------------------------------ -" C_CIncludeMenus: generate the C/C++-standard library menu entries {{{1 -"------------------------------------------------------------------------------ -function! C_CIncludeMenus ( menupath, liblist ) - for item in a:liblist - let replacement = substitute( item, '[&\\]*', '','g' ) - exe "anoremenu ".a:menupath.'.'.item.' o#include<'.replacement.'>' - exe "inoremenu ".a:menupath.'.'.item.' o#include<'.replacement.'>' - endfor - return -endfunction " ---------- end of function C_CIncludeMenus ---------- - -"------------------------------------------------------------------------------ -" C_CIosFlagMenus: generate the C++ ios flags menu entries {{{1 -"------------------------------------------------------------------------------ -function! C_CIosFlagMenus ( menupath, flaglist ) - for item in a:flaglist - let replacement = substitute( item, '[^[:alpha:]:]', '','g' ) - exe " noremenu ".a:menupath.'.'.item.' i'.replacement - exe "inoremenu ".a:menupath.'.'.item.' '.replacement - endfor - return -endfunction " ---------- end of function C_CIosFlagMenus ---------- -" -"------------------------------------------------------------------------------ -" C_Input: Input after a highlighted prompt {{{1 -"------------------------------------------------------------------------------ -function! C_Input ( promp, text, ... ) - echohl Search " highlight prompt - call inputsave() " preserve typeahead - if a:0 == 0 || a:1 == '' - let retval =input( a:promp, a:text ) - else - let retval =input( a:promp, a:text, a:1 ) - endif - call inputrestore() " restore typeahead - echohl None " reset highlighting - let retval = substitute( retval, '^\s\+', "", "" ) " remove leading whitespaces - let retval = substitute( retval, '\s\+$', "", "" ) " remove trailing whitespaces - return retval -endfunction " ---------- end of function C_Input ---------- -" -"------------------------------------------------------------------------------ -" C_AdjustLineEndComm: adjust line-end comments {{{1 -"------------------------------------------------------------------------------ -" -" C comment or C++ comment: -let s:c_cppcomment= '\(\/\*.\{-}\*\/\|\/\/.*$\)' - -function! C_AdjustLineEndComm ( mode ) range - " - if !exists("b:C_LineEndCommentColumn") - let b:C_LineEndCommentColumn = s:C_LineEndCommColDefault - endif - - let save_cursor = getpos(".") - - let save_expandtab = &expandtab - exe ":set expandtab" - - if a:mode == 'v' - let pos0 = line("'<") - let pos1 = line("'>") - else - let pos0 = line(".") - let pos1 = pos0 - endif - - let linenumber = pos0 - exe ":".pos0 - - while linenumber <= pos1 - let line= getline(".") - - " line is not a pure comment but contains one - " - if match( line, '^\s*'.s:c_cppcomment ) < 0 && match( line, s:c_cppcomment ) > 0 - " - " disregard comments starting in a string - " - let idx1 = -1 - let idx2 = -1 - let commentstart= -2 - let commentend = 0 - while commentstart < idx2 && idx2 < commentend - let start = commentend - let idx2 = match( line, s:c_cppcomment, start ) - let commentstart= match ( line, '"[^"]\+"', start ) - let commentend = matchend( line, '"[^"]\+"', start ) - endwhile - " - " try to adjust the comment - " - let idx1 = 1 + match( line, '\s*'.s:c_cppcomment, start ) - let idx2 = 1 + idx2 - call setpos(".", [ 0, linenumber, idx1, 0 ] ) - let vpos1 = virtcol(".") - call setpos(".", [ 0, linenumber, idx2, 0 ] ) - let vpos2 = virtcol(".") - - if ! ( vpos2 == b:C_LineEndCommentColumn - \ || vpos1 > b:C_LineEndCommentColumn - \ || idx2 == 0 ) - - exe ":.,.retab" - " insert some spaces - if vpos2 < b:C_LineEndCommentColumn - let diff = b:C_LineEndCommentColumn-vpos2 - call setpos(".", [ 0, linenumber, vpos2, 0 ] ) - let @" = ' ' - exe "normal ".diff."P" - endif - - " remove some spaces - if vpos1 < b:C_LineEndCommentColumn && vpos2 > b:C_LineEndCommentColumn - let diff = vpos2 - b:C_LineEndCommentColumn - call setpos(".", [ 0, linenumber, b:C_LineEndCommentColumn, 0 ] ) - exe "normal ".diff."x" - endif - - endif - endif - let linenumber=linenumber+1 - normal j - endwhile - " - " restore tab expansion settings and cursor position - let &expandtab = save_expandtab - call setpos('.', save_cursor) - -endfunction " ---------- end of function C_AdjustLineEndComm ---------- -" -"------------------------------------------------------------------------------ -" C_GetLineEndCommCol: get line-end comment position {{{1 -"------------------------------------------------------------------------------ -function! C_GetLineEndCommCol () - let actcol = virtcol(".") - if actcol+1 == virtcol("$") - let b:C_LineEndCommentColumn = '' - while match( b:C_LineEndCommentColumn, '^\s*\d\+\s*$' ) < 0 - let b:C_LineEndCommentColumn = C_Input( 'start line-end comment at virtual column : ', actcol, '' ) - endwhile - else - let b:C_LineEndCommentColumn = virtcol(".") - endif - echomsg "line end comments will start at column ".b:C_LineEndCommentColumn -endfunction " ---------- end of function C_GetLineEndCommCol ---------- -" -"------------------------------------------------------------------------------ -" C_LineEndComment: single line-end comment {{{1 -"------------------------------------------------------------------------------ -function! C_LineEndComment ( ) - if !exists("b:C_LineEndCommentColumn") - let b:C_LineEndCommentColumn = s:C_LineEndCommColDefault - endif - " ----- trim whitespaces ----- - exe 's/\s*$//' - let linelength= virtcol("$") - 1 - let diff = 1 - if linelength < b:C_LineEndCommentColumn - let diff = b:C_LineEndCommentColumn -1 -linelength - endif - exe "normal ".diff."A " - call C_InsertTemplate('comment.end-of-line-comment') -endfunction " ---------- end of function C_LineEndComment ---------- -" -"------------------------------------------------------------------------------ -" C_MultiLineEndComments: multi line-end comments {{{1 -"------------------------------------------------------------------------------ -function! C_MultiLineEndComments ( ) - " - if !exists("b:C_LineEndCommentColumn") - let b:C_LineEndCommentColumn = s:C_LineEndCommColDefault - endif - " - let pos0 = line("'<") - let pos1 = line("'>") - " - " ----- trim whitespaces ----- - exe pos0.','.pos1.'s/\s*$//' - " - " ----- find the longest line ----- - let maxlength = max( map( range(pos0, pos1), "virtcol([v:val, '$'])" ) ) - let maxlength = max( [b:C_LineEndCommentColumn, maxlength+1] ) - " - " ----- fill lines with blanks ----- - for linenumber in range( pos0, pos1 ) - exe ":".linenumber - if getline(linenumber) !~ '^\s*$' - let diff = maxlength - virtcol("$") - exe "normal ".diff."A " - call C_InsertTemplate('comment.end-of-line-comment') - endif - endfor - " - " ----- back to the begin of the marked block ----- - stopinsert - normal '<$ - if match( getline("."), '\/\/\s*$' ) < 0 - if search( '\/\*', 'bcW', line(".") ) > 1 - normal l - endif - let save_cursor = getpos(".") - if getline(".")[save_cursor[2]+1] == ' ' - normal l - endif - else - normal $ - endif -endfunction " ---------- end of function C_MultiLineEndComments ---------- -" -"------------------------------------------------------------------------------ -" C_Comment_C_SectionAll: Section Comments {{{1 -"------------------------------------------------------------------------------ -" -function! C_Comment_C_SectionAll ( type ) - - call C_InsertTemplate("comment.file-section-cpp-header-includes") - call C_InsertTemplate("comment.file-section-cpp-macros") - call C_InsertTemplate("comment.file-section-cpp-typedefs") - call C_InsertTemplate("comment.file-section-cpp-data-types") - if a:type=="cpp" - call C_InsertTemplate("comment.file-section-cpp-class-defs") - endif - call C_InsertTemplate("comment.file-section-cpp-local-variables") - call C_InsertTemplate("comment.file-section-cpp-prototypes") - call C_InsertTemplate("comment.file-section-cpp-function-defs-exported") - call C_InsertTemplate("comment.file-section-cpp-function-defs-local") - if a:type=="cpp" - call C_InsertTemplate("comment.file-section-cpp-class-implementations-exported") - call C_InsertTemplate("comment.file-section-cpp-class-implementations-local") - endif - -endfunction " ---------- end of function C_Comment_C_SectionAll ---------- -" -function! C_Comment_H_SectionAll ( type ) - - call C_InsertTemplate("comment.file-section-hpp-header-includes") - call C_InsertTemplate("comment.file-section-hpp-macros") - call C_InsertTemplate("comment.file-section-hpp-exported-typedefs") - call C_InsertTemplate("comment.file-section-hpp-exported-data-types") - if a:type=="cpp" - call C_InsertTemplate("comment.file-section-hpp-exported-class-defs") - endif - call C_InsertTemplate("comment.file-section-hpp-exported-variables") - call C_InsertTemplate("comment.file-section-hpp-exported-function-declarations") - -endfunction " ---------- end of function C_Comment_H_SectionAll ---------- -" -"---------------------------------------------------------------------- -" C_CodeComment : Code -> Comment {{{1 -"---------------------------------------------------------------------- -function! C_CodeComment( mode, style ) - - if a:mode=="a" - if a:style == 'yes' - silent exe ":s#^#/\* #" - silent put = ' */' - else - silent exe ":s#^#//#" - endif - endif - - if a:mode=="v" - if a:style == 'yes' - silent exe ":'<,'>s/^/ \* /" - silent exe ":'< s'^ '\/'" - silent exe ":'>" - silent put = ' */' - else - silent exe ":'<,'>s#^#//#" - endif - endif - -endfunction " ---------- end of function C_CodeComment ---------- -" -"---------------------------------------------------------------------- -" C_StartMultilineComment : Comment -> Code {{{1 -"---------------------------------------------------------------------- -let s:C_StartMultilineComment = '^\s*\/\*[\*! ]\=' - -function! C_RemoveCComment( start, end ) - - if a:end-a:start<1 - return 0 " lines removed - endif - " - " Is the C-comment complete ? Get length. - " - let check = getline( a:start ) =~ s:C_StartMultilineComment - let linenumber = a:start+1 - while linenumber < a:end && getline( linenumber ) !~ '^\s*\*\/' - let check = check && getline( linenumber ) =~ '^\s*\*[ ]\=' - let linenumber = linenumber+1 - endwhile - let check = check && getline( linenumber ) =~ '^\s*\*\/' - " - " remove a complete comment - " - if check - exe "silent :".a:start.' s/'.s:C_StartMultilineComment.'//' - let linenumber1 = a:start+1 - while linenumber1 < linenumber - exe "silent :".linenumber1.' s/^\s*\*[ ]\=//' - let linenumber1 = linenumber1+1 - endwhile - exe "silent :".linenumber1.' s/^\s*\*\///' - endif - - return linenumber-a:start+1 " lines removed -endfunction " ---------- end of function C_RemoveCComment ---------- -" -"---------------------------------------------------------------------- -" C_CommentCode : Comment -> Code {{{1 -"---------------------------------------------------------------------- -function! C_CommentCode(mode) - if a:mode=="a" - let pos1 = line(".") - let pos2 = pos1 - endif - if a:mode=="v" - let pos1 = line("'<") - let pos2 = line("'>") - endif - - let removed = 0 - " - let linenumber=pos1 - while linenumber <= pos2 - " Do we have a C++ comment ? - if getline( linenumber ) =~ '^\s*//' - exe "silent :".linenumber.' s#^\s*//##' - let removed = 1 - endif - " Do we have a C comment ? - if removed == 0 && getline( linenumber ) =~ s:C_StartMultilineComment - let removed = C_RemoveCComment(linenumber,pos2) - endif - - if removed!=0 - let linenumber = linenumber+removed - let removed = 0 - else - let linenumber = linenumber+1 - endif - endwhile -endfunction " ---------- end of function C_CommentCode ---------- -" -"---------------------------------------------------------------------- -" C_CommentCppToC : C++ Comment -> C Comment {{{1 -" Removes trailing whitespaces. -"---------------------------------------------------------------------- -function! C_CommentCppToC() - silent! exe ':s#\/\/\s*\(.*\)\s*$#/* \1 */#' -endfunction " ---------- end of function C_CommentCppToC ---------- -" -"---------------------------------------------------------------------- -" C_CommentCToCpp : C Comment -> C++ Comment {{{1 -" Changes the first comment in case of multiple comments: -" xxxx; /* */ /* */ -" xxxx; // /* */ -" Removes trailing whitespaces. -"---------------------------------------------------------------------- -function! C_CommentCToCpp() - silent! exe ':s!\/\*\s*\(.\{-}\)\*\/!\/\/ \1!' - silent! exe ':s!\s*$!!' -endfunction " ---------- end of function C_CommentCToCpp ---------- -" -"===================================================================================== -"----- Menu : Statements ----------------------------------------------------------- -"===================================================================================== -" -"------------------------------------------------------------------------------ -" C_PPIf0 : #if 0 .. #endif {{{1 -"------------------------------------------------------------------------------ -function! C_PPIf0 (mode) - " - let s:C_If0_Counter = 0 - let save_line = line(".") - let actual_line = 0 - " - " search for the maximum option number (if any) - " - normal gg - while actual_line < search( s:C_If0_Txt."\\d\\+" ) - let actual_line = line(".") - let actual_opt = matchstr( getline(actual_line), s:C_If0_Txt."\\d\\+" ) - let actual_opt = strpart( actual_opt, strlen(s:C_If0_Txt),strlen(actual_opt)-strlen(s:C_If0_Txt)) - if s:C_If0_Counter < actual_opt - let s:C_If0_Counter = actual_opt - endif - endwhile - let s:C_If0_Counter = s:C_If0_Counter+1 - silent exe ":".save_line - " - if a:mode=='a' - let zz= "\n#if 0 ".s:C_Com1." ----- #if 0 : ".s:C_If0_Txt.s:C_If0_Counter." ----- ".s:C_Com2."\n" - let zz= zz."\n#endif ".s:C_Com1." ----- #if 0 : ".s:C_If0_Txt.s:C_If0_Counter." ----- ".s:C_Com2."\n\n" - put =zz - normal 4k - endif - - if a:mode=='v' - let pos1 = line("'<") - let pos2 = line("'>") - let zz= "#endif ".s:C_Com1." ----- #if 0 : ".s:C_If0_Txt.s:C_If0_Counter." ----- ".s:C_Com2."\n\n" - exe ":".pos2."put =zz" - let zz= "\n#if 0 ".s:C_Com1." ----- #if 0 : ".s:C_If0_Txt.s:C_If0_Counter." ----- ".s:C_Com2."\n" - exe ":".pos1."put! =zz" - " - if &foldenable && foldclosed(".") - normal zv - endif - endif - -endfunction " ---------- end of function C_PPIf0 ---------- -" -"------------------------------------------------------------------------------ -" C_PPIf0Remove : remove #if 0 .. #endif {{{1 -"------------------------------------------------------------------------------ -function! C_PPIf0Remove () - " - " cursor on fold: open fold first - if &foldenable && foldclosed(".") - normal zv - endif - " - let frstline = searchpair( '^\s*#if\s\+0', '', '^\s*#endif\>.\+\.\+\=0 && match( l:snippetfile, '\.\(ni\|noindent\)$' ) < 0 - endif - endif - if line(".")==2 && getline(1)=~"^$" - silent exe ":1,1d" - endif - endif - " - " update current buffer / split window / edit snippet file - " - if a:mode == "e" - if has("browse") && s:C_GuiSnippetBrowser == 'gui' - let l:snippetfile = browse(0,"edit a code snippet",s:C_CodeSnippets,"") - else - let l:snippetfile=input("edit snippet ", s:C_CodeSnippets, "file" ) - endif - if l:snippetfile != "" - :execute "update! | split | edit ".l:snippetfile - endif - endif - " - " write whole buffer into snippet file - " - if a:mode == "w" || a:mode == "wv" - if has("browse") && s:C_GuiSnippetBrowser == 'gui' - let l:snippetfile = browse(0,"write a code snippet",s:C_CodeSnippets,"") - else - let l:snippetfile=input("write snippet ", s:C_CodeSnippets, "file" ) - endif - if l:snippetfile != "" - if filereadable(l:snippetfile) - if confirm("File ".l:snippetfile." exists ! Overwrite ? ", "&Cancel\n&No\n&Yes") != 3 - return - endif - endif - if a:mode == "w" - :execute ":write! ".l:snippetfile - else - :execute ":*write! ".l:snippetfile - endif - endif - endif - - else - echo "code snippet directory ".s:C_CodeSnippets." does not exist (please create it)" - endif -endfunction " ---------- end of function C_CodeSnippets ---------- -" -"------------------------------------------------------------------------------ -" C_help : builtin completion {{{1 -"------------------------------------------------------------------------------ -function! C_ForTypeComplete ( ArgLead, CmdLine, CursorPos ) - " - " show all types - if a:ArgLead == '' - return s:C_ForTypes - endif - " - " show types beginning with a:ArgLead - let expansions = [] - for item in s:C_ForTypes - if match( item, '\<'.a:ArgLead.'\s*\w*' ) == 0 - call add( expansions, item ) - endif - endfor - return expansions -endfunction " ---------- end of function C_ForTypeComplete ---------- -" -"------------------------------------------------------------------------------ -" C_CodeFor : for (idiom) {{{1 -"------------------------------------------------------------------------------ -function! C_CodeFor( direction, mode ) - " - if a:direction == 'up' - let updown = 'INCR.' - else - let updown = 'DECR.' - endif - let string = C_Input( '[TYPE (expand)] VARIABLE [START [END ['.updown.']]] : ', '', 'customlist,C_ForTypeComplete' ) - if string == '' - return - endif - " - let nextindex = -1 - let loopvar_type = '' - for item in s:C_ForTypes - let nextindex = matchend( string, '^\s*'.item ) - if nextindex > 0 - let loopvar_type = item - let string = strpart( string, nextindex ) - endif - endfor - if loopvar_type != '' - let loopvar_type .= ' ' - if string == '' - let string = C_Input( 'VARIABLE [START [END ['.updown.']]] : ', '' ) - if string == '' - return - endif - endif - endif - let part = split( string ) - - if len( part ) > 4 - echohl WarningMsg | echomsg "for loop construction : to many arguments " | echohl None - return - endif - - let missing = 0 - while len(part) < 4 - let part = part + [''] - let missing = missing+1 - endwhile - - let [ loopvar, startval, endval, incval ] = part - - if incval=='' - let incval = '1' - endif - - if a:direction == 'up' - if endval == '' - let endval = 'n' - endif - if startval == '' - let startval = '0' - endif - let zz= 'for ( '.loopvar_type.loopvar.' = '.startval.'; '.loopvar.' < '.endval.'; '.loopvar.' += '.incval." )" - else - if endval == '' - let endval = '0' - endif - if startval == '' - let startval = 'n-1' - endif - let zz= 'for ( '.loopvar_type.loopvar.' = '.startval.'; '.loopvar.' >= '.endval.'; '.loopvar.' -= '.incval." )" - endif - " - " use internal formatting to avoid conficts when using == below - let equalprg_save = &equalprg - set equalprg= - - " ----- normal mode ---------------- - if a:mode=='a' - let zz = zz." {\n}" - put =zz - normal k - normal 2== - endif - " ----- visual mode ---------------- - if a:mode=='v' - let pos1 = line("'<") - let pos2 = line("'>") - let zz = zz.' {' - let zz2= '}' - exe ":".pos2."put =zz2" - exe ":".pos1."put! =zz" - :exe 'normal ='.(pos2-pos1+2).'+' - endif - " - " restore formatter programm - let &equalprg = equalprg_save - " - " position the cursor - " - normal ^ - if missing == 1 - let match = search( '\<'.incval.'\>', 'W', line(".") ) - else - if missing == 2 - let match = search( '\<'.endval.'\>', 'W', line(".") ) - else - if missing == 3 - let match = search( '\<'.startval.'\>', 'W', line(".") ) - endif - endif - endif - " -endfunction " ---------- end of function C_CodeFor ---------- -" -"------------------------------------------------------------------------------ -" Handle prototypes {{{1 -"------------------------------------------------------------------------------ -" -let s:C_Prototype = [] -let s:C_PrototypeShow = [] -let s:C_PrototypeCounter = 0 -let s:C_CComment = '\/\*.\{-}\*\/\s*' " C comment with trailing whitespaces - " '.\{-}' any character, non-greedy -let s:C_CppComment = '\/\/.*$' " C++ comment -" -"------------------------------------------------------------------------------ -" C_ProtoPick : pick up (normal/visual) {{{1 -"------------------------------------------------------------------------------ -function! C_ProtoPick (mode) - if a:mode=="n" - " --- normal mode ------------------- - let pos1 = line(".") - let pos2 = pos1 - else - " --- visual mode ------------------- - let pos1 = line("'<") - let pos2 = line("'>") - endif - " - " remove C/C++-comments, leading and trailing whitespaces, squeeze whitespaces - " - let prototyp = '' - for linenumber in range( pos1, pos2 ) - let newline = getline(linenumber) - let newline = substitute( newline, s:C_CppComment, "", "" ) " remove C++ comment - let prototyp = prototyp." ".newline - endfor - " - let prototyp = substitute( prototyp, '^\s\+', "", "" ) " remove leading whitespaces - let prototyp = substitute( prototyp, s:C_CComment, "", "g" ) " remove (multiline) C comments - let prototyp = substitute( prototyp, '\s\+', " ", "g" ) " squeeze whitespaces - let prototyp = substitute( prototyp, '\s\+$', "", "" ) " remove trailing whitespaces - " - " remove template keyword - " - let prototyp = substitute( prototyp, '^template\s*<\s*class \w\+\s*>\s*', "", "" ) - " - let parlist = stridx( prototyp, '(' ) " start of the parameter list - let part1 = strpart( prototyp, 0, parlist ) - let part2 = strpart( prototyp, parlist ) - " - " remove the scope res. operator - " - let part1 = substitute( part1, '<\s*\w\+\s*>', "", "g" ) - let part1 = substitute( part1, '\ 1 - echon 's' - endif - " -endfunction " --------- end of function C_ProtoPick ---------- -" -"------------------------------------------------------------------------------ -" C_ProtoInsert : insert {{{1 -"------------------------------------------------------------------------------ -function! C_ProtoInsert () - " - " use internal formatting to avoid conficts when using == below - let equalprg_save = &equalprg - set equalprg= - " - if s:C_PrototypeCounter > 0 - for protytype in s:C_Prototype - put =protytype - endfor - let lines = s:C_PrototypeCounter - 1 - silent exe "normal =".lines."-" - call C_ProtoClear() - else - echo "currently no prototypes available" - endif - " - " restore formatter programm - let &equalprg = equalprg_save - " -endfunction " --------- end of function C_ProtoInsert ---------- -" -"------------------------------------------------------------------------------ -" C_ProtoClear : clear {{{1 -"------------------------------------------------------------------------------ -function! C_ProtoClear () - if s:C_PrototypeCounter > 0 - let s:C_Prototype = [] - let s:C_PrototypeShow = [] - if s:C_PrototypeCounter == 1 - echo s:C_PrototypeCounter.' prototype deleted' - else - echo s:C_PrototypeCounter.' prototypes deleted' - endif - let s:C_PrototypeCounter = 0 - else - echo "currently no prototypes available" - endif -endfunction " --------- end of function C_ProtoClear ---------- -" -"------------------------------------------------------------------------------ -" C_ProtoShow : show {{{1 -"------------------------------------------------------------------------------ -function! C_ProtoShow () - if s:C_PrototypeCounter > 0 - for protytype in s:C_PrototypeShow - echo protytype - endfor - else - echo "currently no prototypes available" - endif -endfunction " --------- end of function C_ProtoShow ---------- -" -"------------------------------------------------------------------------------ -" C_EscapeBlanks : C_EscapeBlanks {{{1 -"------------------------------------------------------------------------------ -function! C_EscapeBlanks (arg) - return substitute( a:arg, " ", "\\ ", "g" ) -endfunction " --------- end of function C_EscapeBlanks ---------- -" -"------------------------------------------------------------------------------ -" C_Compile : C_Compile {{{1 -"------------------------------------------------------------------------------ -" The standard make program 'make' called by vim is set to the C or C++ compiler -" and reset after the compilation (setlocal makeprg=... ). -" The errorfile created by the compiler will now be read by gvim and -" the commands cl, cp, cn, ... can be used. -"------------------------------------------------------------------------------ -let s:LastShellReturnCode = 0 " for compile / link / run only - -function! C_Compile () - - let s:C_HlMessage = "" - exe ":cclose" - let Sou = expand("%:p") " name of the file in the current buffer - let Obj = expand("%:p:r").s:C_ObjExtension " name of the object - let SouEsc= escape( Sou, s:escfilename ) - let ObjEsc= escape( Obj, s:escfilename ) - - " update : write source file if necessary - exe ":update" - - " compilation if object does not exist or object exists and is older then the source - if !filereadable(Obj) || (filereadable(Obj) && (getftime(Obj) < getftime(Sou))) - " &makeprg can be a string containing blanks - let makeprg_saved = '"'.&makeprg.'"' - if expand("%:e") == s:C_CExtension - exe "setlocal makeprg=".s:C_CCompiler - else - exe "setlocal makeprg=".s:C_CplusCompiler - endif - " - " COMPILATION - " - let v:statusmsg = '' - let s:LastShellReturnCode = 0 - if s:MSWIN - exe "make ".s:C_CFlags." \"".SouEsc."\" -o \"".ObjEsc."\"" - else - exe "make ".s:C_CFlags." ".SouEsc." -o ".ObjEsc - endif - exe "setlocal makeprg=".makeprg_saved - if v:statusmsg == '' - let s:C_HlMessage = "'".Obj."' : compilation successful" - endif - if v:shell_error != 0 - let s:LastShellReturnCode = v:shell_error - endif - " - " open error window if necessary - :redraw! - exe ":botright cwindow" - else - let s:C_HlMessage = " '".Obj."' is up to date " - endif - -endfunction " ---------- end of function C_Compile ---------- -" -"------------------------------------------------------------------------------ -" C_Link : C_Link {{{1 -"------------------------------------------------------------------------------ -" The standard make program which is used by gvim is set to the compiler -" (for linking) and reset after linking. -" -" calls: C_Compile -"------------------------------------------------------------------------------ -function! C_Link () - - call C_Compile() - :redraw! - if s:LastShellReturnCode != 0 - let s:LastShellReturnCode = 0 - return - endif - - let s:C_HlMessage = "" - let Sou = expand("%:p") " name of the file (full path) - let Obj = expand("%:p:r").s:C_ObjExtension " name of the object file - let Exe = expand("%:p:r").s:C_ExeExtension " name of the executable - let ObjEsc= escape( Obj, s:escfilename ) - let ExeEsc= escape( Exe, s:escfilename ) - - " no linkage if: - " executable exists - " object exists - " source exists - " executable newer then object - " object newer then source - - if filereadable(Exe) && - \ filereadable(Obj) && - \ filereadable(Sou) && - \ (getftime(Exe) >= getftime(Obj)) && - \ (getftime(Obj) >= getftime(Sou)) - let s:C_HlMessage = " '".Exe."' is up to date " - return - endif - - " linkage if: - " object exists - " source exists - " object newer then source - - if filereadable(Obj) && (getftime(Obj) >= getftime(Sou)) - let makeprg_saved='"'.&makeprg.'"' - if expand("%:e") == s:C_CExtension - exe "setlocal makeprg=".s:C_CCompiler - else - exe "setlocal makeprg=".s:C_CplusCompiler - endif - let s:LastShellReturnCode = 0 - let v:statusmsg = '' - if s:MSWIN - silent exe "make ".s:C_LFlags." -o \"".ExeEsc."\" \"".ObjEsc."\" ".s:C_Libs - else - silent exe "make ".s:C_LFlags." -o ".ExeEsc." ".ObjEsc." ".s:C_Libs - endif - if v:statusmsg == '' - let s:C_HlMessage = "'".Exe."' : linking successful" - else - let s:C_HlMessage = "'".Exe."' : linking NOT successful" - endif - if v:shell_error != 0 - let s:LastShellReturnCode = v:shell_error - endif - exe "setlocal makeprg=".makeprg_saved - endif -endfunction " ---------- end of function C_Link ---------- -" -"------------------------------------------------------------------------------ -" C_Run : C_Run {{{1 -" calls: C_Link -"------------------------------------------------------------------------------ -" -let s:C_OutputBufferName = "C-Output" -let s:C_OutputBufferNumber = -1 -let s:C_RunMsg1 ="' does not exist or is not executable or object/source older then executable" -" -function! C_Run () -" - let s:C_HlMessage = "" - let Sou = expand("%:p") " name of the source file - let Obj = expand("%:p:r").s:C_ObjExtension " name of the object file - let Exe = expand("%:p:r").s:C_ExeExtension " name of the executable - let ExeEsc = escape( Exe, s:escfilename ) " name of the executable, escaped - " - let l:arguments = exists("b:C_CmdLineArgs") ? b:C_CmdLineArgs : '' - " - let l:currentbuffer = bufname("%") - " - "============================================================================== - " run : run from the vim command line - "============================================================================== - if s:C_OutputGvim == "vim" - " - silent call C_Link() - if s:LastShellReturnCode == 0 - " clear the last linking message if any" - let s:C_HlMessage = "" - call C_HlMessage() - endif - " - if executable(Exe) && getftime(Exe) >= getftime(Obj) && getftime(Obj) >= getftime(Sou) - if s:MSWIN - exe "!\"".ExeEsc."\" ".l:arguments - else - exe "!".ExeEsc." ".l:arguments - endif - else - echomsg "file '".Exe.s:C_RunMsg1 - endif - - endif - " - "============================================================================== - " run : redirect output to an output buffer - "============================================================================== - if s:C_OutputGvim == "buffer" - let l:currentbuffernr = bufnr("%") - " - silent call C_Link() - " - if l:currentbuffer == bufname("%") - " - " - if bufloaded(s:C_OutputBufferName) != 0 && bufwinnr(s:C_OutputBufferNumber)!=-1 - exe bufwinnr(s:C_OutputBufferNumber) . "wincmd w" - " buffer number may have changed, e.g. after a 'save as' - if bufnr("%") != s:C_OutputBufferNumber - let s:C_OutputBufferNumber = bufnr(s:C_OutputBufferName) - exe ":bn ".s:C_OutputBufferNumber - endif - else - silent exe ":new ".s:C_OutputBufferName - let s:C_OutputBufferNumber=bufnr("%") - setlocal buftype=nofile - setlocal noswapfile - setlocal syntax=none - setlocal bufhidden=delete - setlocal tabstop=8 - endif - " - " run programm - " - setlocal modifiable - if executable(Exe) && getftime(Exe) >= getftime(Obj) && getftime(Obj) >= getftime(Sou) - if s:MSWIN - exe "%!\"".ExeEsc."\" ".l:arguments - else - exe "%!".ExeEsc." ".l:arguments - endif - setlocal nomodifiable - " - if winheight(winnr()) >= line("$") - exe bufwinnr(l:currentbuffernr) . "wincmd w" - endif - else - setlocal nomodifiable - :close - echomsg "file '".Exe.s:C_RunMsg1 - endif - " - endif - endif - " - "============================================================================== - " run : run in a detached xterm (not available for MS Windows) - "============================================================================== - if s:C_OutputGvim == "xterm" - " - silent call C_Link() - " - if executable(Exe) && getftime(Exe) >= getftime(Obj) && getftime(Obj) >= getftime(Sou) - if s:MSWIN - exe "!\"".ExeEsc."\" ".l:arguments - else - silent exe '!xterm -title '.ExeEsc.' '.s:C_XtermDefaults.' -e '.s:C_Wrapper.' '.ExeEsc.' '.l:arguments.' &' - :redraw! - endif - else - echomsg "file '".Exe.s:C_RunMsg1 - endif - endif - - if v:statusmsg == '' - let s:C_HlMessage = "" - endif -endfunction " ---------- end of function C_Run ---------- -" -"------------------------------------------------------------------------------ -" C_Arguments : Arguments for the executable {{{1 -"------------------------------------------------------------------------------ -function! C_Arguments () - let Exe = expand("%:r").s:C_ExeExtension - if Exe == "" - redraw - echohl WarningMsg | echo "no file name " | echohl None - return - endif - let prompt = 'command line arguments for "'.Exe.'" : ' - if exists("b:C_CmdLineArgs") - let b:C_CmdLineArgs= C_Input( prompt, b:C_CmdLineArgs, 'file' ) - else - let b:C_CmdLineArgs= C_Input( prompt , "", 'file' ) - endif -endfunction " ---------- end of function C_Arguments ---------- -" -"---------------------------------------------------------------------- -" C_Toggle_Gvim_Xterm : change output destination {{{1 -"---------------------------------------------------------------------- -function! C_Toggle_Gvim_Xterm () - - if s:C_OutputGvim == "vim" - if has("gui_running") - exe "aunmenu ".s:Run.'.&output:\ VIM->buffer->xterm' - exe "amenu ".s:Run.'.&output:\ BUFFER->xterm->vim :call C_Toggle_Gvim_Xterm()' - exe "imenu ".s:Run.'.&output:\ BUFFER->xterm->vim :call C_Toggle_Gvim_Xterm()' - endif - let s:C_OutputGvim = "buffer" - else - if s:C_OutputGvim == "buffer" - if has("gui_running") - exe "aunmenu ".s:Run.'.&output:\ BUFFER->xterm->vim' - if (!s:MSWIN) - exe "amenu ".s:Run.'.&output:\ XTERM->vim->buffer :call C_Toggle_Gvim_Xterm()' - exe "imenu ".s:Run.'.&output:\ XTERM->vim->buffer :call C_Toggle_Gvim_Xterm()' - else - exe "amenu ".s:Run.'.&output:\ VIM->buffer->xterm :call C_Toggle_Gvim_Xterm()' - exe "imenu ".s:Run.'.&output:\ VIM->buffer->xterm :call C_Toggle_Gvim_Xterm()' - endif - endif - if (!s:MSWIN) && (s:C_Display != '') - let s:C_OutputGvim = "xterm" - else - let s:C_OutputGvim = "vim" - endif - else - " ---------- output : xterm -> gvim - if has("gui_running") - exe "aunmenu ".s:Run.'.&output:\ XTERM->vim->buffer' - exe "amenu ".s:Run.'.&output:\ VIM->buffer->xterm :call C_Toggle_Gvim_Xterm()' - exe "imenu ".s:Run.'.&output:\ VIM->buffer->xterm :call C_Toggle_Gvim_Xterm()' - endif - let s:C_OutputGvim = "vim" - endif - endif - echomsg "output destination is '".s:C_OutputGvim."'" - -endfunction " ---------- end of function C_Toggle_Gvim_Xterm ---------- -" -"------------------------------------------------------------------------------ -" C_XtermSize : xterm geometry {{{1 -"------------------------------------------------------------------------------ -function! C_XtermSize () - let regex = '-geometry\s\+\d\+x\d\+' - let geom = matchstr( s:C_XtermDefaults, regex ) - let geom = matchstr( geom, '\d\+x\d\+' ) - let geom = substitute( geom, 'x', ' ', "" ) - let answer= C_Input(" xterm size (COLUMNS LINES) : ", geom ) - while match(answer, '^\s*\d\+\s\+\d\+\s*$' ) < 0 - let answer= C_Input(" + xterm size (COLUMNS LINES) : ", geom ) - endwhile - let answer = substitute( answer, '\s\+', "x", "" ) " replace inner whitespaces - let s:C_XtermDefaults = substitute( s:C_XtermDefaults, regex, "-geometry ".answer , "" ) -endfunction " ---------- end of function C_XtermSize ---------- -" -"------------------------------------------------------------------------------ -" C_MakeArguments : run make(1) {{{1 -"------------------------------------------------------------------------------ - -let s:C_MakeCmdLineArgs = "" " command line arguments for Run-make; initially empty - -function! C_MakeArguments () - let s:C_MakeCmdLineArgs= C_Input( 'make command line arguments : ', s:C_MakeCmdLineArgs, 'file' ) -endfunction " ---------- end of function C_MakeArguments ---------- -" -function! C_Make() - " update : write source file if necessary - exe ":update" - " run make - exe ":!make ".s:C_MakeCmdLineArgs -endfunction " ---------- end of function C_Make ---------- -" -"------------------------------------------------------------------------------ -" C_SplintArguments : splint command line arguments {{{1 -"------------------------------------------------------------------------------ -function! C_SplintArguments () - if s:C_SplintIsExecutable==0 - let s:C_HlMessage = ' Splint is not executable or not installed! ' - else - let prompt = 'Splint command line arguments for "'.expand("%").'" : ' - if exists("b:C_SplintCmdLineArgs") - let b:C_SplintCmdLineArgs= C_Input( prompt, b:C_SplintCmdLineArgs ) - else - let b:C_SplintCmdLineArgs= C_Input( prompt , "" ) - endif - endif -endfunction " ---------- end of function C_SplintArguments ---------- -" -"------------------------------------------------------------------------------ -" C_SplintCheck : run splint(1) {{{1 -"------------------------------------------------------------------------------ -function! C_SplintCheck () - if s:C_SplintIsExecutable==0 - let s:C_HlMessage = ' Splint is not executable or not installed! ' - return - endif - let l:currentbuffer=bufname("%") - if &filetype != "c" && &filetype != "cpp" - let s:C_HlMessage = ' "'.l:currentbuffer.'" seems not to be a C/C++ file ' - return - endif - let s:C_HlMessage = "" - exe ":cclose" - silent exe ":update" - let makeprg_saved='"'.&makeprg.'"' - " Windows seems to need this: - if s:MSWIN - :compiler splint - endif - :setlocal makeprg=splint - " - let l:arguments = exists("b:C_SplintCmdLineArgs") ? b:C_SplintCmdLineArgs : ' ' - silent exe "make ".l:arguments." ".escape(l:currentbuffer,s:escfilename) - exe "setlocal makeprg=".makeprg_saved - exe ":botright cwindow" - " - " message in case of success - " - if l:currentbuffer == bufname("%") - let s:C_HlMessage = " Splint --- no warnings for : ".l:currentbuffer - endif -endfunction " ---------- end of function C_SplintCheck ---------- -" -"------------------------------------------------------------------------------ -" C_CodeCheckArguments : CodeCheck command line arguments {{{1 -"------------------------------------------------------------------------------ -function! C_CodeCheckArguments () - if s:C_CodeCheckIsExecutable==0 - let s:C_HlMessage = ' CodeCheck is not executable or not installed! ' - else - let prompt = 'CodeCheck command line arguments for "'.expand("%").'" : ' - if exists("b:C_CodeCheckCmdLineArgs") - let b:C_CodeCheckCmdLineArgs= C_Input( prompt, b:C_CodeCheckCmdLineArgs ) - else - let b:C_CodeCheckCmdLineArgs= C_Input( prompt , s:C_CodeCheckOptions ) - endif - endif -endfunction " ---------- end of function C_CodeCheckArguments ---------- -" -"------------------------------------------------------------------------------ -" C_CodeCheck : run CodeCheck {{{1 -"------------------------------------------------------------------------------ -function! C_CodeCheck () - if s:C_CodeCheckIsExecutable==0 - let s:C_HlMessage = ' CodeCheck is not executable or not installed! ' - return - endif - let l:currentbuffer=bufname("%") - if &filetype != "c" && &filetype != "cpp" - let s:C_HlMessage = ' "'.l:currentbuffer.'" seems not to be a C/C++ file ' - return - endif - let s:C_HlMessage = "" - exe ":cclose" - silent exe ":update" - let makeprg_saved='"'.&makeprg.'"' - exe "setlocal makeprg=".s:C_CodeCheckExeName - " - " match the splint error messages (quickfix commands) - " ignore any lines that didn't match one of the patterns - " - :setlocal errorformat=%f(%l)%m - " - let l:arguments = exists("b:C_CodeCheckCmdLineArgs") ? b:C_CodeCheckCmdLineArgs : "" - if l:arguments == "" - let l:arguments = s:C_CodeCheckOptions - endif - exe ":make ".l:arguments." ".escape( l:currentbuffer, s:escfilename ) - exe ':setlocal errorformat=' - exe ":setlocal makeprg=".makeprg_saved - exe ":botright cwindow" - " - " message in case of success - " - if l:currentbuffer == bufname("%") - let s:C_HlMessage = " CodeCheck --- no warnings for : ".l:currentbuffer - endif -endfunction " ---------- end of function C_CodeCheck ---------- -" -"------------------------------------------------------------------------------ -" C_Indent : run indent(1) {{{1 -"------------------------------------------------------------------------------ -" -function! C_Indent ( ) - if !executable("indent") - echomsg 'indent is not executable or not installed!' - return - endif - let l:currentbuffer=expand("%:p") - if &filetype != "c" && &filetype != "cpp" - echomsg '"'.l:currentbuffer.'" seems not to be a C/C++ file ' - return - endif - if C_Input("indent whole file [y/n/Esc] : ", "y" ) != "y" - return - endif - :update - - exe ":cclose" - if s:MSWIN - silent exe ":%!indent " - else - silent exe ":%!indent 2> ".s:C_IndentErrorLog - redraw! - if getfsize( s:C_IndentErrorLog ) > 0 - exe ':edit! '.s:C_IndentErrorLog - let errorlogbuffer = bufnr("%") - exe ':%s/^indent: Standard input/indent: '.escape( l:currentbuffer, '/' ).'/' - setlocal errorformat=indent:\ %f:%l:%m - :cbuffer - exe ':bdelete! '.errorlogbuffer - exe ':botright cwindow' - else - echomsg 'File "'.l:currentbuffer.'" reformatted.' - endif - setlocal errorformat= - endif - -endfunction " ---------- end of function C_Indent ---------- -" -"------------------------------------------------------------------------------ -" C_HlMessage : indent message {{{1 -"------------------------------------------------------------------------------ -function! C_HlMessage () - redraw! - echohl Search - echo s:C_HlMessage - echohl None -endfunction " ---------- end of function C_HlMessage ---------- -" -"------------------------------------------------------------------------------ -" C_Settings : settings {{{1 -"------------------------------------------------------------------------------ -function! C_Settings () - let txt = " C/C++-Support settings\n\n" - let txt = txt.' author : "'.s:C_Macro['|AUTHOR|']."\"\n" - let txt = txt.' initials : "'.s:C_Macro['|AUTHORREF|']."\"\n" - let txt = txt.' email : "'.s:C_Macro['|EMAIL|']."\"\n" - let txt = txt.' company : "'.s:C_Macro['|COMPANY|']."\"\n" - let txt = txt.' project : "'.s:C_Macro['|PROJECT|']."\"\n" - let txt = txt.' copyright holder : "'.s:C_Macro['|COPYRIGHTHOLDER|']."\"\n" - let txt = txt.' C / C++ compiler : '.s:C_CCompiler.' / '.s:C_CplusCompiler."\n" - let txt = txt.' C file extension : "'.s:C_CExtension.'" (everything else is C++)'."\n" - let txt = txt.' extension for objects : "'.s:C_ObjExtension."\"\n" - let txt = txt.'extension for executables : "'.s:C_ExeExtension."\"\n" - let txt = txt.' compiler flags : "'.s:C_CFlags."\"\n" - let txt = txt.' linker flags : "'.s:C_LFlags."\"\n" - let txt = txt.' libraries : "'.s:C_Libs."\"\n" - let txt = txt.' code snippet directory : "'.s:C_CodeSnippets."\"\n" - " ----- template files ------------------------ - let txt = txt.' template style : "'.s:C_ActualStyle."\"\n" - if s:installation == 'system' - let txt = txt.'global template directory : '.s:C_GlobalTemplateDir."\n" - if filereadable( s:C_LocalTemplateFile ) - let txt = txt.' local template directory : '.s:C_LocalTemplateDir."\n" - endif - else - let txt = txt.' local template directory : '.s:C_GlobalTemplateDir."\n" - endif - if !s:MSWIN - let txt = txt.' xterm defaults : '.s:C_XtermDefaults."\n" - endif - " ----- dictionaries ------------------------ - if g:C_Dictionary_File != "" - let ausgabe= &dictionary - let ausgabe= substitute( ausgabe, ",", ",\n + ", "g" ) - let txt = txt." dictionary file(s) : ".ausgabe."\n" - endif - let txt = txt.' current output dest. : '.s:C_OutputGvim."\n" - " ----- splint ------------------------------ - if s:C_SplintIsExecutable==1 - if exists("b:C_SplintCmdLineArgs") - let ausgabe = b:C_SplintCmdLineArgs - else - let ausgabe = "" - endif - let txt = txt." splint options(s) : ".ausgabe."\n" - endif - " ----- code check -------------------------- - if s:C_CodeCheckIsExecutable==1 - if exists("b:C_CodeCheckCmdLineArgs") - let ausgabe = b:C_CodeCheckCmdLineArgs - else - let ausgabe = s:C_CodeCheckOptions - endif - let txt = txt."CodeCheck (TM) options(s) : ".ausgabe."\n" - endif - let txt = txt."\n" - let txt = txt."__________________________________________________________________________\n" - let txt = txt." C/C++-Support, Version ".g:C_Version." / Dr.-Ing. Fritz Mehner / mehner@fh-swf.de\n\n" - echo txt -endfunction " ---------- end of function C_Settings ---------- -" -"------------------------------------------------------------------------------ -" C_Hardcopy : hardcopy {{{1 -" MSWIN : a printer dialog is displayed -" other : print PostScript to file -"------------------------------------------------------------------------------ -function! C_Hardcopy (mode) - let outfile = expand("%") - if outfile == "" - let s:C_HlMessage = 'Buffer has no name.' - call C_HlMessage() - endif - let outdir = getcwd() - if filewritable(outdir) != 2 - let outdir = $HOME - endif - if !s:MSWIN - let outdir = outdir.'/' - endif - let old_printheader=&printheader - exe ':set printheader='.s:C_Printheader - " ----- normal mode ---------------- - if a:mode=="n" - silent exe 'hardcopy > '.outdir.outfile.'.ps' - if !s:MSWIN - echo 'file "'.outfile.'" printed to "'.outdir.outfile.'.ps"' - endif - endif - " ----- visual mode ---------------- - if a:mode=="v" - silent exe "*hardcopy > ".outdir.outfile.".ps" - if !s:MSWIN - echo 'file "'.outfile.'" (lines '.line("'<").'-'.line("'>").') printed to "'.outdir.outfile.'.ps"' - endif - endif - exe ':set printheader='.escape( old_printheader, ' %' ) -endfunction " ---------- end of function C_Hardcopy ---------- -" -"------------------------------------------------------------------------------ -" C_HelpCsupport : help csupport {{{1 -"------------------------------------------------------------------------------ -function! C_HelpCsupport () - try - :help csupport - catch - exe ':helptags '.s:plugin_dir.'doc' - :help csupport - endtry -endfunction " ---------- end of function C_HelpCsupport ---------- -" -"------------------------------------------------------------------------------ -" C_Help : lookup word under the cursor or ask {{{1 -"------------------------------------------------------------------------------ -" -let s:C_DocBufferName = "C_HELP" -let s:C_DocHelpBufferNumber = -1 -" -function! C_Help( type ) - - let cuc = getline(".")[col(".") - 1] " character under the cursor - let item = expand("") " word under the cursor - if cuc == '' || item == "" || match( item, cuc ) == -1 - let item=C_Input('name of the manual page : ', '' ) - endif - - if item == "" - return - endif - "------------------------------------------------------------------------------ - " replace buffer content with bash help text - "------------------------------------------------------------------------------ - " - " jump to an already open bash help window or create one - " - if bufloaded(s:C_DocBufferName) != 0 && bufwinnr(s:C_DocHelpBufferNumber) != -1 - exe bufwinnr(s:C_DocHelpBufferNumber) . "wincmd w" - " buffer number may have changed, e.g. after a 'save as' - if bufnr("%") != s:C_DocHelpBufferNumber - let s:C_DocHelpBufferNumber=bufnr(s:C_OutputBufferName) - exe ":bn ".s:C_DocHelpBufferNumber - endif - else - exe ":new ".s:C_DocBufferName - let s:C_DocHelpBufferNumber=bufnr("%") - setlocal buftype=nofile - setlocal noswapfile - setlocal bufhidden=delete - setlocal filetype=sh " allows repeated use of - setlocal syntax=OFF - endif - setlocal modifiable - " - if a:type == 'm' - " - " Is there more than one manual ? - " - let manpages = system( s:C_Man.' -k '.item ) - if v:shell_error - echomsg "Shell command '".s:C_Man." -k ".item."' failed." - :close - return - endif - let catalogs = split( manpages, '\n', ) - let manual = {} - " - " Select manuals where the name exactly matches - " - for line in catalogs - if line =~ '^'.item.'\s\+(' - let itempart = split( line, '\s\+' ) - let catalog = itempart[1][1:-2] - if match( catalog, '.p$' ) == -1 - let manual[catalog] = catalog - endif - endif - endfor - " - " Build a selection list if there are more than one manual - " - let catalog = "" - if len(keys(manual)) > 1 - for key in keys(manual) - echo ' '.item.' '.key - endfor - let defaultcatalog = '' - if has_key( manual, '3' ) - let defaultcatalog = '3' - else - if has_key( manual, '2' ) - let defaultcatalog = '2' - endif - endif - let catalog = input( 'select manual section ( cancels) : ', defaultcatalog ) - if ! has_key( manual, catalog ) - :close - :redraw - echomsg "no appropriate manual section '".catalog."'" - return - endif - endif - - set filetype=man - silent exe ":%!".s:C_Man." ".catalog." ".item - - endif - - setlocal nomodifiable -endfunction " ---------- end of function C_Help ---------- - -"------------------------------------------------------------------------------ -" C_CreateGuiMenus {{{1 -"------------------------------------------------------------------------------ -let s:C_MenuVisible = 0 " state variable controlling the C-menus -" -function! C_CreateGuiMenus () - if s:C_MenuVisible != 1 - aunmenu &Tools.Load\ C\ Support - amenu 40.1000 &Tools.-SEP100- : - amenu 40.1030 &Tools.Unload\ C\ Support :call C_RemoveGuiMenus() - call C_InitMenus() - let s:C_MenuVisible = 1 - endif -endfunction " ---------- end of function C_CreateGuiMenus ---------- - -"------------------------------------------------------------------------------ -" C_ToolMenu {{{1 -"------------------------------------------------------------------------------ -function! C_ToolMenu () - amenu 40.1000 &Tools.-SEP100- : - amenu 40.1030 &Tools.Load\ C\ Support :call C_CreateGuiMenus() - imenu 40.1030 &Tools.Load\ C\ Support :call C_CreateGuiMenus() -endfunction " ---------- end of function C_ToolMenu ---------- - -"------------------------------------------------------------------------------ -" C_RemoveGuiMenus {{{1 -"------------------------------------------------------------------------------ -function! C_RemoveGuiMenus () - if s:C_MenuVisible == 1 - if s:C_Root == "" - aunmenu Comments - aunmenu Statements - aunmenu Preprocessor - aunmenu Idioms - aunmenu Snippets - aunmenu C++ - aunmenu Run - else - exe "aunmenu ".s:C_Root - endif - " - aunmenu &Tools.Unload\ C\ Support - call C_ToolMenu() - " - let s:C_MenuVisible = 0 - endif -endfunction " ---------- end of function C_RemoveGuiMenus ---------- - -"------------------------------------------------------------------------------ -" C_RereadTemplates {{{1 -" rebuild commands and the menu from the (changed) template file -"------------------------------------------------------------------------------ -function! C_RereadTemplates () - let s:style = 'default' - let s:C_Template = { 'default' : {} } - let s:C_FileVisited = [] - call C_ReadTemplates(s:C_GlobalTemplateFile) - echomsg "templates rebuilt from '".s:C_GlobalTemplateFile."'" - " - if s:installation == 'system' && filereadable( s:C_LocalTemplateFile ) - call C_ReadTemplates( s:C_LocalTemplateFile ) - echomsg " and from '".s:C_LocalTemplateFile."'" - endif -endfunction " ---------- end of function C_RereadTemplates ---------- - -"------------------------------------------------------------------------------ -" C_BrowseTemplateFiles {{{1 -"------------------------------------------------------------------------------ -function! C_BrowseTemplateFiles ( type ) - if filereadable( eval( 's:C_'.a:type.'TemplateFile' ) ) - if has("browse") && s:C_GuiTemplateBrowser == 'gui' - let l:templatefile = browse(0,"edit a template file", eval('s:C_'.a:type.'TemplateDir'), "" ) - else - let l:templatefile = '' - if s:C_GuiTemplateBrowser == 'explorer' - exe ':Explore '.eval('s:C_'.a:type.'TemplateDir') - endif - if s:C_GuiTemplateBrowser == 'commandline' - let l:templatefile = input("edit a template file", eval('s:C_'.a:type.'TemplateDir'), "file" ) - endif - endif - if l:templatefile != "" - :execute "update! | split | edit ".l:templatefile - endif - else - echomsg a:type." template file not readable." - endif -endfunction " ---------- end of function C_BrowseTemplateFiles ---------- - -"------------------------------------------------------------------------------ -" C_EditTemplates {{{1 -"------------------------------------------------------------------------------ -function! C_EditTemplates ( type ) - " - if a:type == 'global' - if s:installation == 'system' - call C_BrowseTemplateFiles('Global') - else - echomsg "C/C++-Support is user installed: no global template file" - endif - endif - " - if a:type == 'local' - if s:installation == 'system' - call C_BrowseTemplateFiles('Local') - else - call C_BrowseTemplateFiles('Global') - endif - endif - " -endfunction " ---------- end of function C_EditTemplates ---------- -" -"------------------------------------------------------------------------------ -" C_ReadTemplates {{{1 -" read the template file(s), build the macro and the template dictionary -" -"------------------------------------------------------------------------------ -let s:style = 'default' -function! C_ReadTemplates ( templatefile ) - - if !filereadable( a:templatefile ) - echohl WarningMsg - echomsg "C/C++ template file '".a:templatefile."' does not exist or is not readable" - echohl None - return - endif - - let skipmacros = 0 - let s:C_FileVisited += [a:templatefile] - - "------------------------------------------------------------------------------ - " read template file, start with an empty template dictionary - "------------------------------------------------------------------------------ - - let item = '' - let skipline = 0 - for line in readfile( a:templatefile ) - " if not a comment : - if line !~ s:C_MacroCommentRegex - " - "------------------------------------------------------------------------------- - " IF |STYLE| IS ... - "------------------------------------------------------------------------------- - " - let string = matchlist( line, s:C_TemplateIf ) - if !empty(string) - if !has_key( s:C_Template, string[1] ) - " new s:style - let s:style = string[1] - let s:C_Template[s:style] = {} - continue - endif - endif - " - "------------------------------------------------------------------------------- - " ENDIF - "------------------------------------------------------------------------------- - " - let string = matchlist( line, s:C_TemplateEndif ) - if !empty(string) - let s:style = 'default' - continue - endif - " - " macros and file includes - " - let string = matchlist( line, s:C_MacroLineRegex ) - if !empty(string) && skipmacros == 0 - let key = '|'.string[1].'|' - let val = string[2] - let val = substitute( val, '\s\+$', '', '' ) - let val = substitute( val, "[\"\']$", '', '' ) - let val = substitute( val, "^[\"\']", '', '' ) - " - if key == '|includefile|' && count( s:C_FileVisited, val ) == 0 - let path = fnamemodify( a:templatefile, ":p:h" ) - call C_ReadTemplates( path.'/'.val ) " recursive call - else - let s:C_Macro[key] = escape( val, '&' ) - endif - continue " next line - endif - " - " template header - " - let name = matchstr( line, s:C_TemplateLineRegex ) - " - if name != '' - let part = split( name, '\s*==\s*') - let item = part[0] - if has_key( s:C_Template[s:style], item ) && s:C_TemplateOverwrittenMsg == 'yes' - echomsg "existing C/C++ template '".item."' overwritten" - endif - let s:C_Template[s:style][item] = '' - let skipmacros = 1 - " - let s:C_Attribute[item] = 'below' - if has_key( s:Attribute, get( part, 1, 'NONE' ) ) - let s:C_Attribute[item] = part[1] - endif - else - if item != '' - let s:C_Template[s:style][item] .= line."\n" - endif - endif - endif - " - endfor " --------- read line --------- - - let s:C_ActualStyle = 'default' - if s:C_Macro['|STYLE|'] != '' - let s:C_ActualStyle = s:C_Macro['|STYLE|'] - endif - let s:C_ActualStyleLast = s:C_ActualStyle - - call C_SetSmallCommentStyle() -endfunction " ---------- end of function C_ReadTemplates ---------- - -"------------------------------------------------------------------------------ -" C_Style{{{1 -" ex-command CStyle : callback function -"------------------------------------------------------------------------------ -function! C_Style ( style ) - let lstyle = substitute( a:style, '^\s\+', "", "" ) " remove leading whitespaces - let lstyle = substitute( lstyle, '\s\+$', "", "" ) " remove trailing whitespaces - if has_key( s:C_Template, lstyle ) - if len( s:C_Template[lstyle] ) == 0 - echomsg "style '".lstyle."' : no templates defined" - return - endif - let s:C_ActualStyleLast = s:C_ActualStyle - let s:C_ActualStyle = lstyle - if len( s:C_ActualStyle ) > 1 && s:C_ActualStyle != s:C_ActualStyleLast - echomsg "template style is '".lstyle."'" - endif - else - echomsg "style '".lstyle."' does not exist" - endif -endfunction " ---------- end of function C_Style ---------- - -"------------------------------------------------------------------------------ -" C_StyleList {{{1 -" ex-command CStyle -"------------------------------------------------------------------------------ -function! C_StyleList ( ArgLead, CmdLine, CursorPos ) - " show all types / types beginning with a:ArgLead - return filter( copy(keys( s:C_Template) ), 'v:val =~ "\\<'.a:ArgLead.'\\w*"' ) -endfunction " ---------- end of function C_StyleList ---------- - -"------------------------------------------------------------------------------ -" C_OpenFold {{{1 -" Open fold and go to the first or last line of this fold. -"------------------------------------------------------------------------------ -function! C_OpenFold ( mode ) - if foldclosed(".") >= 0 - " we are on a closed fold: get end position, open fold, jump to the - " last line of the previously closed fold - let foldstart = foldclosed(".") - let foldend = foldclosedend(".") - normal zv - if a:mode == 'below' - exe ":".foldend - endif - if a:mode == 'start' - exe ":".foldstart - endif - endif -endfunction " ---------- end of function C_OpenFold ---------- - -"------------------------------------------------------------------------------ -" C_InsertTemplate {{{1 -" insert a template from the template dictionary -" do macro expansion -"------------------------------------------------------------------------------ -function! C_InsertTemplate ( key, ... ) - - if !has_key( s:C_Template[s:C_ActualStyle], a:key ) && - \ !has_key( s:C_Template['default'], a:key ) - echomsg "style '".a:key."' / template '".a:key - \ ."' not found. Please check your template file in '".s:C_GlobalTemplateDir."'" - return - endif - - if &foldenable - let foldmethod_save = &foldmethod - set foldmethod=manual - endif - "------------------------------------------------------------------------------ - " insert the user macros - "------------------------------------------------------------------------------ - - " use internal formatting to avoid conficts when using == below - " - let equalprg_save = &equalprg - set equalprg= - - let mode = s:C_Attribute[a:key] - - " remove and insert the complete macro - " - if a:0 == 0 - let val = C_ExpandUserMacros (a:key) - if val == "" - return - endif - let val = C_ExpandSingleMacro( val, '', '' ) - - if mode == 'below' - call C_OpenFold('below') - let pos1 = line(".")+1 - put =val - let pos2 = line(".") - " proper indenting - exe ":".pos1 - let ins = pos2-pos1+1 - exe "normal ".ins."==" - " - elseif mode == 'above' - let pos1 = line(".") - put! =val - let pos2 = line(".") - " proper indenting - exe ":".pos1 - let ins = pos2-pos1+1 - exe "normal ".ins."==" - " - elseif mode == 'start' - normal gg - call C_OpenFold('start') - let pos1 = 1 - put! =val - let pos2 = line(".") - " proper indenting - exe ":".pos1 - let ins = pos2-pos1+1 - exe "normal ".ins."==" - " - elseif mode == 'append' - if &foldenable && foldclosed(".") >= 0 - echohl WarningMsg | echomsg s:MsgInsNotAvail | echohl None - exe "set foldmethod=".foldmethod_save - return - else - let pos1 = line(".") - put =val - let pos2 = line(".")-1 - exe ":".pos1 - :join! - endif - " - elseif mode == 'insert' - if &foldenable && foldclosed(".") >= 0 - echohl WarningMsg | echomsg s:MsgInsNotAvail | echohl None - exe "set foldmethod=".foldmethod_save - return - else - let val = substitute( val, '\n$', '', '' ) - let currentline = getline( "." ) - let pos1 = line(".") - let pos2 = pos1 + count( split(val,'\zs'), "\n" ) - " assign to the unnamed register "" : - let @"=val - normal p - " reformat only multiline inserts and previously empty lines - if pos2-pos1 > 0 || currentline =~ '' - exe ":".pos1 - let ins = pos2-pos1+1 - exe "normal ".ins."==" - endif - endif - " - endif - " - else - " - " ===== visual mode =============================== - " - if a:1 == 'v' - let val = C_ExpandUserMacros (a:key) - let val = C_ExpandSingleMacro( val, s:C_TemplateJumpTarget2, '' ) - if val == "" - return - endif - - if match( val, '\s*\n' ) >= 0 - let part = split( val, '\s*\n' ) - else - let part = split( val, '' ) - endif - - if len(part) < 2 - let part = [ "" ] + part - echomsg 'SPLIT missing in template '.a:key - endif - " - " 'visual' and mode 'insert': - " - " part0 and part1 can consist of several lines - " - if mode == 'insert' - let pos1 = line(".") - let pos2 = pos1 - let string= @* - let replacement = part[0].string.part[1] - " remove trailing '\n' - let replacement = substitute( replacement, '\n$', '', '' ) - exe ':s/'.string.'/'.replacement.'/' - endif - " - " 'visual' and mode 'below': - " - " - " - " part0 and part1 can consist of several lines - " - if mode == 'below' - - :'put =part[1] - - let pos1 = line("'<") - len(split(part[0], '\n' )) - let pos2 = line("'>") + len(split(part[1], '\n' )) - "" echo part[0] part[1] pos1 pos2 - " " proper indenting - exe ":".pos1 - let ins = pos2-pos1+1 - exe "normal ".ins."==" - endif - " - endif " ---------- end visual mode - endif - - " restore formatter programm - let &equalprg = equalprg_save - - "------------------------------------------------------------------------------ - " position the cursor - "------------------------------------------------------------------------------ - exe ":".pos1 - let mtch = search( '\|{CURSOR}', 'c', pos2 ) - if mtch != 0 - let line = getline(mtch) - if line =~ '\|{CURSOR}$' - call setline( mtch, substitute( line, '\|{CURSOR}', '', '' ) ) - if a:0 != 0 && a:1 == 'v' && getline(".") =~ '^\s*$' - normal J - else - if getpos(".")[2] < len(getline(".")) || mode == 'insert' - :startinsert - else - :startinsert! - endif - endif - else - call setline( mtch, substitute( line, '\|{CURSOR}', '', '' ) ) - :startinsert - endif - else - " to the end of the block; needed for repeated inserts - if mode == 'below' - exe ":".pos2 - endif - endif - - "------------------------------------------------------------------------------ - " marked words - "------------------------------------------------------------------------------ - " define a pattern to highlight - call C_HighlightJumpTargets () - - if &foldenable - " restore folding method - exe "set foldmethod=".foldmethod_save - normal zv - endif - -endfunction " ---------- end of function C_InsertTemplate ---------- - -"------------------------------------------------------------------------------ -" C_HighlightJumpTargets -"------------------------------------------------------------------------------ -function! C_HighlightJumpTargets () - if s:C_Ctrl_j == 'on' - exe 'match Search /'.s:C_TemplateJumpTarget1.'\|'.s:C_TemplateJumpTarget2.'/' - endif -endfunction " ---------- end of function C_HighlightJumpTargets ---------- - -"------------------------------------------------------------------------------ -" C_JumpCtrlJ {{{1 -"------------------------------------------------------------------------------ -function! C_JumpCtrlJ () - let match = search( s:C_TemplateJumpTarget1.'\|'.s:C_TemplateJumpTarget2, 'c' ) - if match > 0 - " remove the target - call setline( match, substitute( getline('.'), s:C_TemplateJumpTarget1.'\|'.s:C_TemplateJumpTarget2, '', '' ) ) - else - " try to jump behind parenthesis or strings in the current line - if match( getline(".")[col(".") - 1], "[\]})\"'`]" ) != 0 - call search( "[\]})\"'`]", '', line(".") ) - endif - normal l - endif - return '' -endfunction " ---------- end of function C_JumpCtrlJ ---------- - -"------------------------------------------------------------------------------ -" C_ExpandUserMacros {{{1 -"------------------------------------------------------------------------------ -function! C_ExpandUserMacros ( key ) - - if has_key( s:C_Template[s:C_ActualStyle], a:key ) - let template = s:C_Template[s:C_ActualStyle][ a:key ] - else - let template = s:C_Template['default'][ a:key ] - endif - let s:C_ExpansionCounter = {} " reset the expansion counter - - "------------------------------------------------------------------------------ - " renew the predefined macros and expand them - " can be replaced, with e.g. |?DATE| - "------------------------------------------------------------------------------ - let s:C_Macro['|BASENAME|'] = toupper(expand("%:t:r")) - let s:C_Macro['|DATE|'] = C_DateAndTime('d') - let s:C_Macro['|FILENAME|'] = expand("%:t") - let s:C_Macro['|PATH|'] = expand("%:p:h") - let s:C_Macro['|SUFFIX|'] = expand("%:e") - let s:C_Macro['|TIME|'] = C_DateAndTime('t') - let s:C_Macro['|YEAR|'] = C_DateAndTime('y') - - "------------------------------------------------------------------------------ - " delete jump targets if mapping for C-j is off - "------------------------------------------------------------------------------ - if s:C_Ctrl_j == 'off' - let template = substitute( template, s:C_TemplateJumpTarget1.'\|'.s:C_TemplateJumpTarget2, '', 'g' ) - endif - - "------------------------------------------------------------------------------ - " look for replacements - "------------------------------------------------------------------------------ - while match( template, s:C_ExpansionRegex ) != -1 - let macro = matchstr( template, s:C_ExpansionRegex ) - let replacement = substitute( macro, '?', '', '' ) - let template = substitute( template, macro, replacement, "g" ) - - let match = matchlist( macro, s:C_ExpansionRegex ) - - if match[1] != '' - let macroname = '|'.match[1].'|' - " - " notify flag action, if any - let flagaction = '' - if has_key( s:C_MacroFlag, match[2] ) - let flagaction = ' (-> '.s:C_MacroFlag[ match[2] ].')' - endif - " - " ask for a replacement - if has_key( s:C_Macro, macroname ) - let name = C_Input( match[1].flagaction.' : ', C_ApplyFlag( s:C_Macro[macroname], match[2] ) ) - else - let name = C_Input( match[1].flagaction.' : ', '' ) - endif - if name == "" - return "" - endif - " - " keep the modified name - let s:C_Macro[macroname] = C_ApplyFlag( name, match[2] ) - endif - endwhile - - "------------------------------------------------------------------------------ - " do the actual macro expansion - " loop over the macros found in the template - "------------------------------------------------------------------------------ - while match( template, s:C_NonExpansionRegex ) != -1 - - let macro = matchstr( template, s:C_NonExpansionRegex ) - let match = matchlist( macro, s:C_NonExpansionRegex ) - - if match[1] != '' - let macroname = '|'.match[1].'|' - - if has_key( s:C_Macro, macroname ) - "------------------------------------------------------------------------------- - " check for recursion - "------------------------------------------------------------------------------- - if has_key( s:C_ExpansionCounter, macroname ) - let s:C_ExpansionCounter[macroname] += 1 - else - let s:C_ExpansionCounter[macroname] = 0 - endif - if s:C_ExpansionCounter[macroname] >= s:C_ExpansionLimit - echomsg " recursion terminated for recursive macro ".macroname - return template - endif - "------------------------------------------------------------------------------- - " replace - "------------------------------------------------------------------------------- - let replacement = C_ApplyFlag( s:C_Macro[macroname], match[2] ) - let template = substitute( template, macro, replacement, "g" ) - else - " - " macro not yet defined - let s:C_Macro['|'.match[1].'|'] = '' - endif - endif - - endwhile - - return template -endfunction " ---------- end of function C_ExpandUserMacros ---------- - -"------------------------------------------------------------------------------ -" C_ApplyFlag {{{1 -"------------------------------------------------------------------------------ -function! C_ApplyFlag ( val, flag ) - " - " l : lowercase - if a:flag == ':l' - return tolower(a:val) - endif - " - " u : uppercase - if a:flag == ':u' - return toupper(a:val) - endif - " - " c : capitalize - if a:flag == ':c' - return toupper(a:val[0]).a:val[1:] - endif - " - " L : legalized name - if a:flag == ':L' - return C_LegalizeName(a:val) - endif - " - " flag not valid - return a:val -endfunction " ---------- end of function C_ApplyFlag ---------- -" -"------------------------------------------------------------------------------ -" C_ExpandSingleMacro {{{1 -"------------------------------------------------------------------------------ -function! C_ExpandSingleMacro ( val, macroname, replacement ) - return substitute( a:val, escape(a:macroname, '$' ), a:replacement, "g" ) -endfunction " ---------- end of function C_ExpandSingleMacro ---------- - -"------------------------------------------------------------------------------ -" C_SetSmallCommentStyle {{{1 -"------------------------------------------------------------------------------ -function! C_SetSmallCommentStyle () - if has_key( s:C_Template, 'comment.end-of-line-comment' ) - if match( s:C_Template['comment.end-of-line-comment'], '^\s*/\*' ) != -1 - let s:C_Com1 = '/*' " C-style : comment start - let s:C_Com2 = '*/' " C-style : comment end - else - let s:C_Com1 = '//' " C++style : comment start - let s:C_Com2 = '' " C++style : comment end - endif - endif -endfunction " ---------- end of function C_SetSmallCommentStyle ---------- - -"------------------------------------------------------------------------------ -" C_InsertMacroValue {{{1 -"------------------------------------------------------------------------------ -function! C_InsertMacroValue ( key ) - if s:C_Macro['|'.a:key.'|'] == '' - echomsg 'the tag |'.a:key.'| is empty' - return - endif - " - if &foldenable && foldclosed(".") >= 0 - echohl WarningMsg | echomsg s:MsgInsNotAvail | echohl None - return - endif - if col(".") > 1 - exe 'normal a'.s:C_Macro['|'.a:key.'|'] - else - exe 'normal i'.s:C_Macro['|'.a:key.'|'] - endif -endfunction " ---------- end of function C_InsertMacroValue ---------- - -"------------------------------------------------------------------------------ -" insert date and time {{{1 -"------------------------------------------------------------------------------ -function! C_InsertDateAndTime ( format ) - if &foldenable && foldclosed(".") >= 0 - echohl WarningMsg | echomsg s:MsgInsNotAvail | echohl None - return "" - endif - if col(".") > 1 - exe 'normal a'.C_DateAndTime(a:format) - else - exe 'normal i'.C_DateAndTime(a:format) - endif -endfunction " ---------- end of function C_InsertDateAndTime ---------- - -"------------------------------------------------------------------------------ -" generate date and time {{{1 -"------------------------------------------------------------------------------ -function! C_DateAndTime ( format ) - if a:format == 'd' - return strftime( s:C_FormatDate ) - elseif a:format == 't' - return strftime( s:C_FormatTime ) - elseif a:format == 'dt' - return strftime( s:C_FormatDate ).' '.strftime( s:C_FormatTime ) - elseif a:format == 'y' - return strftime( s:C_FormatYear ) - endif -endfunction " ---------- end of function C_DateAndTime ---------- - -"------------------------------------------------------------------------------ -" check for header or implementation file {{{1 -"------------------------------------------------------------------------------ -function! C_InsertTemplateWrapper () - if index( s:C_SourceCodeExtensionsList, expand('%:e') ) >= 0 - call C_InsertTemplate("comment.file-description") - else - call C_InsertTemplate("comment.file-description-header") - endif -endfunction " ---------- end of function C_InsertTemplateWrapper ---------- - -" -"------------------------------------------------------------------------------- -" Comment : C/C++ File Sections {{{1 -"------------------------------------------------------------------------------- -let s:CFileSection = { - \ "Header\ File\ Includes" : "file-section-cpp-header-includes" , - \ "Local\ Macros" : "file-section-cpp-macros" , - \ "Local\ Type\ Def\." : "file-section-cpp-typedefs" , - \ "Local\ Data\ Types" : "file-section-cpp-data-types" , - \ "Local\ Variables" : "file-section-cpp-local-variables" , - \ "Local\ Prototypes" : "file-section-cpp-prototypes" , - \ "Exp\.\ Function\ Def\." : "file-section-cpp-function-defs-exported" , - \ "Local\ Function\ Def\." : "file-section-cpp-function-defs-local" , - \ "Local\ Class\ Def\." : "file-section-cpp-class-defs" , - \ "Exp\.\ Class\ Impl\." : "file-section-cpp-class-implementations-exported", - \ "Local\ Class\ Impl\." : "file-section-cpp-class-implementations-local" , - \ "All\ sections,\ C" : "c", - \ "All\ sections,\ C++" : "cpp", - \ } - -function! C_CFileSectionList ( ArgLead, CmdLine, CursorPos ) - return filter( copy( sort(keys( s:CFileSection)) ), 'v:val =~ "\\<'.a:ArgLead.'\\w*"' ) -endfunction " ---------- end of function C_CFileSectionList ---------- - -function! C_CFileSectionListInsert ( arg ) - if has_key( s:CFileSection, a:arg ) - if s:CFileSection[a:arg] == 'c' || s:CFileSection[a:arg] == 'cpp' - call C_Comment_C_SectionAll( 'comment.'.s:CFileSection[a:arg] ) - return - endif - call C_InsertTemplate( 'comment.'.s:CFileSection[a:arg] ) - else - echomsg "entry ".a:arg." does not exist" - endif -endfunction " ---------- end of function C_CFileSectionListInsert ---------- -" -"------------------------------------------------------------------------------- -" Comment : H File Sections {{{1 -"------------------------------------------------------------------------------- -let s:HFileSection = { - \ "Header\ File\ Includes" : "file-section-hpp-header-includes" , - \ "Exported\ Macros" : "file-section-hpp-macros" , - \ "Exported\ Type\ Def\." : "file-section-hpp-exported-typedefs" , - \ "Exported\ Data\ Types" : "file-section-hpp-exported-data-types" , - \ "Exported\ Variables" : "file-section-hpp-exported-variables" , - \ "Exported\ Funct\.\ Decl\." : "file-section-hpp-exported-function-declarations", - \ "Exported\ Class\ Def\." : "file-section-hpp-exported-class-defs" , - \ "All\ sections,\ C" : "c" , - \ "All\ sections,\ C++" : "cpp" , - \ } - -function! C_HFileSectionList ( ArgLead, CmdLine, CursorPos ) - return filter( copy( sort(keys( s:HFileSection)) ), 'v:val =~ "\\<'.a:ArgLead.'\\w*"' ) -endfunction " ---------- end of function C_HFileSectionList ---------- - -function! C_HFileSectionListInsert ( arg ) - if has_key( s:HFileSection, a:arg ) - if s:HFileSection[a:arg] == 'c' || s:HFileSection[a:arg] == 'cpp' - call C_Comment_C_SectionAll( 'comment.'.s:HFileSection[a:arg] ) - return - endif - call C_InsertTemplate( 'comment.'.s:HFileSection[a:arg] ) - else - echomsg "entry ".a:arg." does not exist" - endif -endfunction " ---------- end of function C_HFileSectionListInsert ---------- -" -"------------------------------------------------------------------------------- -" Comment : Keyword Comments {{{1 -"------------------------------------------------------------------------------- -let s:KeywordComment = { - \ 'BUG' : 'keyword-bug', - \ 'COMPILER' : 'keyword-compiler', - \ 'TODO' : 'keyword-todo', - \ 'TRICKY' : 'keyword-tricky', - \ 'WARNING' : 'keyword-warning', - \ 'WORKAROUND' : 'keyword-workaround', - \ 'new\ keyword' : 'keyword-keyword', - \ } - -function! C_KeywordCommentList ( ArgLead, CmdLine, CursorPos ) - return filter( copy( sort(keys( s:KeywordComment)) ), 'v:val =~ "\\<'.a:ArgLead.'\\w*"' ) -endfunction " ---------- end of function C_KeywordCommentList ---------- - -function! C_KeywordCommentListInsert ( arg ) - if has_key( s:KeywordComment, a:arg ) - if s:KeywordComment[a:arg] == 'c' || s:KeywordComment[a:arg] == 'cpp' - call C_Comment_C_SectionAll( 'comment.'.s:KeywordComment[a:arg] ) - return - endif - call C_InsertTemplate( 'comment.'.s:KeywordComment[a:arg] ) - else - echomsg "entry ".a:arg." does not exist" - endif -endfunction " ---------- end of function C_KeywordCommentListInsert ---------- -" -"------------------------------------------------------------------------------- -" Comment : Special Comments {{{1 -"------------------------------------------------------------------------------- -let s:SpecialComment = { - \ 'EMPTY' : 'special-empty' , - \ 'FALL\ THROUGH' : 'special-fall-through' , - \ 'IMPL\.\ TYPE\ CONV' : 'special-implicit-type-conversion")' , - \ 'NO\ RETURN' : 'special-no-return' , - \ 'NOT\ REACHED' : 'special-not-reached' , - \ 'TO\ BE\ IMPL\.' : 'special-remains-to-be-implemented' , - \ 'constant\ type\ is\ long\ (L)' : 'special-constant-type-is-long' , - \ 'constant\ type\ is\ unsigned\ (U)' : 'special-constant-type-is-unsigned' , - \ 'constant\ type\ is\ unsigned\ long\ (UL)' : 'special-constant-type-is-unsigned-long' , - \ } - -function! C_SpecialCommentList ( ArgLead, CmdLine, CursorPos ) - return filter( copy( sort(keys( s:SpecialComment)) ), 'v:val =~ "\\<'.a:ArgLead.'\\w*"' ) -endfunction " ---------- end of function C_SpecialCommentList ---------- - -function! C_SpecialCommentListInsert ( arg ) - if has_key( s:SpecialComment, a:arg ) - if s:SpecialComment[a:arg] == 'c' || s:SpecialComment[a:arg] == 'cpp' - call C_Comment_C_SectionAll( 'comment.'.s:SpecialComment[a:arg] ) - return - endif - call C_InsertTemplate( 'comment.'.s:SpecialComment[a:arg] ) - else - echomsg "entry ".a:arg." does not exist" - endif -endfunction " ---------- end of function C_SpecialCommentListInsert ---------- - -"------------------------------------------------------------------------------- -" Standard Library Includes -"------------------------------------------------------------------------------- -function! C_CleanDirNameList ( list ) - let result = copy( a:list ) - let index = 0 - while index < len( result ) - let result[index] = substitute( result[index], '[&\\]', '', 'g' ) - let index = index + 1 - endwhile - return result -endfunction " ---------- end of function C_CleanDirNameList ---------- - -let s:C_StandardLibsClean = C_CleanDirNameList( s:C_StandardLibs ) -let s:C_C99LibsClean = C_CleanDirNameList( s:C_C99Libs ) -let s:Cpp_StandardLibsClean = C_CleanDirNameList( s:Cpp_StandardLibs ) -let s:Cpp_CStandardLibsClean = C_CleanDirNameList( s:Cpp_CStandardLibs ) - -"------------------------------------------------------------------------------- -" callback functions used in the filetype plugin ftplugin/c.vim -" callback functions -"------------------------------------------------------------------------------- - -function! C_IncludesInsert ( arg, List ) - if index( a:List, a:arg ) >= 0 - let zz = "#include\t<".a:arg.'>' - put =zz - else - echomsg "entry ".a:arg." does not exist" - endif -endfunction " ---------- end of function C_IncludesInsert -" -function! C_StdLibraryIncludesInsert ( arg ) - call C_IncludesInsert ( a:arg, s:C_StandardLibsClean ) -endfunction " ---------- end of function C_StdLibraryIncludesInsert - -function! C_C99LibraryIncludesInsert ( arg ) - call C_IncludesInsert ( a:arg, s:C_C99LibsClean ) -endfunction " ---------- end of function C_C99LibraryIncludesInsert - -function! C_CppLibraryIncludesInsert ( arg ) - call C_IncludesInsert ( a:arg, s:Cpp_StandardLibsClean ) -endfunction " ---------- end of function C_CppLibraryIncludesInsert - -function! C_CppCLibraryIncludesInsert ( arg ) - call C_IncludesInsert ( a:arg, s:Cpp_CStandardLibsClean ) -endfunction " ---------- end of function C_CppCLibraryIncludesInsert - -"------------------------------------------------------------------------------- -" callback functions used in the filetype plugin ftplugin/c.vim -" custom completion -"------------------------------------------------------------------------------- - -function! C_IncludesList ( ArgLead, CmdLine, CursorPos, List ) - " show all libs - if a:ArgLead == '' - return a:List - endif - " show libs beginning with a:ArgLead - let expansions = [] - for item in a:List - if match( item, '\<'.a:ArgLead.'\w*' ) == 0 - call add( expansions, item ) - endif - endfor - return expansions -endfunction " ---------- end of function C_IncludesList ---------- -" -function! C_StdLibraryIncludesList ( ArgLead, CmdLine, CursorPos ) - return C_IncludesList ( a:ArgLead, a:CmdLine, a:CursorPos, s:C_StandardLibsClean ) -endfunction " ---------- end of function C_StdLibraryIncludesList ---------- - -function! C_C99LibraryIncludesList ( ArgLead, CmdLine, CursorPos ) - return C_IncludesList ( a:ArgLead, a:CmdLine, a:CursorPos, s:C_C99LibsClean ) -endfunction " ---------- end of function C_C99LibraryIncludesList ---------- - -function! C_CppLibraryIncludesList ( ArgLead, CmdLine, CursorPos ) - return C_IncludesList ( a:ArgLead, a:CmdLine, a:CursorPos, s:Cpp_StandardLibsClean ) -endfunction " ---------- end of function C_CppLibraryIncludesList ---------- - -function! C_CppCLibraryIncludesList ( ArgLead, CmdLine, CursorPos ) - return C_IncludesList ( a:ArgLead, a:CmdLine, a:CursorPos, s:Cpp_CStandardLibsClean ) -endfunction " ---------- end of function C_CppCLibraryIncludesList ---------- - -"------------------------------------------------------------------------------ -" show / hide the c-support menus -" define key mappings (gVim only) -"------------------------------------------------------------------------------ -" -if has("gui_running") - " - call C_ToolMenu() - " - if s:C_LoadMenus == 'yes' - call C_CreateGuiMenus() - endif - " - nmap lcs :call C_CreateGuiMenus() - nmap ucs :call C_RemoveGuiMenus() - " -endif - -"------------------------------------------------------------------------------ -" Automated header insertion -" Local settings for the quickfix window -"------------------------------------------------------------------------------ - -if has("autocmd") - " - " Automated header insertion (suffixes from the gcc manual) - " - if !exists( 'g:C_Styles' ) - "------------------------------------------------------------------------------- - " template styles are the default settings - "------------------------------------------------------------------------------- - autocmd BufNewFile * if (&filetype=='cpp' || &filetype=='c') | - \ call C_InsertTemplateWrapper() | endif - " - " *.h has filetype 'cpp' by default; this can be changed to 'c' : - " - if s:C_TypeOfH=='c' - autocmd BufNewFile,BufEnter *.h :set filetype=c - endif - " - " C/C++ source code files which should not be preprocessed. - " - autocmd BufNewFile,BufRead *.i :set filetype=c - autocmd BufNewFile,BufRead *.ii :set filetype=cpp - " - else - "------------------------------------------------------------------------------- - " template styles are related to file extensions - "------------------------------------------------------------------------------- - for [ pattern, stl ] in items( g:C_Styles ) - exe "autocmd BufNewFile,BufRead,BufEnter ".pattern." call C_Style( '".stl."' )" - exe "autocmd BufNewFile ".pattern." call C_InsertTemplateWrapper() | :w!" - endfor - " - endif - " - " Wrap error descriptions in the quickfix window. - " - autocmd BufReadPost quickfix setlocal wrap | setlocal linebreak - " - exe 'autocmd BufRead *.'.join( s:C_SourceCodeExtensionsList, '\|*.' ) - \ .' call C_HighlightJumpTargets()' - " -endif " has("autocmd") -" -"------------------------------------------------------------------------------ -" READ THE TEMPLATE FILES -"------------------------------------------------------------------------------ -call C_ReadTemplates(s:C_GlobalTemplateFile) -if s:installation == 'system' && filereadable( s:C_LocalTemplateFile ) - call C_ReadTemplates( s:C_LocalTemplateFile ) -endif -" -"===================================================================================== -" vim: tabstop=2 shiftwidth=2 foldmethod=marker diff --git a/vim_old/plugin/snipMate.vim b/vim_old/plugin/snipMate.vim deleted file mode 100644 index 3efee2a..0000000 --- a/vim_old/plugin/snipMate.vim +++ /dev/null @@ -1,247 +0,0 @@ -" File: snipMate.vim -" Author: Michael Sanders -" Last Updated: July 13, 2009 -" Version: 0.83 -" Description: snipMate.vim implements some of TextMate's snippets features in -" Vim. A snippet is a piece of often-typed text that you can -" insert into your document using a trigger word followed by a "". -" -" For more help see snipMate.txt; you can do this by using: -" :helptags ~/.vim/doc -" :h snipMate.txt - -if exists('loaded_snips') || &cp || version < 700 - finish -endif -let loaded_snips = 1 -if !exists('snips_author') | let snips_author = 'Me' | endif - -au BufRead,BufNewFile *.snippets\= set ft=snippet -au FileType snippet setl noet fdm=indent - -let s:snippets = {} | let s:multi_snips = {} - -if !exists('snippets_dir') - let snippets_dir = substitute(globpath(&rtp, 'snippets/'), "\n", ',', 'g') -endif - -fun! MakeSnip(scope, trigger, content, ...) - let multisnip = a:0 && a:1 != '' - let var = multisnip ? 's:multi_snips' : 's:snippets' - if !has_key({var}, a:scope) | let {var}[a:scope] = {} | endif - if !has_key({var}[a:scope], a:trigger) - let {var}[a:scope][a:trigger] = multisnip ? [[a:1, a:content]] : a:content - elseif multisnip | let {var}[a:scope][a:trigger] += [[a:1, a:content]] - else - echom 'Warning in snipMate.vim: Snippet '.a:trigger.' is already defined.' - \ .' See :h multi_snip for help on snippets with multiple matches.' - endif -endf - -fun! ExtractSnips(dir, ft) - for path in split(globpath(a:dir, '*'), "\n") - if isdirectory(path) - let pathname = fnamemodify(path, ':t') - for snipFile in split(globpath(path, '*.snippet'), "\n") - call s:ProcessFile(snipFile, a:ft, pathname) - endfor - elseif fnamemodify(path, ':e') == 'snippet' - call s:ProcessFile(path, a:ft) - endif - endfor -endf - -" Processes a single-snippet file; optionally add the name of the parent -" directory for a snippet with multiple matches. -fun s:ProcessFile(file, ft, ...) - let keyword = fnamemodify(a:file, ':t:r') - if keyword == '' | return | endif - try - let text = join(readfile(a:file), "\n") - catch /E484/ - echom "Error in snipMate.vim: couldn't read file: ".a:file - endtry - return a:0 ? MakeSnip(a:ft, a:1, text, keyword) - \ : MakeSnip(a:ft, keyword, text) -endf - -fun! ExtractSnipsFile(file, ft) - if !filereadable(a:file) | return | endif - let text = readfile(a:file) - let inSnip = 0 - for line in text + ["\n"] - if inSnip && (line[0] == "\t" || line == '') - let content .= strpart(line, 1)."\n" - continue - elseif inSnip - call MakeSnip(a:ft, trigger, content[:-2], name) - let inSnip = 0 - endif - - if line[:6] == 'snippet' - let inSnip = 1 - let trigger = strpart(line, 8) - let name = '' - let space = stridx(trigger, ' ') + 1 - if space " Process multi snip - let name = strpart(trigger, space) - let trigger = strpart(trigger, 0, space - 1) - endif - let content = '' - endif - endfor -endf - -fun! ResetSnippets() - let s:snippets = {} | let s:multi_snips = {} | let g:did_ft = {} -endf - -let g:did_ft = {} -fun! GetSnippets(dir, filetypes) - for ft in split(a:filetypes, '\.') - if has_key(g:did_ft, ft) | continue | endif - call s:DefineSnips(a:dir, ft, ft) - if ft == 'objc' || ft == 'cpp' || ft == 'cs' - call s:DefineSnips(a:dir, 'c', ft) - elseif ft == 'xhtml' - call s:DefineSnips(a:dir, 'html', 'xhtml') - endif - let g:did_ft[ft] = 1 - endfor -endf - -" Define "aliasft" snippets for the filetype "realft". -fun s:DefineSnips(dir, aliasft, realft) - for path in split(globpath(a:dir, a:aliasft.'/')."\n". - \ globpath(a:dir, a:aliasft.'-*/'), "\n") - call ExtractSnips(path, a:realft) - endfor - for path in split(globpath(a:dir, a:aliasft.'.snippets')."\n". - \ globpath(a:dir, a:aliasft.'-*.snippets'), "\n") - call ExtractSnipsFile(path, a:realft) - endfor -endf - -fun! TriggerSnippet() - if exists('g:SuperTabMappingForward') - if g:SuperTabMappingForward == "" - let SuperTabKey = "\" - elseif g:SuperTabMappingBackward == "" - let SuperTabKey = "\" - endif - endif - - if pumvisible() " Update snippet if completion is used, or deal with supertab - if exists('SuperTabKey') - call feedkeys(SuperTabKey) | return '' - endif - call feedkeys("\a", 'n') " Close completion menu - call feedkeys("\") | return '' - endif - - if exists('g:snipPos') | return snipMate#jumpTabStop(0) | endif - - let word = matchstr(getline('.'), '\S\+\%'.col('.').'c') - for scope in [bufnr('%')] + split(&ft, '\.') + ['_'] - let [trigger, snippet] = s:GetSnippet(word, scope) - " If word is a trigger for a snippet, delete the trigger & expand - " the snippet. - if snippet != '' - let col = col('.') - len(trigger) - sil exe 's/\V'.escape(trigger, '/.').'\%#//' - return snipMate#expandSnip(snippet, col) - endif - endfor - - if exists('SuperTabKey') - call feedkeys(SuperTabKey) - return '' - endif - return "\" -endf - -fun! BackwardsSnippet() - if exists('g:snipPos') | return snipMate#jumpTabStop(1) | endif - - if exists('g:SuperTabMappingForward') - if g:SuperTabMappingBackward == "" - let SuperTabKey = "\" - elseif g:SuperTabMappingForward == "" - let SuperTabKey = "\" - endif - endif - if exists('SuperTabKey') - call feedkeys(SuperTabKey) - return '' - endif - return "\" -endf - -" Check if word under cursor is snippet trigger; if it isn't, try checking if -" the text after non-word characters is (e.g. check for "foo" in "bar.foo") -fun s:GetSnippet(word, scope) - let word = a:word | let snippet = '' - while snippet == '' - if exists('s:snippets["'.a:scope.'"]["'.escape(word, '\"').'"]') - let snippet = s:snippets[a:scope][word] - elseif exists('s:multi_snips["'.a:scope.'"]["'.escape(word, '\"').'"]') - let snippet = s:ChooseSnippet(a:scope, word) - if snippet == '' | break | endif - else - if match(word, '\W') == -1 | break | endif - let word = substitute(word, '.\{-}\W', '', '') - endif - endw - if word == '' && a:word != '.' && stridx(a:word, '.') != -1 - let [word, snippet] = s:GetSnippet('.', a:scope) - endif - return [word, snippet] -endf - -fun s:ChooseSnippet(scope, trigger) - let snippet = [] - let i = 1 - for snip in s:multi_snips[a:scope][a:trigger] - let snippet += [i.'. '.snip[0]] - let i += 1 - endfor - if i == 2 | return s:multi_snips[a:scope][a:trigger][0][1] | endif - let num = inputlist(snippet) - 1 - return num == -1 ? '' : s:multi_snips[a:scope][a:trigger][num][1] -endf - -fun! ShowAvailableSnips() - let line = getline('.') - let col = col('.') - let word = matchstr(getline('.'), '\S\+\%'.col.'c') - let words = [word] - if stridx(word, '.') - let words += split(word, '\.', 1) - endif - let matchlen = 0 - let matches = [] - for scope in [bufnr('%')] + split(&ft, '\.') + ['_'] - let triggers = has_key(s:snippets, scope) ? keys(s:snippets[scope]) : [] - if has_key(s:multi_snips, scope) - let triggers += keys(s:multi_snips[scope]) - endif - for trigger in triggers - for word in words - if word == '' - let matches += [trigger] " Show all matches if word is empty - elseif trigger =~ '^'.word - let matches += [trigger] - let len = len(word) - if len > matchlen | let matchlen = len | endif - endif - endfor - endfor - endfor - - " This is to avoid a bug with Vim when using complete(col - matchlen, matches) - " (Issue#46 on the Google Code snipMate issue tracker). - call setline(line('.'), substitute(line, repeat('.', matchlen).'\%'.col.'c', '', '')) - call complete(col, matches) - return '' -endf -" vim:noet:sw=4:ts=4:ft=vim diff --git a/vim_old/plugin/taglist.vim b/vim_old/plugin/taglist.vim deleted file mode 100644 index 59901f6..0000000 --- a/vim_old/plugin/taglist.vim +++ /dev/null @@ -1,4546 +0,0 @@ -" File: taglist.vim -" Author: Yegappan Lakshmanan (yegappan AT yahoo DOT com) -" Version: 4.5 -" Last Modified: September 21, 2007 -" Copyright: Copyright (C) 2002-2007 Yegappan Lakshmanan -" Permission is hereby granted to use and distribute this code, -" with or without modifications, provided that this copyright -" notice is copied with it. Like anything else that's free, -" taglist.vim is provided *as is* and comes with no warranty of any -" kind, either expressed or implied. In no event will the copyright -" holder be liable for any damamges resulting from the use of this -" software. -" -" The "Tag List" plugin is a source code browser plugin for Vim and provides -" an overview of the structure of the programming language files and allows -" you to efficiently browse through source code files for different -" programming languages. You can visit the taglist plugin home page for more -" information: -" -" http://vim-taglist.sourceforge.net -" -" You can subscribe to the taglist mailing list to post your questions -" or suggestions for improvement or to report bugs. Visit the following -" page for subscribing to the mailing list: -" -" http://groups.yahoo.com/group/taglist/ -" -" For more information about using this plugin, after installing the -" taglist plugin, use the ":help taglist" command. -" -" Installation -" ------------ -" 1. Download the taglist.zip file and unzip the files to the $HOME/.vim -" or the $HOME/vimfiles or the $VIM/vimfiles directory. This should -" unzip the following two files (the directory structure should be -" preserved): -" -" plugin/taglist.vim - main taglist plugin file -" doc/taglist.txt - documentation (help) file -" -" Refer to the 'add-plugin', 'add-global-plugin' and 'runtimepath' -" Vim help pages for more details about installing Vim plugins. -" 2. Change to the $HOME/.vim/doc or $HOME/vimfiles/doc or -" $VIM/vimfiles/doc directory, start Vim and run the ":helptags ." -" command to process the taglist help file. -" 3. If the exuberant ctags utility is not present in your PATH, then set the -" Tlist_Ctags_Cmd variable to point to the location of the exuberant ctags -" utility (not to the directory) in the .vimrc file. -" 4. If you are running a terminal/console version of Vim and the -" terminal doesn't support changing the window width then set the -" 'Tlist_Inc_Winwidth' variable to 0 in the .vimrc file. -" 5. Restart Vim. -" 6. You can now use the ":TlistToggle" command to open/close the taglist -" window. You can use the ":help taglist" command to get more -" information about using the taglist plugin. -" -" ****************** Do not modify after this line ************************ - -" Line continuation used here -let s:cpo_save = &cpo -set cpo&vim - -if !exists('loaded_taglist') - " First time loading the taglist plugin - " - " To speed up the loading of Vim, the taglist plugin uses autoload - " mechanism to load the taglist functions. - " Only define the configuration variables, user commands and some - " auto-commands and finish sourcing the file - - " The taglist plugin requires the built-in Vim system() function. If this - " function is not available, then don't load the plugin. - if !exists('*system') - echomsg 'Taglist: Vim system() built-in function is not available. ' . - \ 'Plugin is not loaded.' - let loaded_taglist = 'no' - let &cpo = s:cpo_save - finish - endif - - " Location of the exuberant ctags tool - if !exists('Tlist_Ctags_Cmd') - if executable('exuberant-ctags') - " On Debian Linux, exuberant ctags is installed - " as exuberant-ctags - let Tlist_Ctags_Cmd = 'exuberant-ctags' - elseif executable('exctags') - " On Free-BSD, exuberant ctags is installed as exctags - let Tlist_Ctags_Cmd = 'exctags' - elseif executable('ctags') - let Tlist_Ctags_Cmd = 'ctags' - elseif executable('ctags.exe') - let Tlist_Ctags_Cmd = 'ctags.exe' - elseif executable('tags') - let Tlist_Ctags_Cmd = 'tags' - else - echomsg 'Taglist: Exuberant ctags (http://ctags.sf.net) ' . - \ 'not found in PATH. Plugin is not loaded.' - " Skip loading the plugin - let loaded_taglist = 'no' - let &cpo = s:cpo_save - finish - endif - endif - - - " Automatically open the taglist window on Vim startup - if !exists('Tlist_Auto_Open') - let Tlist_Auto_Open = 0 - endif - - " When the taglist window is toggle opened, move the cursor to the - " taglist window - if !exists('Tlist_GainFocus_On_ToggleOpen') - let Tlist_GainFocus_On_ToggleOpen = 0 - endif - - " Process files even when the taglist window is not open - if !exists('Tlist_Process_File_Always') - let Tlist_Process_File_Always = 0 - endif - - if !exists('Tlist_Show_Menu') - let Tlist_Show_Menu = 0 - endif - - " Tag listing sort type - 'name' or 'order' - if !exists('Tlist_Sort_Type') - let Tlist_Sort_Type = 'order' - endif - - " Tag listing window split (horizontal/vertical) control - if !exists('Tlist_Use_Horiz_Window') - let Tlist_Use_Horiz_Window = 0 - endif - - " Open the vertically split taglist window on the left or on the right - " side. This setting is relevant only if Tlist_Use_Horiz_Window is set to - " zero (i.e. only for vertically split windows) - if !exists('Tlist_Use_Right_Window') - let Tlist_Use_Right_Window = 0 - endif - - " Increase Vim window width to display vertically split taglist window. - " For MS-Windows version of Vim running in a MS-DOS window, this must be - " set to 0 otherwise the system may hang due to a Vim limitation. - if !exists('Tlist_Inc_Winwidth') - if (has('win16') || has('win95')) && !has('gui_running') - let Tlist_Inc_Winwidth = 0 - else - let Tlist_Inc_Winwidth = 1 - endif - endif - - " Vertically split taglist window width setting - if !exists('Tlist_WinWidth') - let Tlist_WinWidth = 30 - endif - - " Horizontally split taglist window height setting - if !exists('Tlist_WinHeight') - let Tlist_WinHeight = 10 - endif - - " Display tag prototypes or tag names in the taglist window - if !exists('Tlist_Display_Prototype') - let Tlist_Display_Prototype = 0 - endif - - " Display tag scopes in the taglist window - if !exists('Tlist_Display_Tag_Scope') - let Tlist_Display_Tag_Scope = 1 - endif - - " Use single left mouse click to jump to a tag. By default this is disabled. - " Only double click using the mouse will be processed. - if !exists('Tlist_Use_SingleClick') - let Tlist_Use_SingleClick = 0 - endif - - " Control whether additional help is displayed as part of the taglist or - " not. Also, controls whether empty lines are used to separate the tag - " tree. - if !exists('Tlist_Compact_Format') - let Tlist_Compact_Format = 0 - endif - - " Exit Vim if only the taglist window is currently open. By default, this is - " set to zero. - if !exists('Tlist_Exit_OnlyWindow') - let Tlist_Exit_OnlyWindow = 0 - endif - - " Automatically close the folds for the non-active files in the taglist - " window - if !exists('Tlist_File_Fold_Auto_Close') - let Tlist_File_Fold_Auto_Close = 0 - endif - - " Close the taglist window when a tag is selected - if !exists('Tlist_Close_On_Select') - let Tlist_Close_On_Select = 0 - endif - - " Automatically update the taglist window to display tags for newly - " edited files - if !exists('Tlist_Auto_Update') - let Tlist_Auto_Update = 1 - endif - - " Automatically highlight the current tag - if !exists('Tlist_Auto_Highlight_Tag') - let Tlist_Auto_Highlight_Tag = 1 - endif - - " Automatically highlight the current tag on entering a buffer - if !exists('Tlist_Highlight_Tag_On_BufEnter') - let Tlist_Highlight_Tag_On_BufEnter = 1 - endif - - " Enable fold column to display the folding for the tag tree - if !exists('Tlist_Enable_Fold_Column') - let Tlist_Enable_Fold_Column = 1 - endif - - " Display the tags for only one file in the taglist window - if !exists('Tlist_Show_One_File') - let Tlist_Show_One_File = 0 - endif - - if !exists('Tlist_Max_Submenu_Items') - let Tlist_Max_Submenu_Items = 20 - endif - - if !exists('Tlist_Max_Tag_Length') - let Tlist_Max_Tag_Length = 10 - endif - - " Do not change the name of the taglist title variable. The winmanager - " plugin relies on this name to determine the title for the taglist - " plugin. - let TagList_title = "__Tag_List__" - - " Taglist debug messages - let s:tlist_msg = '' - - " Define the taglist autocommand to automatically open the taglist window - " on Vim startup - if g:Tlist_Auto_Open - autocmd VimEnter * nested call s:Tlist_Window_Check_Auto_Open() - endif - - " Refresh the taglist - if g:Tlist_Process_File_Always - autocmd BufEnter * call s:Tlist_Refresh() - endif - - if g:Tlist_Show_Menu - autocmd GUIEnter * call s:Tlist_Menu_Init() - endif - - " When the taglist buffer is created when loading a Vim session file, - " the taglist buffer needs to be initialized. The BufFilePost event - " is used to handle this case. - autocmd BufFilePost __Tag_List__ call s:Tlist_Vim_Session_Load() - - " Define the user commands to manage the taglist window - command! -nargs=0 -bar TlistToggle call s:Tlist_Window_Toggle() - command! -nargs=0 -bar TlistOpen call s:Tlist_Window_Open() - " For backwards compatiblity define the Tlist command - command! -nargs=0 -bar Tlist TlistToggle - command! -nargs=+ -complete=file TlistAddFiles - \ call s:Tlist_Add_Files() - command! -nargs=+ -complete=dir TlistAddFilesRecursive - \ call s:Tlist_Add_Files_Recursive() - command! -nargs=0 -bar TlistClose call s:Tlist_Window_Close() - command! -nargs=0 -bar TlistUpdate call s:Tlist_Update_Current_File() - command! -nargs=0 -bar TlistHighlightTag call s:Tlist_Window_Highlight_Tag( - \ fnamemodify(bufname('%'), ':p'), line('.'), 2, 1) - " For backwards compatiblity define the TlistSync command - command! -nargs=0 -bar TlistSync TlistHighlightTag - command! -nargs=* -complete=buffer TlistShowPrototype - \ echo Tlist_Get_Tag_Prototype_By_Line() - command! -nargs=* -complete=buffer TlistShowTag - \ echo Tlist_Get_Tagname_By_Line() - command! -nargs=* -complete=file TlistSessionLoad - \ call s:Tlist_Session_Load() - command! -nargs=* -complete=file TlistSessionSave - \ call s:Tlist_Session_Save() - command! -bar TlistLock let Tlist_Auto_Update=0 - command! -bar TlistUnlock let Tlist_Auto_Update=1 - - " Commands for enabling/disabling debug and to display debug messages - command! -nargs=? -complete=file -bar TlistDebug - \ call s:Tlist_Debug_Enable() - command! -nargs=0 -bar TlistUndebug call s:Tlist_Debug_Disable() - command! -nargs=0 -bar TlistMessages call s:Tlist_Debug_Show() - - " Define autocommands to autoload the taglist plugin when needed. - - " Trick to get the current script ID - map xx xx - let s:tlist_sid = substitute(maparg('xx'), '\(\d\+_\)xx$', - \ '\1', '') - unmap xx - - exe 'autocmd FuncUndefined *' . s:tlist_sid . 'Tlist_* source ' . - \ escape(expand(''), ' ') - exe 'autocmd FuncUndefined *' . s:tlist_sid . 'Tlist_Window_* source ' . - \ escape(expand(''), ' ') - exe 'autocmd FuncUndefined *' . s:tlist_sid . 'Tlist_Menu_* source ' . - \ escape(expand(''), ' ') - exe 'autocmd FuncUndefined Tlist_* source ' . - \ escape(expand(''), ' ') - exe 'autocmd FuncUndefined TagList_* source ' . - \ escape(expand(''), ' ') - - let loaded_taglist = 'fast_load_done' - - if g:Tlist_Show_Menu && has('gui_running') - call s:Tlist_Menu_Init() - endif - - " restore 'cpo' - let &cpo = s:cpo_save - finish -endif - -if !exists('s:tlist_sid') - " Two or more versions of taglist plugin are installed. Don't - " load this version of the plugin. - finish -endif - -unlet! s:tlist_sid - -if loaded_taglist != 'fast_load_done' - " restore 'cpo' - let &cpo = s:cpo_save - finish -endif - -" Taglist plugin functionality is available -let loaded_taglist = 'available' - -"------------------- end of user configurable options -------------------- - -" Default language specific settings for supported file types and tag types -" -" Variable name format: -" -" s:tlist_def_{vim_ftype}_settings -" -" vim_ftype - Filetype detected by Vim -" -" Value format: -" -" ;:;:;... -" -" ctags_ftype - File type supported by exuberant ctags -" flag - Flag supported by exuberant ctags to generate a tag type -" name - Name of the tag type used in the taglist window to display the -" tags of this type -" - -" assembly language -let s:tlist_def_asm_settings = 'asm;d:define;l:label;m:macro;t:type' - -" aspperl language -let s:tlist_def_aspperl_settings = 'asp;f:function;s:sub;v:variable' - -" aspvbs language -let s:tlist_def_aspvbs_settings = 'asp;f:function;s:sub;v:variable' - -" awk language -let s:tlist_def_awk_settings = 'awk;f:function' - -" beta language -let s:tlist_def_beta_settings = 'beta;f:fragment;s:slot;v:pattern' - -" c language -let s:tlist_def_c_settings = 'c;d:macro;g:enum;s:struct;u:union;t:typedef;' . - \ 'v:variable;f:function' - -" c++ language -let s:tlist_def_cpp_settings = 'c++;n:namespace;v:variable;d:macro;t:typedef;' . - \ 'c:class;g:enum;s:struct;u:union;f:function' - -" c# language -let s:tlist_def_cs_settings = 'c#;d:macro;t:typedef;n:namespace;c:class;' . - \ 'E:event;g:enum;s:struct;i:interface;' . - \ 'p:properties;m:method' - -" cobol language -let s:tlist_def_cobol_settings = 'cobol;d:data;f:file;g:group;p:paragraph;' . - \ 'P:program;s:section' - -" eiffel language -let s:tlist_def_eiffel_settings = 'eiffel;c:class;f:feature' - -" erlang language -let s:tlist_def_erlang_settings = 'erlang;d:macro;r:record;m:module;f:function' - -" expect (same as tcl) language -let s:tlist_def_expect_settings = 'tcl;c:class;f:method;p:procedure' - -" fortran language -let s:tlist_def_fortran_settings = 'fortran;p:program;b:block data;' . - \ 'c:common;e:entry;i:interface;k:type;l:label;m:module;' . - \ 'n:namelist;t:derived;v:variable;f:function;s:subroutine' - -" HTML language -let s:tlist_def_html_settings = 'html;a:anchor;f:javascript function' - -" java language -let s:tlist_def_java_settings = 'java;p:package;c:class;i:interface;' . - \ 'f:field;m:method' - -" javascript language -let s:tlist_def_javascript_settings = 'javascript;f:function' - -" lisp language -let s:tlist_def_lisp_settings = 'lisp;f:function' - -" lua language -let s:tlist_def_lua_settings = 'lua;f:function' - -" makefiles -let s:tlist_def_make_settings = 'make;m:macro' - -" pascal language -let s:tlist_def_pascal_settings = 'pascal;f:function;p:procedure' - -" perl language -let s:tlist_def_perl_settings = 'perl;c:constant;l:label;p:package;s:subroutine' - -" php language -let s:tlist_def_php_settings = 'php;c:class;d:constant;v:variable;f:function' - -" python language -let s:tlist_def_python_settings = 'python;c:class;m:member;f:function' - -" rexx language -let s:tlist_def_rexx_settings = 'rexx;s:subroutine' - -" ruby language -let s:tlist_def_ruby_settings = 'ruby;c:class;f:method;F:function;' . - \ 'm:singleton method' - -" scheme language -let s:tlist_def_scheme_settings = 'scheme;s:set;f:function' - -" shell language -let s:tlist_def_sh_settings = 'sh;f:function' - -" C shell language -let s:tlist_def_csh_settings = 'sh;f:function' - -" Z shell language -let s:tlist_def_zsh_settings = 'sh;f:function' - -" slang language -let s:tlist_def_slang_settings = 'slang;n:namespace;f:function' - -" sml language -let s:tlist_def_sml_settings = 'sml;e:exception;c:functor;s:signature;' . - \ 'r:structure;t:type;v:value;f:function' - -" sql language -let s:tlist_def_sql_settings = 'sql;c:cursor;F:field;P:package;r:record;' . - \ 's:subtype;t:table;T:trigger;v:variable;f:function;p:procedure' - -" tcl language -let s:tlist_def_tcl_settings = 'tcl;c:class;f:method;m:method;p:procedure' - -" vera language -let s:tlist_def_vera_settings = 'vera;c:class;d:macro;e:enumerator;' . - \ 'f:function;g:enum;m:member;p:program;' . - \ 'P:prototype;t:task;T:typedef;v:variable;' . - \ 'x:externvar' - -"verilog language -let s:tlist_def_verilog_settings = 'verilog;m:module;c:constant;P:parameter;' . - \ 'e:event;r:register;t:task;w:write;p:port;v:variable;f:function' - -" vim language -let s:tlist_def_vim_settings = 'vim;a:autocmds;v:variable;f:function' - -" yacc language -let s:tlist_def_yacc_settings = 'yacc;l:label' - -"------------------- end of language specific options -------------------- - -" Vim window size is changed by the taglist plugin or not -let s:tlist_winsize_chgd = -1 -" Taglist window is maximized or not -let s:tlist_win_maximized = 0 -" Name of files in the taglist -let s:tlist_file_names='' -" Number of files in the taglist -let s:tlist_file_count = 0 -" Number of filetypes supported by taglist -let s:tlist_ftype_count = 0 -" Is taglist part of other plugins like winmanager or cream? -let s:tlist_app_name = "none" -" Are we displaying brief help text -let s:tlist_brief_help = 1 -" List of files removed on user request -let s:tlist_removed_flist = "" -" Index of current file displayed in the taglist window -let s:tlist_cur_file_idx = -1 -" Taglist menu is empty or not -let s:tlist_menu_empty = 1 - -" An autocommand is used to refresh the taglist window when entering any -" buffer. We don't want to refresh the taglist window if we are entering the -" file window from one of the taglist functions. The 'Tlist_Skip_Refresh' -" variable is used to skip the refresh of the taglist window and is set -" and cleared appropriately. -let s:Tlist_Skip_Refresh = 0 - -" Tlist_Window_Display_Help() -function! s:Tlist_Window_Display_Help() - if s:tlist_app_name == "winmanager" - " To handle a bug in the winmanager plugin, add a space at the - " last line - call setline('$', ' ') - endif - - if s:tlist_brief_help - " Add the brief help - call append(0, '" Press to display help text') - else - " Add the extensive help - call append(0, '" : Jump to tag definition') - call append(1, '" o : Jump to tag definition in new window') - call append(2, '" p : Preview the tag definition') - call append(3, '" : Display tag prototype') - call append(4, '" u : Update tag list') - call append(5, '" s : Select sort field') - call append(6, '" d : Remove file from taglist') - call append(7, '" x : Zoom-out/Zoom-in taglist window') - call append(8, '" + : Open a fold') - call append(9, '" - : Close a fold') - call append(10, '" * : Open all folds') - call append(11, '" = : Close all folds') - call append(12, '" [[ : Move to the start of previous file') - call append(13, '" ]] : Move to the start of next file') - call append(14, '" q : Close the taglist window') - call append(15, '" : Remove help text') - endif -endfunction - -" Tlist_Window_Toggle_Help_Text() -" Toggle taglist plugin help text between the full version and the brief -" version -function! s:Tlist_Window_Toggle_Help_Text() - if g:Tlist_Compact_Format - " In compact display mode, do not display help - return - endif - - " Include the empty line displayed after the help text - let brief_help_size = 1 - let full_help_size = 16 - - setlocal modifiable - - " Set report option to a huge value to prevent informational messages - " while deleting the lines - let old_report = &report - set report=99999 - - " Remove the currently highlighted tag. Otherwise, the help text - " might be highlighted by mistake - match none - - " Toggle between brief and full help text - if s:tlist_brief_help - let s:tlist_brief_help = 0 - - " Remove the previous help - exe '1,' . brief_help_size . ' delete _' - - " Adjust the start/end line numbers for the files - call s:Tlist_Window_Update_Line_Offsets(0, 1, full_help_size - brief_help_size) - else - let s:tlist_brief_help = 1 - - " Remove the previous help - exe '1,' . full_help_size . ' delete _' - - " Adjust the start/end line numbers for the files - call s:Tlist_Window_Update_Line_Offsets(0, 0, full_help_size - brief_help_size) - endif - - call s:Tlist_Window_Display_Help() - - " Restore the report option - let &report = old_report - - setlocal nomodifiable -endfunction - -" Taglist debug support -let s:tlist_debug = 0 - -" File for storing the debug messages -let s:tlist_debug_file = '' - -" Tlist_Debug_Enable -" Enable logging of taglist debug messages. -function! s:Tlist_Debug_Enable(...) - let s:tlist_debug = 1 - - " Check whether a valid file name is supplied. - if a:1 != '' - let s:tlist_debug_file = fnamemodify(a:1, ':p') - - " Empty the log file - exe 'redir! > ' . s:tlist_debug_file - redir END - - " Check whether the log file is present/created - if !filewritable(s:tlist_debug_file) - call s:Tlist_Warning_Msg('Taglist: Unable to create log file ' - \ . s:tlist_debug_file) - let s:tlist_debug_file = '' - endif - endif -endfunction - -" Tlist_Debug_Disable -" Disable logging of taglist debug messages. -function! s:Tlist_Debug_Disable(...) - let s:tlist_debug = 0 - let s:tlist_debug_file = '' -endfunction - -" Tlist_Debug_Show -" Display the taglist debug messages in a new window -function! s:Tlist_Debug_Show() - if s:tlist_msg == '' - call s:Tlist_Warning_Msg('Taglist: No debug messages') - return - endif - - " Open a new window to display the taglist debug messages - new taglist_debug.txt - " Delete all the lines (if the buffer already exists) - silent! %delete _ - " Add the messages - silent! put =s:tlist_msg - " Move the cursor to the first line - normal! gg -endfunction - -" Tlist_Log_Msg -" Log the supplied debug message along with the time -function! s:Tlist_Log_Msg(msg) - if s:tlist_debug - if s:tlist_debug_file != '' - exe 'redir >> ' . s:tlist_debug_file - silent echon strftime('%H:%M:%S') . ': ' . a:msg . "\n" - redir END - else - " Log the message into a variable - " Retain only the last 3000 characters - let len = strlen(s:tlist_msg) - if len > 3000 - let s:tlist_msg = strpart(s:tlist_msg, len - 3000) - endif - let s:tlist_msg = s:tlist_msg . strftime('%H:%M:%S') . ': ' . - \ a:msg . "\n" - endif - endif -endfunction - -" Tlist_Warning_Msg() -" Display a message using WarningMsg highlight group -function! s:Tlist_Warning_Msg(msg) - echohl WarningMsg - echomsg a:msg - echohl None -endfunction - -" Last returned file index for file name lookup. -" Used to speed up file lookup -let s:tlist_file_name_idx_cache = -1 - -" Tlist_Get_File_Index() -" Return the index of the specified filename -function! s:Tlist_Get_File_Index(fname) - if s:tlist_file_count == 0 || a:fname == '' - return -1 - endif - - " If the new filename is same as the last accessed filename, then - " return that index - if s:tlist_file_name_idx_cache != -1 && - \ s:tlist_file_name_idx_cache < s:tlist_file_count - if s:tlist_{s:tlist_file_name_idx_cache}_filename == a:fname - " Same as the last accessed file - return s:tlist_file_name_idx_cache - endif - endif - - " First, check whether the filename is present - let s_fname = a:fname . "\n" - let i = stridx(s:tlist_file_names, s_fname) - if i == -1 - let s:tlist_file_name_idx_cache = -1 - return -1 - endif - - " Second, compute the file name index - let nl_txt = substitute(strpart(s:tlist_file_names, 0, i), "[^\n]", '', 'g') - let s:tlist_file_name_idx_cache = strlen(nl_txt) - return s:tlist_file_name_idx_cache -endfunction - -" Last returned file index for line number lookup. -" Used to speed up file lookup -let s:tlist_file_lnum_idx_cache = -1 - -" Tlist_Window_Get_File_Index_By_Linenum() -" Return the index of the filename present in the specified line number -" Line number refers to the line number in the taglist window -function! s:Tlist_Window_Get_File_Index_By_Linenum(lnum) - call s:Tlist_Log_Msg('Tlist_Window_Get_File_Index_By_Linenum (' . a:lnum . ')') - - " First try to see whether the new line number is within the range - " of the last returned file - if s:tlist_file_lnum_idx_cache != -1 && - \ s:tlist_file_lnum_idx_cache < s:tlist_file_count - if a:lnum >= s:tlist_{s:tlist_file_lnum_idx_cache}_start && - \ a:lnum <= s:tlist_{s:tlist_file_lnum_idx_cache}_end - return s:tlist_file_lnum_idx_cache - endif - endif - - let fidx = -1 - - if g:Tlist_Show_One_File - " Displaying only one file in the taglist window. Check whether - " the line is within the tags displayed for that file - if s:tlist_cur_file_idx != -1 - if a:lnum >= s:tlist_{s:tlist_cur_file_idx}_start - \ && a:lnum <= s:tlist_{s:tlist_cur_file_idx}_end - let fidx = s:tlist_cur_file_idx - endif - - endif - else - " Do a binary search in the taglist - let left = 0 - let right = s:tlist_file_count - 1 - - while left < right - let mid = (left + right) / 2 - - if a:lnum >= s:tlist_{mid}_start && a:lnum <= s:tlist_{mid}_end - let s:tlist_file_lnum_idx_cache = mid - return mid - endif - - if a:lnum < s:tlist_{mid}_start - let right = mid - 1 - else - let left = mid + 1 - endif - endwhile - - if left >= 0 && left < s:tlist_file_count - \ && a:lnum >= s:tlist_{left}_start - \ && a:lnum <= s:tlist_{left}_end - let fidx = left - endif - endif - - let s:tlist_file_lnum_idx_cache = fidx - - return fidx -endfunction - -" Tlist_Exe_Cmd_No_Acmds -" Execute the specified Ex command after disabling autocommands -function! s:Tlist_Exe_Cmd_No_Acmds(cmd) - let old_eventignore = &eventignore - set eventignore=all - exe a:cmd - let &eventignore = old_eventignore -endfunction - -" Tlist_Skip_File() -" Check whether tag listing is supported for the specified file -function! s:Tlist_Skip_File(filename, ftype) - " Skip buffers with no names and buffers with filetype not set - if a:filename == '' || a:ftype == '' - return 1 - endif - - " Skip files which are not supported by exuberant ctags - " First check whether default settings for this filetype are available. - " If it is not available, then check whether user specified settings are - " available. If both are not available, then don't list the tags for this - " filetype - let var = 's:tlist_def_' . a:ftype . '_settings' - if !exists(var) - let var = 'g:tlist_' . a:ftype . '_settings' - if !exists(var) - return 1 - endif - endif - - " Skip files which are not readable or files which are not yet stored - " to the disk - if !filereadable(a:filename) - return 1 - endif - - return 0 -endfunction - -" Tlist_User_Removed_File -" Returns 1 if a file is removed by a user from the taglist -function! s:Tlist_User_Removed_File(filename) - return stridx(s:tlist_removed_flist, a:filename . "\n") != -1 -endfunction - -" Tlist_Update_Remove_List -" Update the list of user removed files from the taglist -" add == 1, add the file to the removed list -" add == 0, delete the file from the removed list -function! s:Tlist_Update_Remove_List(filename, add) - if a:add - let s:tlist_removed_flist = s:tlist_removed_flist . a:filename . "\n" - else - let idx = stridx(s:tlist_removed_flist, a:filename . "\n") - let text_before = strpart(s:tlist_removed_flist, 0, idx) - let rem_text = strpart(s:tlist_removed_flist, idx) - let next_idx = stridx(rem_text, "\n") - let text_after = strpart(rem_text, next_idx + 1) - - let s:tlist_removed_flist = text_before . text_after - endif -endfunction - -" Tlist_FileType_Init -" Initialize the ctags arguments and tag variable for the specified -" file type -function! s:Tlist_FileType_Init(ftype) - call s:Tlist_Log_Msg('Tlist_FileType_Init (' . a:ftype . ')') - " If the user didn't specify any settings, then use the default - " ctags args. Otherwise, use the settings specified by the user - let var = 'g:tlist_' . a:ftype . '_settings' - if exists(var) - " User specified ctags arguments - let settings = {var} . ';' - else - " Default ctags arguments - let var = 's:tlist_def_' . a:ftype . '_settings' - if !exists(var) - " No default settings for this file type. This filetype is - " not supported - return 0 - endif - let settings = s:tlist_def_{a:ftype}_settings . ';' - endif - - let msg = 'Taglist: Invalid ctags option setting - ' . settings - - " Format of the option that specifies the filetype and ctags arugments: - " - " ;flag1:name1;flag2:name2;flag3:name3 - " - - " Extract the file type to pass to ctags. This may be different from the - " file type detected by Vim - let pos = stridx(settings, ';') - if pos == -1 - call s:Tlist_Warning_Msg(msg) - return 0 - endif - let ctags_ftype = strpart(settings, 0, pos) - if ctags_ftype == '' - call s:Tlist_Warning_Msg(msg) - return 0 - endif - " Make sure a valid filetype is supplied. If the user didn't specify a - " valid filetype, then the ctags option settings may be treated as the - " filetype - if ctags_ftype =~ ':' - call s:Tlist_Warning_Msg(msg) - return 0 - endif - - " Remove the file type from settings - let settings = strpart(settings, pos + 1) - if settings == '' - call s:Tlist_Warning_Msg(msg) - return 0 - endif - - " Process all the specified ctags flags. The format is - " flag1:name1;flag2:name2;flag3:name3 - let ctags_flags = '' - let cnt = 0 - while settings != '' - " Extract the flag - let pos = stridx(settings, ':') - if pos == -1 - call s:Tlist_Warning_Msg(msg) - return 0 - endif - let flag = strpart(settings, 0, pos) - if flag == '' - call s:Tlist_Warning_Msg(msg) - return 0 - endif - " Remove the flag from settings - let settings = strpart(settings, pos + 1) - - " Extract the tag type name - let pos = stridx(settings, ';') - if pos == -1 - call s:Tlist_Warning_Msg(msg) - return 0 - endif - let name = strpart(settings, 0, pos) - if name == '' - call s:Tlist_Warning_Msg(msg) - return 0 - endif - let settings = strpart(settings, pos + 1) - - let cnt = cnt + 1 - - let s:tlist_{a:ftype}_{cnt}_name = flag - let s:tlist_{a:ftype}_{cnt}_fullname = name - let ctags_flags = ctags_flags . flag - endwhile - - let s:tlist_{a:ftype}_ctags_args = '--language-force=' . ctags_ftype . - \ ' --' . ctags_ftype . '-types=' . ctags_flags - let s:tlist_{a:ftype}_count = cnt - let s:tlist_{a:ftype}_ctags_flags = ctags_flags - - " Save the filetype name - let s:tlist_ftype_{s:tlist_ftype_count}_name = a:ftype - let s:tlist_ftype_count = s:tlist_ftype_count + 1 - - return 1 -endfunction - -" Tlist_Detect_Filetype -" Determine the filetype for the specified file using the filetypedetect -" autocmd. -function! s:Tlist_Detect_Filetype(fname) - " Ignore the filetype autocommands - let old_eventignore = &eventignore - set eventignore=FileType - - " Save the 'filetype', as this will be changed temporarily - let old_filetype = &filetype - - " Run the filetypedetect group of autocommands to determine - " the filetype - exe 'doautocmd filetypedetect BufRead ' . a:fname - - " Save the detected filetype - let ftype = &filetype - - " Restore the previous state - let &filetype = old_filetype - let &eventignore = old_eventignore - - return ftype -endfunction - -" Tlist_Get_Buffer_Filetype -" Get the filetype for the specified buffer -function! s:Tlist_Get_Buffer_Filetype(bnum) - let buf_ft = getbufvar(a:bnum, '&filetype') - - if bufloaded(a:bnum) - " For loaded buffers, the 'filetype' is already determined - return buf_ft - endif - - " For unloaded buffers, if the 'filetype' option is set, return it - if buf_ft != '' - return buf_ft - endif - - " Skip non-existent buffers - if !bufexists(a:bnum) - return '' - endif - - " For buffers whose filetype is not yet determined, try to determine - " the filetype - let bname = bufname(a:bnum) - - return s:Tlist_Detect_Filetype(bname) -endfunction - -" Tlist_Discard_TagInfo -" Discard the stored tag information for a file -function! s:Tlist_Discard_TagInfo(fidx) - call s:Tlist_Log_Msg('Tlist_Discard_TagInfo (' . - \ s:tlist_{a:fidx}_filename . ')') - let ftype = s:tlist_{a:fidx}_filetype - - " Discard information about the tags defined in the file - let i = 1 - while i <= s:tlist_{a:fidx}_tag_count - let fidx_i = 's:tlist_' . a:fidx . '_' . i - unlet! {fidx_i}_tag - unlet! {fidx_i}_tag_name - unlet! {fidx_i}_tag_type - unlet! {fidx_i}_ttype_idx - unlet! {fidx_i}_tag_proto - unlet! {fidx_i}_tag_searchpat - unlet! {fidx_i}_tag_linenum - let i = i + 1 - endwhile - - let s:tlist_{a:fidx}_tag_count = 0 - - " Discard information about tag type groups - let i = 1 - while i <= s:tlist_{ftype}_count - let ttype = s:tlist_{ftype}_{i}_name - if s:tlist_{a:fidx}_{ttype} != '' - let fidx_ttype = 's:tlist_' . a:fidx . '_' . ttype - let {fidx_ttype} = '' - let {fidx_ttype}_offset = 0 - let cnt = {fidx_ttype}_count - let {fidx_ttype}_count = 0 - let j = 1 - while j <= cnt - unlet! {fidx_ttype}_{j} - let j = j + 1 - endwhile - endif - let i = i + 1 - endwhile - - " Discard the stored menu command also - let s:tlist_{a:fidx}_menu_cmd = '' -endfunction - -" Tlist_Window_Update_Line_Offsets -" Update the line offsets for tags for files starting from start_idx -" and displayed in the taglist window by the specified offset -function! s:Tlist_Window_Update_Line_Offsets(start_idx, increment, offset) - let i = a:start_idx - - while i < s:tlist_file_count - if s:tlist_{i}_visible - " Update the start/end line number only if the file is visible - if a:increment - let s:tlist_{i}_start = s:tlist_{i}_start + a:offset - let s:tlist_{i}_end = s:tlist_{i}_end + a:offset - else - let s:tlist_{i}_start = s:tlist_{i}_start - a:offset - let s:tlist_{i}_end = s:tlist_{i}_end - a:offset - endif - endif - let i = i + 1 - endwhile -endfunction - -" Tlist_Discard_FileInfo -" Discard the stored information for a file -function! s:Tlist_Discard_FileInfo(fidx) - call s:Tlist_Log_Msg('Tlist_Discard_FileInfo (' . - \ s:tlist_{a:fidx}_filename . ')') - call s:Tlist_Discard_TagInfo(a:fidx) - - let ftype = s:tlist_{a:fidx}_filetype - - let i = 1 - while i <= s:tlist_{ftype}_count - let ttype = s:tlist_{ftype}_{i}_name - unlet! s:tlist_{a:fidx}_{ttype} - unlet! s:tlist_{a:fidx}_{ttype}_offset - unlet! s:tlist_{a:fidx}_{ttype}_count - let i = i + 1 - endwhile - - unlet! s:tlist_{a:fidx}_filename - unlet! s:tlist_{a:fidx}_sort_type - unlet! s:tlist_{a:fidx}_filetype - unlet! s:tlist_{a:fidx}_mtime - unlet! s:tlist_{a:fidx}_start - unlet! s:tlist_{a:fidx}_end - unlet! s:tlist_{a:fidx}_valid - unlet! s:tlist_{a:fidx}_visible - unlet! s:tlist_{a:fidx}_tag_count - unlet! s:tlist_{a:fidx}_menu_cmd -endfunction - -" Tlist_Window_Remove_File_From_Display -" Remove the specified file from display -function! s:Tlist_Window_Remove_File_From_Display(fidx) - call s:Tlist_Log_Msg('Tlist_Window_Remove_File_From_Display (' . - \ s:tlist_{a:fidx}_filename . ')') - " If the file is not visible then no need to remove it - if !s:tlist_{a:fidx}_visible - return - endif - - " Remove the tags displayed for the specified file from the window - let start = s:tlist_{a:fidx}_start - " Include the empty line after the last line also - if g:Tlist_Compact_Format - let end = s:tlist_{a:fidx}_end - else - let end = s:tlist_{a:fidx}_end + 1 - endif - - setlocal modifiable - exe 'silent! ' . start . ',' . end . 'delete _' - setlocal nomodifiable - - " Correct the start and end line offsets for all the files following - " this file, as the tags for this file are removed - call s:Tlist_Window_Update_Line_Offsets(a:fidx + 1, 0, end - start + 1) -endfunction - -" Tlist_Remove_File -" Remove the file under the cursor or the specified file index -" user_request - User requested to remove the file from taglist -function! s:Tlist_Remove_File(file_idx, user_request) - let fidx = a:file_idx - - if fidx == -1 - let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(line('.')) - if fidx == -1 - return - endif - endif - call s:Tlist_Log_Msg('Tlist_Remove_File (' . - \ s:tlist_{fidx}_filename . ', ' . a:user_request . ')') - - let save_winnr = winnr() - let winnum = bufwinnr(g:TagList_title) - if winnum != -1 - " Taglist window is open, remove the file from display - - if save_winnr != winnum - let old_eventignore = &eventignore - set eventignore=all - exe winnum . 'wincmd w' - endif - - call s:Tlist_Window_Remove_File_From_Display(fidx) - - if save_winnr != winnum - exe save_winnr . 'wincmd w' - let &eventignore = old_eventignore - endif - endif - - let fname = s:tlist_{fidx}_filename - - if a:user_request - " As the user requested to remove the file from taglist, - " add it to the removed list - call s:Tlist_Update_Remove_List(fname, 1) - endif - - " Remove the file name from the taglist list of filenames - let idx = stridx(s:tlist_file_names, fname . "\n") - let text_before = strpart(s:tlist_file_names, 0, idx) - let rem_text = strpart(s:tlist_file_names, idx) - let next_idx = stridx(rem_text, "\n") - let text_after = strpart(rem_text, next_idx + 1) - let s:tlist_file_names = text_before . text_after - - call s:Tlist_Discard_FileInfo(fidx) - - " Shift all the file variables by one index - let i = fidx + 1 - - while i < s:tlist_file_count - let j = i - 1 - - let s:tlist_{j}_filename = s:tlist_{i}_filename - let s:tlist_{j}_sort_type = s:tlist_{i}_sort_type - let s:tlist_{j}_filetype = s:tlist_{i}_filetype - let s:tlist_{j}_mtime = s:tlist_{i}_mtime - let s:tlist_{j}_start = s:tlist_{i}_start - let s:tlist_{j}_end = s:tlist_{i}_end - let s:tlist_{j}_valid = s:tlist_{i}_valid - let s:tlist_{j}_visible = s:tlist_{i}_visible - let s:tlist_{j}_tag_count = s:tlist_{i}_tag_count - let s:tlist_{j}_menu_cmd = s:tlist_{i}_menu_cmd - - let k = 1 - while k <= s:tlist_{j}_tag_count - let s:tlist_{j}_{k}_tag = s:tlist_{i}_{k}_tag - let s:tlist_{j}_{k}_tag_name = s:tlist_{i}_{k}_tag_name - let s:tlist_{j}_{k}_tag_type = s:Tlist_Get_Tag_Type_By_Tag(i, k) - let s:tlist_{j}_{k}_ttype_idx = s:tlist_{i}_{k}_ttype_idx - let s:tlist_{j}_{k}_tag_proto = s:Tlist_Get_Tag_Prototype(i, k) - let s:tlist_{j}_{k}_tag_searchpat = s:Tlist_Get_Tag_SearchPat(i, k) - let s:tlist_{j}_{k}_tag_linenum = s:Tlist_Get_Tag_Linenum(i, k) - let k = k + 1 - endwhile - - let ftype = s:tlist_{i}_filetype - - let k = 1 - while k <= s:tlist_{ftype}_count - let ttype = s:tlist_{ftype}_{k}_name - let s:tlist_{j}_{ttype} = s:tlist_{i}_{ttype} - let s:tlist_{j}_{ttype}_offset = s:tlist_{i}_{ttype}_offset - let s:tlist_{j}_{ttype}_count = s:tlist_{i}_{ttype}_count - if s:tlist_{j}_{ttype} != '' - let l = 1 - while l <= s:tlist_{j}_{ttype}_count - let s:tlist_{j}_{ttype}_{l} = s:tlist_{i}_{ttype}_{l} - let l = l + 1 - endwhile - endif - let k = k + 1 - endwhile - - " As the file and tag information is copied to the new index, - " discard the previous information - call s:Tlist_Discard_FileInfo(i) - - let i = i + 1 - endwhile - - " Reduce the number of files displayed - let s:tlist_file_count = s:tlist_file_count - 1 - - if g:Tlist_Show_One_File - " If the tags for only one file is displayed and if we just - " now removed that file, then invalidate the current file idx - if s:tlist_cur_file_idx == fidx - let s:tlist_cur_file_idx = -1 - endif - endif -endfunction - -" Tlist_Window_Goto_Window -" Goto the taglist window -function! s:Tlist_Window_Goto_Window() - let winnum = bufwinnr(g:TagList_title) - if winnum != -1 - if winnr() != winnum - call s:Tlist_Exe_Cmd_No_Acmds(winnum . 'wincmd w') - endif - endif -endfunction - -" Tlist_Window_Create -" Create a new taglist window. If it is already open, jump to it -function! s:Tlist_Window_Create() - call s:Tlist_Log_Msg('Tlist_Window_Create()') - " If the window is open, jump to it - let winnum = bufwinnr(g:TagList_title) - if winnum != -1 - " Jump to the existing window - if winnr() != winnum - exe winnum . 'wincmd w' - endif - return - endif - - " If used with winmanager don't open windows. Winmanager will handle - " the window/buffer management - if s:tlist_app_name == "winmanager" - return - endif - - " Create a new window. If user prefers a horizontal window, then open - " a horizontally split window. Otherwise open a vertically split - " window - if g:Tlist_Use_Horiz_Window - " Open a horizontally split window - let win_dir = 'botright' - " Horizontal window height - let win_size = g:Tlist_WinHeight - else - if s:tlist_winsize_chgd == -1 - " Open a vertically split window. Increase the window size, if - " needed, to accomodate the new window - if g:Tlist_Inc_Winwidth && - \ &columns < (80 + g:Tlist_WinWidth) - " Save the original window position - let s:tlist_pre_winx = getwinposx() - let s:tlist_pre_winy = getwinposy() - - " one extra column is needed to include the vertical split - let &columns= &columns + g:Tlist_WinWidth + 1 - - let s:tlist_winsize_chgd = 1 - else - let s:tlist_winsize_chgd = 0 - endif - endif - - if g:Tlist_Use_Right_Window - " Open the window at the rightmost place - let win_dir = 'botright vertical' - else - " Open the window at the leftmost place - let win_dir = 'topleft vertical' - endif - let win_size = g:Tlist_WinWidth - endif - - " If the tag listing temporary buffer already exists, then reuse it. - " Otherwise create a new buffer - let bufnum = bufnr(g:TagList_title) - if bufnum == -1 - " Create a new buffer - let wcmd = g:TagList_title - else - " Edit the existing buffer - let wcmd = '+buffer' . bufnum - endif - - " Create the taglist window - exe 'silent! ' . win_dir . ' ' . win_size . 'split ' . wcmd - - " Save the new window position - let s:tlist_winx = getwinposx() - let s:tlist_winy = getwinposy() - - " Initialize the taglist window - call s:Tlist_Window_Init() -endfunction - -" Tlist_Window_Zoom -" Zoom (maximize/minimize) the taglist window -function! s:Tlist_Window_Zoom() - if s:tlist_win_maximized - " Restore the window back to the previous size - if g:Tlist_Use_Horiz_Window - exe 'resize ' . g:Tlist_WinHeight - else - exe 'vert resize ' . g:Tlist_WinWidth - endif - let s:tlist_win_maximized = 0 - else - " Set the window size to the maximum possible without closing other - " windows - if g:Tlist_Use_Horiz_Window - resize - else - vert resize - endif - let s:tlist_win_maximized = 1 - endif -endfunction - -" Tlist_Ballon_Expr -" When the mouse cursor is over a tag in the taglist window, display the -" tag prototype (balloon) -function! Tlist_Ballon_Expr() - " Get the file index - let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(v:beval_lnum) - if fidx == -1 - return '' - endif - - " Get the tag output line for the current tag - let tidx = s:Tlist_Window_Get_Tag_Index(fidx, v:beval_lnum) - if tidx == 0 - return '' - endif - - " Get the tag search pattern and display it - return s:Tlist_Get_Tag_Prototype(fidx, tidx) -endfunction - -" Tlist_Window_Check_Width -" Check the width of the taglist window. For horizontally split windows, the -" 'winfixheight' option is used to fix the height of the window. For -" vertically split windows, Vim doesn't support the 'winfixwidth' option. So -" need to handle window width changes from this function. -function! s:Tlist_Window_Check_Width() - let tlist_winnr = bufwinnr(g:TagList_title) - if tlist_winnr == -1 - return - endif - - let width = winwidth(tlist_winnr) - if width != g:Tlist_WinWidth - call s:Tlist_Log_Msg("Tlist_Window_Check_Width: Changing window " . - \ "width from " . width . " to " . g:Tlist_WinWidth) - let save_winnr = winnr() - if save_winnr != tlist_winnr - call s:Tlist_Exe_Cmd_No_Acmds(tlist_winnr . 'wincmd w') - endif - exe 'vert resize ' . g:Tlist_WinWidth - if save_winnr != tlist_winnr - call s:Tlist_Exe_Cmd_No_Acmds('wincmd p') - endif - endif -endfunction - -" Tlist_Window_Exit_Only_Window -" If the 'Tlist_Exit_OnlyWindow' option is set, then exit Vim if only the -" taglist window is present. -function! s:Tlist_Window_Exit_Only_Window() - " Before quitting Vim, delete the taglist buffer so that - " the '0 mark is correctly set to the previous buffer. - if v:version < 700 - if winbufnr(2) == -1 - bdelete - quit - endif - else - if winbufnr(2) == -1 - if tabpagenr('$') == 1 - " Only one tag page is present - bdelete - quit - else - " More than one tab page is present. Close only the current - " tab page - close - endif - endif - endif -endfunction - -" Tlist_Window_Init -" Set the default options for the taglist window -function! s:Tlist_Window_Init() - call s:Tlist_Log_Msg('Tlist_Window_Init()') - - " The 'readonly' option should not be set for the taglist buffer. - " If Vim is started as "view/gview" or if the ":view" command is - " used, then the 'readonly' option is set for all the buffers. - " Unset it for the taglist buffer - setlocal noreadonly - - " Set the taglist buffer filetype to taglist - setlocal filetype=taglist - - " Define taglist window element highlighting - syntax match TagListComment '^" .*' - syntax match TagListFileName '^[^" ].*$' - syntax match TagListTitle '^ \S.*$' - syntax match TagListTagScope '\s\[.\{-\}\]$' - - " Define the highlighting only if colors are supported - if has('gui_running') || &t_Co > 2 - " Colors to highlight various taglist window elements - " If user defined highlighting group exists, then use them. - " Otherwise, use default highlight groups. - if hlexists('MyTagListTagName') - highlight link TagListTagName MyTagListTagName - else - highlight default link TagListTagName Search - endif - " Colors to highlight comments and titles - if hlexists('MyTagListComment') - highlight link TagListComment MyTagListComment - else - highlight clear TagListComment - highlight default link TagListComment Comment - endif - if hlexists('MyTagListTitle') - highlight link TagListTitle MyTagListTitle - else - highlight clear TagListTitle - highlight default link TagListTitle Title - endif - if hlexists('MyTagListFileName') - highlight link TagListFileName MyTagListFileName - else - highlight clear TagListFileName - highlight default TagListFileName guibg=Grey ctermbg=darkgray - \ guifg=white ctermfg=white - endif - if hlexists('MyTagListTagScope') - highlight link TagListTagScope MyTagListTagScope - else - highlight clear TagListTagScope - highlight default link TagListTagScope Identifier - endif - else - highlight default TagListTagName term=reverse cterm=reverse - endif - - " Folding related settings - setlocal foldenable - setlocal foldminlines=0 - setlocal foldmethod=manual - setlocal foldlevel=9999 - if g:Tlist_Enable_Fold_Column - setlocal foldcolumn=3 - else - setlocal foldcolumn=0 - endif - setlocal foldtext=v:folddashes.getline(v:foldstart) - - if s:tlist_app_name != "winmanager" - " Mark buffer as scratch - silent! setlocal buftype=nofile - if s:tlist_app_name == "none" - silent! setlocal bufhidden=delete - endif - silent! setlocal noswapfile - " Due to a bug in Vim 6.0, the winbufnr() function fails for unlisted - " buffers. So if the taglist buffer is unlisted, multiple taglist - " windows will be opened. This bug is fixed in Vim 6.1 and above - if v:version >= 601 - silent! setlocal nobuflisted - endif - endif - - silent! setlocal nowrap - - " If the 'number' option is set in the source window, it will affect the - " taglist window. So forcefully disable 'number' option for the taglist - " window - silent! setlocal nonumber - - " Use fixed height when horizontally split window is used - if g:Tlist_Use_Horiz_Window - if v:version >= 602 - set winfixheight - endif - endif - if !g:Tlist_Use_Horiz_Window && v:version >= 700 - set winfixwidth - endif - - " Setup balloon evaluation to display tag prototype - if v:version >= 700 && has('balloon_eval') - setlocal balloonexpr=Tlist_Ballon_Expr() - set ballooneval - endif - - " Setup the cpoptions properly for the maps to work - let old_cpoptions = &cpoptions - set cpoptions&vim - - " Create buffer local mappings for jumping to the tags and sorting the list - nnoremap - \ :call Tlist_Window_Jump_To_Tag('useopen') - nnoremap o - \ :call Tlist_Window_Jump_To_Tag('newwin') - nnoremap p - \ :call Tlist_Window_Jump_To_Tag('preview') - nnoremap P - \ :call Tlist_Window_Jump_To_Tag('prevwin') - if v:version >= 700 - nnoremap t - \ :call Tlist_Window_Jump_To_Tag('checktab') - nnoremap - \ :call Tlist_Window_Jump_To_Tag('newtab') - endif - nnoremap <2-LeftMouse> - \ :call Tlist_Window_Jump_To_Tag('useopen') - nnoremap s - \ :call Tlist_Change_Sort('cmd', 'toggle', '') - nnoremap + :silent! foldopen - nnoremap - :silent! foldclose - nnoremap * :silent! %foldopen! - nnoremap = :silent! %foldclose - nnoremap :silent! foldopen - nnoremap :silent! foldclose - nnoremap :silent! %foldopen! - nnoremap :call Tlist_Window_Show_Info() - nnoremap u :call Tlist_Window_Update_File() - nnoremap d :call Tlist_Remove_File(-1, 1) - nnoremap x :call Tlist_Window_Zoom() - nnoremap [[ :call Tlist_Window_Move_To_File(-1) - nnoremap :call Tlist_Window_Move_To_File(-1) - nnoremap ]] :call Tlist_Window_Move_To_File(1) - nnoremap :call Tlist_Window_Move_To_File(1) - nnoremap :call Tlist_Window_Toggle_Help_Text() - nnoremap q :close - - " Insert mode mappings - inoremap - \ :call Tlist_Window_Jump_To_Tag('useopen') - " Windows needs return - inoremap - \ :call Tlist_Window_Jump_To_Tag('useopen') - inoremap o - \ :call Tlist_Window_Jump_To_Tag('newwin') - inoremap p - \ :call Tlist_Window_Jump_To_Tag('preview') - inoremap P - \ :call Tlist_Window_Jump_To_Tag('prevwin') - if v:version >= 700 - inoremap t - \ :call Tlist_Window_Jump_To_Tag('checktab') - inoremap - \ :call Tlist_Window_Jump_To_Tag('newtab') - endif - inoremap <2-LeftMouse> - \ :call Tlist_Window_Jump_To_Tag('useopen') - inoremap s - \ :call Tlist_Change_Sort('cmd', 'toggle', '') - inoremap + :silent! foldopen - inoremap - :silent! foldclose - inoremap * :silent! %foldopen! - inoremap = :silent! %foldclose - inoremap :silent! foldopen - inoremap :silent! foldclose - inoremap :silent! %foldopen! - inoremap :call - \ Tlist_Window_Show_Info() - inoremap u - \ :call Tlist_Window_Update_File() - inoremap d :call Tlist_Remove_File(-1, 1) - inoremap x :call Tlist_Window_Zoom() - inoremap [[ :call Tlist_Window_Move_To_File(-1) - inoremap :call Tlist_Window_Move_To_File(-1) - inoremap ]] :call Tlist_Window_Move_To_File(1) - inoremap :call Tlist_Window_Move_To_File(1) - inoremap :call Tlist_Window_Toggle_Help_Text() - inoremap q :close - - " Map single left mouse click if the user wants this functionality - if g:Tlist_Use_SingleClick == 1 - " Contributed by Bindu Wavell - " attempt to perform single click mapping, it would be much - " nicer if we could nnoremap ... however vim does - " not fire the when you use the mouse - " to enter a buffer. - let clickmap = ':if bufname("%") =~ "__Tag_List__" ' . - \ 'call Tlist_Window_Jump_To_Tag("useopen") ' . - \ ' endif ' - if maparg('', 'n') == '' - " no mapping for leftmouse - exe ':nnoremap ' . clickmap - else - " we have a mapping - let mapcmd = ':nnoremap ' - let mapcmd = mapcmd . substitute(substitute( - \ maparg('', 'n'), '|', '', 'g'), - \ '\c^', '', '') - let mapcmd = mapcmd . clickmap - exe mapcmd - endif - endif - - " Define the taglist autocommands - augroup TagListAutoCmds - autocmd! - " Display the tag prototype for the tag under the cursor. - autocmd CursorHold __Tag_List__ call s:Tlist_Window_Show_Info() - " Highlight the current tag periodically - autocmd CursorHold * silent call s:Tlist_Window_Highlight_Tag( - \ fnamemodify(bufname('%'), ':p'), line('.'), 1, 0) - - " Adjust the Vim window width when taglist window is closed - autocmd BufUnload __Tag_List__ call s:Tlist_Post_Close_Cleanup() - " Close the fold for this buffer when leaving the buffer - if g:Tlist_File_Fold_Auto_Close - autocmd BufEnter * silent - \ call s:Tlist_Window_Open_File_Fold(expand('')) - endif - " Exit Vim itself if only the taglist window is present (optional) - if g:Tlist_Exit_OnlyWindow - autocmd BufEnter __Tag_List__ nested - \ call s:Tlist_Window_Exit_Only_Window() - endif - if s:tlist_app_name != "winmanager" && - \ !g:Tlist_Process_File_Always && - \ (!has('gui_running') || !g:Tlist_Show_Menu) - " Auto refresh the taglist window - autocmd BufEnter * call s:Tlist_Refresh() - endif - - if !g:Tlist_Use_Horiz_Window - if v:version < 700 - autocmd WinEnter * call s:Tlist_Window_Check_Width() - endif - endif - if v:version >= 700 - autocmd TabEnter * silent call s:Tlist_Refresh_Folds() - endif - augroup end - - " Restore the previous cpoptions settings - let &cpoptions = old_cpoptions -endfunction - -" Tlist_Window_Refresh -" Display the tags for all the files in the taglist window -function! s:Tlist_Window_Refresh() - call s:Tlist_Log_Msg('Tlist_Window_Refresh()') - " Set report option to a huge value to prevent informational messages - " while deleting the lines - let old_report = &report - set report=99999 - - " Mark the buffer as modifiable - setlocal modifiable - - " Delete the contents of the buffer to the black-hole register - silent! %delete _ - - " As we have cleared the taglist window, mark all the files - " as not visible - let i = 0 - while i < s:tlist_file_count - let s:tlist_{i}_visible = 0 - let i = i + 1 - endwhile - - if g:Tlist_Compact_Format == 0 - " Display help in non-compact mode - call s:Tlist_Window_Display_Help() - endif - - " Mark the buffer as not modifiable - setlocal nomodifiable - - " Restore the report option - let &report = old_report - - " If the tags for only one file should be displayed in the taglist - " window, then no need to add the tags here. The bufenter autocommand - " will add the tags for that file. - if g:Tlist_Show_One_File - return - endif - - " List all the tags for the previously processed files - " Do this only if taglist is configured to display tags for more than - " one file. Otherwise, when Tlist_Show_One_File is configured, - " tags for the wrong file will be displayed. - let i = 0 - while i < s:tlist_file_count - call s:Tlist_Window_Refresh_File(s:tlist_{i}_filename, - \ s:tlist_{i}_filetype) - let i = i + 1 - endwhile - - if g:Tlist_Auto_Update - " Add and list the tags for all buffers in the Vim buffer list - let i = 1 - let last_bufnum = bufnr('$') - while i <= last_bufnum - if buflisted(i) - let fname = fnamemodify(bufname(i), ':p') - let ftype = s:Tlist_Get_Buffer_Filetype(i) - " If the file doesn't support tag listing, skip it - if !s:Tlist_Skip_File(fname, ftype) - call s:Tlist_Window_Refresh_File(fname, ftype) - endif - endif - let i = i + 1 - endwhile - endif - - " If Tlist_File_Fold_Auto_Close option is set, then close all the folds - if g:Tlist_File_Fold_Auto_Close - " Close all the folds - silent! %foldclose - endif - - " Move the cursor to the top of the taglist window - normal! gg -endfunction - -" Tlist_Post_Close_Cleanup() -" Close the taglist window and adjust the Vim window width -function! s:Tlist_Post_Close_Cleanup() - call s:Tlist_Log_Msg('Tlist_Post_Close_Cleanup()') - " Mark all the files as not visible - let i = 0 - while i < s:tlist_file_count - let s:tlist_{i}_visible = 0 - let i = i + 1 - endwhile - - " Remove the taglist autocommands - silent! autocmd! TagListAutoCmds - - " Clear all the highlights - match none - - silent! syntax clear TagListTitle - silent! syntax clear TagListComment - silent! syntax clear TagListTagScope - - " Remove the left mouse click mapping if it was setup initially - if g:Tlist_Use_SingleClick - if hasmapto('') - nunmap - endif - endif - - if s:tlist_app_name != "winmanager" - if g:Tlist_Use_Horiz_Window || g:Tlist_Inc_Winwidth == 0 || - \ s:tlist_winsize_chgd != 1 || - \ &columns < (80 + g:Tlist_WinWidth) - " No need to adjust window width if using horizontally split taglist - " window or if columns is less than 101 or if the user chose not to - " adjust the window width - else - " If the user didn't manually move the window, then restore the window - " position to the pre-taglist position - if s:tlist_pre_winx != -1 && s:tlist_pre_winy != -1 && - \ getwinposx() == s:tlist_winx && - \ getwinposy() == s:tlist_winy - exe 'winpos ' . s:tlist_pre_winx . ' ' . s:tlist_pre_winy - endif - - " Adjust the Vim window width - let &columns= &columns - (g:Tlist_WinWidth + 1) - endif - endif - - let s:tlist_winsize_chgd = -1 - - " Reset taglist state variables - if s:tlist_app_name == "winmanager" - let s:tlist_app_name = "none" - endif - let s:tlist_window_initialized = 0 -endfunction - -" Tlist_Window_Refresh_File() -" List the tags defined in the specified file in a Vim window -function! s:Tlist_Window_Refresh_File(filename, ftype) - call s:Tlist_Log_Msg('Tlist_Window_Refresh_File (' . a:filename . ')') - " First check whether the file already exists - let fidx = s:Tlist_Get_File_Index(a:filename) - if fidx != -1 - let file_listed = 1 - else - let file_listed = 0 - endif - - if !file_listed - " Check whether this file is removed based on user request - " If it is, then don't display the tags for this file - if s:Tlist_User_Removed_File(a:filename) - return - endif - endif - - if file_listed && s:tlist_{fidx}_visible - " Check whether the file tags are currently valid - if s:tlist_{fidx}_valid - " Goto the first line in the file - exe s:tlist_{fidx}_start - - " If the line is inside a fold, open the fold - if foldclosed('.') != -1 - exe "silent! " . s:tlist_{fidx}_start . "," . - \ s:tlist_{fidx}_end . "foldopen!" - endif - return - endif - - " Discard and remove the tags for this file from display - call s:Tlist_Discard_TagInfo(fidx) - call s:Tlist_Window_Remove_File_From_Display(fidx) - endif - - " Process and generate a list of tags defined in the file - if !file_listed || !s:tlist_{fidx}_valid - let ret_fidx = s:Tlist_Process_File(a:filename, a:ftype) - if ret_fidx == -1 - return - endif - let fidx = ret_fidx - endif - - " Set report option to a huge value to prevent informational messages - " while adding lines to the taglist window - let old_report = &report - set report=99999 - - if g:Tlist_Show_One_File - " Remove the previous file - if s:tlist_cur_file_idx != -1 - call s:Tlist_Window_Remove_File_From_Display(s:tlist_cur_file_idx) - let s:tlist_{s:tlist_cur_file_idx}_visible = 0 - let s:tlist_{s:tlist_cur_file_idx}_start = 0 - let s:tlist_{s:tlist_cur_file_idx}_end = 0 - endif - let s:tlist_cur_file_idx = fidx - endif - - " Mark the buffer as modifiable - setlocal modifiable - - " Add new files to the end of the window. For existing files, add them at - " the same line where they were previously present. If the file is not - " visible, then add it at the end - if s:tlist_{fidx}_start == 0 || !s:tlist_{fidx}_visible - if g:Tlist_Compact_Format - let s:tlist_{fidx}_start = line('$') - else - let s:tlist_{fidx}_start = line('$') + 1 - endif - endif - - let s:tlist_{fidx}_visible = 1 - - " Goto the line where this file should be placed - if g:Tlist_Compact_Format - exe s:tlist_{fidx}_start - else - exe s:tlist_{fidx}_start - 1 - endif - - let txt = fnamemodify(s:tlist_{fidx}_filename, ':t') . ' (' . - \ fnamemodify(s:tlist_{fidx}_filename, ':p:h') . ')' - if g:Tlist_Compact_Format == 0 - silent! put =txt - else - silent! put! =txt - " Move to the next line - exe line('.') + 1 - endif - let file_start = s:tlist_{fidx}_start - - " Add the tag names grouped by tag type to the buffer with a title - let i = 1 - let ttype_cnt = s:tlist_{a:ftype}_count - while i <= ttype_cnt - let ttype = s:tlist_{a:ftype}_{i}_name - " Add the tag type only if there are tags for that type - let fidx_ttype = 's:tlist_' . fidx . '_' . ttype - let ttype_txt = {fidx_ttype} - if ttype_txt != '' - let txt = ' ' . s:tlist_{a:ftype}_{i}_fullname - if g:Tlist_Compact_Format == 0 - let ttype_start_lnum = line('.') + 1 - silent! put =txt - else - let ttype_start_lnum = line('.') - silent! put! =txt - endif - silent! put =ttype_txt - - let {fidx_ttype}_offset = ttype_start_lnum - file_start - - " create a fold for this tag type - let fold_start = ttype_start_lnum - let fold_end = fold_start + {fidx_ttype}_count - exe fold_start . ',' . fold_end . 'fold' - - " Adjust the cursor position - if g:Tlist_Compact_Format == 0 - exe ttype_start_lnum + {fidx_ttype}_count - else - exe ttype_start_lnum + {fidx_ttype}_count + 1 - endif - - if g:Tlist_Compact_Format == 0 - " Separate the tag types by a empty line - silent! put ='' - endif - endif - let i = i + 1 - endwhile - - if s:tlist_{fidx}_tag_count == 0 - if g:Tlist_Compact_Format == 0 - silent! put ='' - endif - endif - - let s:tlist_{fidx}_end = line('.') - 1 - - " Create a fold for the entire file - exe s:tlist_{fidx}_start . ',' . s:tlist_{fidx}_end . 'fold' - exe 'silent! ' . s:tlist_{fidx}_start . ',' . - \ s:tlist_{fidx}_end . 'foldopen!' - - " Goto the starting line for this file, - exe s:tlist_{fidx}_start - - if s:tlist_app_name == "winmanager" - " To handle a bug in the winmanager plugin, add a space at the - " last line - call setline('$', ' ') - endif - - " Mark the buffer as not modifiable - setlocal nomodifiable - - " Restore the report option - let &report = old_report - - " Update the start and end line numbers for all the files following this - " file - let start = s:tlist_{fidx}_start - " include the empty line after the last line - if g:Tlist_Compact_Format - let end = s:tlist_{fidx}_end - else - let end = s:tlist_{fidx}_end + 1 - endif - call s:Tlist_Window_Update_Line_Offsets(fidx + 1, 1, end - start + 1) - - " Now that we have updated the taglist window, update the tags - " menu (if present) - if g:Tlist_Show_Menu - call s:Tlist_Menu_Update_File(1) - endif -endfunction - -" Tlist_Init_File -" Initialize the variables for a new file -function! s:Tlist_Init_File(filename, ftype) - call s:Tlist_Log_Msg('Tlist_Init_File (' . a:filename . ')') - " Add new files at the end of the list - let fidx = s:tlist_file_count - let s:tlist_file_count = s:tlist_file_count + 1 - " Add the new file name to the taglist list of file names - let s:tlist_file_names = s:tlist_file_names . a:filename . "\n" - - " Initialize the file variables - let s:tlist_{fidx}_filename = a:filename - let s:tlist_{fidx}_sort_type = g:Tlist_Sort_Type - let s:tlist_{fidx}_filetype = a:ftype - let s:tlist_{fidx}_mtime = -1 - let s:tlist_{fidx}_start = 0 - let s:tlist_{fidx}_end = 0 - let s:tlist_{fidx}_valid = 0 - let s:tlist_{fidx}_visible = 0 - let s:tlist_{fidx}_tag_count = 0 - let s:tlist_{fidx}_menu_cmd = '' - - " Initialize the tag type variables - let i = 1 - while i <= s:tlist_{a:ftype}_count - let ttype = s:tlist_{a:ftype}_{i}_name - let s:tlist_{fidx}_{ttype} = '' - let s:tlist_{fidx}_{ttype}_offset = 0 - let s:tlist_{fidx}_{ttype}_count = 0 - let i = i + 1 - endwhile - - return fidx -endfunction - -" Tlist_Get_Tag_Type_By_Tag -" Return the tag type for the specified tag index -function! s:Tlist_Get_Tag_Type_By_Tag(fidx, tidx) - let ttype_var = 's:tlist_' . a:fidx . '_' . a:tidx . '_tag_type' - - " Already parsed and have the tag name - if exists(ttype_var) - return {ttype_var} - endif - - let tag_line = s:tlist_{a:fidx}_{a:tidx}_tag - let {ttype_var} = s:Tlist_Extract_Tagtype(tag_line) - - return {ttype_var} -endfunction - -" Tlist_Get_Tag_Prototype -function! s:Tlist_Get_Tag_Prototype(fidx, tidx) - let tproto_var = 's:tlist_' . a:fidx . '_' . a:tidx . '_tag_proto' - - " Already parsed and have the tag prototype - if exists(tproto_var) - return {tproto_var} - endif - - " Parse and extract the tag prototype - let tag_line = s:tlist_{a:fidx}_{a:tidx}_tag - let start = stridx(tag_line, '/^') + 2 - let end = stridx(tag_line, '/;"' . "\t") - if tag_line[end - 1] == '$' - let end = end -1 - endif - let tag_proto = strpart(tag_line, start, end - start) - let {tproto_var} = substitute(tag_proto, '\s*', '', '') - - return {tproto_var} -endfunction - -" Tlist_Get_Tag_SearchPat -function! s:Tlist_Get_Tag_SearchPat(fidx, tidx) - let tpat_var = 's:tlist_' . a:fidx . '_' . a:tidx . '_tag_searchpat' - - " Already parsed and have the tag search pattern - if exists(tpat_var) - return {tpat_var} - endif - - " Parse and extract the tag search pattern - let tag_line = s:tlist_{a:fidx}_{a:tidx}_tag - let start = stridx(tag_line, '/^') + 2 - let end = stridx(tag_line, '/;"' . "\t") - if tag_line[end - 1] == '$' - let end = end -1 - endif - let {tpat_var} = '\V\^' . strpart(tag_line, start, end - start) . - \ (tag_line[end] == '$' ? '\$' : '') - - return {tpat_var} -endfunction - -" Tlist_Get_Tag_Linenum -" Return the tag line number, given the tag index -function! s:Tlist_Get_Tag_Linenum(fidx, tidx) - let tline_var = 's:tlist_' . a:fidx . '_' . a:tidx . '_tag_linenum' - - " Already parsed and have the tag line number - if exists(tline_var) - return {tline_var} - endif - - " Parse and extract the tag line number - let tag_line = s:tlist_{a:fidx}_{a:tidx}_tag - let start = strridx(tag_line, 'line:') + 5 - let end = strridx(tag_line, "\t") - if end < start - let {tline_var} = strpart(tag_line, start) + 0 - else - let {tline_var} = strpart(tag_line, start, end - start) + 0 - endif - - return {tline_var} -endfunction - -" Tlist_Parse_Tagline -" Parse a tag line from the ctags output. Separate the tag output based on the -" tag type and store it in the tag type variable. -" The format of each line in the ctags output is: -" -" tag_namefile_nameex_cmd;"extension_fields -" -function! s:Tlist_Parse_Tagline(tag_line) - if a:tag_line == '' - " Skip empty lines - return - endif - - " Extract the tag type - let ttype = s:Tlist_Extract_Tagtype(a:tag_line) - - " Make sure the tag type is a valid and supported one - if ttype == '' || stridx(s:ctags_flags, ttype) == -1 - " Line is not in proper tags format or Tag type is not supported - return - endif - - " Update the total tag count - let s:tidx = s:tidx + 1 - - " The following variables are used to optimize this code. Vim is slow in - " using curly brace names. To reduce the amount of processing needed, the - " curly brace variables are pre-processed here - let fidx_tidx = 's:tlist_' . s:fidx . '_' . s:tidx - let fidx_ttype = 's:tlist_' . s:fidx . '_' . ttype - - " Update the count of this tag type - let ttype_idx = {fidx_ttype}_count + 1 - let {fidx_ttype}_count = ttype_idx - - " Store the ctags output for this tag - let {fidx_tidx}_tag = a:tag_line - - " Store the tag index and the tag type index (back pointers) - let {fidx_ttype}_{ttype_idx} = s:tidx - let {fidx_tidx}_ttype_idx = ttype_idx - - " Extract the tag name - let tag_name = strpart(a:tag_line, 0, stridx(a:tag_line, "\t")) - - " Extract the tag scope/prototype - if g:Tlist_Display_Prototype - let ttxt = ' ' . s:Tlist_Get_Tag_Prototype(s:fidx, s:tidx) - else - let ttxt = ' ' . tag_name - - " Add the tag scope, if it is available and is configured. Tag - " scope is the last field after the 'line:\t' field - if g:Tlist_Display_Tag_Scope - let tag_scope = s:Tlist_Extract_Tag_Scope(a:tag_line) - if tag_scope != '' - let ttxt = ttxt . ' [' . tag_scope . ']' - endif - endif - endif - - " Add this tag to the tag type variable - let {fidx_ttype} = {fidx_ttype} . ttxt . "\n" - - " Save the tag name - let {fidx_tidx}_tag_name = tag_name -endfunction - -" Tlist_Process_File -" Get the list of tags defined in the specified file and store them -" in Vim variables. Returns the file index where the tags are stored. -function! s:Tlist_Process_File(filename, ftype) - call s:Tlist_Log_Msg('Tlist_Process_File (' . a:filename . ', ' . - \ a:ftype . ')') - " Check whether this file is supported - if s:Tlist_Skip_File(a:filename, a:ftype) - return -1 - endif - - " If the tag types for this filetype are not yet created, then create - " them now - let var = 's:tlist_' . a:ftype . '_count' - if !exists(var) - if s:Tlist_FileType_Init(a:ftype) == 0 - return -1 - endif - endif - - " If this file is already processed, then use the cached values - let fidx = s:Tlist_Get_File_Index(a:filename) - if fidx == -1 - " First time, this file is loaded - let fidx = s:Tlist_Init_File(a:filename, a:ftype) - else - " File was previously processed. Discard the tag information - call s:Tlist_Discard_TagInfo(fidx) - endif - - let s:tlist_{fidx}_valid = 1 - - " Exuberant ctags arguments to generate a tag list - let ctags_args = ' -f - --format=2 --excmd=pattern --fields=nks ' - - " Form the ctags argument depending on the sort type - if s:tlist_{fidx}_sort_type == 'name' - let ctags_args = ctags_args . '--sort=yes' - else - let ctags_args = ctags_args . '--sort=no' - endif - - " Add the filetype specific arguments - let ctags_args = ctags_args . ' ' . s:tlist_{a:ftype}_ctags_args - - " Ctags command to produce output with regexp for locating the tags - let ctags_cmd = g:Tlist_Ctags_Cmd . ctags_args - let ctags_cmd = ctags_cmd . ' "' . a:filename . '"' - - if &shellxquote == '"' - " Double-quotes within double-quotes will not work in the - " command-line.If the 'shellxquote' option is set to double-quotes, - " then escape the double-quotes in the ctags command-line. - let ctags_cmd = escape(ctags_cmd, '"') - endif - - " In Windows 95, if not using cygwin, disable the 'shellslash' - " option. Otherwise, this will cause problems when running the - " ctags command. - if has('win95') && !has('win32unix') - let old_shellslash = &shellslash - set noshellslash - endif - - if has('win32') && !has('win32unix') && !has('win95') - \ && (&shell =~ 'cmd.exe') - " Windows does not correctly deal with commands that have more than 1 - " set of double quotes. It will strip them all resulting in: - " 'C:\Program' is not recognized as an internal or external command - " operable program or batch file. To work around this, place the - " command inside a batch file and call the batch file. - " Do this only on Win2K, WinXP and above. - " Contributed by: David Fishburn. - let s:taglist_tempfile = fnamemodify(tempname(), ':h') . - \ '\taglist.cmd' - exe 'redir! > ' . s:taglist_tempfile - silent echo ctags_cmd - redir END - - call s:Tlist_Log_Msg('Cmd inside batch file: ' . ctags_cmd) - let ctags_cmd = '"' . s:taglist_tempfile . '"' - endif - - call s:Tlist_Log_Msg('Cmd: ' . ctags_cmd) - - " Run ctags and get the tag list - let cmd_output = system(ctags_cmd) - - " Restore the value of the 'shellslash' option. - if has('win95') && !has('win32unix') - let &shellslash = old_shellslash - endif - - if exists('s:taglist_tempfile') - " Delete the temporary cmd file created on MS-Windows - call delete(s:taglist_tempfile) - endif - - " Handle errors - if v:shell_error - let msg = "Taglist: Failed to generate tags for " . a:filename - call s:Tlist_Warning_Msg(msg) - if cmd_output != '' - call s:Tlist_Warning_Msg(cmd_output) - endif - return fidx - endif - - " Store the modification time for the file - let s:tlist_{fidx}_mtime = getftime(a:filename) - - " No tags for current file - if cmd_output == '' - call s:Tlist_Log_Msg('No tags defined in ' . a:filename) - return fidx - endif - - call s:Tlist_Log_Msg('Generated tags information for ' . a:filename) - - if v:version > 601 - " The following script local variables are used by the - " Tlist_Parse_Tagline() function. - let s:ctags_flags = s:tlist_{a:ftype}_ctags_flags - let s:fidx = fidx - let s:tidx = 0 - - " Process the ctags output one line at a time. The substitute() - " command is used to parse the tag lines instead of using the - " matchstr()/stridx()/strpart() functions for performance reason - call substitute(cmd_output, "\\([^\n]\\+\\)\n", - \ '\=s:Tlist_Parse_Tagline(submatch(1))', 'g') - - " Save the number of tags for this file - let s:tlist_{fidx}_tag_count = s:tidx - - " The following script local variables are no longer needed - unlet! s:ctags_flags - unlet! s:tidx - unlet! s:fidx - else - " Due to a bug in Vim earlier than version 6.1, - " we cannot use substitute() to parse the ctags output. - " Instead the slow str*() functions are used - let ctags_flags = s:tlist_{a:ftype}_ctags_flags - let tidx = 0 - - while cmd_output != '' - " Extract one line at a time - let idx = stridx(cmd_output, "\n") - let one_line = strpart(cmd_output, 0, idx) - " Remove the line from the tags output - let cmd_output = strpart(cmd_output, idx + 1) - - if one_line == '' - " Line is not in proper tags format - continue - endif - - " Extract the tag type - let ttype = s:Tlist_Extract_Tagtype(one_line) - - " Make sure the tag type is a valid and supported one - if ttype == '' || stridx(ctags_flags, ttype) == -1 - " Line is not in proper tags format or Tag type is not - " supported - continue - endif - - " Update the total tag count - let tidx = tidx + 1 - - " The following variables are used to optimize this code. Vim is - " slow in using curly brace names. To reduce the amount of - " processing needed, the curly brace variables are pre-processed - " here - let fidx_tidx = 's:tlist_' . fidx . '_' . tidx - let fidx_ttype = 's:tlist_' . fidx . '_' . ttype - - " Update the count of this tag type - let ttype_idx = {fidx_ttype}_count + 1 - let {fidx_ttype}_count = ttype_idx - - " Store the ctags output for this tag - let {fidx_tidx}_tag = one_line - - " Store the tag index and the tag type index (back pointers) - let {fidx_ttype}_{ttype_idx} = tidx - let {fidx_tidx}_ttype_idx = ttype_idx - - " Extract the tag name - let tag_name = strpart(one_line, 0, stridx(one_line, "\t")) - - " Extract the tag scope/prototype - if g:Tlist_Display_Prototype - let ttxt = ' ' . s:Tlist_Get_Tag_Prototype(fidx, tidx) - else - let ttxt = ' ' . tag_name - - " Add the tag scope, if it is available and is configured. Tag - " scope is the last field after the 'line:\t' field - if g:Tlist_Display_Tag_Scope - let tag_scope = s:Tlist_Extract_Tag_Scope(one_line) - if tag_scope != '' - let ttxt = ttxt . ' [' . tag_scope . ']' - endif - endif - endif - - " Add this tag to the tag type variable - let {fidx_ttype} = {fidx_ttype} . ttxt . "\n" - - " Save the tag name - let {fidx_tidx}_tag_name = tag_name - endwhile - - " Save the number of tags for this file - let s:tlist_{fidx}_tag_count = tidx - endif - - call s:Tlist_Log_Msg('Processed ' . s:tlist_{fidx}_tag_count . - \ ' tags in ' . a:filename) - - return fidx -endfunction - -" Tlist_Update_File -" Update the tags for a file (if needed) -function! Tlist_Update_File(filename, ftype) - call s:Tlist_Log_Msg('Tlist_Update_File (' . a:filename . ')') - " If the file doesn't support tag listing, skip it - if s:Tlist_Skip_File(a:filename, a:ftype) - return - endif - - " Convert the file name to a full path - let fname = fnamemodify(a:filename, ':p') - - " First check whether the file already exists - let fidx = s:Tlist_Get_File_Index(fname) - - if fidx != -1 && s:tlist_{fidx}_valid - " File exists and the tags are valid - " Check whether the file was modified after the last tags update - " If it is modified, then update the tags - if s:tlist_{fidx}_mtime == getftime(fname) - return - endif - else - " If the tags were removed previously based on a user request, - " as we are going to update the tags (based on the user request), - " remove the filename from the deleted list - call s:Tlist_Update_Remove_List(fname, 0) - endif - - " If the taglist window is opened, update it - let winnum = bufwinnr(g:TagList_title) - if winnum == -1 - " Taglist window is not present. Just update the taglist - " and return - call s:Tlist_Process_File(fname, a:ftype) - else - if g:Tlist_Show_One_File && s:tlist_cur_file_idx != -1 - " If tags for only one file are displayed and we are not - " updating the tags for that file, then no need to - " refresh the taglist window. Otherwise, the taglist - " window should be updated. - if s:tlist_{s:tlist_cur_file_idx}_filename != fname - call s:Tlist_Process_File(fname, a:ftype) - return - endif - endif - - " Save the current window number - let save_winnr = winnr() - - " Goto the taglist window - call s:Tlist_Window_Goto_Window() - - " Save the cursor position - let save_line = line('.') - let save_col = col('.') - - " Update the taglist window - call s:Tlist_Window_Refresh_File(fname, a:ftype) - - " Restore the cursor position - if v:version >= 601 - call cursor(save_line, save_col) - else - exe save_line - exe 'normal! ' . save_col . '|' - endif - - if winnr() != save_winnr - " Go back to the original window - call s:Tlist_Exe_Cmd_No_Acmds(save_winnr . 'wincmd w') - endif - endif - - " Update the taglist menu - if g:Tlist_Show_Menu - call s:Tlist_Menu_Update_File(1) - endif -endfunction - -" Tlist_Window_Close -" Close the taglist window -function! s:Tlist_Window_Close() - call s:Tlist_Log_Msg('Tlist_Window_Close()') - " Make sure the taglist window exists - let winnum = bufwinnr(g:TagList_title) - if winnum == -1 - call s:Tlist_Warning_Msg('Error: Taglist window is not open') - return - endif - - if winnr() == winnum - " Already in the taglist window. Close it and return - if winbufnr(2) != -1 - " If a window other than the taglist window is open, - " then only close the taglist window. - close - endif - else - " Goto the taglist window, close it and then come back to the - " original window - let curbufnr = bufnr('%') - exe winnum . 'wincmd w' - close - " Need to jump back to the original window only if we are not - " already in that window - let winnum = bufwinnr(curbufnr) - if winnr() != winnum - exe winnum . 'wincmd w' - endif - endif -endfunction - -" Tlist_Window_Mark_File_Window -" Mark the current window as the file window to use when jumping to a tag. -" Only if the current window is a non-plugin, non-preview and non-taglist -" window -function! s:Tlist_Window_Mark_File_Window() - if getbufvar('%', '&buftype') == '' && !&previewwindow - let w:tlist_file_window = "yes" - endif -endfunction - -" Tlist_Window_Open -" Open and refresh the taglist window -function! s:Tlist_Window_Open() - call s:Tlist_Log_Msg('Tlist_Window_Open()') - " If the window is open, jump to it - let winnum = bufwinnr(g:TagList_title) - if winnum != -1 - " Jump to the existing window - if winnr() != winnum - exe winnum . 'wincmd w' - endif - return - endif - - if s:tlist_app_name == "winmanager" - " Taglist plugin is no longer part of the winmanager app - let s:tlist_app_name = "none" - endif - - " Get the filename and filetype for the specified buffer - let curbuf_name = fnamemodify(bufname('%'), ':p') - let curbuf_ftype = s:Tlist_Get_Buffer_Filetype('%') - let cur_lnum = line('.') - - " Mark the current window as the desired window to open a file when a tag - " is selected. - call s:Tlist_Window_Mark_File_Window() - - " Open the taglist window - call s:Tlist_Window_Create() - - call s:Tlist_Window_Refresh() - - if g:Tlist_Show_One_File - " Add only the current buffer and file - " - " If the file doesn't support tag listing, skip it - if !s:Tlist_Skip_File(curbuf_name, curbuf_ftype) - call s:Tlist_Window_Refresh_File(curbuf_name, curbuf_ftype) - endif - endif - - if g:Tlist_File_Fold_Auto_Close - " Open the fold for the current file, as all the folds in - " the taglist window are closed - let fidx = s:Tlist_Get_File_Index(curbuf_name) - if fidx != -1 - exe "silent! " . s:tlist_{fidx}_start . "," . - \ s:tlist_{fidx}_end . "foldopen!" - endif - endif - - " Highlight the current tag - call s:Tlist_Window_Highlight_Tag(curbuf_name, cur_lnum, 1, 1) -endfunction - -" Tlist_Window_Toggle() -" Open or close a taglist window -function! s:Tlist_Window_Toggle() - call s:Tlist_Log_Msg('Tlist_Window_Toggle()') - " If taglist window is open then close it. - let winnum = bufwinnr(g:TagList_title) - if winnum != -1 - call s:Tlist_Window_Close() - return - endif - - call s:Tlist_Window_Open() - - " Go back to the original window, if Tlist_GainFocus_On_ToggleOpen is not - " set - if !g:Tlist_GainFocus_On_ToggleOpen - call s:Tlist_Exe_Cmd_No_Acmds('wincmd p') - endif - - " Update the taglist menu - if g:Tlist_Show_Menu - call s:Tlist_Menu_Update_File(0) - endif -endfunction - -" Tlist_Process_Filelist -" Process multiple files. Each filename is separated by "\n" -" Returns the number of processed files -function! s:Tlist_Process_Filelist(file_names) - let flist = a:file_names - - " Enable lazy screen updates - let old_lazyredraw = &lazyredraw - set lazyredraw - - " Keep track of the number of processed files - let fcnt = 0 - - " Process one file at a time - while flist != '' - let nl_idx = stridx(flist, "\n") - let one_file = strpart(flist, 0, nl_idx) - - " Remove the filename from the list - let flist = strpart(flist, nl_idx + 1) - - if one_file == '' - continue - endif - - " Skip directories - if isdirectory(one_file) - continue - endif - - let ftype = s:Tlist_Detect_Filetype(one_file) - - echon "\r " - echon "\rProcessing tags for " . fnamemodify(one_file, ':p:t') - - let fcnt = fcnt + 1 - - call Tlist_Update_File(one_file, ftype) - endwhile - - " Clear the displayed informational messages - echon "\r " - - " Restore the previous state - let &lazyredraw = old_lazyredraw - - return fcnt -endfunction - -" Tlist_Process_Dir -" Process the files in a directory matching the specified pattern -function! s:Tlist_Process_Dir(dir_name, pat) - let flist = glob(a:dir_name . '/' . a:pat) . "\n" - - let fcnt = s:Tlist_Process_Filelist(flist) - - let len = strlen(a:dir_name) - if a:dir_name[len - 1] == '\' || a:dir_name[len - 1] == '/' - let glob_expr = a:dir_name . '*' - else - let glob_expr = a:dir_name . '/*' - endif - let all_files = glob(glob_expr) . "\n" - - while all_files != '' - let nl_idx = stridx(all_files, "\n") - let one_file = strpart(all_files, 0, nl_idx) - - let all_files = strpart(all_files, nl_idx + 1) - if one_file == '' - continue - endif - - " Skip non-directory names - if !isdirectory(one_file) - continue - endif - - echon "\r " - echon "\rProcessing files in directory " . fnamemodify(one_file, ':t') - let fcnt = fcnt + s:Tlist_Process_Dir(one_file, a:pat) - endwhile - - return fcnt -endfunction - -" Tlist_Add_Files_Recursive -" Add files recursively from a directory -function! s:Tlist_Add_Files_Recursive(dir, ...) - let dir_name = fnamemodify(a:dir, ':p') - if !isdirectory(dir_name) - call s:Tlist_Warning_Msg('Error: ' . dir_name . ' is not a directory') - return - endif - - if a:0 == 1 - " User specified file pattern - let pat = a:1 - else - " Default file pattern - let pat = '*' - endif - - echon "\r " - echon "\rProcessing files in directory " . fnamemodify(dir_name, ':t') - let fcnt = s:Tlist_Process_Dir(dir_name, pat) - - echon "\rAdded " . fcnt . " files to the taglist" -endfunction - -" Tlist_Add_Files -" Add the specified list of files to the taglist -function! s:Tlist_Add_Files(...) - let flist = '' - let i = 1 - - " Get all the files matching the file patterns supplied as argument - while i <= a:0 - let flist = flist . glob(a:{i}) . "\n" - let i = i + 1 - endwhile - - if flist == '' - call s:Tlist_Warning_Msg('Error: No matching files are found') - return - endif - - let fcnt = s:Tlist_Process_Filelist(flist) - echon "\rAdded " . fcnt . " files to the taglist" -endfunction - -" Tlist_Extract_Tagtype -" Extract the tag type from the tag text -function! s:Tlist_Extract_Tagtype(tag_line) - " The tag type is after the tag prototype field. The prototype field - " ends with the /;"\t string. We add 4 at the end to skip the characters - " in this special string.. - let start = strridx(a:tag_line, '/;"' . "\t") + 4 - let end = strridx(a:tag_line, 'line:') - 1 - let ttype = strpart(a:tag_line, start, end - start) - - return ttype -endfunction - -" Tlist_Extract_Tag_Scope -" Extract the tag scope from the tag text -function! s:Tlist_Extract_Tag_Scope(tag_line) - let start = strridx(a:tag_line, 'line:') - let end = strridx(a:tag_line, "\t") - if end <= start - return '' - endif - - let tag_scope = strpart(a:tag_line, end + 1) - let tag_scope = strpart(tag_scope, stridx(tag_scope, ':') + 1) - - return tag_scope -endfunction - -" Tlist_Refresh() -" Refresh the taglist -function! s:Tlist_Refresh() - call s:Tlist_Log_Msg('Tlist_Refresh (Skip_Refresh = ' . - \ s:Tlist_Skip_Refresh . ', ' . bufname('%') . ')') - " If we are entering the buffer from one of the taglist functions, then - " no need to refresh the taglist window again. - if s:Tlist_Skip_Refresh - " We still need to update the taglist menu - if g:Tlist_Show_Menu - call s:Tlist_Menu_Update_File(0) - endif - return - endif - - " If part of the winmanager plugin and not configured to process - " tags always and not configured to display the tags menu, then return - if (s:tlist_app_name == 'winmanager') && !g:Tlist_Process_File_Always - \ && !g:Tlist_Show_Menu - return - endif - - " Skip buffers with 'buftype' set to nofile, nowrite, quickfix or help - if &buftype != '' - return - endif - - let filename = fnamemodify(bufname('%'), ':p') - let ftype = s:Tlist_Get_Buffer_Filetype('%') - - " If the file doesn't support tag listing, skip it - if s:Tlist_Skip_File(filename, ftype) - return - endif - - let tlist_win = bufwinnr(g:TagList_title) - - " If the taglist window is not opened and not configured to process - " tags always and not displaying the tags menu, then return - if tlist_win == -1 && !g:Tlist_Process_File_Always && !g:Tlist_Show_Menu - return - endif - - let fidx = s:Tlist_Get_File_Index(filename) - if fidx == -1 - " Check whether this file is removed based on user request - " If it is, then don't display the tags for this file - if s:Tlist_User_Removed_File(filename) - return - endif - - " If the taglist should not be auto updated, then return - if !g:Tlist_Auto_Update - return - endif - endif - - let cur_lnum = line('.') - - if fidx == -1 - " Update the tags for the file - let fidx = s:Tlist_Process_File(filename, ftype) - else - let mtime = getftime(filename) - if s:tlist_{fidx}_mtime != mtime - " Invalidate the tags listed for this file - let s:tlist_{fidx}_valid = 0 - - " Update the taglist and the window - call Tlist_Update_File(filename, ftype) - - " Store the new file modification time - let s:tlist_{fidx}_mtime = mtime - endif - endif - - " Update the taglist window - if tlist_win != -1 - " Disable screen updates - let old_lazyredraw = &lazyredraw - set nolazyredraw - - " Save the current window number - let save_winnr = winnr() - - " Goto the taglist window - call s:Tlist_Window_Goto_Window() - - if !g:Tlist_Auto_Highlight_Tag || !g:Tlist_Highlight_Tag_On_BufEnter - " Save the cursor position - let save_line = line('.') - let save_col = col('.') - endif - - " Update the taglist window - call s:Tlist_Window_Refresh_File(filename, ftype) - - " Open the fold for the file - exe "silent! " . s:tlist_{fidx}_start . "," . - \ s:tlist_{fidx}_end . "foldopen!" - - if g:Tlist_Highlight_Tag_On_BufEnter && g:Tlist_Auto_Highlight_Tag - if g:Tlist_Show_One_File && s:tlist_cur_file_idx != fidx - " If displaying tags for only one file in the taglist - " window and about to display the tags for a new file, - " then center the current tag line for the new file - let center_tag_line = 1 - else - let center_tag_line = 0 - endif - - " Highlight the current tag - call s:Tlist_Window_Highlight_Tag(filename, cur_lnum, 1, center_tag_line) - else - " Restore the cursor position - if v:version >= 601 - call cursor(save_line, save_col) - else - exe save_line - exe 'normal! ' . save_col . '|' - endif - endif - - " Jump back to the original window - if save_winnr != winnr() - call s:Tlist_Exe_Cmd_No_Acmds(save_winnr . 'wincmd w') - endif - - " Restore screen updates - let &lazyredraw = old_lazyredraw - endif - - " Update the taglist menu - if g:Tlist_Show_Menu - call s:Tlist_Menu_Update_File(0) - endif -endfunction - -" Tlist_Change_Sort() -" Change the sort order of the tag listing -" caller == 'cmd', command used in the taglist window -" caller == 'menu', taglist menu -" action == 'toggle', toggle sort from name to order and vice versa -" action == 'set', set the sort order to sort_type -function! s:Tlist_Change_Sort(caller, action, sort_type) - call s:Tlist_Log_Msg('Tlist_Change_Sort (caller = ' . a:caller . - \ ', action = ' . a:action . ', sort_type = ' . a:sort_type . ')') - if a:caller == 'cmd' - let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(line('.')) - if fidx == -1 - return - endif - - " Remove the previous highlighting - match none - elseif a:caller == 'menu' - let fidx = s:Tlist_Get_File_Index(fnamemodify(bufname('%'), ':p')) - if fidx == -1 - return - endif - endif - - if a:action == 'toggle' - let sort_type = s:tlist_{fidx}_sort_type - - " Toggle the sort order from 'name' to 'order' and vice versa - if sort_type == 'name' - let s:tlist_{fidx}_sort_type = 'order' - else - let s:tlist_{fidx}_sort_type = 'name' - endif - else - let s:tlist_{fidx}_sort_type = a:sort_type - endif - - " Invalidate the tags listed for this file - let s:tlist_{fidx}_valid = 0 - - if a:caller == 'cmd' - " Save the current line for later restoration - let curline = '\V\^' . getline('.') . '\$' - - call s:Tlist_Window_Refresh_File(s:tlist_{fidx}_filename, - \ s:tlist_{fidx}_filetype) - - exe s:tlist_{fidx}_start . ',' . s:tlist_{fidx}_end . 'foldopen!' - - " Go back to the cursor line before the tag list is sorted - call search(curline, 'w') - - call s:Tlist_Menu_Update_File(1) - else - call s:Tlist_Menu_Remove_File() - - call s:Tlist_Refresh() - endif -endfunction - -" Tlist_Update_Current_File() -" Update taglist for the current buffer by regenerating the tag list -" Contributed by WEN Guopeng. -function! s:Tlist_Update_Current_File() - call s:Tlist_Log_Msg('Tlist_Update_Current_File()') - if winnr() == bufwinnr(g:TagList_title) - " In the taglist window. Update the current file - call s:Tlist_Window_Update_File() - else - " Not in the taglist window. Update the current buffer - let filename = fnamemodify(bufname('%'), ':p') - let fidx = s:Tlist_Get_File_Index(filename) - if fidx != -1 - let s:tlist_{fidx}_valid = 0 - endif - let ft = s:Tlist_Get_Buffer_Filetype('%') - call Tlist_Update_File(filename, ft) - endif -endfunction - -" Tlist_Window_Update_File() -" Update the tags displayed in the taglist window -function! s:Tlist_Window_Update_File() - call s:Tlist_Log_Msg('Tlist_Window_Update_File()') - let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(line('.')) - if fidx == -1 - return - endif - - " Remove the previous highlighting - match none - - " Save the current line for later restoration - let curline = '\V\^' . getline('.') . '\$' - - let s:tlist_{fidx}_valid = 0 - - " Update the taglist window - call s:Tlist_Window_Refresh_File(s:tlist_{fidx}_filename, - \ s:tlist_{fidx}_filetype) - - exe s:tlist_{fidx}_start . ',' . s:tlist_{fidx}_end . 'foldopen!' - - " Go back to the tag line before the list is updated - call search(curline, 'w') -endfunction - -" Tlist_Window_Get_Tag_Type_By_Linenum() -" Return the tag type index for the specified line in the taglist window -function! s:Tlist_Window_Get_Tag_Type_By_Linenum(fidx, lnum) - let ftype = s:tlist_{a:fidx}_filetype - - " Determine to which tag type the current line number belongs to using the - " tag type start line number and the number of tags in a tag type - let i = 1 - while i <= s:tlist_{ftype}_count - let ttype = s:tlist_{ftype}_{i}_name - let start_lnum = - \ s:tlist_{a:fidx}_start + s:tlist_{a:fidx}_{ttype}_offset - let end = start_lnum + s:tlist_{a:fidx}_{ttype}_count - if a:lnum >= start_lnum && a:lnum <= end - break - endif - let i = i + 1 - endwhile - - " Current line doesn't belong to any of the displayed tag types - if i > s:tlist_{ftype}_count - return '' - endif - - return ttype -endfunction - -" Tlist_Window_Get_Tag_Index() -" Return the tag index for the specified line in the taglist window -function! s:Tlist_Window_Get_Tag_Index(fidx, lnum) - let ttype = s:Tlist_Window_Get_Tag_Type_By_Linenum(a:fidx, a:lnum) - - " Current line doesn't belong to any of the displayed tag types - if ttype == '' - return 0 - endif - - " Compute the index into the displayed tags for the tag type - let ttype_lnum = s:tlist_{a:fidx}_start + s:tlist_{a:fidx}_{ttype}_offset - let tidx = a:lnum - ttype_lnum - if tidx == 0 - return 0 - endif - - " Get the corresponding tag line and return it - return s:tlist_{a:fidx}_{ttype}_{tidx} -endfunction - -" Tlist_Window_Highlight_Line -" Highlight the current line -function! s:Tlist_Window_Highlight_Line() - " Clear previously selected name - match none - - " Highlight the current line - if g:Tlist_Display_Prototype == 0 - let pat = '/\%' . line('.') . 'l\s\+\zs.*/' - else - let pat = '/\%' . line('.') . 'l.*/' - endif - - exe 'match TagListTagName ' . pat -endfunction - -" Tlist_Window_Open_File -" Open the specified file in either a new window or an existing window -" and place the cursor at the specified tag pattern -function! s:Tlist_Window_Open_File(win_ctrl, filename, tagpat) - call s:Tlist_Log_Msg('Tlist_Window_Open_File (' . a:filename . ',' . - \ a:win_ctrl . ')') - let prev_Tlist_Skip_Refresh = s:Tlist_Skip_Refresh - let s:Tlist_Skip_Refresh = 1 - - if s:tlist_app_name == "winmanager" - " Let the winmanager edit the file - call WinManagerFileEdit(a:filename, a:win_ctrl == 'newwin') - else - - if a:win_ctrl == 'newtab' - " Create a new tab - exe 'tabnew ' . escape(a:filename, ' ') - " Open the taglist window in the new tab - call s:Tlist_Window_Open() - endif - - if a:win_ctrl == 'checktab' - " Check whether the file is present in any of the tabs. - " If the file is present in the current tab, then use the - " current tab. - if bufwinnr(a:filename) != -1 - let file_present_in_tab = 1 - let i = tabpagenr() - else - let i = 1 - let bnum = bufnr(a:filename) - let file_present_in_tab = 0 - while i <= tabpagenr('$') - if index(tabpagebuflist(i), bnum) != -1 - let file_present_in_tab = 1 - break - endif - let i += 1 - endwhile - endif - - if file_present_in_tab - " Goto the tab containing the file - exe 'tabnext ' . i - else - " Open a new tab - exe 'tabnew ' . escape(a:filename, ' ') - - " Open the taglist window - call s:Tlist_Window_Open() - endif - endif - - let winnum = -1 - if a:win_ctrl == 'prevwin' - " Open the file in the previous window, if it is usable - let cur_win = winnr() - wincmd p - if &buftype == '' && !&previewwindow - exe "edit " . escape(a:filename, ' ') - let winnum = winnr() - else - " Previous window is not usable - exe cur_win . 'wincmd w' - endif - endif - - " Goto the window containing the file. If the window is not there, open a - " new window - if winnum == -1 - let winnum = bufwinnr(a:filename) - endif - - if winnum == -1 - " Locate the previously used window for opening a file - let fwin_num = 0 - let first_usable_win = 0 - - let i = 1 - let bnum = winbufnr(i) - while bnum != -1 - if getwinvar(i, 'tlist_file_window') == 'yes' - let fwin_num = i - break - endif - if first_usable_win == 0 && - \ getbufvar(bnum, '&buftype') == '' && - \ !getwinvar(i, '&previewwindow') - " First non-taglist, non-plugin and non-preview window - let first_usable_win = i - endif - let i = i + 1 - let bnum = winbufnr(i) - endwhile - - " If a previously used window is not found, then use the first - " non-taglist window - if fwin_num == 0 - let fwin_num = first_usable_win - endif - - if fwin_num != 0 - " Jump to the file window - exe fwin_num . "wincmd w" - - " If the user asked to jump to the tag in a new window, then split - " the existing window into two. - if a:win_ctrl == 'newwin' - split - endif - exe "edit " . escape(a:filename, ' ') - else - " Open a new window - if g:Tlist_Use_Horiz_Window - exe 'leftabove split ' . escape(a:filename, ' ') - else - if winbufnr(2) == -1 - " Only the taglist window is present - if g:Tlist_Use_Right_Window - exe 'leftabove vertical split ' . - \ escape(a:filename, ' ') - else - exe 'rightbelow vertical split ' . - \ escape(a:filename, ' ') - endif - - " Go to the taglist window to change the window size to - " the user configured value - call s:Tlist_Exe_Cmd_No_Acmds('wincmd p') - if g:Tlist_Use_Horiz_Window - exe 'resize ' . g:Tlist_WinHeight - else - exe 'vertical resize ' . g:Tlist_WinWidth - endif - " Go back to the file window - call s:Tlist_Exe_Cmd_No_Acmds('wincmd p') - else - " A plugin or help window is also present - wincmd w - exe 'leftabove split ' . escape(a:filename, ' ') - endif - endif - endif - " Mark the window, so that it can be reused. - call s:Tlist_Window_Mark_File_Window() - else - if v:version >= 700 - " If the file is opened in more than one window, then check - " whether the last accessed window has the selected file. - " If it does, then use that window. - let lastwin_bufnum = winbufnr(winnr('#')) - if bufnr(a:filename) == lastwin_bufnum - let winnum = winnr('#') - endif - endif - exe winnum . 'wincmd w' - - " If the user asked to jump to the tag in a new window, then split the - " existing window into two. - if a:win_ctrl == 'newwin' - split - endif - endif - endif - - " Jump to the tag - if a:tagpat != '' - " Add the current cursor position to the jump list, so that user can - " jump back using the ' and ` marks. - mark ' - silent call search(a:tagpat, 'w') - - " Bring the line to the middle of the window - normal! z. - - " If the line is inside a fold, open the fold - if foldclosed('.') != -1 - .foldopen - endif - endif - - " If the user selects to preview the tag then jump back to the - " taglist window - if a:win_ctrl == 'preview' - " Go back to the taglist window - let winnum = bufwinnr(g:TagList_title) - exe winnum . 'wincmd w' - else - " If the user has selected to close the taglist window, when a - " tag is selected, close the taglist window - if g:Tlist_Close_On_Select - call s:Tlist_Window_Goto_Window() - close - - " Go back to the window displaying the selected file - let wnum = bufwinnr(a:filename) - if wnum != -1 && wnum != winnr() - call s:Tlist_Exe_Cmd_No_Acmds(wnum . 'wincmd w') - endif - endif - endif - - let s:Tlist_Skip_Refresh = prev_Tlist_Skip_Refresh -endfunction - -" Tlist_Window_Jump_To_Tag() -" Jump to the location of the current tag -" win_ctrl == useopen - Reuse the existing file window -" win_ctrl == newwin - Open a new window -" win_ctrl == preview - Preview the tag -" win_ctrl == prevwin - Open in previous window -" win_ctrl == newtab - Open in new tab -function! s:Tlist_Window_Jump_To_Tag(win_ctrl) - call s:Tlist_Log_Msg('Tlist_Window_Jump_To_Tag(' . a:win_ctrl . ')') - " Do not process comment lines and empty lines - let curline = getline('.') - if curline =~ '^\s*$' || curline[0] == '"' - return - endif - - " If inside a closed fold, then use the first line of the fold - " and jump to the file. - let lnum = foldclosed('.') - if lnum == -1 - " Jump to the selected tag or file - let lnum = line('.') - else - " Open the closed fold - .foldopen! - endif - - let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(lnum) - if fidx == -1 - return - endif - - " Get the tag output for the current tag - let tidx = s:Tlist_Window_Get_Tag_Index(fidx, lnum) - if tidx != 0 - let tagpat = s:Tlist_Get_Tag_SearchPat(fidx, tidx) - - " Highlight the tagline - call s:Tlist_Window_Highlight_Line() - else - " Selected a line which is not a tag name. Just edit the file - let tagpat = '' - endif - - call s:Tlist_Window_Open_File(a:win_ctrl, s:tlist_{fidx}_filename, tagpat) -endfunction - -" Tlist_Window_Show_Info() -" Display information about the entry under the cursor -function! s:Tlist_Window_Show_Info() - call s:Tlist_Log_Msg('Tlist_Window_Show_Info()') - - " Clear the previously displayed line - echo - - " Do not process comment lines and empty lines - let curline = getline('.') - if curline =~ '^\s*$' || curline[0] == '"' - return - endif - - " If inside a fold, then don't display the prototype - if foldclosed('.') != -1 - return - endif - - let lnum = line('.') - - " Get the file index - let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(lnum) - if fidx == -1 - return - endif - - if lnum == s:tlist_{fidx}_start - " Cursor is on a file name - let fname = s:tlist_{fidx}_filename - if strlen(fname) > 50 - let fname = fnamemodify(fname, ':t') - endif - echo fname . ', Filetype=' . s:tlist_{fidx}_filetype . - \ ', Tag count=' . s:tlist_{fidx}_tag_count - return - endif - - " Get the tag output line for the current tag - let tidx = s:Tlist_Window_Get_Tag_Index(fidx, lnum) - if tidx == 0 - " Cursor is on a tag type - let ttype = s:Tlist_Window_Get_Tag_Type_By_Linenum(fidx, lnum) - if ttype == '' - return - endif - - let ttype_name = '' - - let ftype = s:tlist_{fidx}_filetype - let i = 1 - while i <= s:tlist_{ftype}_count - if ttype == s:tlist_{ftype}_{i}_name - let ttype_name = s:tlist_{ftype}_{i}_fullname - break - endif - let i = i + 1 - endwhile - - echo 'Tag type=' . ttype_name . - \ ', Tag count=' . s:tlist_{fidx}_{ttype}_count - return - endif - - " Get the tag search pattern and display it - echo s:Tlist_Get_Tag_Prototype(fidx, tidx) -endfunction - -" Tlist_Find_Nearest_Tag_Idx -" Find the tag idx nearest to the supplied line number -" Returns -1, if a tag couldn't be found for the specified line number -function! s:Tlist_Find_Nearest_Tag_Idx(fidx, linenum) - let sort_type = s:tlist_{a:fidx}_sort_type - - let left = 1 - let right = s:tlist_{a:fidx}_tag_count - - if sort_type == 'order' - " Tags sorted by order, use a binary search. - " The idea behind this function is taken from the ctags.vim script (by - " Alexey Marinichev) available at the Vim online website. - - " If the current line is the less than the first tag, then no need to - " search - let first_lnum = s:Tlist_Get_Tag_Linenum(a:fidx, 1) - - if a:linenum < first_lnum - return -1 - endif - - while left < right - let middle = (right + left + 1) / 2 - let middle_lnum = s:Tlist_Get_Tag_Linenum(a:fidx, middle) - - if middle_lnum == a:linenum - let left = middle - break - endif - - if middle_lnum > a:linenum - let right = middle - 1 - else - let left = middle - endif - endwhile - else - " Tags sorted by name, use a linear search. (contributed by Dave - " Eggum). - " Look for a tag with a line number less than or equal to the supplied - " line number. If multiple tags are found, then use the tag with the - " line number closest to the supplied line number. IOW, use the tag - " with the highest line number. - let closest_lnum = 0 - let final_left = 0 - while left <= right - let lnum = s:Tlist_Get_Tag_Linenum(a:fidx, left) - - if lnum < a:linenum && lnum > closest_lnum - let closest_lnum = lnum - let final_left = left - elseif lnum == a:linenum - let closest_lnum = lnum - let final_left = left - break - else - let left = left + 1 - endif - endwhile - if closest_lnum == 0 - return -1 - endif - if left >= right - let left = final_left - endif - endif - - return left -endfunction - -" Tlist_Window_Highlight_Tag() -" Highlight the current tag -" cntx == 1, Called by the taglist plugin itself -" cntx == 2, Forced by the user through the TlistHighlightTag command -" center = 1, move the tag line to the center of the taglist window -function! s:Tlist_Window_Highlight_Tag(filename, cur_lnum, cntx, center) - " Highlight the current tag only if the user configured the - " taglist plugin to do so or if the user explictly invoked the - " command to highlight the current tag. - if !g:Tlist_Auto_Highlight_Tag && a:cntx == 1 - return - endif - - if a:filename == '' - return - endif - - " Make sure the taglist window is present - let winnum = bufwinnr(g:TagList_title) - if winnum == -1 - call s:Tlist_Warning_Msg('Error: Taglist window is not open') - return - endif - - let fidx = s:Tlist_Get_File_Index(a:filename) - if fidx == -1 - return - endif - - " If the file is currently not displayed in the taglist window, then retrn - if !s:tlist_{fidx}_visible - return - endif - - " If there are no tags for this file, then no need to proceed further - if s:tlist_{fidx}_tag_count == 0 - return - endif - - " Ignore all autocommands - let old_ei = &eventignore - set eventignore=all - - " Save the original window number - let org_winnr = winnr() - - if org_winnr == winnum - let in_taglist_window = 1 - else - let in_taglist_window = 0 - endif - - " Go to the taglist window - if !in_taglist_window - exe winnum . 'wincmd w' - endif - - " Clear previously selected name - match none - - let tidx = s:Tlist_Find_Nearest_Tag_Idx(fidx, a:cur_lnum) - if tidx == -1 - " Make sure the current tag line is visible in the taglist window. - " Calling the winline() function makes the line visible. Don't know - " of a better way to achieve this. - let lnum = line('.') - - if lnum < s:tlist_{fidx}_start || lnum > s:tlist_{fidx}_end - " Move the cursor to the beginning of the file - exe s:tlist_{fidx}_start - endif - - if foldclosed('.') != -1 - .foldopen - endif - - call winline() - - if !in_taglist_window - exe org_winnr . 'wincmd w' - endif - - " Restore the autocommands - let &eventignore = old_ei - return - endif - - " Extract the tag type - let ttype = s:Tlist_Get_Tag_Type_By_Tag(fidx, tidx) - - " Compute the line number - " Start of file + Start of tag type + offset - let lnum = s:tlist_{fidx}_start + s:tlist_{fidx}_{ttype}_offset + - \ s:tlist_{fidx}_{tidx}_ttype_idx - - " Goto the line containing the tag - exe lnum - - " Open the fold - if foldclosed('.') != -1 - .foldopen - endif - - if a:center - " Move the tag line to the center of the taglist window - normal! z. - else - " Make sure the current tag line is visible in the taglist window. - " Calling the winline() function makes the line visible. Don't know - " of a better way to achieve this. - call winline() - endif - - " Highlight the tag name - call s:Tlist_Window_Highlight_Line() - - " Go back to the original window - if !in_taglist_window - exe org_winnr . 'wincmd w' - endif - - " Restore the autocommands - let &eventignore = old_ei - return -endfunction - -" Tlist_Get_Tag_Prototype_By_Line -" Get the prototype for the tag on or before the specified line number in the -" current buffer -function! Tlist_Get_Tag_Prototype_By_Line(...) - if a:0 == 0 - " Arguments are not supplied. Use the current buffer name - " and line number - let filename = bufname('%') - let linenr = line('.') - elseif a:0 == 2 - " Filename and line number are specified - let filename = a:1 - let linenr = a:2 - if linenr !~ '\d\+' - " Invalid line number - return "" - endif - else - " Sufficient arguments are not supplied - let msg = 'Usage: Tlist_Get_Tag_Prototype_By_Line ' . - \ '' - call s:Tlist_Warning_Msg(msg) - return "" - endif - - " Expand the file to a fully qualified name - let filename = fnamemodify(filename, ':p') - if filename == '' - return "" - endif - - let fidx = s:Tlist_Get_File_Index(filename) - if fidx == -1 - return "" - endif - - " If there are no tags for this file, then no need to proceed further - if s:tlist_{fidx}_tag_count == 0 - return "" - endif - - " Get the tag text using the line number - let tidx = s:Tlist_Find_Nearest_Tag_Idx(fidx, linenr) - if tidx == -1 - return "" - endif - - return s:Tlist_Get_Tag_Prototype(fidx, tidx) -endfunction - -" Tlist_Get_Tagname_By_Line -" Get the tag name on or before the specified line number in the -" current buffer -function! Tlist_Get_Tagname_By_Line(...) - if a:0 == 0 - " Arguments are not supplied. Use the current buffer name - " and line number - let filename = bufname('%') - let linenr = line('.') - elseif a:0 == 2 - " Filename and line number are specified - let filename = a:1 - let linenr = a:2 - if linenr !~ '\d\+' - " Invalid line number - return "" - endif - else - " Sufficient arguments are not supplied - let msg = 'Usage: Tlist_Get_Tagname_By_Line ' - call s:Tlist_Warning_Msg(msg) - return "" - endif - - " Make sure the current file has a name - let filename = fnamemodify(filename, ':p') - if filename == '' - return "" - endif - - let fidx = s:Tlist_Get_File_Index(filename) - if fidx == -1 - return "" - endif - - " If there are no tags for this file, then no need to proceed further - if s:tlist_{fidx}_tag_count == 0 - return "" - endif - - " Get the tag name using the line number - let tidx = s:Tlist_Find_Nearest_Tag_Idx(fidx, linenr) - if tidx == -1 - return "" - endif - - return s:tlist_{fidx}_{tidx}_tag_name -endfunction - -" Tlist_Window_Move_To_File -" Move the cursor to the beginning of the current file or the next file -" or the previous file in the taglist window -" dir == -1, move to start of current or previous function -" dir == 1, move to start of next function -function! s:Tlist_Window_Move_To_File(dir) - if foldlevel('.') == 0 - " Cursor is on a non-folded line (it is not in any of the files) - " Move it to a folded line - if a:dir == -1 - normal! zk - else - " While moving down to the start of the next fold, - " no need to do go to the start of the next file. - normal! zj - return - endif - endif - - let fidx = s:Tlist_Window_Get_File_Index_By_Linenum(line('.')) - if fidx == -1 - return - endif - - let cur_lnum = line('.') - - if a:dir == -1 - if cur_lnum > s:tlist_{fidx}_start - " Move to the beginning of the current file - exe s:tlist_{fidx}_start - return - endif - - if fidx != 0 - " Move to the beginning of the previous file - let fidx = fidx - 1 - else - " Cursor is at the first file, wrap around to the last file - let fidx = s:tlist_file_count - 1 - endif - - exe s:tlist_{fidx}_start - return - else - " Move to the beginning of the next file - let fidx = fidx + 1 - - if fidx >= s:tlist_file_count - " Cursor is at the last file, wrap around to the first file - let fidx = 0 - endif - - if s:tlist_{fidx}_start != 0 - exe s:tlist_{fidx}_start - endif - return - endif -endfunction - -" Tlist_Session_Load -" Load a taglist session (information about all the displayed files -" and the tags) from the specified file -function! s:Tlist_Session_Load(...) - if a:0 == 0 || a:1 == '' - call s:Tlist_Warning_Msg('Usage: TlistSessionLoad ') - return - endif - - let sessionfile = a:1 - - if !filereadable(sessionfile) - let msg = 'Taglist: Error - Unable to open file ' . sessionfile - call s:Tlist_Warning_Msg(msg) - return - endif - - " Mark the current window as the file window - call s:Tlist_Window_Mark_File_Window() - - " Source the session file - exe 'source ' . sessionfile - - let new_file_count = g:tlist_file_count - unlet! g:tlist_file_count - - let i = 0 - while i < new_file_count - let ftype = g:tlist_{i}_filetype - unlet! g:tlist_{i}_filetype - - if !exists('s:tlist_' . ftype . '_count') - if s:Tlist_FileType_Init(ftype) == 0 - let i = i + 1 - continue - endif - endif - - let fname = g:tlist_{i}_filename - unlet! g:tlist_{i}_filename - - let fidx = s:Tlist_Get_File_Index(fname) - if fidx != -1 - let s:tlist_{fidx}_visible = 0 - let i = i + 1 - continue - else - " As we are loading the tags from the session file, if this - " file was previously deleted by the user, now we need to - " add it back. So remove the file from the deleted list. - call s:Tlist_Update_Remove_List(fname, 0) - endif - - let fidx = s:Tlist_Init_File(fname, ftype) - - let s:tlist_{fidx}_filename = fname - - let s:tlist_{fidx}_sort_type = g:tlist_{i}_sort_type - unlet! g:tlist_{i}_sort_type - - let s:tlist_{fidx}_filetype = ftype - let s:tlist_{fidx}_mtime = getftime(fname) - - let s:tlist_{fidx}_start = 0 - let s:tlist_{fidx}_end = 0 - - let s:tlist_{fidx}_valid = 1 - - let s:tlist_{fidx}_tag_count = g:tlist_{i}_tag_count - unlet! g:tlist_{i}_tag_count - - let j = 1 - while j <= s:tlist_{fidx}_tag_count - let s:tlist_{fidx}_{j}_tag = g:tlist_{i}_{j}_tag - let s:tlist_{fidx}_{j}_tag_name = g:tlist_{i}_{j}_tag_name - let s:tlist_{fidx}_{j}_ttype_idx = g:tlist_{i}_{j}_ttype_idx - unlet! g:tlist_{i}_{j}_tag - unlet! g:tlist_{i}_{j}_tag_name - unlet! g:tlist_{i}_{j}_ttype_idx - let j = j + 1 - endwhile - - let j = 1 - while j <= s:tlist_{ftype}_count - let ttype = s:tlist_{ftype}_{j}_name - - if exists('g:tlist_' . i . '_' . ttype) - let s:tlist_{fidx}_{ttype} = g:tlist_{i}_{ttype} - unlet! g:tlist_{i}_{ttype} - let s:tlist_{fidx}_{ttype}_offset = 0 - let s:tlist_{fidx}_{ttype}_count = g:tlist_{i}_{ttype}_count - unlet! g:tlist_{i}_{ttype}_count - - let k = 1 - while k <= s:tlist_{fidx}_{ttype}_count - let s:tlist_{fidx}_{ttype}_{k} = g:tlist_{i}_{ttype}_{k} - unlet! g:tlist_{i}_{ttype}_{k} - let k = k + 1 - endwhile - else - let s:tlist_{fidx}_{ttype} = '' - let s:tlist_{fidx}_{ttype}_offset = 0 - let s:tlist_{fidx}_{ttype}_count = 0 - endif - - let j = j + 1 - endwhile - - let i = i + 1 - endwhile - - " If the taglist window is open, then update it - let winnum = bufwinnr(g:TagList_title) - if winnum != -1 - let save_winnr = winnr() - - " Goto the taglist window - call s:Tlist_Window_Goto_Window() - - " Refresh the taglist window - call s:Tlist_Window_Refresh() - - " Go back to the original window - if save_winnr != winnr() - call s:Tlist_Exe_Cmd_No_Acmds('wincmd p') - endif - endif -endfunction - -" Tlist_Session_Save -" Save a taglist session (information about all the displayed files -" and the tags) into the specified file -function! s:Tlist_Session_Save(...) - if a:0 == 0 || a:1 == '' - call s:Tlist_Warning_Msg('Usage: TlistSessionSave ') - return - endif - - let sessionfile = a:1 - - if s:tlist_file_count == 0 - " There is nothing to save - call s:Tlist_Warning_Msg('Warning: Taglist is empty. Nothing to save.') - return - endif - - if filereadable(sessionfile) - let ans = input('Do you want to overwrite ' . sessionfile . ' (Y/N)?') - if ans !=? 'y' - return - endif - - echo "\n" - endif - - let old_verbose = &verbose - set verbose&vim - - exe 'redir! > ' . sessionfile - - silent! echo '" Taglist session file. This file is auto-generated.' - silent! echo '" File information' - silent! echo 'let tlist_file_count = ' . s:tlist_file_count - - let i = 0 - - while i < s:tlist_file_count - " Store information about the file - silent! echo 'let tlist_' . i . "_filename = '" . - \ s:tlist_{i}_filename . "'" - silent! echo 'let tlist_' . i . '_sort_type = "' . - \ s:tlist_{i}_sort_type . '"' - silent! echo 'let tlist_' . i . '_filetype = "' . - \ s:tlist_{i}_filetype . '"' - silent! echo 'let tlist_' . i . '_tag_count = ' . - \ s:tlist_{i}_tag_count - " Store information about all the tags - let j = 1 - while j <= s:tlist_{i}_tag_count - let txt = escape(s:tlist_{i}_{j}_tag, '"\\') - silent! echo 'let tlist_' . i . '_' . j . '_tag = "' . txt . '"' - silent! echo 'let tlist_' . i . '_' . j . '_tag_name = "' . - \ s:tlist_{i}_{j}_tag_name . '"' - silent! echo 'let tlist_' . i . '_' . j . '_ttype_idx' . ' = ' . - \ s:tlist_{i}_{j}_ttype_idx - let j = j + 1 - endwhile - - " Store information about all the tags grouped by their type - let ftype = s:tlist_{i}_filetype - let j = 1 - while j <= s:tlist_{ftype}_count - let ttype = s:tlist_{ftype}_{j}_name - if s:tlist_{i}_{ttype}_count != 0 - let txt = escape(s:tlist_{i}_{ttype}, '"\') - let txt = substitute(txt, "\n", "\\\\n", 'g') - silent! echo 'let tlist_' . i . '_' . ttype . ' = "' . - \ txt . '"' - silent! echo 'let tlist_' . i . '_' . ttype . '_count = ' . - \ s:tlist_{i}_{ttype}_count - let k = 1 - while k <= s:tlist_{i}_{ttype}_count - silent! echo 'let tlist_' . i . '_' . ttype . '_' . k . - \ ' = ' . s:tlist_{i}_{ttype}_{k} - let k = k + 1 - endwhile - endif - let j = j + 1 - endwhile - - silent! echo - - let i = i + 1 - endwhile - - redir END - - let &verbose = old_verbose -endfunction - -" Tlist_Buffer_Removed -" A buffer is removed from the Vim buffer list. Remove the tags defined -" for that file -function! s:Tlist_Buffer_Removed(filename) - call s:Tlist_Log_Msg('Tlist_Buffer_Removed (' . a:filename . ')') - - " Make sure a valid filename is supplied - if a:filename == '' - return - endif - - " Get tag list index of the specified file - let fidx = s:Tlist_Get_File_Index(a:filename) - if fidx == -1 - " File not present in the taglist - return - endif - - " Remove the file from the list - call s:Tlist_Remove_File(fidx, 0) -endfunction - -" When a buffer is deleted, remove the file from the taglist -autocmd BufDelete * silent call s:Tlist_Buffer_Removed(expand(':p')) - -" Tlist_Window_Open_File_Fold -" Open the fold for the specified file and close the fold for all the -" other files -function! s:Tlist_Window_Open_File_Fold(acmd_bufnr) - call s:Tlist_Log_Msg('Tlist_Window_Open_File_Fold (' . a:acmd_bufnr . ')') - - " Make sure the taglist window is present - let winnum = bufwinnr(g:TagList_title) - if winnum == -1 - call s:Tlist_Warning_Msg('Taglist: Error - Taglist window is not open') - return - endif - - " Save the original window number - let org_winnr = winnr() - if org_winnr == winnum - let in_taglist_window = 1 - else - let in_taglist_window = 0 - endif - - if in_taglist_window - " When entering the taglist window, no need to update the folds - return - endif - - " Go to the taglist window - if !in_taglist_window - call s:Tlist_Exe_Cmd_No_Acmds(winnum . 'wincmd w') - endif - - " Close all the folds - silent! %foldclose - - " Get tag list index of the specified file - let fname = fnamemodify(bufname(a:acmd_bufnr + 0), ':p') - if filereadable(fname) - let fidx = s:Tlist_Get_File_Index(fname) - if fidx != -1 - " Open the fold for the file - exe "silent! " . s:tlist_{fidx}_start . "," . - \ s:tlist_{fidx}_end . "foldopen" - endif - endif - - " Go back to the original window - if !in_taglist_window - call s:Tlist_Exe_Cmd_No_Acmds(org_winnr . 'wincmd w') - endif -endfunction - -" Tlist_Window_Check_Auto_Open -" Open the taglist window automatically on Vim startup. -" Open the window only when files present in any of the Vim windows support -" tags. -function! s:Tlist_Window_Check_Auto_Open() - let open_window = 0 - - let i = 1 - let buf_num = winbufnr(i) - while buf_num != -1 - let filename = fnamemodify(bufname(buf_num), ':p') - let ft = s:Tlist_Get_Buffer_Filetype(buf_num) - if !s:Tlist_Skip_File(filename, ft) - let open_window = 1 - break - endif - let i = i + 1 - let buf_num = winbufnr(i) - endwhile - - if open_window - call s:Tlist_Window_Toggle() - endif -endfunction - -" Tlist_Refresh_Folds -" Remove and create the folds for all the files displayed in the taglist -" window. Used after entering a tab. If this is not done, then the folds -" are not properly created for taglist windows displayed in multiple tabs. -function! s:Tlist_Refresh_Folds() - let winnum = bufwinnr(g:TagList_title) - if winnum == -1 - return - endif - - let save_wnum = winnr() - exe winnum . 'wincmd w' - - " First remove all the existing folds - normal! zE - - " Create the folds for each in the tag list - let fidx = 0 - while fidx < s:tlist_file_count - let ftype = s:tlist_{fidx}_filetype - - " Create the folds for each tag type in a file - let j = 1 - while j <= s:tlist_{ftype}_count - let ttype = s:tlist_{ftype}_{j}_name - if s:tlist_{fidx}_{ttype}_count - let s = s:tlist_{fidx}_start + s:tlist_{fidx}_{ttype}_offset - let e = s + s:tlist_{fidx}_{ttype}_count - exe s . ',' . e . 'fold' - endif - let j = j + 1 - endwhile - - exe s:tlist_{fidx}_start . ',' . s:tlist_{fidx}_end . 'fold' - exe 'silent! ' . s:tlist_{fidx}_start . ',' . - \ s:tlist_{fidx}_end . 'foldopen!' - let fidx = fidx + 1 - endwhile - - exe save_wnum . 'wincmd w' -endfunction - -function! s:Tlist_Menu_Add_Base_Menu() - call s:Tlist_Log_Msg('Adding the base menu') - - " Add the menu - anoremenu T&ags.Refresh\ menu :call Tlist_Menu_Refresh() - anoremenu T&ags.Sort\ menu\ by.Name - \ :call Tlist_Change_Sort('menu', 'set', 'name') - anoremenu T&ags.Sort\ menu\ by.Order - \ :call Tlist_Change_Sort('menu', 'set', 'order') - anoremenu T&ags.-SEP1- : - - if &mousemodel =~ 'popup' - anoremenu PopUp.T&ags.Refresh\ menu - \ :call Tlist_Menu_Refresh() - anoremenu PopUp.T&ags.Sort\ menu\ by.Name - \ :call Tlist_Change_Sort('menu', 'set', 'name') - anoremenu PopUp.T&ags.Sort\ menu\ by.Order - \ :call Tlist_Change_Sort('menu', 'set', 'order') - anoremenu PopUp.T&ags.-SEP1- : - endif -endfunction - -let s:menu_char_prefix = - \ '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' - -" Tlist_Menu_Get_Tag_Type_Cmd -" Get the menu command for the specified tag type -" fidx - File type index -" ftype - File Type -" add_ttype_name - To add or not to add the tag type name to the menu entries -" ttype_idx - Tag type index -function! s:Tlist_Menu_Get_Tag_Type_Cmd(fidx, ftype, add_ttype_name, ttype_idx) - " Curly brace variable name optimization - let ftype_ttype_idx = a:ftype . '_' . a:ttype_idx - - let ttype = s:tlist_{ftype_ttype_idx}_name - if a:add_ttype_name - " If the tag type name contains space characters, escape it. This - " will be used to create the menu entries. - let ttype_fullname = escape(s:tlist_{ftype_ttype_idx}_fullname, ' ') - endif - - " Curly brace variable name optimization - let fidx_ttype = a:fidx . '_' . ttype - - " Number of tag entries for this tag type - let tcnt = s:tlist_{fidx_ttype}_count - if tcnt == 0 " No entries for this tag type - return '' - endif - - let mcmd = '' - - " Create the menu items for the tags. - " Depending on the number of tags of this type, split the menu into - " multiple sub-menus, if needed. - if tcnt > g:Tlist_Max_Submenu_Items - let j = 1 - while j <= tcnt - let final_index = j + g:Tlist_Max_Submenu_Items - 1 - if final_index > tcnt - let final_index = tcnt - endif - - " Extract the first and last tag name and form the - " sub-menu name - let tidx = s:tlist_{fidx_ttype}_{j} - let first_tag = s:tlist_{a:fidx}_{tidx}_tag_name - - let tidx = s:tlist_{fidx_ttype}_{final_index} - let last_tag = s:tlist_{a:fidx}_{tidx}_tag_name - - " Truncate the names, if they are greater than the - " max length - let first_tag = strpart(first_tag, 0, g:Tlist_Max_Tag_Length) - let last_tag = strpart(last_tag, 0, g:Tlist_Max_Tag_Length) - - " Form the menu command prefix - let m_prefix = 'anoremenu T\&ags.' - if a:add_ttype_name - let m_prefix = m_prefix . ttype_fullname . '.' - endif - let m_prefix = m_prefix . first_tag . '\.\.\.' . last_tag . '.' - - " Character prefix used to number the menu items (hotkey) - let m_prefix_idx = 0 - - while j <= final_index - let tidx = s:tlist_{fidx_ttype}_{j} - - let tname = s:tlist_{a:fidx}_{tidx}_tag_name - - let mcmd = mcmd . m_prefix . '\&' . - \ s:menu_char_prefix[m_prefix_idx] . '\.' . - \ tname . ' :call Tlist_Menu_Jump_To_Tag(' . - \ tidx . ')|' - - let m_prefix_idx = m_prefix_idx + 1 - let j = j + 1 - endwhile - endwhile - else - " Character prefix used to number the menu items (hotkey) - let m_prefix_idx = 0 - - let m_prefix = 'anoremenu T\&ags.' - if a:add_ttype_name - let m_prefix = m_prefix . ttype_fullname . '.' - endif - let j = 1 - while j <= tcnt - let tidx = s:tlist_{fidx_ttype}_{j} - - let tname = s:tlist_{a:fidx}_{tidx}_tag_name - - let mcmd = mcmd . m_prefix . '\&' . - \ s:menu_char_prefix[m_prefix_idx] . '\.' . - \ tname . ' :call Tlist_Menu_Jump_To_Tag(' . tidx - \ . ')|' - - let m_prefix_idx = m_prefix_idx + 1 - let j = j + 1 - endwhile - endif - - return mcmd -endfunction - -" Update the taglist menu with the tags for the specified file -function! s:Tlist_Menu_File_Refresh(fidx) - call s:Tlist_Log_Msg('Refreshing the tag menu for ' . s:tlist_{a:fidx}_filename) - " The 'B' flag is needed in the 'cpoptions' option - let old_cpoptions = &cpoptions - set cpoptions&vim - - exe s:tlist_{a:fidx}_menu_cmd - - " Update the popup menu (if enabled) - if &mousemodel =~ 'popup' - let cmd = substitute(s:tlist_{a:fidx}_menu_cmd, ' T\\&ags\.', - \ ' PopUp.T\\\&ags.', "g") - exe cmd - endif - - " The taglist menu is not empty now - let s:tlist_menu_empty = 0 - - " Restore the 'cpoptions' settings - let &cpoptions = old_cpoptions -endfunction - -" Tlist_Menu_Update_File -" Add the taglist menu -function! s:Tlist_Menu_Update_File(clear_menu) - if !has('gui_running') - " Not running in GUI mode - return - endif - - call s:Tlist_Log_Msg('Updating the tag menu, clear_menu = ' . a:clear_menu) - - " Remove the tags menu - if a:clear_menu - call s:Tlist_Menu_Remove_File() - - endif - - " Skip buffers with 'buftype' set to nofile, nowrite, quickfix or help - if &buftype != '' - return - endif - - let filename = fnamemodify(bufname('%'), ':p') - let ftype = s:Tlist_Get_Buffer_Filetype('%') - - " If the file doesn't support tag listing, skip it - if s:Tlist_Skip_File(filename, ftype) - return - endif - - let fidx = s:Tlist_Get_File_Index(filename) - if fidx == -1 || !s:tlist_{fidx}_valid - " Check whether this file is removed based on user request - " If it is, then don't display the tags for this file - if s:Tlist_User_Removed_File(filename) - return - endif - - " Process the tags for the file - let fidx = s:Tlist_Process_File(filename, ftype) - if fidx == -1 - return - endif - endif - - let fname = escape(fnamemodify(bufname('%'), ':t'), '.') - if fname != '' - exe 'anoremenu T&ags.' . fname . ' ' - anoremenu T&ags.-SEP2- : - endif - - if !s:tlist_{fidx}_tag_count - return - endif - - if s:tlist_{fidx}_menu_cmd != '' - " Update the menu with the cached command - call s:Tlist_Menu_File_Refresh(fidx) - - return - endif - - " We are going to add entries to the tags menu, so the menu won't be - " empty - let s:tlist_menu_empty = 0 - - let cmd = '' - - " Determine whether the tag type name needs to be added to the menu - " If more than one tag type is present in the taglisting for a file, - " then the tag type name needs to be present - let add_ttype_name = -1 - let i = 1 - while i <= s:tlist_{ftype}_count && add_ttype_name < 1 - let ttype = s:tlist_{ftype}_{i}_name - if s:tlist_{fidx}_{ttype}_count - let add_ttype_name = add_ttype_name + 1 - endif - let i = i + 1 - endwhile - - " Process the tags by the tag type and get the menu command - let i = 1 - while i <= s:tlist_{ftype}_count - let mcmd = s:Tlist_Menu_Get_Tag_Type_Cmd(fidx, ftype, add_ttype_name, i) - if mcmd != '' - let cmd = cmd . mcmd - endif - - let i = i + 1 - endwhile - - " Cache the menu command for reuse - let s:tlist_{fidx}_menu_cmd = cmd - - " Update the menu - call s:Tlist_Menu_File_Refresh(fidx) -endfunction - -" Tlist_Menu_Remove_File -" Remove the tags displayed in the tags menu -function! s:Tlist_Menu_Remove_File() - if !has('gui_running') || s:tlist_menu_empty - return - endif - - call s:Tlist_Log_Msg('Removing the tags menu for a file') - - " Cleanup the Tags menu - silent! unmenu T&ags - if &mousemodel =~ 'popup' - silent! unmenu PopUp.T&ags - endif - - " Add a dummy menu item to retain teared off menu - noremenu T&ags.Dummy l - - silent! unmenu! T&ags - if &mousemodel =~ 'popup' - silent! unmenu! PopUp.T&ags - endif - - call s:Tlist_Menu_Add_Base_Menu() - - " Remove the dummy menu item - unmenu T&ags.Dummy - - let s:tlist_menu_empty = 1 -endfunction - -" Tlist_Menu_Refresh -" Refresh the taglist menu -function! s:Tlist_Menu_Refresh() - call s:Tlist_Log_Msg('Refreshing the tags menu') - let fidx = s:Tlist_Get_File_Index(fnamemodify(bufname('%'), ':p')) - if fidx != -1 - " Invalidate the cached menu command - let s:tlist_{fidx}_menu_cmd = '' - endif - - " Update the taglist, menu and window - call s:Tlist_Update_Current_File() -endfunction - -" Tlist_Menu_Jump_To_Tag -" Jump to the selected tag -function! s:Tlist_Menu_Jump_To_Tag(tidx) - let fidx = s:Tlist_Get_File_Index(fnamemodify(bufname('%'), ':p')) - if fidx == -1 - return - endif - - let tagpat = s:Tlist_Get_Tag_SearchPat(fidx, a:tidx) - if tagpat == '' - return - endif - - " Add the current cursor position to the jump list, so that user can - " jump back using the ' and ` marks. - mark ' - - silent call search(tagpat, 'w') - - " Bring the line to the middle of the window - normal! z. - - " If the line is inside a fold, open the fold - if foldclosed('.') != -1 - .foldopen - endif -endfunction - -" Tlist_Menu_Init -" Initialize the taglist menu -function! s:Tlist_Menu_Init() - call s:Tlist_Menu_Add_Base_Menu() - - " Automatically add the tags defined in the current file to the menu - augroup TagListMenuCmds - autocmd! - - if !g:Tlist_Process_File_Always - autocmd BufEnter * call s:Tlist_Refresh() - endif - autocmd BufLeave * call s:Tlist_Menu_Remove_File() - augroup end - - call s:Tlist_Menu_Update_File(0) -endfunction - -" Tlist_Vim_Session_Load -" Initialize the taglist window/buffer, which is created when loading -" a Vim session file. -function! s:Tlist_Vim_Session_Load() - call s:Tlist_Log_Msg('Tlist_Vim_Session_Load') - - " Initialize the taglist window - call s:Tlist_Window_Init() - - " Refresh the taglist window - call s:Tlist_Window_Refresh() -endfunction - -" Tlist_Set_App -" Set the name of the external plugin/application to which taglist -" belongs. -" Taglist plugin is part of another plugin like cream or winmanager. -function! Tlist_Set_App(name) - if a:name == "" - return - endif - - let s:tlist_app_name = a:name -endfunction - -" Winmanager integration - -" Initialization required for integration with winmanager -function! TagList_Start() - " If current buffer is not taglist buffer, then don't proceed - if bufname('%') != '__Tag_List__' - return - endif - - call Tlist_Set_App('winmanager') - - " Get the current filename from the winmanager plugin - let bufnum = WinManagerGetLastEditedFile() - if bufnum != -1 - let filename = fnamemodify(bufname(bufnum), ':p') - let ftype = s:Tlist_Get_Buffer_Filetype(bufnum) - endif - - " Initialize the taglist window, if it is not already initialized - if !exists('s:tlist_window_initialized') || !s:tlist_window_initialized - call s:Tlist_Window_Init() - call s:Tlist_Window_Refresh() - let s:tlist_window_initialized = 1 - endif - - " Update the taglist window - if bufnum != -1 - if !s:Tlist_Skip_File(filename, ftype) && g:Tlist_Auto_Update - call s:Tlist_Window_Refresh_File(filename, ftype) - endif - endif -endfunction - -function! TagList_IsValid() - return 0 -endfunction - -function! TagList_WrapUp() - return 0 -endfunction - -" restore 'cpo' -let &cpo = s:cpo_save -unlet s:cpo_save - diff --git a/vim_old/snippets/_.snippets b/vim_old/snippets/_.snippets deleted file mode 100644 index c3925a5..0000000 --- a/vim_old/snippets/_.snippets +++ /dev/null @@ -1,7 +0,0 @@ -# Global snippets - -# (c) holds no legal value ;) -snippet c) - `&enc[:2] == "utf" ? "©" : "(c)"` Copyright `strftime("%Y")` ${1:`g:snips_author`}. All Rights Reserved.${2} -snippet date - `strftime("%Y-%m-%d")` diff --git a/vim_old/snippets/autoit.snippets b/vim_old/snippets/autoit.snippets deleted file mode 100644 index 690018c..0000000 --- a/vim_old/snippets/autoit.snippets +++ /dev/null @@ -1,66 +0,0 @@ -snippet if - If ${1:condition} Then - ${2:; True code} - EndIf -snippet el - Else - ${1} -snippet elif - ElseIf ${1:condition} Then - ${2:; True code} -# If/Else block -snippet ifel - If ${1:condition} Then - ${2:; True code} - Else - ${3:; Else code} - EndIf -# If/ElseIf/Else block -snippet ifelif - If ${1:condition 1} Then - ${2:; True code} - ElseIf ${3:condition 2} Then - ${4:; True code} - Else - ${5:; Else code} - EndIf -# Switch block -snippet switch - Switch (${1:condition}) - Case {$2:case1}: - {$3:; Case 1 code} - Case Else: - {$4:; Else code} - EndSwitch -# Select block -snippet select - Select (${1:condition}) - Case {$2:case1}: - {$3:; Case 1 code} - Case Else: - {$4:; Else code} - EndSelect -# While loop -snippet while - While (${1:condition}) - ${2:; code...} - WEnd -# For loop -snippet for - For ${1:n} = ${3:1} to ${2:count} - ${4:; code...} - Next -# New Function -snippet func - Func ${1:fname}(${2:`indent('.') ? 'self' : ''`}): - ${4:Return} - EndFunc -# Message box -snippet msg - MsgBox(${3:MsgType}, ${1:"Title"}, ${2:"Message Text"}) -# Debug Message -snippet debug - MsgBox(0, "Debug", ${1:"Debug Message"}) -# Show Variable Debug Message -snippet showvar - MsgBox(0, "${1:VarName}", $1) diff --git a/vim_old/snippets/c.snippets b/vim_old/snippets/c.snippets deleted file mode 100644 index 89b81ba..0000000 --- a/vim_old/snippets/c.snippets +++ /dev/null @@ -1,110 +0,0 @@ -# main() -snippet main - int main(int argc, const char *argv[]) - { - ${1} - return 0; - } -# #include <...> -snippet inc - #include <${1:stdio}.h>${2} -# #include "..." -snippet Inc - #include "${1:`Filename("$1.h")`}"${2} -# #ifndef ... #define ... #endif -snippet Def - #ifndef $1 - #define ${1:SYMBOL} ${2:value} - #endif${3} -snippet def - #define -snippet ifdef - #ifdef ${1:FOO} - ${2:#define } - #endif -snippet #if - #if ${1:FOO} - ${2} - #endif -# Header Include-Guard -# (the randomizer code is taken directly from TextMate; it could probably be -# cleaner, I don't know how to do it in vim script) -snippet once - #ifndef ${1:`toupper(Filename('', 'UNTITLED').'_'.system("/usr/bin/ruby -e 'print (rand * 2821109907455).round.to_s(36)'"))`} - - #define $1 - - ${2} - - #endif /* end of include guard: $1 */ -# If Condition -snippet if - if (${1:/* condition */}) { - ${2:/* code */} - } -snippet el - else { - ${1} - } -# Tertiary conditional -snippet t - ${1:/* condition */} ? ${2:a} : ${3:b} -# Do While Loop -snippet do - do { - ${2:/* code */} - } while (${1:/* condition */}); -# While Loop -snippet wh - while (${1:/* condition */}) { - ${2:/* code */} - } -# For Loop -snippet for - for (${2:i} = 0; $2 < ${1:count}; $2${3:++}) { - ${4:/* code */} - } -# Custom For Loop -snippet forr - for (${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++}) { - ${5:/* code */} - } -# Function -snippet fun - ${1:void} ${2:function_name}(${3}) - { - ${4:/* code */} - } -# Function Declaration -snippet fund - ${1:void} ${2:function_name}(${3});${4} -# Typedef -snippet td - typedef ${1:int} ${2:MyCustomType};${3} -# Struct -snippet st - struct ${1:`Filename('$1_t', 'name')`} { - ${2:/* data */} - }${3: /* optional variable list */};${4} -# Typedef struct -snippet tds - typedef struct ${2:_$1 }{ - ${3:/* data */} - } ${1:`Filename('$1_t', 'name')`}; -# Typdef enum -snippet tde - typedef enum { - ${1:/* data */} - } ${2:foo}; -# printf -# unfortunately version this isn't as nice as TextMates's, given the lack of a -# dynamic `...` -snippet pr - printf("${1:%s}\n"${2});${3} -# fprintf (again, this isn't as nice as TextMate's version, but it works) -snippet fpr - fprintf(${1:stderr}, "${2:%s}\n"${3});${4} -snippet . - [${1}]${2} -snippet un - unsigned diff --git a/vim_old/snippets/cpp.snippets b/vim_old/snippets/cpp.snippets deleted file mode 100644 index e4850cd..0000000 --- a/vim_old/snippets/cpp.snippets +++ /dev/null @@ -1,30 +0,0 @@ -# Read File Into Vector -snippet readfile - std::vector v; - if (FILE *${2:fp} = fopen(${1:"filename"}, "r")) { - char buf[1024]; - while (size_t len = fread(buf, 1, sizeof(buf), $2)) - v.insert(v.end(), buf, buf + len); - fclose($2); - }${3} -# std::map -snippet map - std::map<${1:key}, ${2:value}> map${3}; -# std::vector -snippet vector - std::vector<${1:char}> v${2}; -# Namespace -snippet ns - namespace ${1:`Filename('', 'my')`} { - ${2} - } /* $1 */ -# Class -snippet cl - class ${1:`Filename('$1_t', 'name')`} { - public: - $1 (${2:arguments}); - virtual ~$1 (); - - private: - ${3:/* data */} - }; diff --git a/vim_old/snippets/html.snippets b/vim_old/snippets/html.snippets deleted file mode 100644 index aefb9db..0000000 --- a/vim_old/snippets/html.snippets +++ /dev/null @@ -1,190 +0,0 @@ -# Some useful Unicode entities -# Non-Breaking Space -snippet nbs -   -# ← -snippet left - ← -# → -snippet right - → -# ↑ -snippet up - ↑ -# ↓ -snippet down - ↓ -# ↩ -snippet return - ↩ -# ⇤ -snippet backtab - ⇤ -# ⇥ -snippet tab - ⇥ -# ⇧ -snippet shift - ⇧ -# ⌃ -snippet control - ⌃ -# ⌅ -snippet enter - ⌅ -# ⌘ -snippet command - ⌘ -# ⌥ -snippet option - ⌥ -# ⌦ -snippet delete - ⌦ -# ⌫ -snippet backspace - ⌫ -# ⎋ -snippet escape - ⎋ -# Generic Doctype -snippet doctype HTML 4.01 Strict - -snippet doctype HTML 4.01 Transitional - -snippet doctype HTML 5 - -snippet doctype XHTML 1.0 Frameset - -snippet doctype XHTML 1.0 Strict - -snippet doctype XHTML 1.0 Transitional - -snippet doctype XHTML 1.1 - -# HTML Doctype 4.01 Strict -snippet docts - -# HTML Doctype 4.01 Transitional -snippet doct - -# HTML Doctype 5 -snippet doct5 - -# XHTML Doctype 1.0 Frameset -snippet docxf - -# XHTML Doctype 1.0 Strict -snippet docxs - -# XHTML Doctype 1.0 Transitional -snippet docxt - -# XHTML Doctype 1.1 -snippet docx - -snippet html - - ${1} - -snippet xhtml - - ${1} - -snippet body - - ${1} - -snippet head - - - - ${1:`substitute(Filename('', 'Page Title'), '^.', '\u&', '')`} - ${2} - -snippet title - ${1:`substitute(Filename('', 'Page Title'), '^.', '\u&', '')`}${2} -snippet script - ${2} -snippet scriptsrc - ${2} -snippet style - ${3} -snippet base - -snippet r - -snippet div -
- ${2} -
-# Embed QT Movie -snippet movie - - - - - - ${6} -snippet fieldset -
- ${1:name} - - ${3} -
-snippet form -
- ${3} - - -

-
-snippet h1 -

${2:$1}

-snippet input - ${4} -snippet label - ${7} -snippet link - ${4} -snippet mailto - ${3:email me} -snippet meta - ${3} -snippet opt - ${3} -snippet optt - ${2} -snippet select - ${5} -snippet table - - - -
${2:Header}
${3:Data}
${4} -snippet textarea - ${5} diff --git a/vim_old/snippets/java.snippets b/vim_old/snippets/java.snippets deleted file mode 100644 index fd705cb..0000000 --- a/vim_old/snippets/java.snippets +++ /dev/null @@ -1,78 +0,0 @@ -snippet main - public static void main (String [] args) - { - ${1:/* code */} - } -snippet pu - public -snippet po - protected -snippet pr - private -snippet st - static -snippet fi - final -snippet ab - abstract -snippet re - return -snippet br - break; -snippet de - default: - ${1} -snippet ca - catch(${1:Exception} ${2:e}) ${3} -snippet th - throw -snippet sy - synchronized -snippet im - import -snippet j.u - java.util -snippet j.i - java.io. -snippet j.b - java.beans. -snippet j.n - java.net. -snippet j.m - java.math. -snippet if - if (${1}) ${2} -snippet el - else -snippet elif - else if (${1}) ${2} -snippet wh - while (${1}) ${2} -snippet for - for (${1}; ${2}; ${3}) ${4} -snippet fore - for (${1} : ${2}) ${3} -snippet sw - switch (${1}) ${2} -snippet cs - case ${1}: - ${2} - ${3} -snippet tc - public class ${1:`Filename()`} extends ${2:TestCase} -snippet t - public void test${1:Name}() throws Exception ${2} -snippet cl - class ${1:`Filename("", "untitled")`} ${2} -snippet in - interface ${1:`Filename("", "untitled")`} ${2:extends Parent}${3} -snippet m - ${1:void} ${2:method}(${3}) ${4:throws }${5} -snippet v - ${1:String} ${2:var}${3: = null}${4};${5} -snippet co - static public final ${1:String} ${2:var} = ${3};${4} -snippet cos - static public final String ${1:var} = "${2}";${3} -snippet as - assert ${1:test} : "${2:Failure message}";${3} diff --git a/vim_old/snippets/javascript.snippets b/vim_old/snippets/javascript.snippets deleted file mode 100644 index 51f5e05..0000000 --- a/vim_old/snippets/javascript.snippets +++ /dev/null @@ -1,74 +0,0 @@ -# Prototype -snippet proto - ${1:class_name}.prototype.${2:method_name} = - function(${3:first_argument}) { - ${4:// body...} - }; -# Function -snippet fun - function ${1:function_name} (${2:argument}) { - ${3:// body...} - } -# Anonymous Function -snippet f - function(${1}) {${2}}; -# if -snippet if - if (${1:true}) {${2}}; -# if ... else -snippet ife - if (${1:true}) {${2}} - else{${3}}; -# tertiary conditional -snippet t - ${1:/* condition */} ? ${2:a} : ${3:b} -# switch -snippet switch - switch(${1:expression}) { - case '${3:case}': - ${4:// code} - break; - ${5} - default: - ${2:// code} - } -# case -snippet case - case '${1:case}': - ${2:// code} - break; - ${3} -# for (...) {...} -snippet for - for (var ${2:i} = 0; $2 < ${1:Things}.length; $2${3:++}) { - ${4:$1[$2]} - }; -# for (...) {...} (Improved Native For-Loop) -snippet forr - for (var ${2:i} = ${1:Things}.length - 1; $2 >= 0; $2${3:--}) { - ${4:$1[$2]} - }; -# while (...) {...} -snippet wh - while (${1:/* condition */}) { - ${2:/* code */} - } -# do...while -snippet do - do { - ${2:/* code */} - } while (${1:/* condition */}); -# Object Method -snippet :f - ${1:method_name}: function(${2:attribute}) { - ${4} - }${3:,} -# setTimeout function -snippet timeout - setTimeout(function() {${3}}${2}, ${1:10}; -# Get Elements -snippet get - getElementsBy${1:TagName}('${2}')${3} -# Get Element -snippet gett - getElementBy${1:Id}('${2}')${3} diff --git a/vim_old/snippets/mako.snippets b/vim_old/snippets/mako.snippets deleted file mode 100644 index 2a0aef9..0000000 --- a/vim_old/snippets/mako.snippets +++ /dev/null @@ -1,54 +0,0 @@ -snippet def - <%def name="${1:name}"> - ${2:} - -snippet call - <%call expr="${1:name}"> - ${2:} - -snippet doc - <%doc> - ${1:} - -snippet text - <%text> - ${1:} - -snippet for - % for ${1:i} in ${2:iter}: - ${3:} - % endfor -snippet if if - % if ${1:condition}: - ${2:} - % endif -snippet if if/else - % if ${1:condition}: - ${2:} - % else: - ${3:} - % endif -snippet try - % try: - ${1:} - % except${2:}: - ${3:pass} - % endtry -snippet wh - % while ${1:}: - ${2:} - % endwhile -snippet $ - ${ ${1:} } -snippet <% - <% ${1:} %> -snippet -snippet inherit - <%inherit file="${1:filename}" /> -snippet include - <%include file="${1:filename}" /> -snippet namespace - <%namespace file="${1:name}" /> -snippet page - <%page args="${1:}" /> diff --git a/vim_old/snippets/objc.snippets b/vim_old/snippets/objc.snippets deleted file mode 100644 index 4749bb7..0000000 --- a/vim_old/snippets/objc.snippets +++ /dev/null @@ -1,184 +0,0 @@ -# #import <...> -snippet Imp - #import <${1:Cocoa/Cocoa.h}>${2} -# #import "..." -snippet imp - #import "${1:`Filename()`.h}"${2} -# @selector(...) -snippet sel - @selector(${1:method}:)${3} -# @"..." string -snippet s - @"${1}"${2} -# Object -snippet o - ${1:NSObject} *${2:foo} = [${3:$1 alloc}]${4};${5} -# NSLog(...) -snippet log - NSLog(@"${1:%@}"${2});${3} -# Class -snippet objc - @interface ${1:`Filename('', 'someClass')`} : ${2:NSObject} - { - } - @end - - @implementation $1 - ${3} - @end -# Class Interface -snippet int - @interface ${1:`Filename('', 'someClass')`} : ${2:NSObject} - {${3} - } - ${4} - @end -# Class Implementation -snippet impl - @implementation ${1:`Filename('', 'someClass')`} - ${2} - @end -snippet init - - (id)init - { - [super init]; - return self; - } -snippet ifself - if (self = [super init]) { - ${1:/* code */} - } - return self; -snippet ibo - IBOutlet ${1:NSSomeClass} *${2:$1};${3} -# Category -snippet cat - @interface ${1:NSObject} (${2:Category}) - @end - - @implementation $1 ($2) - ${3} - @end -# Category Interface -snippet cath - @interface ${1:NSObject} (${2:Category}) - ${3} - @end -# NSArray -snippet array - NSMutableArray *${1:array} = [NSMutable array];${2} -# NSDictionary -snippet dict - NSMutableDictionary *${1:dict} = [NSMutableDictionary dictionary];${2} -# NSBezierPath -snippet bez - NSBezierPath *${1:path} = [NSBezierPath bezierPath];${2} -# Method -snippet m - - (${1:id})${2:method} - { - ${3} - } -# Method declaration -snippet md - - (${1:id})${2:method};${3} -# IBAction declaration -snippet ibad - - (IBAction)${1:method}:(${2:id})sender;${3} -# IBAction method -snippet iba - - (IBAction)${1:method}:(${2:id})sender - { - ${3} - } -# awakeFromNib method -snippet wake - - (void)awakeFromNib - { - ${1} - } -# Class Method -snippet M - + (${1:id})${2:method} - {${3} - return nil; - } -# Sub-method (Call super) -snippet sm - - (${1:id})${2:method} - { - [super $2];${3} - return self; - } -# Method: Initialize -snippet I - + (void) initialize - { - [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWIthObjectsAndKeys: - ${1}@"value", @"key", - nil]]; - } -# Accessor Methods For: -# Object -snippet objacc - - (${1:id})${2:thing} - { - return $2; - } - - - (void)set$2:($1)${3:new$2} - { - [$3 retain]; - [$2 release]; - $2 = $3; - }${4} -# for (object in array) -snippet forin - for (${1:Class} *${2:some$1} in ${3:array}) { - ${4} - } -snippet forarray - unsigned int ${1:object}Count = [${2:array} count]; - - for (unsigned int index = 0; index < $1Count; index++) { - ${3:id} $1 = [$2 $1AtIndex:index]; - ${4} - } -# IBOutlet -# @property (Objective-C 2.0) -snippet prop - @property (${1:retain}) ${2:NSSomeClass} ${3:*$2};${4} -# @synthesize (Objective-C 2.0) -snippet syn - @synthesize ${1:property};${2} -# [[ alloc] init] -snippet alloc - [[${1:foo} alloc] init${2}];${3} -# retain -snippet ret - [${1:foo} retain];${2} -# release -snippet rel - [${1:foo} release]; - ${2:$1 = nil;} -# autorelease -snippet arel - [${1:foo} autorelease]; -# autorelease pool -snippet pool - NSAutoreleasePool *${1:pool} = [[NSAutoreleasePool alloc] init]; - ${2:/* code */} - [$1 drain]; -# Throw an exception -snippet except - NSException *${1:badness}; - $1 = [NSException exceptionWithName:@"${2:$1Name}" - reason:@"${3}" - userInfo:nil]; - [$1 raise]; -snippet prag - #pragma mark ${1:foo} -snippet cl - @class ${1:Foo};${2} -snippet color - [[NSColor ${1:blackColor}] set]; diff --git a/vim_old/snippets/perl.snippets b/vim_old/snippets/perl.snippets deleted file mode 100644 index cf8f9fc..0000000 --- a/vim_old/snippets/perl.snippets +++ /dev/null @@ -1,91 +0,0 @@ -# #!/usr/bin/perl -snippet #! - #!/usr/bin/perl - -# Hash Pointer -snippet . - => -# Function -snippet sub - sub ${1:function_name} { - ${2:#body ...} - } -# Conditional -snippet if - if (${1}) { - ${2:# body...} - } -# Conditional if..else -snippet ife - if (${1}) { - ${2:# body...} - } else { - ${3:# else...} - } -# Conditional if..elsif..else -snippet ifee - if (${1}) { - ${2:# body...} - } elsif (${3}) { - ${4:# elsif...} - } else { - ${5:# else...} - } -# Conditional One-line -snippet xif - ${1:expression} if ${2:condition};${3} -# Unless conditional -snippet unless - unless (${1}) { - ${2:# body...} - } -# Unless conditional One-line -snippet xunless - ${1:expression} unless ${2:condition};${3} -# Try/Except -snippet eval - eval { - ${1:# do something risky...} - }; - if ($@) { - ${2:# handle failure...} - } -# While Loop -snippet wh - while (${1}) { - ${2:# body...} - } -# While Loop One-line -snippet xwh - ${1:expression} while ${2:condition};${3} -# For Loop -snippet for - for (my $${2:var} = 0; $$2 < ${1:count}; $$2${3:++}) { - ${4:# body...} - } -# Foreach Loop -snippet fore - foreach my $${1:x} (@${2:array}) { - ${3:# body...} - } -# Foreach Loop One-line -snippet xfore - ${1:expression} foreach @${2:array};${3} -# Package -snippet cl - package ${1:ClassName}; - - use base qw(${2:ParentClass}); - - sub new { - my $class = shift; - $class = ref $class if ref $class; - my $self = bless {}, $class; - $self; - } - - 1;${3} -# Read File -snippet slurp - my $${1:var}; - { local $/ = undef; local *FILE; open FILE, "<${2:file}"; $$1 = ; close FILE }${3} diff --git a/vim_old/snippets/php.snippets b/vim_old/snippets/php.snippets deleted file mode 100644 index 3ce9e26..0000000 --- a/vim_old/snippets/php.snippets +++ /dev/null @@ -1,216 +0,0 @@ -snippet php - -snippet ec - echo "${1:string}"${2}; -snippet inc - include '${1:file}';${2} -snippet inc1 - include_once '${1:file}';${2} -snippet req - require '${1:file}';${2} -snippet req1 - require_once '${1:file}';${2} -# $GLOBALS['...'] -snippet globals - $GLOBALS['${1:variable}']${2: = }${3:something}${4:;}${5} -snippet $_ COOKIE['...'] - $_COOKIE['${1:variable}']${2} -snippet $_ ENV['...'] - $_ENV['${1:variable}']${2} -snippet $_ FILES['...'] - $_FILES['${1:variable}']${2} -snippet $_ Get['...'] - $_GET['${1:variable}']${2} -snippet $_ POST['...'] - $_POST['${1:variable}']${2} -snippet $_ REQUEST['...'] - $_REQUEST['${1:variable}']${2} -snippet $_ SERVER['...'] - $_SERVER['${1:variable}']${2} -snippet $_ SESSION['...'] - $_SESSION['${1:variable}']${2} -# Start Docblock -snippet /* - /** - * ${1} - **/ -# Class - post doc -snippet doc_cp - /** - * ${1:undocumented class} - * - * @package ${2:default} - * @author ${3:`g:snips_author`} - **/${4} -# Class Variable - post doc -snippet doc_vp - /** - * ${1:undocumented class variable} - * - * @var ${2:string} - **/${3} -# Class Variable -snippet doc_v - /** - * ${3:undocumented class variable} - * - * @var ${4:string} - **/ - ${1:var} $${2};${5} -# Class -snippet doc_c - /** - * ${3:undocumented class} - * - * @packaged ${4:default} - * @author ${5:`g:snips_author`} - **/ - ${1:}class ${2:} - {${6} - } // END $1class $2 -# Constant Definition - post doc -snippet doc_dp - /** - * ${1:undocumented constant} - **/${2} -# Constant Definition -snippet doc_d - /** - * ${3:undocumented constant} - **/ - define(${1}, ${2});${4} -# Function - post doc -snippet doc_fp - /** - * ${1:undocumented function} - * - * @return ${2:void} - * @author ${3:`g:snips_author`} - **/${4} -# Function signature -snippet doc_s - /** - * ${4:undocumented function} - * - * @return ${5:void} - * @author ${6:`g:snips_author`} - **/ - ${1}function ${2}(${3});${7} -# Function -snippet doc_f - /** - * ${4:undocumented function} - * - * @return ${5:void} - * @author ${6:`g:snips_author`} - **/ - ${1}function ${2}(${3}) - {${7} - } -# Header -snippet doc_h - /** - * ${1} - * - * @author ${2:`g:snips_author`} - * @version ${3:$Id$} - * @copyright ${4:$2}, `strftime('%d %B, %Y')` - * @package ${5:default} - **/ - - /** - * Define DocBlock - *// -# Interface -snippet doc_i - /** - * ${2:undocumented class} - * - * @package ${3:default} - * @author ${4:`g:snips_author`} - **/ - interface ${1:} - {${5} - } // END interface $1 -# class ... -snippet class - /** - * ${1} - **/ - class ${2:ClassName} - { - ${3} - function ${4:__construct}(${5:argument}) - { - ${6:// code...} - } - } -# define(...) -snippet def - define('${1}'${2});${3} -# defined(...) -snippet def? - ${1}defined('${2}')${3} -snippet wh - while (${1:/* condition */}) { - ${2:// code...} - } -# do ... while -snippet do - do { - ${2:// code... } - } while (${1:/* condition */}); -snippet if - if (${1:/* condition */}) { - ${2:// code...} - } -snippet ife - if (${1:/* condition */}) { - ${2:// code...} - } else { - ${3:// code...} - } - ${4} -snippet else - else { - ${1:// code...} - } -snippet elseif - elseif (${1:/* condition */}) { - ${2:// code...} - } -# Tertiary conditional -snippet t - $${1:retVal} = (${2:condition}) ? ${3:a} : ${4:b};${5} -snippet switch - switch ($${1:variable}) { - case '${2:value}': - ${3:// code...} - break; - ${5} - default: - ${4:// code...} - break; - } -snippet case - case '${1:value}': - ${2:// code...} - break;${3} -snippet for - for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) { - ${4: // code...} - } -snippet foreach - foreach ($${1:variable} as $${2:key}) { - ${3:// code...} - } -snippet fun - ${1:public }function ${2:FunctionName}(${3}) - { - ${4:// code...} - } -# $... = array (...) -snippet array - $${1:arrayName} = array('${2}' => ${3});${4} diff --git a/vim_old/snippets/python.snippets b/vim_old/snippets/python.snippets deleted file mode 100644 index d511184..0000000 --- a/vim_old/snippets/python.snippets +++ /dev/null @@ -1,86 +0,0 @@ -snippet #! - #!/usr/bin/python - -snippet imp - import ${1:module} -# Module Docstring -snippet docs - ''' - File: ${1:`Filename('$1.py', 'foo.py')`} - Author: ${2:`g:snips_author`} - Description: ${3} - ''' -snippet wh - while ${1:condition}: - ${2:# code...} -snippet for - for ${1:needle} in ${2:haystack}: - ${3:# code...} -# New Class -snippet cl - class ${1:ClassName}(${2:object}): - """${3:docstring for $1}""" - def __init__(self, ${4:arg}): - ${5:super($1, self).__init__()} - self.$4 = $4 - ${6} -# New Function -snippet def - def ${1:fname}(${2:`indent('.') ? 'self' : ''`}): - """${3:docstring for $1}""" - ${4:pass} -snippet deff - def ${1:fname}(${2:`indent('.') ? 'self' : ''`}): - ${3} -# New Method -snippet defs - def ${1:mname}(self, ${2:arg}): - ${3:pass} -# New Property -snippet property - def ${1:foo}(): - doc = "${2:The $1 property.}" - def fget(self): - ${3:return self._$1} - def fset(self, value): - ${4:self._$1 = value} -# Lambda -snippet ld - ${1:var} = lambda ${2:vars} : ${3:action} -snippet . - self. -snippet try Try/Except - try: - ${1:pass} - except ${2:Exception}, ${3:e}: - ${4:raise $3} -snippet try Try/Except/Else - try: - ${1:pass} - except ${2:Exception}, ${3:e}: - ${4:raise $3} - else: - ${5:pass} -snippet try Try/Except/Finally - try: - ${1:pass} - except ${2:Exception}, ${3:e}: - ${4:raise $3} - finally: - ${5:pass} -snippet try Try/Except/Else/Finally - try: - ${1:pass} - except ${2:Exception}, ${3:e}: - ${4:raise $3} - else: - ${5:pass} - finally: - ${6:pass} -# if __name__ == '__main__': -snippet ifmain - if __name__ == '__main__': - ${1:main()} -# __magic__ -snippet _ - __${1:init}__${2} diff --git a/vim_old/snippets/ruby.snippets b/vim_old/snippets/ruby.snippets deleted file mode 100644 index bf1d7f1..0000000 --- a/vim_old/snippets/ruby.snippets +++ /dev/null @@ -1,420 +0,0 @@ -# #!/usr/bin/ruby -snippet #! - #!/usr/bin/ruby - -# New Block -snippet =b - =begin rdoc - ${1} - =end -snippet y - :yields: ${1:arguments} -snippet rb - #!/usr/bin/env ruby -wKU - -snippet req - require "${1}"${2} -snippet # - # => -snippet end - __END__ -snippet case - case ${1:object} - when ${2:condition} - ${3} - end -snippet when - when ${1:condition} - ${2} -snippet def - def ${1:method_name} - ${2} - end -snippet deft - def test_${1:case_name} - ${2} - end -snippet if - if ${1:condition} - ${2} - end -snippet ife - if ${1:condition} - ${2} - else - ${3} - end -snippet elsif - elsif ${1:condition} - ${2} -snippet unless - unless ${1:condition} - ${2} - end -snippet while - while ${1:condition} - ${2} - end -snippet until - until ${1:condition} - ${2} - end -snippet cla class .. end - class ${1:`substitute(Filename(), '^.', '\u&', '')`} - ${2} - end -snippet cla class .. initialize .. end - class ${1:`substitute(Filename(), '^.', '\u&', '')`} - def initialize(${2:args}) - ${3} - end - - - end -snippet cla class .. < ParentClass .. initialize .. end - class ${1:`substitute(Filename(), '^.', '\u&', '')`} < ${2:ParentClass} - def initialize(${3:args}) - ${4} - end - - - end -snippet cla ClassName = Struct .. do .. end - ${1:`substitute(Filename(), '^.', '\u&', '')`} = Struct.new(:${2:attr_names}) do - def ${3:method_name} - ${4} - end - - - end -snippet cla class BlankSlate .. initialize .. end - class ${1:BlankSlate} - instance_methods.each { |meth| undef_method(meth) unless meth =~ /\A__/ } -snippet cla class << self .. end - class << ${1:self} - ${2} - end -# class .. < DelegateClass .. initialize .. end -snippet cla- - class ${1:`substitute(Filename(), '^.', '\u&', '')`} < DelegateClass(${2:ParentClass}) - def initialize(${3:args}) - super(${4:del_obj}) - - ${5} - end - - - end -snippet mod module .. end - module ${1:`substitute(Filename(), '^.', '\u&', '')`} - ${2} - end -snippet mod module .. module_function .. end - module ${1:`substitute(Filename(), '^.', '\u&', '')`} - module_function - - ${2} - end -snippet mod module .. ClassMethods .. end - module ${1:`substitute(Filename(), '^.', '\u&', '')`} - module ClassMethods - ${2} - end - - module InstanceMethods - - end - - def self.included(receiver) - receiver.extend ClassMethods - receiver.send :include, InstanceMethods - end - end -# attr_reader -snippet r - attr_reader :${1:attr_names} -# attr_writer -snippet w - attr_writer :${1:attr_names} -# attr_accessor -snippet rw - attr_accessor :${1:attr_names} -# include Enumerable -snippet Enum - include Enumerable - - def each(&block) - ${1} - end -# include Comparable -snippet Comp - include Comparable - - def <=>(other) - ${1} - end -# extend Forwardable -snippet Forw- - extend Forwardable -# def self -snippet defs - def self.${1:class_method_name} - ${2} - end -# def method_missing -snippet defmm - def method_missing(meth, *args, &blk) - ${1} - end -snippet defd - def_delegator :${1:@del_obj}, :${2:del_meth}, :${3:new_name} -snippet defds - def_delegators :${1:@del_obj}, :${2:del_methods} -snippet am - alias_method :${1:new_name}, :${2:old_name} -snippet app - if __FILE__ == $PROGRAM_NAME - ${1} - end -# usage_if() -snippet usai - if ARGV.${1} - abort "Usage: #{$PROGRAM_NAME} ${2:ARGS_GO_HERE}"${3} - end -# usage_unless() -snippet usau - unless ARGV.${1} - abort "Usage: #{$PROGRAM_NAME} ${2:ARGS_GO_HERE}"${3} - end -snippet array - Array.new(${1:10}) { |${2:i}| ${3} } -snippet hash - Hash.new { |${1:hash}, ${2:key}| $1[$2] = ${3} } -snippet file File.foreach() { |line| .. } - File.foreach(${1:"path/to/file"}) { |${2:line}| ${3} } -snippet file File.read() - File.read(${1:"path/to/file"})${2} -snippet Dir Dir.global() { |file| .. } - Dir.glob(${1:"dir/glob/*"}) { |${2:file}| ${3} } -snippet Dir Dir[".."] - Dir[${1:"glob/**/*.rb"}]${2} -snippet dir - Filename.dirname(__FILE__) -snippet deli - delete_if { |${1:e}| ${2} } -snippet fil - fill(${1:range}) { |${2:i}| ${3} } -# flatten_once() -snippet flao - inject(Array.new) { |${1:arr}, ${2:a}| $1.push(*$2)}${3} -snippet zip - zip(${1:enums}) { |${2:row}| ${3} } -# downto(0) { |n| .. } -snippet dow - downto(${1:0}) { |${2:n}| ${3} } -snippet ste - step(${1:2}) { |${2:n}| ${3} } -snippet tim - times { |${1:n}| ${2} } -snippet upt - upto(${1:1.0/0.0}) { |${2:n}| ${3} } -snippet loo - loop { ${1} } -snippet ea - each { |${1:e}| ${2} } -snippet eab - each_byte { |${1:byte}| ${2} } -snippet eac- each_char { |chr| .. } - each_char { |${1:chr}| ${2} } -snippet eac- each_cons(..) { |group| .. } - each_cons(${1:2}) { |${2:group}| ${3} } -snippet eai - each_index { |${1:i}| ${2} } -snippet eak - each_key { |${1:key}| ${2} } -snippet eal - each_line { |${1:line}| ${2} } -snippet eap - each_pair { |${1:name}, ${2:val}| ${3} } -snippet eas- - each_slice(${1:2}) { |${2:group}| ${3} } -snippet eav - each_value { |${1:val}| ${2} } -snippet eawi - each_with_index { |${1:e}, ${2:i}| ${3} } -snippet reve - reverse_each { |${1:e}| ${2} } -snippet inj - inject(${1:init}) { |${2:mem}, ${3:var}| ${4} } -snippet map - map { |${1:e}| ${2} } -snippet mapwi- - enum_with_index.map { |${1:e}, ${2:i}| ${3} } -snippet sor - sort { |a, b| ${1} } -snippet sorb - sort_by { |${1:e}| ${2} } -snippet ran - sort_by { rand } -snippet all - all? { |${1:e}| ${2} } -snippet any - any? { |${1:e}| ${2} } -snippet cl - classify { |${1:e}| ${2} } -snippet col - collect { |${1:e}| ${2} } -snippet det - detect { |${1:e}| ${2} } -snippet fet - fetch(${1:name}) { |${2:key}| ${3} } -snippet fin - find { |${1:e}| ${2} } -snippet fina - find_all { |${1:e}| ${2} } -snippet gre - grep(${1:/pattern/}) { |${2:match}| ${3} } -snippet sub - ${1:g}sub(${2:/pattern/}) { |${3:match}| ${4} } -snippet sca - scan(${1:/pattern/}) { |${2:match}| ${3} } -snippet max - max { |a, b|, ${1} } -snippet min - min { |a, b|, ${1} } -snippet par - partition { |${1:e}|, ${2} } -snippet rej - reject { |${1:e}|, ${2} } -snippet sel - select { |${1:e}|, ${2} } -snippet lam - lambda { |${1:args}| ${2} } -snippet do - do |${1:variable}| - ${2} - end -snippet : - :${1:key} => ${2:"value"}${3} -snippet ope - open(${1:"path/or/url/or/pipe"}, "${2:w}") { |${3:io}| ${4} } -# path_from_here() -snippet patfh - File.join(File.dirname(__FILE__), *%2[${1:rel path here}])${2} -# unix_filter {} -snippet unif - ARGF.each_line${1} do |${2:line}| - ${3} - end -# option_parse {} -snippet optp - require "optparse" - - options = {${1:default => "args"}} - - ARGV.options do |opts| - opts.banner = "Usage: #{File.basename($PROGRAM_NAME)} -snippet opt - opts.on( "-${1:o}", "--${2:long-option-name}", ${3:String}, - "${4:Option description.}") do |${5:opt}| - ${6} - end -snippet tc - require "test/unit" - - require "${1:library_file_name}" - - class Test${2:$1} < Test::Unit::TestCase - def test_${3:case_name} - ${4} - end - end -snippet ts - require "test/unit" - - require "tc_${1:test_case_file}" - require "tc_${2:test_case_file}"${3} -snippet as - assert(${1:test}, "${2:Failure message.}")${3} -snippet ase - assert_equal(${1:expected}, ${2:actual})${3} -snippet asne - assert_not_equal(${1:unexpected}, ${2:actual})${3} -snippet asid - assert_in_delta(${1:expected_float}, ${2:actual_float}, ${3:2 ** -20})${4} -snippet asio - assert_instance_of(${1:ExpectedClass}, ${2:actual_instance})${3} -snippet asko - assert_kind_of(${1:ExpectedKind}, ${2:actual_instance})${3} -snippet asn - assert_nil(${1:instance})${2} -snippet asnn - assert_not_nil(${1:instance})${2} -snippet asm - assert_match(/${1:expected_pattern}/, ${2:actual_string})${3} -snippet asnm - assert_no_match(/${1:unexpected_pattern}/, ${2:actual_string})${3} -snippet aso - assert_operator(${1:left}, :${2:operator}, ${3:right})${4} -snippet asr - assert_raise(${1:Exception}) { ${2} } -snippet asnr - assert_nothing_raised(${1:Exception}) { ${2} } -snippet asrt - assert_respond_to(${1:object}, :${2:method})${3} -snippet ass assert_same(..) - assert_same(${1:expected}, ${2:actual})${3} -snippet ass assert_send(..) - assert_send([${1:object}, :${2:message}, ${3:args}])${4} -snippet asns - assert_not_same(${1:unexpected}, ${2:actual})${3} -snippet ast - assert_throws(:${1:expected}) { ${2} } -snippet asnt - assert_nothing_thrown { ${1} } -snippet fl - flunk("${1:Failure message.}")${2} -# Benchmark.bmbm do .. end -snippet bm- - TESTS = ${1:10_000} - Benchmark.bmbm do |results| - ${2} - end -snippet rep - results.report("${1:name}:") { TESTS.times { ${2} }} -# Marshal.dump(.., file) -snippet Md - File.open(${1:"path/to/file.dump"}, "wb") { |${2:file}| Marshal.dump(${3:obj}, $2) }${4} -# Mashal.load(obj) -snippet Ml - File.open(${1:"path/to/file.dump"}, "rb") { |${2:file}| Marshal.load($2) }${3} -# deep_copy(..) -snippet deec - Marshal.load(Marshal.dump(${1:obj_to_copy}))${2} -snippet Pn- - PStore.new(${1:"file_name.pstore"})${2} -snippet tra - transaction(${1:true}) { ${2} } -# xmlread(..) -snippet xml- - REXML::Document.new(File.read(${1:"path/to/file"}))${2} -# xpath(..) { .. } -snippet xpa - elements.each(${1:"//Xpath"}) do |${2:node}| - ${3} - end -# class_from_name() -snippet clafn - split("::").inject(Object) { |par, const| par.const_get(const) } -# singleton_class() -snippet sinc - class << self; self end -snippet nam - namespace :${1:`Filename()`} do - ${2} - end -snippet tas - desc "${1:Task description\}" - task :${2:task_name => [:dependent, :tasks]} do - ${3} - end diff --git a/vim_old/snippets/sh.snippets b/vim_old/snippets/sh.snippets deleted file mode 100644 index f035126..0000000 --- a/vim_old/snippets/sh.snippets +++ /dev/null @@ -1,28 +0,0 @@ -# #!/bin/bash -snippet #! - #!/bin/bash - -snippet if - if [[ ${1:condition} ]]; then - ${2:#statements} - fi -snippet elif - elif [[ ${1:condition} ]]; then - ${2:#statements} -snippet for - for (( ${2:i} = 0; $2 < ${1:count}; $2++ )); do - ${3:#statements} - done -snippet wh - while [[ ${1:condition} ]]; do - ${2:#statements} - done -snippet until - until [[ ${1:condition} ]]; do - ${2:#statements} - done -snippet case - case ${1:word} in - ${2:pattern}) - ${3};; - esac diff --git a/vim_old/snippets/snippet.snippets b/vim_old/snippets/snippet.snippets deleted file mode 100644 index 854c058..0000000 --- a/vim_old/snippets/snippet.snippets +++ /dev/null @@ -1,7 +0,0 @@ -# snippets for making snippets :) -snippet snip - snippet ${1:trigger} - ${2} -snippet msnip - snippet ${1:trigger} ${2:description} - ${3} diff --git a/vim_old/snippets/tcl.snippets b/vim_old/snippets/tcl.snippets deleted file mode 100644 index bee2ef8..0000000 --- a/vim_old/snippets/tcl.snippets +++ /dev/null @@ -1,92 +0,0 @@ -# #!/usr/bin/tclsh -snippet #! - #!/usr/bin/tclsh - -# Process -snippet pro - proc ${1:function_name} {${2:args}} { - ${3:#body ...} - } -#xif -snippet xif - ${1:expr}? ${2:true} : ${3:false} -# Conditional -snippet if - if {${1}} { - ${2:# body...} - } -# Conditional if..else -snippet ife - if {${1}} { - ${2:# body...} - } else { - ${3:# else...} - } -# Conditional if..elsif..else -snippet ifee - if {${1}} { - ${2:# body...} - } elseif {${3}} { - ${4:# elsif...} - } else { - ${5:# else...} - } -# If catch then -snippet ifc - if { [catch {${1:#do something...}} ${2:err}] } { - ${3:# handle failure...} - } -# Catch -snippet catch - catch {${1}} ${2:err} ${3:options} -# While Loop -snippet wh - while {${1}} { - ${2:# body...} - } -# For Loop -snippet for - for {set ${2:var} 0} {$$2 < ${1:count}} {${3:incr} $2} { - ${4:# body...} - } -# Foreach Loop -snippet fore - foreach ${1:x} {${2:#list}} { - ${3:# body...} - } -# after ms script... -snippet af - after ${1:ms} ${2:#do something} -# after cancel id -snippet afc - after cancel ${1:id or script} -# after idle -snippet afi - after idle ${1:script} -# after info id -snippet afin - after info ${1:id} -# Expr -snippet exp - expr {${1:#expression here}} -# Switch -snippet sw - switch ${1:var} { - ${3:pattern 1} { - ${4:#do something} - } - default { - ${2:#do something} - } - } -# Case -snippet ca - ${1:pattern} { - ${2:#do something} - }${3} -# Namespace eval -snippet ns - namespace eval ${1:path} {${2:#script...}} -# Namespace current -snippet nsc - namespace current diff --git a/vim_old/snippets/tex.snippets b/vim_old/snippets/tex.snippets deleted file mode 100644 index 22f7316..0000000 --- a/vim_old/snippets/tex.snippets +++ /dev/null @@ -1,115 +0,0 @@ -# \begin{}...\end{} -snippet begin - \begin{${1:env}} - ${2} - \end{$1} -# Tabular -snippet tab - \begin{${1:tabular}}{${2:c}} - ${3} - \end{$1} -# Align(ed) -snippet ali - \begin{align${1:ed}} - ${2} - \end{align$1} -# Gather(ed) -snippet gat - \begin{gather${1:ed}} - ${2} - \end{gather$1} -# Equation -snippet eq - \begin{equation} - ${1} - \end{equation} -# Unnumbered Equation -snippet \ - \\[ - ${1} - \\] -# Enumerate -snippet enum - \begin{enumerate} - \item ${1} - \end{enumerate} -# Itemize -snippet item - \begin{itemize} - \item ${1} - \end{itemize} -# Description -snippet desc - \begin{description} - \item[${1}] ${2} - \end{description} -# Matrix -snippet mat - \begin{${1:p/b/v/V/B/small}matrix} - ${2} - \end{$1matrix} -# Cases -snippet cas - \begin{cases} - ${1:equation}, &\text{ if }${2:case}\\ - ${3} - \end{cases} -# Split -snippet spl - \begin{split} - ${1} - \end{split} -# Part -snippet part - \part{${1:part name}} % (fold) - \label{prt:${2:$1}} - ${3} - % part $2 (end) -# Chapter -snippet cha - \chapter{${1:chapter name}} % (fold) - \label{cha:${2:$1}} - ${3} - % chapter $2 (end) -# Section -snippet sec - \section{${1:section name}} % (fold) - \label{sec:${2:$1}} - ${3} - % section $2 (end) -# Sub Section -snippet sub - \subsection{${1:subsection name}} % (fold) - \label{sub:${2:$1}} - ${3} - % subsection $2 (end) -# Sub Sub Section -snippet subs - \subsubsection{${1:subsubsection name}} % (fold) - \label{ssub:${2:$1}} - ${3} - % subsubsection $2 (end) -# Paragraph -snippet par - \paragraph{${1:paragraph name}} % (fold) - \label{par:${2:$1}} - ${3} - % paragraph $2 (end) -# Sub Paragraph -snippet subp - \subparagraph{${1:subparagraph name}} % (fold) - \label{subp:${2:$1}} - ${3} - % subparagraph $2 (end) -snippet itd - \item[${1:description}] ${2:item} -snippet figure - ${1:Figure}~\ref{${2:fig:}}${3} -snippet table - ${1:Table}~\ref{${2:tab:}}${3} -snippet listing - ${1:Listing}~\ref{${2:list}}${3} -snippet section - ${1:Section}~\ref{${2:sec:}}${3} -snippet page - ${1:page}~\pageref{${2}}${3} diff --git a/vim_old/snippets/vim.snippets b/vim_old/snippets/vim.snippets deleted file mode 100644 index 64e7807..0000000 --- a/vim_old/snippets/vim.snippets +++ /dev/null @@ -1,32 +0,0 @@ -snippet header - " File: ${1:`expand('%:t')`} - " Author: ${2:`g:snips_author`} - " Description: ${3} - ${4:" Last Modified: `strftime("%B %d, %Y")`} -snippet guard - if exists('${1:did_`Filename()`}') || &cp${2: || version < 700} - finish - endif - let $1 = 1${3} -snippet f - fun ${1:function_name}(${2}) - ${3:" code} - endf -snippet for - for ${1:needle} in ${2:haystack} - ${3:" code} - endfor -snippet wh - while ${1:condition} - ${2:" code} - endw -snippet if - if ${1:condition} - ${2:" code} - endif -snippet ife - if ${1:condition} - ${2} - else - ${3} - endif diff --git a/vim_old/snippets/zsh.snippets b/vim_old/snippets/zsh.snippets deleted file mode 100644 index 7aee05b..0000000 --- a/vim_old/snippets/zsh.snippets +++ /dev/null @@ -1,58 +0,0 @@ -# #!/bin/zsh -snippet #! - #!/bin/zsh - -snippet if - if ${1:condition}; then - ${2:# statements} - fi -snippet ife - if ${1:condition}; then - ${2:# statements} - else - ${3:# statements} - fi -snippet elif - elif ${1:condition} ; then - ${2:# statements} -snippet for - for (( ${2:i} = 0; $2 < ${1:count}; $2++ )); do - ${3:# statements} - done -snippet fore - for ${1:item} in ${2:list}; do - ${3:# statements} - done -snippet wh - while ${1:condition}; do - ${2:# statements} - done -snippet until - until ${1:condition}; do - ${2:# statements} - done -snippet repeat - repeat ${1:integer}; do - ${2:# statements} - done -snippet case - case ${1:word} in - ${2:pattern}) - ${3};; - esac -snippet select - select ${1:answer} in ${2:choices}; do - ${3:# statements} - done -snippet ( - ( ${1:#statements} ) -snippet { - { ${1:#statements} } -snippet [ - [[ ${1:test} ]] -snippet always - { ${1:try} } always { ${2:always} } -snippet fun - function ${1:name} (${2:args}) { - ${3:# body} - } diff --git a/vim_old/syntax/jade.vim b/vim_old/syntax/jade.vim deleted file mode 100644 index f65f42e..0000000 --- a/vim_old/syntax/jade.vim +++ /dev/null @@ -1,65 +0,0 @@ -" Vim syntax file -" Language: Jade -" Maintainer: Joshua Borton -" Credits: Tim Pope -" Filenames: *.jade - -if exists("b:current_syntax") - finish -endif - -if !exists("main_syntax") - let main_syntax = 'jade' -endif - -runtime! syntax/html.vim -unlet! b:current_syntax - -syn case match - -syn cluster jadeTop contains=jadeBegin,jadeComment -syn match jadeBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=jadeTag,jadeClassChar,jadeIdChar,jadePlainChar -syn match jadeTag "\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@jadeComponent -syn cluster jadeComponent contains=jadeAttributes,jadeIdChar,jadeClassChar,jadePlainChar -syn match jadeComment ' *\/\/.*$' -syn region jadeAttributes matchgroup=jadeAttributesDelimiter start="(" skip=+\%(\\\\\)*\\'+ end=")" contained contains=htmlArg,jadeAttributeString,htmlEvent,htmlCssDefinition nextgroup=@jadeComponent -syn match jadeClassChar "\." contained nextgroup=jadeClass -syn match jadeIdChar "#{\@!" contained nextgroup=jadeId -syn match jadeClass "\%(\w\|-\)\+" contained nextgroup=@jadeComponent -syn match jadeId "\%(\w\|-\)\+" contained nextgroup=@jadeComponent -syn region jadeDocType start="^\s*!!!" end="$" - -syn match jadePlainChar "\\" contained -syn region jadeInterpolation matchgroup=jadeInterpolationDelimiter start="#{" end="}" contains=@htmlJavaScript -syn match jadeInterpolationEscape "\\\@ -" Last Change: June 4, 2009 -" Version: 0.7.7 -" Changes: Add "undefined" as a type keyword -" -" TODO: -" - Add the HTML syntax inside the JSDoc - -if !exists("main_syntax") - if version < 600 - syntax clear - elseif exists("b:current_syntax") - finish - endif - let main_syntax = 'javascript' -endif - -"" Drop fold if it set but VIM doesn't support it. -let b:javascript_fold='true' -if version < 600 " Don't support the old version - unlet! b:javascript_fold -endif - -"" dollar sigh is permittd anywhere in an identifier -setlocal iskeyword+=$ - -syntax sync fromstart - -"" JavaScript comments -syntax keyword javaScriptCommentTodo TODO FIXME XXX TBD contained -syntax region javaScriptLineComment start=+\/\/+ end=+$+ keepend contains=javaScriptCommentTodo,@Spell -syntax region javaScriptLineComment start=+^\s*\/\/+ skip=+\n\s*\/\/+ end=+$+ keepend contains=javaScriptCommentTodo,@Spell fold -syntax region javaScriptCvsTag start="\$\cid:" end="\$" oneline contained -syntax region javaScriptComment start="/\*" end="\*/" contains=javaScriptCommentTodo,javaScriptCvsTag,@Spell fold - -"" JSDoc support start -if !exists("javascript_ignore_javaScriptdoc") - syntax case ignore - - "" syntax coloring for javadoc comments (HTML) - "syntax include @javaHtml :p:h/html.vim - "unlet b:current_syntax - - syntax region javaScriptDocComment matchgroup=javaScriptComment start="/\*\*\s*$" end="\*/" contains=javaScriptDocTags,javaScriptCommentTodo,javaScriptCvsTag,@javaScriptHtml,@Spell fold - syntax match javaScriptDocTags contained "@\(param\|argument\|requires\|exception\|throws\|type\|class\|extends\|see\|link\|member\|module\|method\|title\|namespace\|optional\|default\|base\|file\)\>" nextgroup=javaScriptDocParam,javaScriptDocSeeTag skipwhite - syntax match javaScriptDocTags contained "@\(beta\|deprecated\|description\|fileoverview\|author\|license\|version\|returns\=\|constructor\|private\|protected\|final\|ignore\|addon\|exec\)\>" - syntax match javaScriptDocParam contained "\%(#\|\w\|\.\|:\|\/\)\+" - syntax region javaScriptDocSeeTag contained matchgroup=javaScriptDocSeeTag start="{" end="}" contains=javaScriptDocTags - - syntax case match -endif "" JSDoc end - -syntax case match - -"" Syntax in the JavaScript code -syntax match javaScriptSpecial "\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\." -syntax region javaScriptStringD start=+"+ skip=+\\\\\|\\$"+ end=+"+ contains=javaScriptSpecial,@htmlPreproc -syntax region javaScriptStringS start=+'+ skip=+\\\\\|\\$'+ end=+'+ contains=javaScriptSpecial,@htmlPreproc -syntax region javaScriptRegexpString start=+/\(\*\|/\)\@!+ skip=+\\\\\|\\/+ end=+/[gim]\{,3}+ contains=javaScriptSpecial,@htmlPreproc oneline -syntax match javaScriptNumber /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/ -syntax match javaScriptFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/ -syntax match javaScriptLabel /\(?\s*\)\@/ - syntax match javaScriptDomElemFuncs contained /\%(insertBefore\|replaceChild\|removeChild\|appendChild\|hasChildNodes\|cloneNode\|normalize\|isSupported\|hasAttributes\|getAttribute\|setAttribute\|removeAttribute\|getAttributeNode\|setAttributeNode\|removeAttributeNode\|getElementsByTagName\|getAttributeNS\|setAttributeNS\|removeAttributeNS\|getAttributeNodeNS\|setAttributeNodeNS\|getElementsByTagNameNS\|hasAttribute\|hasAttributeNS\)\>/ nextgroup=javaScriptParen skipwhite - " HTML things - syntax match javaScriptHtmlElemAttrs contained /\%(className\|clientHeight\|clientLeft\|clientTop\|clientWidth\|dir\|id\|innerHTML\|lang\|length\|offsetHeight\|offsetLeft\|offsetParent\|offsetTop\|offsetWidth\|scrollHeight\|scrollLeft\|scrollTop\|scrollWidth\|style\|tabIndex\|title\)\>/ - syntax match javaScriptHtmlElemFuncs contained /\%(blur\|click\|focus\|scrollIntoView\|addEventListener\|dispatchEvent\|removeEventListener\|item\)\>/ nextgroup=javaScriptParen skipwhite - - " CSS Styles in JavaScript - syntax keyword javaScriptCssStyles contained color font fontFamily fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontWeight letterSpacing lineBreak lineHeight quotes rubyAlign rubyOverhang rubyPosition - syntax keyword javaScriptCssStyles contained textAlign textAlignLast textAutospace textDecoration textIndent textJustify textJustifyTrim textKashidaSpace textOverflowW6 textShadow textTransform textUnderlinePosition - syntax keyword javaScriptCssStyles contained unicodeBidi whiteSpace wordBreak wordSpacing wordWrap writingMode - syntax keyword javaScriptCssStyles contained bottom height left position right top width zIndex - syntax keyword javaScriptCssStyles contained border borderBottom borderLeft borderRight borderTop borderBottomColor borderLeftColor borderTopColor borderBottomStyle borderLeftStyle borderRightStyle borderTopStyle borderBottomWidth borderLeftWidth borderRightWidth borderTopWidth borderColor borderStyle borderWidth borderCollapse borderSpacing captionSide emptyCells tableLayout - syntax keyword javaScriptCssStyles contained margin marginBottom marginLeft marginRight marginTop outline outlineColor outlineStyle outlineWidth padding paddingBottom paddingLeft paddingRight paddingTop - syntax keyword javaScriptCssStyles contained listStyle listStyleImage listStylePosition listStyleType - syntax keyword javaScriptCssStyles contained background backgroundAttachment backgroundColor backgroundImage gackgroundPosition backgroundPositionX backgroundPositionY backgroundRepeat - syntax keyword javaScriptCssStyles contained clear clip clipBottom clipLeft clipRight clipTop content counterIncrement counterReset cssFloat cursor direction display filter layoutGrid layoutGridChar layoutGridLine layoutGridMode layoutGridType - syntax keyword javaScriptCssStyles contained marks maxHeight maxWidth minHeight minWidth opacity MozOpacity overflow overflowX overflowY verticalAlign visibility zoom cssText - syntax keyword javaScriptCssStyles contained scrollbar3dLightColor scrollbarArrowColor scrollbarBaseColor scrollbarDarkShadowColor scrollbarFaceColor scrollbarHighlightColor scrollbarShadowColor scrollbarTrackColor - - " Highlight ways - syntax match javaScriptDotNotation "\." nextgroup=javaScriptPrototype,javaScriptDomElemAttrs,javaScriptDomElemFuncs,javaScriptHtmlElemAttrs,javaScriptHtmlElemFuncs - syntax match javaScriptDotNotation "\.style\." nextgroup=javaScriptCssStyles - -endif "DOM/HTML/CSS - -"" end DOM/HTML/CSS specified things - - -"" Code blocks -syntax cluster javaScriptAll contains=javaScriptComment,javaScriptLineComment,javaScriptDocComment,javaScriptStringD,javaScriptStringS,javaScriptRegexpString,javaScriptNumber,javaScriptFloat,javaScriptLabel,javaScriptSource,javaScriptType,javaScriptOperator,javaScriptBoolean,javaScriptNull,javaScriptFunction,javaScriptConditional,javaScriptRepeat,javaScriptBranch,javaScriptStatement,javaScriptGlobalObjects,javaScriptExceptions,javaScriptFutureKeys,javaScriptDomErrNo,javaScriptDomNodeConsts,javaScriptHtmlEvents,javaScriptDotNotation -syntax region javaScriptBracket matchgroup=javaScriptBracket transparent start="\[" end="\]" contains=@javaScriptAll,javaScriptParensErrB,javaScriptParensErrC,javaScriptBracket,javaScriptParen,javaScriptBlock,@htmlPreproc -syntax region javaScriptParen matchgroup=javaScriptParen transparent start="(" end=")" contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrC,javaScriptParen,javaScriptBracket,javaScriptBlock,@htmlPreproc -syntax region javaScriptBlock matchgroup=javaScriptBlock transparent start="{" end="}" contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrB,javaScriptParen,javaScriptBracket,javaScriptBlock,@htmlPreproc - -"" catch errors caused by wrong parenthesis -syntax match javaScriptParensError ")\|}\|\]" -syntax match javaScriptParensErrA contained "\]" -syntax match javaScriptParensErrB contained ")" -syntax match javaScriptParensErrC contained "}" - -if main_syntax == "javascript" - syntax sync clear - syntax sync ccomment javaScriptComment minlines=200 - syntax sync match javaScriptHighlight grouphere javaScriptBlock /{/ -endif - -"" Fold control -if exists("b:javascript_fold") - syntax match javaScriptFunction /\/ nextgroup=javaScriptFuncName skipwhite - syntax match javaScriptOpAssign /=\@= 508 || !exists("did_javascript_syn_inits") - if version < 508 - let did_javascript_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink javaScriptComment Comment - HiLink javaScriptLineComment Comment - HiLink javaScriptDocComment Comment - HiLink javaScriptCommentTodo Todo - HiLink javaScriptCvsTag Function - HiLink javaScriptDocTags Special - HiLink javaScriptDocSeeTag Function - HiLink javaScriptDocParam Function - HiLink javaScriptStringS String - HiLink javaScriptStringD String - HiLink javaScriptRegexpString String - HiLink javaScriptCharacter Character - HiLink javaScriptPrototype Type - HiLink javaScriptConditional Conditional - HiLink javaScriptBranch Conditional - HiLink javaScriptRepeat Repeat - HiLink javaScriptStatement Statement - HiLink javaScriptFunction Function - HiLink javaScriptError Error - HiLink javaScriptParensError Error - HiLink javaScriptParensErrA Error - HiLink javaScriptParensErrB Error - HiLink javaScriptParensErrC Error - HiLink javaScriptOperator Operator - HiLink javaScriptType Type - HiLink javaScriptNull Type - HiLink javaScriptNumber Number - HiLink javaScriptFloat Number - HiLink javaScriptBoolean Boolean - HiLink javaScriptLabel Label - HiLink javaScriptSpecial Special - HiLink javaScriptSource Special - HiLink javaScriptGlobalObjects Special - HiLink javaScriptExceptions Special - - HiLink javaScriptDomErrNo Constant - HiLink javaScriptDomNodeConsts Constant - HiLink javaScriptDomElemAttrs Label - HiLink javaScriptDomElemFuncs PreProc - - HiLink javaScriptHtmlEvents Special - HiLink javaScriptHtmlElemAttrs Label - HiLink javaScriptHtmlElemFuncs PreProc - - HiLink javaScriptCssStyles Label - - delcommand HiLink -endif - -" Define the htmlJavaScript for HTML syntax html.vim -"syntax clear htmlJavaScript -"syntax clear javaScriptExpression -syntax cluster htmlJavaScript contains=@javaScriptAll,javaScriptBracket,javaScriptParen,javaScriptBlock,javaScriptParenError -syntax cluster javaScriptExpression contains=@javaScriptAll,javaScriptBracket,javaScriptParen,javaScriptBlock,javaScriptParenError,@htmlPreproc - -let b:current_syntax = "javascript" -if main_syntax == 'javascript' - unlet main_syntax -endif - -" vim: ts=4 diff --git a/vim_old/syntax/less.vim b/vim_old/syntax/less.vim deleted file mode 100644 index 95c6260..0000000 --- a/vim_old/syntax/less.vim +++ /dev/null @@ -1,305 +0,0 @@ -" Vim syntax file -" Language: LESS Cascading Style Sheets -" Maintainer: Leaf Corcoran -" Modifier: Bryan J Swift -" URL: http://leafo.net/lessphp/vim/less.vim -" URL: http://gist.github.com/161047 -" Last Change: 2009 August 4 -" LESS by Leaf Corcoran -" CSS2 by Nikolai Weibull -" Full CSS2, HTML4 support by Yeti - -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if !exists("main_syntax") - if version < 600 - syntax clear - elseif exists("b:current_syntax") - finish -endif - let main_syntax = 'less' -endif - -syn case ignore - - - -syn keyword cssTagName abbr acronym address applet area a b base -syn keyword cssTagName basefont bdo big blockquote body br button -syn keyword cssTagName caption center cite code col colgroup dd del -syn keyword cssTagName dfn dir div dl dt em fieldset font form frame -syn keyword cssTagName frameset h1 h2 h3 h4 h5 h6 head hr html img i -syn keyword cssTagName iframe img input ins isindex kbd label legend li -syn keyword cssTagName link map menu meta noframes noscript ol optgroup -syn keyword cssTagName option p param pre q s samp script select small -syn keyword cssTagName span strike strong style sub sup tbody td -syn keyword cssTagName textarea tfoot th thead title tr tt ul u var -syn match cssTagName "\" -syn match cssTagName "\*" - -syn match cssTagName "@page\>" nextgroup=cssDefinition - -syn match cssSelectorOp "[+>.]" -syn match cssSelectorOp2 "[~|]\?=" contained -syn region cssAttributeSelector matchgroup=cssSelectorOp start="\[" end="]" transparent contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ - -try -syn match cssIdentifier "#[A-Za-zÀ-ÿ_@][A-Za-zÀ-ÿ0-9_@-]*" -catch /^.*/ -syn match cssIdentifier "#[A-Za-z_@][A-Za-z0-9_@-]*" -endtry - -syn match cssMedia "@media\>" nextgroup=cssMediaType skipwhite skipnl -syn keyword cssMediaType contained screen print aural braile embosed handheld projection ty tv all nextgroup=cssMediaComma,cssMediaBlock skipwhite skipnl -syn match cssMediaComma "," nextgroup=cssMediaType skipwhite skipnl -syn region cssMediaBlock transparent matchgroup=cssBraces start='{' end='}' contains=cssTagName,cssError,cssComment,cssDefinition,cssURL,cssUnicodeEscape,cssIdentifier - -syn match cssValueInteger "[-+]\=\d\+" -syn match cssValueNumber "[-+]\=\d\+\(\.\d*\)\=" -syn match cssValueLength "[-+]\=\d\+\(\.\d*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\)" - -syn match cssValueAngle contained "[-+]\=\d\+\(\.\d*\)\=\(deg\|grad\|rad\)" -syn match cssValueTime contained "+\=\d\+\(\.\d*\)\=\(ms\|s\)" -syn match cssValueFrequency contained "+\=\d\+\(\.\d*\)\=\(Hz\|kHz\)" - -syn match cssFontDescriptor "@font-face\>" nextgroup=cssFontDescriptorBlock skipwhite skipnl -syn region cssFontDescriptorBlock contained transparent matchgroup=cssBraces start="{" end="}" contains=cssComment,cssError,cssUnicodeEscape,cssFontProp,cssFontAttr,cssCommonAttr,cssStringQ,cssStringQQ,cssFontDescriptorProp,cssValue.*,cssFontDescriptorFunction,cssUnicodeRange,cssFontDescriptorAttr -syn match cssFontDescriptorProp contained "\<\(unicode-range\|unit-per-em\|panose-1\|cap-height\|x-height\|definition-src\)\>" -syn keyword cssFontDescriptorProp contained src stemv stemh slope ascent descent widths bbox baseline centerline mathline topline -syn keyword cssFontDescriptorAttr contained all -syn region cssFontDescriptorFunction contained matchgroup=cssFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cssStringQ,cssStringQQ oneline keepend -syn match cssUnicodeRange contained "U+[0-9A-Fa-f?]\+" -syn match cssUnicodeRange contained "U+\x\+-\x\+" - -syn keyword cssColor contained aqua black blue fuchsia gray green lime maroon navy olive purple red silver teal yellow -" FIXME: These are actually case-insentivie too, but (a) specs recommend using -" mixed-case (b) it's hard to highlight the word `Background' correctly in -" all situations -syn case match -syn keyword cssColor contained ActiveBorder ActiveCaption AppWorkspace ButtonFace ButtonHighlight ButtonShadow ButtonText CaptionText GrayText Highlight HighlightText InactiveBorder InactiveCaption InactiveCaptionText InfoBackground InfoText Menu MenuText Scrollbar ThreeDDarkShadow ThreeDFace ThreeDHighlight ThreeDLightShadow ThreeDShadow Window WindowFrame WindowText Background -syn case ignore -syn match cssColor contained "\" -syn match cssColor contained "\" -syn match cssColor contained "#[0-9A-Fa-f]\{3\}\>" -syn match cssColor contained "#[0-9A-Fa-f]\{6\}\>" -"syn match cssColor contained "\" - -syn keyword cssCommonAttr contained auto none inherit -syn keyword cssCommonAttr contained top bottom -syn keyword cssCommonAttr contained medium normal - -syn match cssFontProp contained "\\(-\(family\|style\|variant\|weight\|size\(-adjust\)\=\|stretch\)\>\)\=" -syn match cssFontAttr contained "\<\(sans-\)\=\" -syn match cssFontAttr contained "\\(-\(caps\|caption\)\>\)\=" -syn match cssFontAttr contained "\" -syn match cssFontAttr contained "\" -syn match cssFontAttr contained "\" -syn match cssFontAttr contained "\<\(\(ultra\|extra\|semi\|status-bar\)-\)\=\(condensed\|expanded\)\>" -syn keyword cssFontAttr contained cursive fantasy monospace italic oblique -syn keyword cssFontAttr contained bold bolder lighter larger smaller -syn keyword cssFontAttr contained icon menu -syn match cssFontAttr contained "\" -syn keyword cssFontAttr contained large smaller larger -syn keyword cssFontAttr contained narrower wider - -syn keyword cssColorProp contained color -syn match cssColorProp contained "\" -syn match cssColorAttr contained "\" - -syn match cssTextProp "\<\(\(word\|letter\)-spacing\|text\(-\(decoration\|transform\|align\|index\|shadow\)\)\=\|vertical-align\|unicode-bidi\|line-height\)\>" -syn match cssTextAttr contained "\" -syn match cssTextAttr contained "\" -syn match cssTextAttr contained "\<\(text-\)\=\(top\|bottom\)\>" -syn keyword cssTextAttr contained underline overline blink sub super middle -syn keyword cssTextAttr contained capitalize uppercase lowercase center justify baseline sub super - -syn match cssBoxProp contained "\<\(margin\|padding\|border\)\(-\(top\|right\|bottom\|left\)\)\=\>" -syn match cssBoxProp contained "\" -syn match cssBoxProp contained "\<\(width\|z-index\)\>" -syn match cssBoxProp contained "\<\(min\|max\)-\(width\|height\)\>" -syn keyword cssBoxProp contained width height float clear overflow clip visibility -syn keyword cssBoxAttr contained thin thick both -syn keyword cssBoxAttr contained dotted dashed solid double groove ridge inset outset -syn keyword cssBoxAttr contained hidden visible scroll collapse - -syn keyword cssGeneratedContentProp contained content quotes -syn match cssGeneratedContentProp contained "\" -syn match cssGeneratedContentProp contained "\" -syn match cssGeneratedContentAttr contained "\<\(no-\)\=\(open\|close\)-quote\>" -syn match cssAuralAttr contained "\" -syn match cssGeneratedContentAttr contained "\<\(lower\|upper\)-\(roman\|alpha\|greek\|latin\)\>" -syn match cssGeneratedContentAttr contained "\<\(hiragana\|katakana\)\(-iroha\)\=\>" -syn match cssGeneratedContentAttr contained "\<\(decimal\(-leading-zero\)\=\|cjk-ideographic\)\>" -syn keyword cssGeneratedContentAttr contained disc circle square hebrew armenian georgian -syn keyword cssGeneratedContentAttr contained inside outside - -syn match cssPagingProp contained "\" -syn keyword cssPagingProp contained size marks inside orphans widows -syn keyword cssPagingAttr contained landscape portrait crop cross always avoid - -syn keyword cssUIProp contained cursor -syn match cssUIProp contained "\" -syn match cssUIAttr contained "\<[ns]\=[ew]\=-resize\>" -syn keyword cssUIAttr contained default crosshair pointer move wait help -syn keyword cssUIAttr contained thin thick -syn keyword cssUIAttr contained dotted dashed solid double groove ridge inset outset -syn keyword cssUIAttr contained invert - -syn match cssRenderAttr contained "\" -syn match cssRenderProp contained "\<\(display\|marker-offset\|unicode-bidi\|white-space\|list-item\|run-in\|inline-table\)\>" -syn keyword cssRenderProp contained position top bottom direction -syn match cssRenderProp contained "\<\(left\|right\)\>" -syn keyword cssRenderAttr contained block inline compact -syn match cssRenderAttr contained "\" -syn keyword cssRenderAttr contained static relative absolute fixed -syn keyword cssRenderAttr contained ltr rtl embed bidi-override pre nowrap -syn match cssRenderAttr contained "\" - -syn match cssAuralProp contained "\<\(pause\|cue\)\(-\(before\|after\)\)\=\>" -syn match cssAuralProp contained "\<\(play-during\|speech-rate\|voice-family\|pitch\(-range\)\=\|speak\(-\(punctuation\|numerals\)\)\=\)\>" -syn keyword cssAuralProp contained volume during azimuth elevation stress richness -syn match cssAuralAttr contained "\<\(x-\)\=\(soft\|loud\)\>" -syn keyword cssAuralAttr contained silent -syn match cssAuralAttr contained "\" -syn keyword cssAuralAttr contained non mix -syn match cssAuralAttr contained "\<\(left\|right\)-side\>" -syn match cssAuralAttr contained "\<\(far\|center\)-\(left\|center\|right\)\>" -syn keyword cssAuralAttr contained leftwards rightwards behind -syn keyword cssAuralAttr contained below level above higher -syn match cssAuralAttr contained "\<\(x-\)\=\(slow\|fast\)\>" -syn keyword cssAuralAttr contained faster slower -syn keyword cssAuralAttr contained male female child code digits continuous - -syn match cssTableProp contained "\<\(caption-side\|table-layout\|border-collapse\|border-spacing\|empty-cells\|speak-header\)\>" -syn keyword cssTableAttr contained fixed collapse separate show hide once always - - - -syn match lessComment "//.*$" contains=@Spell -syn match lessVariable "@[A-Za-z_-][A-Za-z0-9_-]*" contained -syn region lessVariableDefinition start="^@" end=";" contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssDefinition,cssClassName,cssTagName,cssIdentifier,lessComment,lessVariable,lessFunction - -" captures both the definition and the call -syn region lessFunction matchgroup=lessFuncDef start="@[A-Za-z_-][A-Za-z0-9_-]*(" end=")" contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssDefinition,cssClassName,cssTagName,cssIdentifier,lessComment,lessVariable,lessFunction - - - - - -" FIXME: This allows cssMediaBlock before the semicolon, which is wrong. -syn region cssInclude start="@import" end=";" contains=cssComment,cssURL,cssUnicodeEscape,cssMediaType -syn match cssBraces contained "[{}]" -syn match cssError contained "{@<>" -syn region cssDefinition transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssDefinition,cssClassName,cssTagName,cssIdentifier,lessComment,lessVariable,lessFunction -" syn match cssBraceError "}" - -syn match cssPseudoClass ":\S*" contains=cssPseudoClassId,cssUnicodeEscape -syn keyword cssPseudoClassId contained link visited active hover focus before after left right -syn match cssPseudoClassId contained "\" -syn region cssPseudoClassLang matchgroup=cssPseudoClassId start=":lang(" end=")" oneline - -syn region cssComment start="/\*" end="\*/" contains=@Spell - -syn match cssUnicodeEscape "\\\x\{1,6}\s\?" -syn match cssSpecialCharQQ +\\"+ contained -syn match cssSpecialCharQ +\\'+ contained -syn region cssStringQQ start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=cssUnicodeEscape,cssSpecialCharQQ -syn region cssStringQ start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=cssUnicodeEscape,cssSpecialCharQ -syn match cssClassName "\.[A-Za-z][A-Za-z0-9_-]\+" - - - - -if main_syntax == "css" - syn sync minlines=10 -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_less_syn_inits") - if version < 508 - let did_less_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - HiLink lessComment Comment - HiLink lessVariable Special - HiLink lessFuncDef Function - HiLink cssComment Comment - HiLink cssTagName Statement - HiLink cssSelectorOp Special - HiLink cssSelectorOp2 Special - HiLink cssFontProp StorageClass - HiLink cssColorProp storageClass - HiLink cssTextProp StorageClass - HiLink cssBoxProp StorageClass - HiLink cssRenderProp StorageClass - HiLink cssAuralProp StorageClass - HiLink cssRenderProp StorageClass - HiLink cssGeneratedContentProp StorageClass - HiLink cssPagingProp StorageClass - HiLink cssTableProp StorageClass - HiLink cssUIProp StorageClass - HiLink cssFontAttr Type - HiLink cssColorAttr Type - HiLink cssTextAttr Type - HiLink cssBoxAttr Type - HiLink cssRenderAttr Type - HiLink cssAuralAttr Type - HiLink cssGeneratedContentAttr Type - HiLink cssPagingAttr Type - HiLink cssTableAttr Type - HiLink cssUIAttr Type - HiLink cssCommonAttr Type - HiLink cssPseudoClassId PreProc - HiLink cssPseudoClassLang Constant - HiLink cssValueLength Number - HiLink cssValueInteger Number - HiLink cssValueNumber Number - HiLink cssValueAngle Number - HiLink cssValueTime Number - HiLink cssValueFrequency Number - HiLink cssFunction Constant - HiLink cssURL String - HiLink cssFunctionName Function - HiLink cssColor Constant - HiLink cssIdentifier Function - HiLink cssInclude Include - HiLink cssImportant Special - HiLink cssBraces SpecialChar - HiLink cssBraceError Error - HiLink cssError Error - HiLink cssInclude Include - HiLink cssUnicodeEscape Special - HiLink cssStringQQ String - HiLink cssStringQ String - HiLink cssMedia Special - HiLink cssMediaType Special - HiLink cssMediaComma Normal - HiLink cssFontDescriptor Special - HiLink cssFontDescriptorFunction Constant - HiLink cssFontDescriptorProp StorageClass - HiLink cssFontDescriptorAttr Type - HiLink cssUnicodeRange Constant - HiLink cssClassName Function - delcommand HiLink -endif - -let b:current_syntax = "less" - -if main_syntax == 'less' - unlet main_syntax -endif - - -" vim: ts=8 - diff --git a/vim_old/syntax/php.vim b/vim_old/syntax/php.vim deleted file mode 100644 index f7a059b..0000000 --- a/vim_old/syntax/php.vim +++ /dev/null @@ -1,3625 +0,0 @@ -" Vim syntax file -" Language: PHP 4/5 -" Maintainer: Peter Hodge -" Last Change: May 7, 2008 -" -" URL: http://www.vim.org/scripts/script.php?script_id=1571 -" Version: 0.9.7 -" -" ================================================================ -" -" Note: If you are having speed issues loading or editting PHP files, try -" disabling some of the options. In your .vimrc, try adding: -" :let php_folding = 0 -" :let php_strict_blocks = 0 -" -" Also, there is a 'large file' mode which can disable certain options -" if a PHP file is too big (see php_large_file below). -" -" ================================================================ -" -" Note: If you are using a colour terminal with a dark background, you will -" probably find the 'elflord' colorscheme will give you the most -" distinctive colors. -" -" ================================================================ -" -" OPTIONS: -" -" Many of these default to 1 (On), so you would need to set -" them to 0 to turn them off. E.g., in your .vimrc file: -" let php_special_vars = 0 -" let php_special_functions = 0 -" let php_alt_comparisons = 0 -" etc. -" If the variables do not exist, the default value will be used. -" -" -" All options can be set globally or on a per-file basis by using -" global or buffer-local variables. For example, you could turn on -" automatic folding for all PHP scripts in your .vimrc: -" let g:php_folding = 3 -" -" Then you could turn it off in only one file using this command: -" -" :let b:php_folding = 0 | setfiletype php -" -" -" -- PHP FEATURES -- -" -" let php_sql_query = 1/0 [default 0] -" ... for SQL syntax highlighting inside strings -" -" let php_htmlInStrings = 1/0 [default 0] -" ... for HTML syntax highlighting inside strings -" -" let php_baselib = 1/0 [default 0] -" ... for highlighting baselib functions -" -" let php_special_vars = 1/0 [default 1] -" ... to highlight superglobals like $_GET, $_SERVER, etc. -" * always on if using php_oldStyle -" -" let php_special_functions = 1/0 [default 1] -" ... to highlight functions with special behaviour -" e.g., unset(), extract() -" -" let php_alt_comparisons = 1/0 [default 1] -" ... to highlight comparison operators in an alternate colour -" * always on if using php_oldStyle -" -" let php_alt_assignByReference = 1/0 [default 1] -" ... to highlight '=&' in '$foo =& $bar' in an alternate colour. -" This also applies to a function which returns by-reference, -" as well as a function argument which is by-reference. -" -" let php_smart_members = 1/0 [default 0] -" ... syntax works out whether -> indicates a property or method. -" Otherwise method colours may be used on properties, for -" example: -" $object->__get[] = true; -" '__get' would be highlighted as a special method, even -" thought it is clearly a property in this context. -" Note: turning this OFF can improve the highlighting speed on -" object-oriented code -" -" let php_alt_properties = 1/0 [default 0] -" ... use a different color for '->' based on whether it is used -" for property access, method access, or dynamic access (using -" '->{...}') -" * requires php_smart_members -" -" let php_highlight_quotes = 1/0 [default 0] -" ... makes quote characters the same colour as the string -" contents, like in C syntax. -" -" let php_show_semicolon = 1/0 [default 1] -" ... to make the semicolon (;) more visible -" -" let php_smart_semicolon = 1/0 [default 1] -" ... semicolon adopts the color of a 'return' or 'break' keyword -" * requires php_show_semicolon -" Note: this also includes the ':' or ';' which follows a -" 'case' or 'default' inside a switch -" -" let php_alt_blocks = 1/0 [default 1] -" ... colorize { and } around class/function/try/catch bodies -" according to the type of code block. -" * requires php_strict_blocks -" -" let php_alt_arrays = 0/1/2 [default 1] -" ... to colorize ( and ) around an array body, as well as '=>' -" * requires php_strict_blocks -" Setting this to '2' will highlighting the commas as well. -" Commas are not highlighted by default because it's too much -" color. -" -" let php_alt_construct_parents = 0/1 [default 0] -" ... to colorize the ( and ) around an if, while, foreach, or switch -" body. -" * requires ... what? -" TODO: work out dependencies, code them correctly -" -" let php_show_spl = 1/0 [default 1] -" .. to colorize methods which are defined by PHP default interfaces -" TODO: work out what these interfaces are part of: SPL or just -" PHP -" -" let php_show_pcre = 1/0 [default 1] -" (was: 'php_show_preg') -" ... to highlight regular expression patterns inside calls -" to preg_match(), preg_replace(), etc. -" -" -" -- FINDING ERRORS -- -" -" let php_parent_error_close = 1/0 [default 1] -" ... for highlighting parent error ] or ) or } -" * requires php_strict_blocks -" -" let php_parent_error_open = ? -" ... for skipping a php end tag, if there exists an -" open ( or [ without a closing one -" Note: this option is now enabled permanently (unless -" php_strict_blocks is disabled). -" * requires php_strict_blocks -" -" let php_empty_construct_error = 0/1 [default 1] -" ... highlights ';' as an error if it comes immediately after -" an if/else/while/for/foreach/switch statement (the -" logical constructs should have a body). -" * requires php_strict_blocks - -" let php_show_semicolon_error = 1/0 [default 1] -" ... highlights certain cases when ';' is followed by an -" operator such as '+'. -" * requires php_show_semicolon -" -" let php_nested_functions = 0/1 [default 0] -" ... Whether or not to allow contiaining one function inside -" another. This option is mostly for speeding up syntax -" highlighting - { } blocks can by inserted much faster while -" editting a large class. -" Note: this is the only option which might break valid PHP -" code, although only if you define one function inside -" another, which is usually discouraged. -" * only relevant when using php_strict_blocks -" -" -- OTHER OPTIONS -- -" -" let php_large_file = 0/? [ default 3000 ] -" ... If a PHP script has more lines than this limit (e.g., more -" than 3000 lines), some options are automatically turned off -" to help it load faster. These options are: -" php_strict_blocks = 0 -" php_smart_members = 0 -" php_smart_semicolon = 0 -" php_show_pcre = 0 -" php_folding = 0 -" Note: If you set this option to '0', then this feature will -" be disabled; thus you can use: -" :let b:php_large_file = 0 | setfiletype php -" to reload the current file with the disabled syntax options -" re-activated. -" -" let php_strict_blocks = 1/0 [default 1] -" ... to match together all {} () and [] blocks correctly. This is -" required by some of the other options for finding errors and -" applying correct colors to { } blocks, etc. However, it may -" cause Vim to slow down on large files. -" -" let php_asp_tags = 1/0 [default 0] -" ... for highlighting ASP-style short tags: <% %> -" -" let php_noShortTags = 1/0 [default 0] -" ... don't sync as php -" * This has been deprecated in favour of php_short_tags (which -" has the opposite meaning) -" -" let php_short_tags = 1/0 [default 1] -" ... highlight blocks as php. If this is OFF, you need to -" use the longer -" -" let php_oldStyle = 1 -" ... for using old colorstyle -" -" let php_folding = 1/2/3 [default 0] -" ... 1: for folding classes and functions -" 2: for folding all { } regions -" 3: for folding only functions -" TODO: documentation for php_folding_manual -" -" let php_fold_arrays = 0/1 [default 0] -" ... To fold arrays as well. -" * requires php_folding, php_strict_blocks, php_alt_arrays -" -" let php_fold_heredoc = 0/1 [default 0] -" ... Fold heredoc blocks ($string = << 0 to sync at least x lines backwards -" x = 0 to sync from start -" -" -" ================================================================ -" -" TODO LIST: -" -" PRIORITY: -" - document the phpControlParent feature, make sure it works fully, or not -" at all -" - what to do about 'iskeyword' containing '$'? -" - test syntax against older Vims (6.4, 6.0, 5.7) -" - concat rid of lines beginning with '\' -" - allow turning off all semicolon errors -" - fix bug in highlighting of pattern: /[\\\]/ and /[\\]]/ -" - fix bug in highlighting of pattern: "/\$/" should make the '$' match the -" end-of-pattern -" - case/default syntax items don't work inside a switch/endswitch -" although it's still OK using {...} -" -" PHP Syntax: -" - review support for PHP built-in superglobals: -" - ensure all PHP 5.2 superglobals are recognized -" - review support for PHP built-in constants, make sure I've got them all -" - make support for PHP built-in class methods optional. -" - review highlight links to ensure maximum readability on GUI -" and color terminal using colorschemes 'elflord' and 'default' -" - new group phpReservedFunction, because some parts of -" phpSpecialFunction can be used as a method name. -" - what is php_oldStyle? is it still needed? -" - use 'nextgroup' to highlight errors when a ']' or ')' is followed by -" a constant/variable or function call. This will also help find when -" a closing ')' is missing. -" - Review syncing searches, see if there is anything we can add to help the -" syncing process. -" - make ';' on the end of a while() NOT a problem unless it is followed by -" a '{' -" -" PCRE Syntax: -" - fix problem: in regex "/(...)\1/", '\1' does NOT refer to a backreference! -" this is caused by incorrect matching of escape sequences in -" double-quoted strings where the double-quote escape sequences should -" take precedence -" - fix problem: this line breaks folding -" preg_match("#^require MODULES_PATH \. (['\"])main\.inc\.php\\1;$#m", '', $m)) -" -" - decide on terminology: 'PCRE' or 'PREG' -" - Review effects of paired delimiters when combined with other -" PCRE complex atoms using those symbols -" - decide on better colors for the -" (?(?=lookahead/lookbehind)conditional|sub-pattern) -" -" -" Future Plans: -" - option to choose PHP4 or PHP5 compatibility -" - differentiate between an interface block and a class block -" - add ability to highlight user-defined functions and keywords -" using any of the following means: -" 1) a comma-separated string of user functions -" 2) a file containing user functions -" 3) using names from the tags file(s) -" (this may be better as a separate plugin) -" - add support for phpDocumentor comment blocks and tags -" - add support for POSIX Regex patterns -" - allow easy embedding of the PHP syntax using 'contains=@phpClTop' or -" 'syn region phpRegion ...' -" - automatically select best colors by examining the colorscheme -" - check to see if 'baselib' needs to be highlighted still -" - Add support 2nd parameter to preg_replace and highlight -" "\1" and other confusing sequences as errors ("\1" is "\x01") -" - Add support for class constants (foo::bar) -" -" Difficult To Implement: -" - Highlight expressions without operators or commas, such as: -" echo $a $b; -" These expressions are *really* difficult to find efficiently. -" - Folding around 'case' blocks. -" -" -" -" ================================================================ -" -" Note: -" - syntax case is 'ignore' unless explicitly set to 'match' -" for a single item. - -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syn clear -elseif exists("b:current_syntax") - finish -endif - -if !exists("main_syntax") - let main_syntax = 'php' -endif - -" TODO: what's all this about? -if version < 600 - unlet! php_folding - if exists("php_sync_method") && !php_sync_method - let php_sync_method=-1 - endif - so :p:h/html.vim -else - runtime! syntax/html.vim - unlet b:current_syntax -endif - -" accept old options -if !exists("php_sync_method") - if exists("php_minlines") - let php_sync_method=php_minlines - else - let php_sync_method=-1 - endif -endif - -function! s:ChooseValue(name, default) - if exists('b:' . a:name) - return b:{a:name} - elseif exists('g:' . a:name) - return g:{a:name} - else - return a:default - endif -endfunction - -" set up variables based on global or buffer variables {{{1 - " Is it a large file? (s:large_file) {{{2 - let s:large_file_limit = s:ChooseValue('php_large_file', 3000) - let s:large_file = (s:large_file_limit == 0) ? 0 : (line('$') >= s:large_file_limit) - - if s:large_file - echohl WarningMsg - echomsg printf('WARNING: Large PHP File (%d lines); some syntax options have been disabled.', line('$')) - echohl None - endif - - " Strict Blocks (s:strict_blocks) {{{2 - let s:strict_blocks = s:large_file ? 0 : s:ChooseValue('php_strict_blocks', 1) - - " Fold Level (s:folding) {{{2 - let s:folding = s:large_file ? 0 : s:ChooseValue('php_folding', 0) - - " Fold manually (s:fold_manual) {{{2 - let s:fold_manual = s:large_file ? 0 : s:ChooseValue('php_fold_manual', s:folding ? 1 : 0) - - " Fold arrays (s:fold_arrays) {{{2 - let s:fold_arrays = (s:folding && s:ChooseValue('php_fold_arrays', 0)) - - " Fold heredoc strings (s:fold_heredoc) {{{2 - let s:fold_heredoc = (s:folding && s:ChooseValue('php_fold_heredoc', 0)) - - " Allow nested functions (s:nested_functions) {{{2 - let s:nested_functions = s:ChooseValue('php_nested_functions', 1) - - " Allow ASP-style <% %> tags (s:asp_tags) {{{2 - let s:asp_tags = s:ChooseValue('php_asp_tags', 0) - - " Only allow long tags '' (s:smart_members / s:alt_properties) {{{2 - let s:smart_members = s:large_file ? 0 : s:ChooseValue('php_smart_members', 0) - let s:alt_properties = (s:smart_members && s:ChooseValue('php_alt_properties', 0)) - - " Syncing method (s:sync) {{{2 - let s:sync = s:ChooseValue('php_sync_method', -1) - -" }}}1 - -delfunction s:ChooseValue - -syn cluster htmlPreproc add=phpRegion,phpRegionAsp,phpRegionSc - -" need to source the SQL syntax file in case we encounter -" heredoc containing SQL -if version < 600 - syn include @sqlTop :p:h/sql.vim -else - syn include @sqlTop syntax/sql.vim -endif - -syn sync clear -unlet b:current_syntax -syn cluster sqlTop remove=sqlString,sqlComment -if s:show_sql - syn cluster phpClShowInStrings contains=@sqlTop -endif - -if s:show_html_in_strings - syn cluster phpClShowInStrings add=@htmlTop -endif - -" NOTE: syntax case should be 'ignore' for all items (in keeping -" with PHP's case insensitive behaviour). If an item MUST be case -" sensitive, 'syntax case match' should precede that item and -" 'syntax case ignore' must follow IMMEDIATELY after so that there -" can be no confusion over the value of 'syntax case' for most items -" syntax matches and regions may use '\C' to utilize case sensitivity -syn case ignore - -" PHP syntax: clusters {{{1 - - " these represent a single value in PHP - syn cluster phpClValues add=@phpClConstants - - syn cluster phpClValues add=phpIdentifier,phpIdentifierComplex,phpMethodsVar - - " TODO: add class constants (foo::BAR) - - " these can go anywhere an expression is valid inside PHP code - syn cluster phpClExpressions add=@phpClValues - syn cluster phpClExpressions add=phpRelation,phpList - syn cluster phpClExpressions add=phpParent,phpParentError - syn cluster phpClExpressions add=phpObjectOperator - - " these are the control statements - they shouldn't contain each other - syn cluster phpClCode add=@phpClExpressions - syn cluster phpClCode add=phpLabel - syn cluster phpClCode add=phpFoldTry,phpFoldCatch - - " TODO: what is phpStorageClass class exactly? it needs a more descriptive - " name so I know where to include it. Maybe it should be broken up - syn cluster phpClCode add=phpStorageClass - - " code which is inside a function/method/class or global scope - syn cluster phpClInFunction add=@phpClCode - syn cluster phpClInMethod add=@phpClCode - syn cluster phpClInClass add=@phpClValues,phpAssign,phpSemicolon - syn cluster phpClTop add=@phpClCode - - " This cluster contains matches to find where an expression follows another - " expression without a comma or operator inbetween - " TODO: is this even possible to do? - syn cluster phpClExprNotSeparated add=NONE - - " Note: there is one cluster here each for: - " - constants - " - functions - " - classes - " - interfaces - " - structures (classes and interfaces combined) - " - methods - " - properties - " - members (things which are a method and a property) - syn cluster phpClConstants add=NONE - syn cluster phpClFunctions add=NONE - - syn cluster phpClClasses add=NONE - syn cluster phpClInterfaces add=NONE - syn cluster phpClStructures add=@phpClClasses,@phpClInterfaces - - syn cluster phpClMethods add=@phpClMembers - syn cluster phpClProperties add=@phpClMembers - syn cluster phpClMembers add=NONE - - " these are the things which can be matched inside an identifier - syn cluster phpClIdentifier add=NONE - - " Note: the next clusters contains all the regions or matches that can - " contain a class or interface name - syn cluster phpClClassHere add=phpStructureHere - syn cluster phpClInterfaceHere add=phpStructureHere - syn cluster phpClStructureHere add=@phpClClassHere,@phpClStructureHere - - syn cluster phpClMethodHere add=phpMemberHere,phpMethodHere - syn cluster phpClPropertyHere add=phpMemberHere,phpPropertyHere - syn cluster phpClMemberHere add=@phpClMethodHere,@phpClPropertyHere - - " also, some very basic matches for these place-holders - syn match phpStructureHere /\h\w*/ contained display - syn match phpMemberHere /\h\w*/ contained display - syn match phpMethodHere /\h\w*/ contained display - syn match phpPropertyHere /\h\w*/ contained display - - " what to include at the top level? - if ! s:strict_blocks - " if not strict blocks, we must also allow matching of things from inside - " functions/methods/classes - syn cluster phpClTop add=@phpClInFunction,@phpClInMethod,@phpClInClass - endif - - " Note: these are the old clusters ... they are deprecated now, but still - " here just in case someone is using them elsewhere - syn cluster phpClInside add=@phpClExpressions - syn cluster phpClConst add=@phpClExpressions - syn cluster phpClFunction add=@phpClCode - -" PHP syntax: comments {{{1 - - syn cluster phpClValues add=phpComment - syn cluster phpClInClass add=phpComment - - syn region phpComment start="/\*" end="\*/" contained extend contains=@Spell - if version >= 600 - syn match phpComment "#.\{-}\(?>\|$\)\@=" contained extend contains=@Spell - syn match phpComment "//.\{-}\(?>\|$\)\@=" contained extend contains=@Spell - else - syn match phpComment "#.\{-}$" contained - syn match phpComment "#.\{-}?>"me=e-2 contained - syn match phpComment "//.\{-}$" contained - syn match phpComment "//.\{-}?>"me=e-2 contained - endif - -" PHP syntax: Operators: + - * / && || (etc) {{{1 - - " NOTE: these need to come before the numbers (so that floats work) - syn cluster phpClExpressions add=phpAssign - syn match phpAssign /==\@!/ contained display - hi link phpAssign phpOperator - - syn cluster phpClExpressions add=phpOperator - syn match phpOperator contained display /[%^|*!.~]/ - " & can't be preceded by a '=' or ',' or '(' - syn match phpOperator contained display /\%([=,(]\_s*\)\@' - syn match phpOperator contained display /+[.0-9]\@!/ - syn match phpOperator contained display /-[.>0-9]\@!/ - syn match phpOperator contained display /[-+*/%^&|.]=/ - syn match phpOperator contained display /\/[*/]\@!/ - syn match phpOperator contained display /&&/ - syn match phpOperator contained display /||/ - syn match phpOperator contained display />>/ - " Note: how the shift-left operator can't be followed by another '<' (that - " would make it a Heredoc syntax) - syn match phpOperator contained display /<<<\@!/ - syn keyword phpOperator contained and or xor - - " allow a ':' on its own - this may be after an 'else:' or something like that - syn match phpOperator contained display /::\@!/ - - syn cluster phpClExpressions add=phpTernaryRegion - syn region phpTernaryRegion matchgroup=phpOperator start=/?/ end=/::\@!/ - \ transparent keepend extend display - \ contained matchgroup=Error end=/[;)\]}]/ - - -" PHP syntax: null/true/false/numbers {{{1 - - syn cluster phpClValues add=phpNull - syn keyword phpNull contained null - - syn cluster phpClValues add=phpBoolean - syn keyword phpBoolean contained true false - - syn cluster phpClValues add=phpNumber - syn match phpNumber contained display /\<[1-9]\d*\>/ - syn match phpNumber contained display /-[1-9]\d*\>/ - syn match phpNumber contained display /+[1-9]\d*\>/ - syn match phpNumber contained display /\<0x\x\{1,8}\>/ - syn match phpNumber contained display /\<0\d*\>/ contains=phpOctalError - syn match phpOctalError contained display /[89]/ - - " Note: I've split float into 3 matches which each have a fixed starting - " character - syn cluster phpClValues add=phpFloat - syn match phpFloat contained display /\.\d\+\>/ - syn match phpFloat contained display /\<\d\+\.\d\+\>/ - syn match phpFloat contained display /-\d*\.\d\+\>/ - syn match phpFloat contained display /+\d*\.\d\+\>/ - -" PHP syntax: dynamic strings {{{1 - - " single-quoted strings are always the same - " TODO: work out a good name for an option which will add 'display' option - " to these strings - syn cluster phpClValues add=phpStringSingle - syn region phpStringSingle matchgroup=phpQuoteSingle start=/'/ skip=/\\./ end=/'/ - \ contained keepend extend contains=@phpClShowInStrings - - " Note: this next version of the php double-quoted string can't contain - " variables, because a few parts of PHP code require strings without - " variables. There is another string match later which takes precedence - " over this one in most circumstances where a string containing variables IS - " allowed - syn cluster phpClValues add=phpStringDoubleConstant - syn region phpStringDoubleConstant contained keepend extend - \ matchgroup=phpQuoteSingle start=/"/ end=/"/ skip=/\\./ - \ contains=@phpClShowInStrings,phpSpecialChar - - " Note: this version of the double-quoted string also contains - " @phpClStringIdentifiers, which means variables can go inside the string - syn cluster phpClExpressions add=phpStringDouble - syn region phpStringDouble matchgroup=phpQuoteDouble start=/"/ skip=/\\./ end=/"/ - \ contained keepend extend - \ contains=@phpClShowInStrings,phpSpecialChar,@phpClStringIdentifiers - - " backticks - syn cluster phpClExpressions add=phpBacktick - syn region phpBacktick matchgroup=phpQuoteBacktick start=/`/ skip=/\\./ end=/`/ - \ contained keepend extend - \ contains=phpSpecialChar,@phpClStringIdentifiers - - " this cluster contains only strings which accept things like \n or \x32 - " inside them - syn cluster phpClStringsWithSpecials add=phpStringDoubleConstant,@phpClStringsWithIdentifiers - - " this cluster contains strings which accept things like {$foo} inside them - syn cluster phpClStringsWithIdentifiers add=phpStringDouble,phpBacktick,phpHereDoc - - " HereDoc {{{ - if version >= 600 - syn cluster phpClExpressions add=phpHereDoc - syn case match -" syn keyword phpHereDoc contained foobar - if s:folding && s:fold_heredoc - syn region phpHereDoc keepend extend contained - \ matchgroup=phpHereDocDelimiter end=/^\z1\%(;\=$\)\@=/ - \ start=/<<<\s*\z(\h\w*\)$/ - \ contains=phpSpecialChar - \ fold - - " always match special Heredocs which state what type of content they have - syn region phpHereDoc keepend extend contained - \ matchgroup=phpHereDocDelimiter end=/^\z1\%(;\=$\)\@=/ - \ start=/\c<<<\s*\z(\%(\h\w*\)\=html\)$/ - \ contains=@htmlTop,phpSpecialChar - \ fold - syn region phpHereDoc keepend extend contained - \ matchgroup=phpHereDocDelimiter end=/^\z1\%(;\=$\)\@=/ - \ start=/\c<<<\s*\z(\%(\h\w*\)\=sql\)$/ - \ contains=@sqlTop,phpSpecialChar - \ fold - syn region phpHereDoc keepend extend contained - \ matchgroup=phpHereDocDelimiter end=/^\z1\%(;\=$\)\@=/ - \ start=/\c<<<\s*\z(\%(\h\w*\)\=javascript\)$/ - \ contains=@htmlJavascript,phpSpecialChar - \fold - else - syn region phpHereDoc keepend extend contained - \ matchgroup=phpHereDocDelimiter end=/^\z1\%(;\=$\)\@=/ - \ start=/<<<\s*\z(\h\w*\)$/ - \ contains=phpSpecialChar - - " always match special Heredocs which state what type of content they have - syn region phpHereDoc keepend extend contained - \ matchgroup=phpHereDocDelimiter end=/^\z1\%(;\=$\)\@=/ - \ start=/\c<<<\s*\z(\%(\h\w*\)\=html\)$/ - \ contains=@htmlTop,phpSpecialChar - syn region phpHereDoc keepend extend contained - \ matchgroup=phpHereDocDelimiter end=/^\z1\%(;\=$\)\@=/ - \ start=/\c<<<\s*\z(\%(\h\w*\)\=sql\)$/ - \ contains=@sqlTop,phpSpecialChar - syn region phpHereDoc keepend extend contained - \ matchgroup=phpHereDocDelimiter end=/^\z1\%(;\=$\)\@=/ - \ start=/\c<<<\s*\z(\%(\h\w*\)\=javascript\)$/ - \ contains=@htmlJavascript,phpSpecialChar - endif - - syn case ignore - endif " }}} - - -" PHP syntax: strings: special sequences {{{1 - - " match an escaped backslash inside any type of string - syn match phpStringLiteral /\\\\/ contained display - \ containedin=phpStringSingle,@phpClStringsWithSpecials - - " match an escaped quote in each type of string - syn match phpStringLiteral /\\`/ contained display containedin=phpBacktick - syn match phpStringLiteral /\\'/ contained display containedin=phpStringSingle - syn match phpStringLiteral /\\"/ contained display - \ containedin=phpStringDouble,phpStringDoubleConstant - - " highlighting for an escaped '\$' inside a double-quoted string - syn match phpStringLiteral /\\\$/ contained display containedin=@phpClStringsWithSpecials - - " match \{ as regular string content so that it stops \{$var} from - " highlighting the { } region - syn match phpStringRegular /\\{/ contained display containedin=@phpClStringsWithSpecials - hi link phpStringRegular phpStringDouble - - " match an \r\n\t or hex or octal sequence - " TODO: these should also be available in PCRE pattern strings - " TODO: what were all these extra escape sequences??? - syn match phpSpecialChar contained display /\\[nrt]/ - syn match phpSpecialChar contained display /\\\o\{1,3}/ - syn match phpSpecialChar contained display /\\x\x\x\=/ - - " create an identifier match for inside strings: - syn match phpIdentifierInString /\$\h\w*/ contained display - \ nextgroup=phpPropertyInString,phpPropertyInStringError,@phpClIdentifierIndexInString - \ contains=phpIdentifier - \ containedin=@phpClStringsWithIdentifiers - - " match an index [bar] [0] [$key] after a variable inside a string {{{2 - - " First: match the [ and ] which would appear in the index (they're - " contained int the following items) - syn match phpBracketInString /[[\]]/ contained display - hi link phpBracketInString phpSpecialChar - - " Second: match a single '[' as an error - syn cluster phpClIdentifierIndexInString add=phpBracketInStringFalseStart - syn match phpBracketInStringFalseStart /\[\]\=/ contained display - hi link phpBracketInStringFalseStart Error - - " Third: match any other [] region which is completed, but doesn't have a - " valid key - syn cluster phpClIdentifierIndexInString add=phpIdentifierIndexInString - syn match phpIdentifierIndexInString /\[[^"]\{-1,}\]/ - \ contains=phpBracketInString,phpIdentifierIndexInStringError - \ contained display - - " error on a bracket which is inside another bracket - syn match phpIdentifierIndexInStringError /\[[$_a-z0-9]*\[/ contained display - hi link phpIdentifierIndexInStringError Error - - " any character which isn't a valid index character - syn match phpIdentifierIndexInStringError /[^$a-z0-9_[\]]\+/ contained display - - " a number *must not* be preceded by the '[' and followed by a \w - syn match phpIdentifierIndexInStringError /\[\@<=\d\+\w\@=/ contained display - - " a dollar sign *must* be preceded by the '[' - syn match phpIdentifierIndexInStringError /\[\@\h\w*/ contained display extend - \ contains=phpPropertySelector,@phpClProperties - - " it's sometimes easy to get it wrong - syn match phpPropertyInStringError contained display /->\%([^a-z0-9_"\\]\|\\.\)/ - \ contains=phpPropertySelector - syn match phpPropertyInStringError contained display /->"\@=/ - hi! link phpPropertyInStringError Error - - syn region phpIdentifierInStringComplex matchgroup=phpSpecialChar - \ start=/{\$\@=/ start=/\${\w\@!/ end=/}/ - \ contained extend keepend contains=@phpClExpressions - \ containedin=@phpClStringsWithIdentifiers - - syn region phpIdentifierInStringErratic contained extend - \ matchgroup=phpSpecialChar start=/\${\w\@=/ end=/}/ - \ containedin=@phpClStringsWithIdentifiers - \ contains=phpIdentifierErratic - - syn match phpIdentifierErratic /{\@<=\h\w*/ contained - \ nextgroup=phpErraticBracketRegion - \ nextgroup=phpIdentifierInStringErraticError skipwhite skipempty - syn region phpErraticBracketRegion contained keepend extend contains=@phpClExpressions - \ matchgroup=phpParent start=/\[/ end=/\]/ display - \ matchgroup=Error end=/;/ - \ nextgroup=phpIdentifierInStringErraticError skipwhite skipempty - - syn match phpIdentifierInStringErraticError contained /[^ \t\r\n}]\+/ - \ nextgroup=phpIdentifierInStringErraticError skipwhite skipempty - hi link phpIdentifierInStringErraticError Error - - -" PHP syntax: variables/identifiers ($foo) {{{1 - - " one $ - syn match phpVarSelector contained display /\$/ - " two $$ - syn match phpVarSelectorDeref contained display /\$\$/ - syn match phpVarSelectorError contained display /\$\$\$\+/ - - " match a regular variable - syn cluster phpClExpressions add=phpIdentifier - syn match phpIdentifier /\$\h\w*/ contained display - \ contains=phpVarSelector,@phpClIdentifier - - " match a dereference-variable ($$variable) - syn match phpIdentifier /\$\$\+\h\w*/ contained display - \ contains=@phpClIdentifier,phpVarSelectorDeref,phpVarSelectorError,phpDerefInvalid - - " you can't dereference these variables: - syn match phpDerefInvalid contained display - \ /\C\$\$\ze\%(this\|arg[cv]\|GLOBALS\)\>/ - syn match phpDerefInvalid contained display - \ /\C\$\$\ze_\%(GET\|POST\|REQUEST\|COOKIE\|SESSION\|SERVER\|ENV\)\>/ - hi link phpDerefInvalid Error - - if s:special_vars - - syn case match - - " Superglobals: {{{2 - syn cluster phpClIdentifier add=phpSuperglobal - syn match phpSuperglobal contained display /\$\@<=GLOBALS\>/ - syn match phpSuperglobal contained display /\$\@<=_GET\>/ - syn match phpSuperglobal contained display /\$\@<=_POST\>/ - syn match phpSuperglobal contained display /\$\@<=_COOKIE\>/ - syn match phpSuperglobal contained display /\$\@<=_REQUEST\>/ - syn match phpSuperglobal contained display /\$\@<=_FILES\>/ - syn match phpSuperglobal contained display /\$\@<=_SESSION\>/ - syn match phpSuperglobal contained display /\$\@<=_SERVER\>/ - syn match phpSuperglobal contained display /\$\@<=_ENV\>/ - syn match phpSuperglobal contained display /\$\@<=this\>/ - - " Built In Variables: {{{2 - syn cluster phpClIdentifier add=phpBuiltinVar - syn match phpBuiltinVar contained display /\$\@<=argc\>/ - syn match phpBuiltinVar contained display /\$\@<=argv\>/ - syn match phpBuiltinVar contained display /\$\@<=php_errormsg\>/ - - " Long Arrays: {{{2 - syn cluster phpClIdentifier add=phpLongVar - syn match phpLongVar contained display /\$\@<=HTTP_GET_VARS\>/ - syn match phpLongVar contained display /\$\@<=HTTP_POST_VARS\>/ - syn match phpLongVar contained display /\$\@<=HTTP_POST_FILES\>/ - syn match phpLongVar contained display /\$\@<=HTTP_COOKIE_VARS\>/ - syn match phpLongVar contained display /\$\@<=HTTP_SESSION_VARS\>/ - syn match phpLongVar contained display /\$\@<=HTTP_SERVER_VARS\>/ - syn match phpLongVar contained display /\$\@<=HTTP_ENV_VARS\>/ - - " Server Variables: {{{2 - " TODO: check these against the latest PHP manual - syn cluster phpClIdentifier add=phpEnvVar - syn match phpEnvVar contained display /\C\$\@<=GATEWAY_INTERFACE\>/ - syn match phpEnvVar contained display /\C\$\@<=SERVER_NAME\>/ - syn match phpEnvVar contained display /\C\$\@<=SERVER_SOFTWARE\>/ - syn match phpEnvVar contained display /\C\$\@<=SERVER_PROTOCOL\>/ - syn match phpEnvVar contained display /\C\$\@<=REQUEST_METHOD\>/ - syn match phpEnvVar contained display /\C\$\@<=QUERY_STRING\>/ - syn match phpEnvVar contained display /\C\$\@<=DOCUMENT_ROOT\>/ - syn match phpEnvVar contained display /\C\$\@<=HTTP_ACCEPT\>/ - syn match phpEnvVar contained display /\C\$\@<=HTTP_ACCEPT_CHARSET\>/ - syn match phpEnvVar contained display /\C\$\@<=HTTP_ENCODING\>/ - syn match phpEnvVar contained display /\C\$\@<=HTTP_ACCEPT_LANGUAGE\>/ - syn match phpEnvVar contained display /\C\$\@<=HTTP_CONNECTION\>/ - syn match phpEnvVar contained display /\C\$\@<=HTTP_HOST\>/ - syn match phpEnvVar contained display /\C\$\@<=HTTP_REFERER\>/ - syn match phpEnvVar contained display /\C\$\@<=HTTP_USER_AGENT\>/ - syn match phpEnvVar contained display /\C\$\@<=REMOTE_ADDR\>/ - syn match phpEnvVar contained display /\C\$\@<=REMOTE_PORT\>/ - syn match phpEnvVar contained display /\C\$\@<=SCRIPT_FILENAME\>/ - syn match phpEnvVar contained display /\C\$\@<=SERVER_ADMIN\>/ - syn match phpEnvVar contained display /\C\$\@<=SERVER_PORT\>/ - syn match phpEnvVar contained display /\C\$\@<=SERVER_SIGNATURE\>/ - syn match phpEnvVar contained display /\C\$\@<=PATH_TRANSLATED\>/ - syn match phpEnvVar contained display /\C\$\@<=SCRIPT_NAME\>/ - syn match phpEnvVar contained display /\C\$\@<=REQUEST_URI\>/ - endif - - " }}}2 - -" PHP Syntax: type-casting: (string)$foo {{{1 - - syn cluster phpClValues add=phpType - syn keyword phpType contained null bool boolean int integer real double float string object - " only match 'array' as a type when it *isn't* followed by '(' - syn match phpType contained /\\%(\_s*(\)\@!/ - -" PHP Syntax: function/static calls: {{{1 - - " Note: I could have forced function calls to be matched only when a '(' - " follows, but I think users would want PHP functions highlighted in more - " places, rather than less, so I have just added the :\@! to make sure it is - " not part of a static method call - " Note: this didn't work properly ... if the match didn't include the - " '(...)', then functions in @phpClFunctions can't have a nextgroup on them - syn cluster phpClExpressions add=@phpClFunctions -" syn cluster phpClExpressions add=phpFunctionCall -" syn match phpFunctionCall contained /\<\%(\h\w*\)(\_.*)/ -" \ contains=@phpClFunctions - - " Also, a match when a word is part of a :: reference: - syn cluster phpClValues add=phpStaticUsage - syn cluster phpClExpressions add=phpStaticUsage - syn cluster phpClStructureHere add=phpStaticUsage - syn match phpStaticUsage contained display /\<\%(\h\w*\)\@>\%(\_s*::\)\@=/ - \ transparent contains=@phpClClasses - - - " a match for a static function call - syn cluster phpClValues add=phpStaticAccess - syn cluster phpClExpressions add=phpStaticVariable,phpStaticCall - syn cluster phpClPropertyHere add=phpStaticAccess - syn cluster phpClMethodHere add=phpStaticCall - - " also allowed in function prototypes - syn cluster phpClDefineFuncProtoArgs add=phpStaticAccess - - syn match phpStaticAccess contained extend display /::\_s*\%(\h\w*\|\%#\)/ contains=phpDoubleColon - syn match phpStaticCall contained extend display /::\_s*\h\w*\ze\_s*(/ - \ contains=phpDoubleColon,@phpClMethods - - " a match for a static variable usage - syn match phpStaticVariable contained display /::\_s*\$\h\w*/ extend - \ contains=phpDoubleColon,phpIdentifier - - " a match for a static constant usage - - syn match phpDoubleColon contained display /::/ - hi link phpDoubleColon phpDefine - - -" PHP Syntax: magic classes (self/parent): {{{1 - - syn cluster phpClClasses add=phpMagicClass - syn keyword phpMagicClass contained self parent - - " Note: 'self' and 'parent' are also matched in other places because they - " could be confusing otherwise ... - syn cluster phpClValues add=phpMagicClass - -" PHP Syntax: control structures: {{{1 - - syn cluster phpClCode add=phpConditional - syn keyword phpConditional contained declare enddeclare if else elseif endif - - syn cluster phpClCode add=phpRepeat - syn keyword phpRepeat contained foreach endforeach - \ do while endwhile for endfor - \ switch endswitch - - " override 'foreach' if we need use a special colour for the '(...)' region - if s:alt_arrays || s:alt_control_parents - syn keyword phpRepeat contained foreach nextgroup=phpForeachRegion skipwhite skipempty - syn keyword phpAs contained as containedin=phpForeachRegion - hi link phpAs phpRepeat - else - " otherwise, allow 'as' anywhere - syn cluster phpClExpressions add=phpAs - syn keyword phpAs contained as - endif - - if s:strict_blocks - " need an alternate parenthesis block for 'for' structure - " when using strict blocks - syn keyword phpRepeat contained for nextgroup=phpForRegion skipwhite skipempty - - " if looking for errors with semicolons, add the other 'nextgroups' as well - if s:no_empty_construct - syn keyword phpRepeat contained while nextgroup=phpConstructRegion skipwhite skipempty - syn keyword phpRepeat contained switch nextgroup=phpSwitchConstructRegion skipwhite skipempty - syn keyword phpConditional contained if elseif nextgroup=phpConstructRegion skipwhite skipempty - syn keyword phpConditional contained else nextgroup=phpSemicolonNotAllowedHere skipwhite skipempty - syn keyword phpRepeat contained do nextgroup=phpDoBlock,phpSemicolonNotAllowedHere skipwhite skipempty - if s:folding == 2 - syn region phpDoBlock matchgroup=phpBrace start=/{/ end=/}/ keepend extend - \ contained transparent - \ nextgroup=phpDoWhile skipwhite skipempty -" \ matchgroup=phpHTMLError end=/?>/ - \ fold - syn region phpSwitchBlock matchgroup=phpBrace start=/{/ end=/}/ keepend extend - \ contained contains=@phpClInSwitch,@phpClCode - \ fold - else - syn region phpDoBlock matchgroup=phpBrace start=/{/ end=/}/ keepend extend - \ contained transparent - \ nextgroup=phpDoWhile skipwhite skipempty -" \ matchgroup=phpHTMLError end=/?>/ - syn region phpSwitchBlock matchgroup=phpBrace start=/{/ end=/}/ keepend extend - \ contained contains=@phpClInSwitch,@phpClCode - - " TODO: thoroughly test this feature ... - if s:fold_manual - syn region phpDoBlock matchgroup=phpBrace start='{\ze\s*//\s*fold\s*$\c' end='}' keepend extend - \ contained transparent - \ nextgroup=phpDoWhile skipwhite skipempty -" \ matchgroup=phpHTMLError end=/?>/ - \ fold - syn region phpSwitchBlock matchgroup=phpBrace start='{\ze\s*//\s*fold\s*$\c' end='}' keepend extend - \ contained contains=@phpClInSwitch,@phpClCode - \ fold - endif - endif - syn keyword phpDoWhile contained while nextgroup=phpDoWhileConstructRegion skipwhite skipempty - hi link phpDoWhile phpRepeat - endif - endif - - -" PHP Syntax: statements: {{{1 - - " if we are not using smart semicolons, we can implement these using - " keywords - if ! s:smart_semicolon - syn cluster phpClCode add=phpStatement - syn keyword phpStatement contained return break continue exit die throw - - syn cluster phpClInSwitch add=phpCase - syn keyword phpCase contained case default - - else - " if we *are* using smart semicolons, we'll need to use regions instead - syn cluster phpClCode add=phpStatementRegion - syn cluster phpClInSwitch add=phpCaseRegion - - " with or without error on mis-matched /})]/ at end? - " Note: by containing phpSemicolonError, the semicolon error is - " automatically taken care of by the phpSemicolonError item - - " return/break/continue/exit/die: {{{2 - " Note: having an error ending at 'private/var/final' etc, makes things much - " much faster for writing classes. - if s:strict_blocks - syn region phpStatementRegion extend keepend contained - \ contains=@phpClExpressions,phpSemicolonError - \ matchgroup=phpStatement end=/;/ end=/\ze?>/ - \ start=/\$\@/ - \ start=/\$\@/ - \ start=/\$\@/ - \ start=/\$\@/ - \ start=/\$\@/ - \ start=/\$\@/ - \ matchgroup=Error - \ end=/[$>]\@/ - \ end=/}/ end=/)/ end=/\]/ - \ end=/,/ -" \ end=/;\_s*\%([.*\^|&,:!=<>]\|?>\@!\|\/[/*]\@!\|++\@!\|--\@!\)/ - else - syn region phpStatementRegion extend keepend contained - \ contains=@phpClExpressions,phpSemicolonError - \ matchgroup=phpStatement end=/;/ - \ start=/\$\@/ - \ start=/\$\@/ - \ start=/\$\@/ - \ start=/\$\@/ - \ start=/\$\@/ - \ start=/\$\@/ -" \ end=/;\_s*\%([.*\^|&,:!=<>]\|?>\@!\|\/[/*]\@!\|++\@!\|--\@!\)/ - endif " }}}2 - " case: {{{2 - if s:strict_blocks - syn region phpCaseRegion extend keepend contained display - \ contains=@phpClExpressions,phpSemicolonError,phpColonError - \ matchgroup=phpCase start=/\$\@/ end=/[;:]/ skip=/::/ - \ matchgroup=Error - \ end=/}/ end=/)/ end=/\]/ -" \ end=/;\_s*\%([.*\^|&,:!=<>]\|?>\@!\|\/[/*]\@!\|++\@!\|--\@!\)/ - else - syn region phpCaseRegion extend keepend contained display - \ contains=@phpClExpressions,phpSemicolonError,phpColonError - \ matchgroup=phpCase start=/\$\@/ end=/[;:]/ - endif " }}}2 - " default: {{{2 - if s:strict_blocks - syn region phpCaseRegion extend keepend contained display - \ contains=phpComment,phpSemicolonError,phpColonError - \ matchgroup=phpCase start=/\$\@/ end=/[;:]/ - \ matchgroup=Error end=/}/ end=/)/ end=/\]/ -" \ end=/;\_s*\%([.*\^|&,:!=<>]\|?>\@!\|\/[/*]\@!\|++\@!\|--\@!\)/ - else - syn region phpCaseRegion extend keepend contained display - \ contains=phpComment,phpSemicolonError,phpColonError - \ matchgroup=phpCase start=/\$\@/ end=/[;:]/ - endif " }}}2 - - endif - - " if we *aren't* using strict blocks, allow a 'case' or 'default' - " anywhere in regular code - if ! s:strict_blocks - syn cluster phpClCode add=@phpClInSwitch - endif - - -" PHP Syntax: semicolons: {{{1 - - if s:show_semicolon - " highlight the semicolon anywhere it appears in regular code - syn cluster phpClExpressions add=phpSemicolon - syn match phpSemicolon /;/ contained display contains=phpSemicolonError - - " match a semicolon or colon which is followed by one of: - " = ! . +-*/ &|^ < > , ? : - if s:show_semicolon_error - " match a semicolon or colon which is followed by one of: - " = ! . +-*/ &|^ < > , ? : - syn match phpSemicolonError contained display extend - \ ";\_s*\%(\%(\%(//.*$\|#.*$\|/\*\_.\{-}\*/\)\_s*\)*\)\@>\%([.*/\^|&,:!=<>]\|?>\@!\|++\@!\|--\@!\)" - syn match phpColonError contained display extend - \ "::\@!\_s*\%(\%(\%(//.*$\|#.*$\|/\*\_.\{-}\*/\)\_s*\)*\)\@>\%([.*/\^|&,:!=<>]\|?>\@!\|++\@!\|--\@!\)" - endif - hi link phpSemicolonError Error - hi link phpColonError Error - - " need to sync back one or two linebreaks to capture the semicolon - " error properly - syn sync linebreaks=2 - endif - - " a special match for when a semicolon is not allowed here - " Note: this is contained/nextgrouped by other items, not included - " directly - if s:no_empty_construct - syn match phpSemicolonNotAllowedHere /;/ contained display - endif - - -" PHP Syntax: constants: {{{1 - - " Magic Constants {{{2 - syn cluster phpClConstants add=phpMagicConstant - syn case match - syn keyword phpMagicConstant contained __LINE__ __FILE__ __FUNCTION__ __METHOD__ __CLASS__ - syn case ignore - " }}}2 - - " Built-in Constants {{{2 - " TODO: check these against the latest PHP manual - syn cluster phpClConstants add=phpCoreConstant - syn case match - syn keyword phpCoreConstant contained ASSERT_ACTIVE ASSERT_BAIL ASSERT_CALLBACK ASSERT_QUIET_EVAL ASSERT_WARNING - syn keyword phpCoreConstant contained CAL_DOW_DAYNO CAL_DOW_LONG CAL_DOW_SHORT CAL_EASTER_ALWAYS_GREGORIAN CAL_EASTER_ALWAYS_JULIAN CAL_EASTER_DEFAULT CAL_EASTER_ROMAN CAL_FRENCH CAL_GREGORIAN CAL_JULIAN CAL_NUM_CALS CAL_JEWISH CAL_JEWISH_ADD_ALAFIM CAL_JEWISH_ADD_ALAFIM_GERESH CAL_JEWISH_ADD_GERESHAYIM CAL_MONTH_FRENCH CAL_MONTH_GREGORIAN_LONG CAL_MONTH_GREGORIAN_SHORT CAL_MONTH_JEWISH CAL_MONTH_JULIAN_LONG CAL_MONTH_JULIAN_SHORT - syn keyword phpCoreConstant contained CASE_LOWER CASE_UPPER CHAR_MAX - syn keyword phpCoreConstant contained CLSCTX_ALL CLSCTX_INPROC_HANDLER CLSCTX_INPROC_SERVER CLSCTX_LOCAL_SERVER CLSCTX_REMOTE_SERVER CLSCTX_SERVER - syn keyword phpCoreConstant contained CONNECTION_ABORTED CONNECTION_NORMAL CONNECTION_TIMEOUT - syn keyword phpCoreConstant contained COUNT_NORMAL COUNT_RECURSIVE - syn keyword phpCoreConstant contained CP_ACP CP_MACCP CP_OEMCP CP_SYMBOL CP_THREAD_ACP CP_UTF7 CP_UTF8 - syn keyword phpCoreConstant contained CREDITS_ALL CREDITS_DOCS CREDITS_FULLPAGE CREDITS_GENERAL CREDITS_GROUP CREDITS_MODULES CREDITS_QA CREDITS_SAPI - syn keyword phpCoreConstant contained CRYPT_BLOWFISH CRYPT_EXT_DES CRYPT_MD5 CRYPT_SALT_LENGTH CRYPT_STD_DES - syn keyword phpCoreConstant contained DATE_ATOM DATE_COOKIE DATE_ISO8601 DATE_RFC1036 DATE_RFC1123 DATE_RFC2822 DATE_RFC822 DATE_RFC850 DATE_RSS DATE_W3C - syn keyword phpCoreConstant contained DEFAULT_INCLUDE_PATH DIRECTORY_SEPARATOR - syn keyword phpCoreConstant contained DISP_E_BADINDEX DISP_E_DIVBYZERO DISP_E_OVERFLOW - syn keyword phpCoreConstant contained DOMSTRING_SIZE_ERR - syn keyword phpCoreConstant contained DOM_HIERARCHY_REQUEST_ERR DOM_INDEX_SIZE_ERR DOM_INUSE_ATTRIBUTE_ERR DOM_INVALID_ACCESS_ERR DOM_INVALID_CHARACTER_ERR DOM_INVALID_MODIFICATION_ERR - syn keyword phpCoreConstant contained DOM_INVALID_STATE_ERR DOM_NAMESPACE_ERR DOM_NOT_FOUND_ERR DOM_NOT_SUPPORTED_ERR DOM_NO_DATA_ALLOWED_ERR DOM_NO_MODIFICATION_ALLOWED_ERR DOM_PHP_ERR - syn keyword phpCoreConstant contained DOM_SYNTAX_ERR DOM_VALIDATION_ERR DOM_WRONG_DOCUMENT_ERR - syn keyword phpCoreConstant contained ENT_COMPAT ENT_NOQUOTES ENT_QUOTES - syn keyword phpCoreConstant contained EXTR_IF_EXISTS EXTR_OVERWRITE EXTR_PREFIX_ALL EXTR_PREFIX_IF_EXISTS EXTR_PREFIX_INVALID EXTR_PREFIX_SAME EXTR_REFS EXTR_SKIP - syn keyword phpCoreConstant contained E_ERROR E_WARNING E_PARSE E_NOTICE E_STRICT E_CORE_ERROR E_CORE_WARNING E_COMPILE_ERROR E_COMPILE_WARNING E_USER_ERROR E_USER_WARNING E_USER_NOTICE E_ALL - syn keyword phpCoreConstant contained FILE_APPEND FILE_IGNORE_NEW_LINES FILE_NO_DEFAULT_CONTEXT FILE_SKIP_EMPTY_LINES FILE_USE_INCLUDE_PATH - syn keyword phpCoreConstant contained FORCE_DEFLATE FORCE_GZIP - syn keyword phpCoreConstant contained FTP_ASCII FTP_AUTORESUME FTP_AUTOSEEK FTP_BINARY FTP_FAILED FTP_FINISHED FTP_IMAGE FTP_MOREDATA FTP_TEXT FTP_TIMEOUT_SEC - syn keyword phpCoreConstant contained GLOB_BRACE GLOB_ERR GLOB_MARK GLOB_NOCHECK GLOB_NOESCAPE GLOB_NOSORT GLOB_ONLYDIR - syn keyword phpCoreConstant contained HTML_ENTITIES HTML_SPECIALCHARS - syn keyword phpCoreConstant contained ICONV_IMPL ICONV_MIME_DECODE_CONTINUE_ON_ERROR ICONV_MIME_DECODE_STRICT ICONV_VERSION - syn keyword phpCoreConstant contained IMAGETYPE_BMP IMAGETYPE_GIF IMAGETYPE_IFF IMAGETYPE_JB2 IMAGETYPE_JP2 IMAGETYPE_JPC IMAGETYPE_JPEG IMAGETYPE_JPEG2000 - syn keyword phpCoreConstant contained IMAGETYPE_JPX IMAGETYPE_PNG IMAGETYPE_PSD IMAGETYPE_SWC IMAGETYPE_SWF IMAGETYPE_TIFF_II IMAGETYPE_TIFF_MM IMAGETYPE_WBMP IMAGETYPE_XBM - syn keyword phpCoreConstant contained INF - syn keyword phpCoreConstant contained INFO_ALL INFO_CONFIGURATION INFO_CREDITS INFO_ENVIRONMENT INFO_GENERAL INFO_LICENSE INFO_MODULES INFO_VARIABLES - syn keyword phpCoreConstant contained INI_ALL INI_PERDIR INI_SYSTEM INI_USER - syn keyword phpCoreConstant contained LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY LC_NUMERIC LC_TIME - syn keyword phpCoreConstant contained LIBXML_COMPACT LIBXML_DOTTED_VERSION LIBXML_DTDATTR LIBXML_DTDLOAD LIBXML_DTDVALID LIBXML_ERR_ERROR LIBXML_ERR_FATAL LIBXML_ERR_NONE - syn keyword phpCoreConstant contained LIBXML_ERR_WARNING LIBXML_NOBLANKS LIBXML_NOCDATA LIBXML_NOEMPTYTAG LIBXML_NOENT LIBXML_NOERROR LIBXML_NONET LIBXML_NOWARNING - syn keyword phpCoreConstant contained LIBXML_NOXMLDECL LIBXML_NSCLEAN LIBXML_VERSION LIBXML_XINCLUDE - syn keyword phpCoreConstant contained LOCK_EX LOCK_NB LOCK_SH LOCK_UN - syn keyword phpCoreConstant contained LOG_ALERT LOG_AUTH LOG_AUTHPRIV LOG_CONS LOG_CRIT LOG_CRON LOG_DAEMON LOG_DEBUG - syn keyword phpCoreConstant contained LOG_EMERG LOG_ERR LOG_INFO LOG_KERN LOG_LPR LOG_MAIL LOG_NDELAY LOG_NEWS - syn keyword phpCoreConstant contained LOG_NOTICE LOG_NOWAIT LOG_ODELAY LOG_PERROR LOG_PID LOG_SYSLOG LOG_USER LOG_UUCP LOG_WARNING - syn keyword phpCoreConstant contained MK_E_UNAVAILABLE - syn keyword phpCoreConstant contained MYSQL_ASSOC MYSQL_BOTH MYSQL_CLIENT_COMPRESS MYSQL_CLIENT_IGNORE_SPACE MYSQL_CLIENT_INTERACTIVE MYSQL_CLIENT_SSL MYSQL_NUM - syn keyword phpCoreConstant contained M_1_PI M_2_PI M_2_SQRTPI M_E M_LN10 M_LN2 M_LOG10E M_LOG2E M_PI M_PI_2 M_PI_4 M_SQRT1_2 M_SQRT2 - syn keyword phpCoreConstant contained NAN - syn keyword phpCoreConstant contained NORM_IGNORECASE NORM_IGNOREKANATYPE NORM_IGNORENONSPACE NORM_IGNORESYMBOLS NORM_IGNOREWIDTH - syn keyword phpCoreConstant contained ODBC_BINMODE_CONVERT ODBC_BINMODE_PASSTHRU ODBC_BINMODE_RETURN ODBC_TYPE - syn keyword phpCoreConstant contained PATHINFO_BASENAME PATHINFO_DIRNAME PATHINFO_EXTENSION - syn keyword phpCoreConstant contained PATH_SEPARATOR - syn keyword phpCoreConstant contained PEAR_INSTALL_DIR PEAR_EXTENSION_DIR - syn keyword phpCoreConstant contained PHP_PREFIX PHP_BINDIR PHP_CONFIG_FILE_PATH PHP_CONFIG_FILE_SCAN_DIR PHP_DATADIR PHP_EXTENSION_DIR PHP_LIBDIR PHP_LOCALSTATEDIR PHP_SYSCONFDIR PHP_SHLIB_SUFFIX - syn keyword phpCoreConstant contained PHP_OUTPUT_HANDLER_CONT PHP_OUTPUT_HANDLER_END PHP_OUTPUT_HANDLER_START - syn keyword phpCoreConstant contained PHP_URL_FRAGMENT PHP_URL_HOST PHP_URL_PASS PHP_URL_PATH PHP_URL_PORT PHP_URL_QUERY PHP_URL_SCHEME PHP_URL_USER - syn keyword phpCoreConstant contained PHP_VERSION PHP_OS PHP_SAPI PHP_EOL PHP_INT_MAX PHP_INT_SIZE - syn keyword phpCoreConstant contained PREG_GREP_INVERT PREG_OFFSET_CAPTURE PREG_PATTERN_ORDER PREG_SET_ORDER PREG_SPLIT_DELIM_CAPTURE PREG_SPLIT_NO_EMPTY PREG_SPLIT_OFFSET_CAPTURE - syn keyword phpCoreConstant contained PSFS_ERR_FATAL PSFS_FEED_ME PSFS_FLAG_FLUSH_CLOSE PSFS_FLAG_FLUSH_INC PSFS_FLAG_NORMAL PSFS_PASS_ON - syn keyword phpCoreConstant contained SEEK_CUR SEEK_END SEEK_SET - syn keyword phpCoreConstant contained SORT_ASC SORT_DESC SORT_LOCALE_STRING SORT_NUMERIC SORT_REGULAR SORT_STRING - syn keyword phpCoreConstant contained SQL_BIGINT SQL_BINARY SQL_BIT SQL_CHAR SQL_CONCURRENCY SQL_CONCUR_LOCK SQL_CONCUR_READ_ONLY SQL_CONCUR_ROWVER SQL_CONCUR_VALUES - syn keyword phpCoreConstant contained SQL_CURSOR_DYNAMIC SQL_CURSOR_FORWARD_ONLY SQL_CURSOR_KEYSET_DRIVEN SQL_CURSOR_STATIC SQL_CURSOR_TYPE SQL_CUR_USE_DRIVER SQL_CUR_USE_IF_NEEDED SQL_CUR_USE_ODBC - syn keyword phpCoreConstant contained SQL_DATE SQL_DECIMAL SQL_DOUBLE SQL_FETCH_FIRST SQL_FETCH_NEXT SQL_FLOAT SQL_INTEGER SQL_KEYSET_SIZE - syn keyword phpCoreConstant contained SQL_LONGVARBINARY SQL_LONGVARCHAR SQL_NUMERIC SQL_ODBC_CURSORS SQL_REAL SQL_SMALLINT SQL_TIME SQL_TIMESTAMP SQL_TINYINT SQL_VARBINARY SQL_VARCHAR - syn keyword phpCoreConstant contained STDERR STDIN STDOUT - syn keyword phpCoreConstant contained STREAM_CLIENT_ASYNC_CONNECT STREAM_CLIENT_CONNECT STREAM_CLIENT_PERSISTENT - syn keyword phpCoreConstant contained STREAM_CRYPTO_METHOD_SSLv23_CLIENT STREAM_CRYPTO_METHOD_SSLv23_SERVER STREAM_CRYPTO_METHOD_SSLv2_CLIENT STREAM_CRYPTO_METHOD_SSLv2_SERVER STREAM_CRYPTO_METHOD_SSLv3_CLIENT STREAM_CRYPTO_METHOD_SSLv3_SERVER STREAM_CRYPTO_METHOD_TLS_CLIENT STREAM_CRYPTO_METHOD_TLS_SERVER - syn keyword phpCoreConstant contained STREAM_ENFORCE_SAFE_MODE STREAM_FILTER_ALL STREAM_FILTER_READ STREAM_FILTER_WRITE STREAM_IGNORE_URL - syn keyword phpCoreConstant contained STREAM_IPPROTO_ICMP STREAM_IPPROTO_IP STREAM_IPPROTO_RAW STREAM_IPPROTO_TCP STREAM_IPPROTO_UDP STREAM_MKDIR_RECURSIVE STREAM_MUST_SEEK - syn keyword phpCoreConstant contained STREAM_NOTIFY_AUTH_REQUIRED STREAM_NOTIFY_AUTH_RESULT STREAM_NOTIFY_COMPLETED STREAM_NOTIFY_CONNECT STREAM_NOTIFY_FAILURE STREAM_NOTIFY_FILE_SIZE_IS STREAM_NOTIFY_MIME_TYPE_IS - syn keyword phpCoreConstant contained STREAM_NOTIFY_PROGRESS STREAM_NOTIFY_REDIRECTED STREAM_NOTIFY_RESOLVE STREAM_NOTIFY_SEVERITY_ERR STREAM_NOTIFY_SEVERITY_INFO STREAM_NOTIFY_SEVERITY_WARN - syn keyword phpCoreConstant contained STREAM_OOB STREAM_PEEK STREAM_PF_INET STREAM_PF_INET6 STREAM_PF_UNIX STREAM_REPORT_ERRORS STREAM_SERVER_BIND STREAM_SERVER_LISTEN - syn keyword phpCoreConstant contained STREAM_SOCK_DGRAM STREAM_SOCK_RAW STREAM_SOCK_RDM STREAM_SOCK_SEQPACKET STREAM_SOCK_STREAM STREAM_URL_STAT_LINK STREAM_URL_STAT_QUIET STREAM_USE_PATH - syn keyword phpCoreConstant contained STR_PAD_BOTH STR_PAD_LEFT STR_PAD_RIGHT - syn keyword phpCoreConstant contained SUNFUNCS_RET_DOUBLE SUNFUNCS_RET_STRING SUNFUNCS_RET_TIMESTAMP - syn keyword phpCoreConstant contained T_ABSTRACT T_AND_EQUAL T_ARRAY T_ARRAY_CAST T_AS T_BAD_CHARACTER T_BOOLEAN_AND T_BOOLEAN_OR T_BOOL_CAST T_BREAK T_CASE T_CATCH - syn keyword phpCoreConstant contained T_CHARACTER T_CLASS T_CLASS_C T_CLONE T_CLOSE_TAG T_COMMENT T_CONCAT_EQUAL T_CONST T_CONSTANT_ENCAPSED_STRING T_CONTINUE - syn keyword phpCoreConstant contained T_CURLY_OPEN T_DEC T_DECLARE T_DEFAULT T_DIV_EQUAL T_DNUMBER T_DO T_DOC_COMMENT T_DOLLAR_OPEN_CURLY_BRACES T_DOUBLE_ARROW - syn keyword phpCoreConstant contained T_DOUBLE_CAST T_DOUBLE_COLON T_ECHO T_ELSE T_ELSEIF T_EMPTY T_ENCAPSED_AND_WHITESPACE T_ENDDECLARE T_ENDFOR T_ENDFOREACH - syn keyword phpCoreConstant contained T_ENDIF T_ENDSWITCH T_ENDWHILE T_END_HEREDOC T_EVAL T_EXIT T_EXTENDS T_FILE T_FINAL T_FOR T_FOREACH T_FUNCTION T_FUNC_C - syn keyword phpCoreConstant contained T_GLOBAL T_HALT_COMPILER T_IF T_IMPLEMENTS T_INC T_INCLUDE T_INCLUDE_ONCE T_INLINE_HTML T_INSTANCEOF T_INTERFACE T_INT_CAST - syn keyword phpCoreConstant contained T_ISSET T_IS_EQUAL T_IS_GREATER_OR_EQUAL T_IS_IDENTICAL T_IS_NOT_EQUAL T_IS_NOT_IDENTICAL T_IS_SMALLER_OR_EQUAL T_LINE T_LIST - syn keyword phpCoreConstant contained T_LNUMBER T_LOGICAL_AND T_LOGICAL_OR T_LOGICAL_XOR T_METHOD_C T_MINUS_EQUAL T_MOD_EQUAL T_MUL_EQUAL T_NEW T_NUM_STRING T_OBJECT_CAST - syn keyword phpCoreConstant contained T_OBJECT_OPERATOR T_OPEN_TAG T_OPEN_TAG_WITH_ECHO T_OR_EQUAL T_PAAMAYIM_NEKUDOTAYIM T_PLUS_EQUAL T_PRINT T_PRIVATE T_PROTECTED T_PUBLIC - syn keyword phpCoreConstant contained T_REQUIRE T_REQUIRE_ONCE T_RETURN T_SL T_SL_EQUAL T_SR T_SR_EQUAL T_START_HEREDOC T_STATIC T_STRING T_STRING_CAST T_STRING_VARNAME - syn keyword phpCoreConstant contained T_SWITCH T_THROW T_TRY T_UNSET T_UNSET_CAST T_USE T_VAR T_VARIABLE T_WHILE T_WHITESPACE T_XOR_EQUAL - syn keyword phpCoreConstant contained UPLOAD_ERR_CANT_WRITE UPLOAD_ERR_FORM_SIZE UPLOAD_ERR_INI_SIZE UPLOAD_ERR_NO_FILE UPLOAD_ERR_NO_TMP_DIR UPLOAD_ERR_OK UPLOAD_ERR_PARTIAL - syn keyword phpCoreConstant contained VARCMP_EQ VARCMP_GT VARCMP_LT VARCMP_NULL - syn keyword phpCoreConstant contained VT_ARRAY VT_BOOL VT_BSTR VT_BYREF VT_CY VT_DATE VT_DECIMAL VT_DISPATCH VT_EMPTY VT_ERROR VT_I1 VT_I2 VT_I4 VT_INT VT_NULL VT_R4 VT_R8 VT_UI1 VT_UI2 VT_UI4 VT_UINT VT_UNKNOWN VT_VARIANT - syn keyword phpCoreConstant contained XML_ATTRIBUTE_CDATA XML_ATTRIBUTE_DECL_NODE XML_ATTRIBUTE_ENTITY XML_ATTRIBUTE_ENUMERATION XML_ATTRIBUTE_ID XML_ATTRIBUTE_IDREF - syn keyword phpCoreConstant contained XML_ATTRIBUTE_IDREFS XML_ATTRIBUTE_NMTOKEN XML_ATTRIBUTE_NMTOKENS XML_ATTRIBUTE_NODE XML_ATTRIBUTE_NOTATION XML_CDATA_SECTION_NODE - syn keyword phpCoreConstant contained XML_COMMENT_NODE XML_DOCUMENT_FRAG_NODE XML_DOCUMENT_NODE XML_DOCUMENT_TYPE_NODE XML_DTD_NODE XML_ELEMENT_DECL_NODE XML_ELEMENT_NODE - syn keyword phpCoreConstant contained XML_ENTITY_DECL_NODE XML_ENTITY_NODE XML_ENTITY_REF_NODE XML_ERROR_ASYNC_ENTITY XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF XML_ERROR_BAD_CHAR_REF - syn keyword phpCoreConstant contained XML_ERROR_BINARY_ENTITY_REF XML_ERROR_DUPLICATE_ATTRIBUTE XML_ERROR_EXTERNAL_ENTITY_HANDLING XML_ERROR_INCORRECT_ENCODING XML_ERROR_INVALID_TOKEN - syn keyword phpCoreConstant contained XML_ERROR_JUNK_AFTER_DOC_ELEMENT XML_ERROR_MISPLACED_XML_PI XML_ERROR_NONE XML_ERROR_NO_ELEMENTS XML_ERROR_NO_MEMORY XML_ERROR_PARAM_ENTITY_REF - syn keyword phpCoreConstant contained XML_ERROR_PARTIAL_CHAR XML_ERROR_RECURSIVE_ENTITY_REF XML_ERROR_SYNTAX XML_ERROR_TAG_MISMATCH XML_ERROR_UNCLOSED_CDATA_SECTION - syn keyword phpCoreConstant contained XML_ERROR_UNCLOSED_TOKEN XML_ERROR_UNDEFINED_ENTITY XML_ERROR_UNKNOWN_ENCODING XML_HTML_DOCUMENT_NODE XML_LOCAL_NAMESPACE - syn keyword phpCoreConstant contained XML_NAMESPACE_DECL_NODE XML_NOTATION_NODE XML_OPTION_CASE_FOLDING XML_OPTION_SKIP_TAGSTART XML_OPTION_SKIP_WHITE XML_OPTION_TARGET_ENCODING - syn keyword phpCoreConstant contained XML_PI_NODE XML_SAX_IMPL XML_TEXT_NODE - syn keyword phpCoreConstant contained ZEND_THREAD_SAFE - syn case ignore - " }}}2 - -" PHP Syntax: functions {{{1 - - " TODO: move constants out of here - they need to be case-sensitive - - " Function and Methods ripped from php_manual_de.tar.gz Jan 2003 {{{2 - " TODO: check these against the latest PHP manual - syn cluster phpClFunctions add=phpFunctions - - " Apache - syn keyword phpFunctions contained apache_child_terminate apache_get_modules apache_get_version apache_getenv apache_lookup_uri apache_note apache_request_headers apache_reset_timeout apache_response_headers apache_setenv ascii2ebcdic ebcdic2ascii getallheaders virtual - - " APC Alternative PHP Cache - syn keyword phpFunctions contained apc_add apc_cache_info apc_clear_cache apc_compile_file apc_define_constants apc_delete apc_fetch apc_load_constants apc_sma_info apc_store - - " APD Advanced PHP Debugger - syn keyword phpCoreConstant contained FUNCTION_TRACE ARGS_TRACE ASSIGNMENT_TRACE STATEMENT_TRACE MEMORY_TRACE TIMING_TRACE SUMMARY_TRACE ERROR_TRACE PROF_TRACE APD_VERSION - syn keyword phpFunctions contained apd_breakpoint apd_callstack apd_clunk apd_continue apd_croak apd_dump_function_table apd_dump_persistent_resources apd_dump_regular_resources apd_echo apd_get_active_symbols apd_set_pprof_trace apd_set_session_trace apd_set_session apd_set_socket_session_trace override_function rename_function - - " array functions - syn keyword phpCoreConstant contained CASE_LOWER CASE_UPPER SORT_ASC SORT_DESC SORT_REGULAR SORT_NUMERIC SORT_STRING SORT_LOCALE_STRING COUNT_NORMAL COUNT_RECURSIVE EXTR_OVERWRITE EXTR_SKIP EXTR_PREFIX_SAME EXTR_PREFIX_ALL EXTR_PREFIX_INVALID EXTR_PREFIX_IF_EXISTS EXTR_IF_EXISTS EXTR_REFS - syn keyword phpFunctions contained array_change_key_case array_chunk array_combine array_count_values array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_diff array_fill_keys array_fill array_filter array_flip array_intersect_assoc array_intersect_key array_intersect_uassoc array_intersect_ukey array_intersect array_key_exists array_keys array_map array_merge_recursive array_merge array_multisort array_pad array_pop array_product array_push array_rand array_reduce array_reverse array_search array_shift array_slice array_splice array_sum array_udiff_assoc array_udiff_uassoc array_udiff array_uintersect_assoc array_uintersect_uassoc array_uintersect array_unique array_unshift array_values array_walk_recursive array_walk arsort asort compact count current each end extract in_array key krsort ksort natcasesort natsort next pos prev range reset rsort shuffle sizeof sort uasort uksort usort - - " NOTE: aspell is deprecated as of PHP 4.3.0 - " syn keyword phpFunctions aspell_check aspell_new aspell_suggest contained - - " BBCode - syn keyword phpCoreConstant contained BBCODE_TYPE_NOARG BBCODE_TYPE_SINGLE BBCODE_TYPE_ARG BBCODE_TYPE_OPTARG BBCODE_TYPE_ROOT BBCODE_FLAGS_ARG_PARSING BBCODE_FLAGS_CDATA_NOT_ALLOWED BBCODE_FLAGS_SMILEYS_ON BBCODE_FLAGS_SMILEYS_OFF BBCODE_FLAGS_ONE_OPEN_PER_LEVEL BBCODE_FLAGS_REMOVE_IF_EMPTY BBCODE_FLAGS_DENY_REOPEN_CHILD BBCODE_ARG_DOUBLE_QUOTE BBCODE_ARG_SINGLE_QUOTE BBCODE_ARG_HTML_QUOTE BBCODE_AUTO_CORRECT BBCODE_CORRECT_REOPEN_TAGS BBCODE_DISABLE_TREE_BUILD BBCODE_DEFAULT_SMILEYS_ON BBCODE_DEFAULT_SMILEYS_OFF BBCODE_FORCE_SMILEYS_OFF BBCODE_SMILEYS_CASE_INSENSITIVE BBCODE_SET_FLAGS_SET BBCODE_SET_FLAGS_ADD BBCODE_SET_FLAGS_REMOVE - syn keyword phpFunctions contained bbcode_add_element bbcode_add_smiley bbcode_create bbcode_destroy bbcode_parse bbcode_set_arg_parser bbcode_set_flags - - " BC Math - syn keyword phpFunctions contained bcadd bccomp bcdiv bcmod bcmul bcpow bcpowmod bcscale bcsqrt bcsub - - " BZip2 - syn keyword phpFunctions contained bzclose bzcompress bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite - - " Calendar functions - syn keyword phpCoreConstant contained CAL_GREGORIAN CAL_JULIAN CAL_JEWISH CAL_FRENCH CAL_NUM_CALS CAL_DOW_DAYNO CAL_DOW_SHORT CAL_DOW_LONG CAL_MONTH_GREGORIAN_SHORT CAL_MONTH_GREGORIAN_LONG CAL_MONTH_JULIAN_SHORT CAL_MONTH_JULIAN_LONG CAL_MONTH_JEWISH CAL_MONTH_FRENCH CAL_EASTER_DEFAULT CAL_EASTER_ROMAN CAL_EASTER_ALWAYS_GREGORIAN CAL_EASTER_ALWAYS_JULIAN CAL_JEWISH_ADD_ALAFIM_GERESH CAL_JEWISH_ADD_ALAFIM CAL_JEWISH_ADD_GERESHAYIM - syn keyword phpFunctions contained cal_days_in_month cal_from_jd cal_info cal_to_jd easter_date easter_days FrenchToJD GregorianToJD JDDayOfWeek JDMonthName JDToFrench JDToGregorian jdtojewish JDToJulian jdtounix JewishToJD JulianToJD unixtojd - - " NOTE: CCVS has been deprecated as of PHP 4.3.0 - " syn keyword phpFunctions ccvs_add ccvs_auth ccvs_command ccvs_count ccvs_delete ccvs_done ccvs_init ccvs_lookup ccvs_new ccvs_report ccvs_return ccvs_reverse ccvs_sale ccvs_status ccvs_textvalue ccvs_void contained - - " Classes / Objects - " NOTE: call_user_method_array() and call_user_method() are both deprecated ... - syn keyword phpFunctions contained class_exists get_class_methods get_class_vars get_class get_declared_classes get_declared_interfaces get_object_vars get_parent_class interface_exists is_a is_subclass_of method_exists property_exists - - " COM - syn keyword phpCoreConstant contained CLSCTX_INPROC_SERVER CLSCTX_INPROC_HANDLER CLSCTX_LOCAL_SERVER CLSCTX_REMOTE_SERVER CLSCTX_SERVER CLSCTX_ALL VT_NULL VT_EMPTY VT_UI1 VT_I2 VT_I4 VT_R4 VT_R8 VT_BOOL VT_ERROR VT_CY VT_DATE VT_BSTR VT_DECIMAL VT_UNKNOWN VT_DISPATCH VT_VARIANT VT_I1 VT_UI2 VT_UI4 VT_INT VT_UINT VT_ARRAY VT_BYREF CP_ACP CP_MACCP CP_OEMCP CP_UTF7 CP_UTF8 CP_SYMBOL CP_THREAD_ACP VARCMP_LT VARCMP_EQ VARCMP_GT VARCMP_NULL NORM_IGNORECASE NORM_IGNORENONSPACE NORM_IGNORESYMBOLS NORM_IGNOREWIDTH NORM_IGNOREKANATYPE NORM_IGNOREKASHIDA DISP_E_DIVBYZERO DISP_E_OVERFLOW MK_E_UNAVAILABLE - syn keyword phpClasses contained COM DOTNET VARIANT - syn keyword phpFunctions contained com_addref com_create_guid com_event_sink com_get_active_object com_get com_invoke com_isenum com_load_typelib com_load com_message_pump com_print_typeinfo com_propget com_propput com_propset com_release com_set variant_abs variant_add variant_and variant_cast variant_cat variant_cmp variant_date_from_timestamp variant_date_to_timestamp variant_div variant_eqv variant_fix variant_get_type variant_idiv variant_imp variant_int variant_mod variant_mul variant_neg variant_not variant_or variant_pow variant_round variant_set_type variant_set variant_sub variant_xor - - " Crack functions - syn keyword phpFunctions contained crack_check crack_closedict crack_getlastmessage crack_opendict - - " Character type functions - syn keyword phpFunctions contained ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_graph ctype_lower ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit - - " cURL - syn keyword phpCoreConstant contained CURLOPT_AUTOREFERER CURLOPT_COOKIESESSION CURLOPT_DNS_USE_GLOBAL_CACHE CURLOPT_DNS_CACHE_TIMEOUT CURLOPT_FTP_SSL CURLFTPSSL_TRY CURLFTPSSL_ALL CURLFTPSSL_CONTROL CURLFTPSSL_NONE CURLOPT_PRIVATE CURLOPT_FTPSSLAUTH CURLOPT_PORT CURLOPT_FILE CURLOPT_INFILE CURLOPT_INFILESIZE CURLOPT_URL CURLOPT_PROXY CURLOPT_VERBOSE CURLOPT_HEADER CURLOPT_HTTPHEADER CURLOPT_NOPROGRESS CURLOPT_NOBODY CURLOPT_FAILONERROR CURLOPT_UPLOAD CURLOPT_POST CURLOPT_FTPLISTONLY CURLOPT_FTPAPPEND CURLOPT_FTP_CREATE_MISSING_DIRS CURLOPT_NETRC CURLOPT_FOLLOWLOCATION CURLOPT_FTPASCII CURLOPT_PUT CURLOPT_MUTE CURLOPT_USERPWD CURLOPT_PROXYUSERPWD CURLOPT_RANGE CURLOPT_TIMEOUT CURLOPT_TIMEOUT_MS CURLOPT_TCP_NODELAY CURLOPT_POSTFIELDS CURLOPT_REFERER CURLOPT_USERAGENT CURLOPT_FTPPORT CURLOPT_FTP_USE_EPSV CURLOPT_LOW_SPEED_LIMIT CURLOPT_LOW_SPEED_TIME CURLOPT_RESUME_FROM CURLOPT_COOKIE CURLOPT_SSLCERT CURLOPT_SSLCERTPASSWD CURLOPT_WRITEHEADER CURLOPT_SSL_VERIFYHOST CURLOPT_COOKIEFILE CURLOPT_SSLVERSION CURLOPT_TIMECONDITION CURLOPT_TIMEVALUE CURLOPT_CUSTOMREQUEST CURLOPT_STDERR CURLOPT_TRANSFERTEXT CURLOPT_RETURNTRANSFER CURLOPT_QUOTE CURLOPT_POSTQUOTE CURLOPT_INTERFACE CURLOPT_KRB4LEVEL CURLOPT_HTTPPROXYTUNNEL CURLOPT_FILETIME CURLOPT_WRITEFUNCTION CURLOPT_READFUNCTION CURLOPT_PASSWDFUNCTION CURLOPT_HEADERFUNCTION CURLOPT_MAXREDIRS CURLOPT_MAXCONNECTS CURLOPT_CLOSEPOLICY CURLOPT_FRESH_CONNECT CURLOPT_FORBID_REUSE CURLOPT_RANDOM_FILE CURLOPT_EGDSOCKET CURLOPT_CONNECTTIMEOUT CURLOPT_CONNECTTIMEOUT_MS CURLOPT_SSL_VERIFYPEER CURLOPT_CAINFO CURLOPT_CAPATH CURLOPT_COOKIEJAR CURLOPT_SSL_CIPHER_LIST CURLOPT_BINARYTRANSFER CURLOPT_NOSIGNAL CURLOPT_PROXYTYPE CURLOPT_BUFFERSIZE CURLOPT_HTTPGET CURLOPT_HTTP_VERSION CURLOPT_SSLKEY CURLOPT_SSLKEYTYPE CURLOPT_SSLKEYPASSWD CURLOPT_SSLENGINE CURLOPT_SSLENGINE_DEFAULT CURLOPT_SSLCERTTYPE CURLOPT_CRLF CURLOPT_ENCODING CURLOPT_PROXYPORT CURLOPT_UNRESTRICTED_AUTH CURLOPT_FTP_USE_EPRT CURLOPT_HTTP200ALIASES CURLOPT_HTTPAUTH CURLAUTH_BASIC - syn keyword phpCoreConstant contained CURLAUTH_DIGEST CURLAUTH_GSSNEGOTIATE CURLAUTH_NTLM CURLAUTH_ANY CURLAUTH_ANYSAFE CURLOPT_PROXYAUTH CURLCLOSEPOLICY_LEAST_RECENTLY_USED CURLCLOSEPOLICY_LEAST_TRAFFIC CURLCLOSEPOLICY_SLOWEST CURLCLOSEPOLICY_CALLBACK CURLCLOSEPOLICY_OLDEST CURLINFO_PRIVATE CURLINFO_EFFECTIVE_URL CURLINFO_HTTP_CODE CURLINFO_HEADER_OUT CURLINFO_HEADER_SIZE CURLINFO_REQUEST_SIZE CURLINFO_TOTAL_TIME CURLINFO_NAMELOOKUP_TIME CURLINFO_CONNECT_TIME CURLINFO_PRETRANSFER_TIME CURLINFO_SIZE_UPLOAD CURLINFO_SIZE_DOWNLOAD CURLINFO_SPEED_DOWNLOAD CURLINFO_SPEED_UPLOAD CURLINFO_FILETIME CURLINFO_SSL_VERIFYRESULT CURLINFO_CONTENT_LENGTH_DOWNLOAD CURLINFO_CONTENT_LENGTH_UPLOAD CURLINFO_STARTTRANSFER_TIME CURLINFO_CONTENT_TYPE CURLINFO_REDIRECT_TIME CURLINFO_REDIRECT_COUNT CURL_TIMECOND_IFMODSINCE CURL_TIMECOND_IFUNMODSINCE CURL_TIMECOND_LASTMOD CURL_VERSION_IPV6 CURL_VERSION_KERBEROS4 CURL_VERSION_SSL CURL_VERSION_LIBZ CURLVERSION_NOW CURLE_OK CURLE_UNSUPPORTED_PROTOCOL CURLE_FAILED_INIT CURLE_URL_MALFORMAT CURLE_URL_MALFORMAT_USER CURLE_COULDNT_RESOLVE_PROXY CURLE_COULDNT_RESOLVE_HOST CURLE_COULDNT_CONNECT CURLE_FTP_WEIRD_SERVER_REPLY CURLE_FTP_ACCESS_DENIED CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_FTP_WEIRD_PASS_REPLY CURLE_FTP_WEIRD_USER_REPLY CURLE_FTP_WEIRD_PASV_REPLY CURLE_FTP_WEIRD_227_FORMAT CURLE_FTP_CANT_GET_HOST CURLE_FTP_CANT_RECONNECT CURLE_FTP_COULDNT_SET_BINARY CURLE_PARTIAL_FILE CURLE_FTP_COULDNT_RETR_FILE CURLE_FTP_WRITE_ERROR CURLE_FTP_QUOTE_ERROR CURLE_HTTP_NOT_FOUND CURLE_WRITE_ERROR CURLE_MALFORMAT_USER CURLE_FTP_COULDNT_STOR_FILE CURLE_READ_ERROR CURLE_OUT_OF_MEMORY CURLE_OPERATION_TIMEOUTED CURLE_FTP_COULDNT_SET_ASCII CURLE_FTP_PORT_FAILED CURLE_FTP_COULDNT_USE_REST CURLE_FTP_COULDNT_GET_SIZE CURLE_HTTP_RANGE_ERROR CURLE_HTTP_POST_ERROR CURLE_SSL_CONNECT_ERROR CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_FILE_COULDNT_READ_FILE CURLE_LDAP_CANNOT_BIND CURLE_LDAP_SEARCH_FAILED CURLE_LIBRARY_NOT_FOUND CURLE_FUNCTION_NOT_FOUND CURLE_ABORTED_BY_CALLBACK CURLE_BAD_FUNCTION_ARGUMENT CURLE_BAD_CALLING_ORDER CURLE_HTTP_PORT_FAILED CURLE_BAD_PASSWORD_ENTERED CURLE_TOO_MANY_REDIRECTS CURLE_UNKNOWN_TELNET_OPTION CURLE_TELNET_OPTION_SYNTAX CURLE_OBSOLETE CURLE_SSL_PEER_CERTIFICATE CURLE_GOT_NOTHING CURLE_SSL_ENGINE_NOTFOUND CURLE_SSL_ENGINE_SETFAILED CURLE_SEND_ERROR CURLE_RECV_ERROR CURLE_SHARE_IN_USE CURLE_SSL_CERTPROBLEM CURLE_SSL_CIPHER CURLE_SSL_CACERT CURLE_BAD_CONTENT_ENCODING CURLE_LDAP_INVALID_URL CURLE_FILESIZE_EXCEEDED CURLE_FTP_SSL_FAILED CURLFTPAUTH_DEFAULT CURLFTPAUTH_SSL CURLFTPAUTH_TLS CURLPROXY_HTTP CURLPROXY_SOCKS5 CURL_NETRC_OPTIONAL CURL_NETRC_IGNORED CURL_NETRC_REQUIRED CURL_HTTP_VERSION_NONE CURL_HTTP_VERSION_1_0 CURL_HTTP_VERSION_1_1 CURLM_CALL_MULTI_PERFORM CURLM_OK CURLM_BAD_HANDLE CURLM_BAD_EASY_HANDLE CURLM_OUT_OF_MEMORY CURLM_INTERNAL_ERROR CURLMSG_DONE - syn keyword phpFunctions contained curl_close curl_copy_handle curl_errno curl_error curl_exec curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_setopt_array curl_setopt curl_version - - " Cybercash - syn keyword phpFunctions contained cybercash_base64_decode cybercash_base64_encode cybercash_decr cybercash_encr - - " Cybermut - syn keyword phpFunctions contained cybermut_creerformulairecm cybermut_creerreponsecm cybermut_testmac - - " Cyrus IMAP administration - syn keyword phpCoreConstant contained CYRUS_CONN_NONSYNCLITERAL CYRUS_CONN_INITIALRESPONSE CYRUS_CALLBACK_NUMBERED CYRUS_CALLBACK_NOLITERAL - syn keyword phpFunctions contained cyrus_authenticate cyrus_bind cyrus_close cyrus_connect cyrus_query cyrus_unbind - - " Date/Time functions - syn keyword phpCoreConstant contained DATE_ATOM DATE_COOKIE DATE_ISO8601 DATE_RFC822 DATE_RFC850 DATE_RFC1036 DATE_RFC1123 DATE_RFC2822 DATE_RFC3339 DATE_RSS DATE_W3C SUNFUNCS_RET_TIMESTAMP SUNFUNCS_RET_STRING SUNFUNCS_RET_DOUBLE - syn keyword phpFunctions contained checkdate date_create date_date_set date_default_timezone_get date_default_timezone_set date_format date_isodate_set date_modify date_offset_get date_parse date_sun_info date_sunrise date_sunset date_time_set date_timezone_get date_timezone_set date getdate gettimeofday gmdate gmmktime gmstrftime idate localtime microtime mktime strftime strptime strtotime time timezone_abbreviations_list timezone_identifiers_list timezone_name_from_abbr timezone_name_get timezone_offset_get timezone_open timezone_transitions_get - syn keyword phpClasses contained DateTime DateTimeZone - - " Database (dbm-style) Abstraction Layer Functions - syn keyword phpFunctions contained dba_close dba_delete dba_exists dba_fetch dba_firstkey dba_handlers dba_insert dba_key_split dba_list dba_nextkey dba_open dba_optimize dba_popen dba_replace dba_sync - - " dBase functions - syn keyword phpFunctions contained dbase_add_record dbase_close dbase_create dbase_delete_record dbase_get_header_info dbase_get_record_with_names dbase_get_record dbase_numfields dbase_numrecords dbase_open dbase_pack dbase_replace_record - - " NOTE: DBM functions are deprecated as of PHP 5.0 - " syn keyword phpFunctions contained dblist dbmclose dbmdelete dbmexists dbmfetch dbmfirstkey dbminsert dbmnextkey dbmopen dbmreplace - - " DBX Functions - syn keyword phpCoreConstant contained DBX_MYSQL DBX_ODBC DBX_PGSQL DBX_MSSQL DBX_FBSQL DBX_OCI8 DBX_SYBASECT DBX_SQLITE DBX_PERSISTENT DBX_RESULT_INFO DBX_RESULT_INDEX DBX_RESULT_ASSOC DBX_RESULT_UNBUFFERED DBX_COLNAMES_UNCHANGED DBX_COLNAMES_UPPERCASE DBX_COLNAMES_LOWERCASE DBX_CMP_NATIVE DBX_CMP_TEXT DBX_CMP_NUMBER DBX_CMP_ASC DBX_CMP_DESC - syn keyword phpFunctions contained dbx_close dbx_compare dbx_connect dbx_error dbx_escape_string dbx_fetch_row dbx_query dbx_sort - - " Direct I/O functions - " NOTE: this extension also defines the constant 'c', but I am not declaring - " it here because most people will never use it ... - syn keyword phpCoreConstant contained F_DUPFD F_GETFD F_GETFL F_GETLK F_GETOWN F_RDLCK F_SETFL F_SETLK F_SETLKW F_SETOWN F_UNLCK F_WRLCK O_APPEND O_ASYNC O_CREAT O_EXCL O_NDELAY O_NOCTTY O_NONBLOCK O_RDONLY O_RDWR O_SYNC O_TRUNC O_WRONLY S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR - syn keyword phpFunctions contained dio_close dio_fcntl dio_open dio_read dio_seek dio_stat dio_tcsetattr dio_truncate dio_write - - " Directory functions - syn keyword phpCoreConstant contained DIRECTORY_SEPARATOR PATH_SEPARATOR - syn keyword phpFunctions contained chdir chroot dir closedir getcwd opendir readdir rewinddir scandir - syn keyword phpClasses contained Directory - - " DOM functions - syn keyword phpClasses contained DOMAttr DOMCharacterData DOMComment DOMDocument DOMDocumentFragment DOMDocumentType DOMElement DOMEntity DOMEntityReference DOMException DOMImplementation DOMNamedNodeMap DOMNode DOMNodeList DOMNotation DOMProcessingInstruction DOMText DOMXPath - syn keyword phpCoreConstant contained XML_ELEMENT_NODE XML_ATTRIBUTE_NODE XML_TEXT_NODE XML_CDATA_SECTION_NODE XML_ENTITY_REF_NODE XML_ENTITY_NODE XML_PI_NODE XML_COMMENT_NODE XML_DOCUMENT_NODE XML_DOCUMENT_TYPE_NODE XML_DOCUMENT_FRAG_NODE XML_NOTATION_NODE XML_HTML_DOCUMENT_NODE XML_DTD_NODE XML_ELEMENT_DECL_NODE XML_ATTRIBUTE_DECL_NODE XML_ENTITY_DECL_NODE XML_NAMESPACE_DECL_NODE XML_ATTRIBUTE_CDATA XML_ATTRIBUTE_ID XML_ATTRIBUTE_IDREF XML_ATTRIBUTE_IDREFS XML_ATTRIBUTE_ENTITY XML_ATTRIBUTE_NMTOKEN XML_ATTRIBUTE_NMTOKENS XML_ATTRIBUTE_ENUMERATION XML_ATTRIBUTE_NOTATION DOM_INDEX_SIZE_ERR DOMSTRING_SIZE_ERR DOM_HIERARCHY_REQUEST_ERR DOM_WRONG_DOCUMENT_ERR DOM_INVALID_CHARACTER_ERR DOM_NO_DATA_ALLOWED_ERR DOM_NO_MODIFICATION_ALLOWED_ERR DOM_NOT_FOUND_ERR DOM_NOT_SUPPORTED_ERR DOM_INUSE_ATTRIBUTE_ERR DOM_INVALID_STATE_ERR DOM_SYNTAX_ERR DOM_INVALID_MODIFICATION_ERR DOM_NAMESPACE_ERR DOM_INVALID_ACCESS_ERR DOM_VALIDATION_ERR - syn keyword phpFunctions contained dom_import_simplexml - - " DOM XML functions - " NOTE: DOM XML is deprecated in favour of the new 'DOM' extension (they - " appear to contain overlapping functionality) - " syn keyword phpCoreConstant contained XML_ELEMENT_NODE XML_ATTRIBUTE_NODE XML_TEXT_NODE XML_CDATA_SECTION_NODE XML_ENTITY_REF_NODE XML_ENTITY_NODE XML_PI_NODE XML_COMMENT_NODE XML_DOCUMENT_NODE XML_DOCUMENT_TYPE_NODE XML_DOCUMENT_FRAG_NODE XML_NOTATION_NODE XML_GLOBAL_NAMESPACE XML_LOCAL_NAMESPACE XML_HTML_DOCUMENT_NODE XML_DTD_NODE XML_ELEMENT_DECL_NODE XML_ATTRIBUTE_DECL_NODE XML_ENTITY_DECL_NODE XML_NAMESPACE_DECL_NODE XML_ATTRIBUTE_CDATA XML_ATTRIBUTE_ID XML_ATTRIBUTE_IDREF XML_ATTRIBUTE_IDREFS XML_ATTRIBUTE_ENTITY XML_ATTRIBUTE_NMTOKEN XML_ATTRIBUTE_NMTOKENS XML_ATTRIBUTE_ENUMERATION XML_ATTRIBUTE_NOTATION XPATH_UNDEFINED XPATH_NODESET XPATH_BOOLEAN XPATH_NUMBER XPATH_STRING XPATH_POINT XPATH_RANGE XPATH_LOCATIONSET XPATH_USERS XPATH_NUMBER - " syn keyword phpClasses contained DomAttribute DomCData DomComment DomDocument DomDocumentType DomElement DomEntity DomEntityReference DomProcessingInstruction DomText Parser XPathContext - " syn keyword phpFunctions contained domxml_new_doc domxml_open_file domxml_open_mem domxml_version domxml_xmltree domxml_xslt_stylesheet_doc domxml_xslt_stylesheet_file domxml_xslt_stylesheet domxml_xslt_version xpath_eval_expression xpath_eval xpath_new_context xpath_register_ns_auto xpath_register_ns xptr_eval xptr_new_context - - " Enchant functions - syn keyword phpFunctions contained enchant_broker_describe enchant_broker_dict_exists enchant_broker_free_dict enchant_broker_free enchant_broker_get_error enchant_broker_init enchant_broker_list_dicts enchant_broker_request_dict enchant_broker_request_pwl_dict enchant_broker_set_ordering enchant_dict_add_to_personal enchant_dict_add_to_session enchant_dict_check enchant_dict_describe enchant_dict_get_error enchant_dict_is_in_session enchant_dict_quick_check enchant_dict_store_replacement enchant_dict_suggest - - " error-handling - syn keyword phpCoreConstant contained E_ERROR E_WARNING E_PARSE E_NOTICE E_CORE_ERROR E_CORE_WARNING E_COMPILE_ERROR E_COMPILE_WARNING E_USER_ERROR E_USER_WARNING E_USER_NOTICE E_STRICT E_RECOVERABLE_ERROR E_ALL - syn keyword phpFunctions contained debug_backtrace debug_print_backtrace error_get_last error_log error_reporting restore_error_handler restore_exception_handler set_error_handler set_exception_handler trigger_error user_error - - " exif functions - syn keyword phpCoreConstant contained EXIF_USE_MBSTRING - syn keyword phpCoreConstant contained IMAGETYPE_GIF IMAGETYPE_JPEG IMAGETYPE_PNG IMAGETYPE_SWF IMAGETYPE_PSD IMAGETYPE_BMP IMAGETYPE_TIFF_II IMAGETYPE_TIFF_MM IMAGETYPE_JPC IMAGETYPE_JP2 IMAGETYPE_JPX IMAGETYPE_JB2 IMAGETYPE_SWC IMAGETYPE_IFF IMAGETYPE_WBMP IMAGETYPE_XBM - syn keyword phpFunctions contained exif_imagetype exif_read_data exif_tagname exif_thumbnail read_exif_data - - " expect functions - syn keyword phpCoreConstant contained EXP_GLOB EXP_EXACT EXP_REGEXP EXP_EOF EXP_TIMEOUT EXP_FULLBUFFER - syn keyword phpFunctions contained expect_expectl expect_popen - - " FAM functions - syn keyword phpCoreConstant contained FAMChanged FAMDeleted FAMStartExecuting FAMStopExecuting FAMCreated FAMMoved FAMAcknowledge FAMExists FAMEndExist - syn keyword phpFunctions contained fam_cancel_monitor fam_close fam_monitor_collection fam_monitor_directory fam_monitor_file fam_next_event fam_open fam_pending fam_resume_monitor fam_suspend_monitor - - " FDF functions - syn keyword phpCoreConstant contained FDFValue FDFStatus FDFFile FDFID FDFFf FDFSetFf FDFClearFf FDFFlags FDFSetF FDFClrF FDFAP FDFAS FDFAction FDFAA FDFAPRef FDFIF FDFEnter FDFExit FDFDown FDFUp FDFFormat FDFValidate FDFKeystroke FDFCalculate FDFNormalAP FDFRolloverAP FDFDownAP - syn keyword phpFunctions contained fdf_add_doc_javascript fdf_add_template fdf_close fdf_create fdf_enum_values fdf_errno fdf_error fdf_get_ap fdf_get_attachment fdf_get_encoding fdf_get_file fdf_get_flags fdf_get_opt fdf_get_status fdf_get_value fdf_get_version fdf_header fdf_next_field_name fdf_open_string fdf_open fdf_remove_item fdf_save_string fdf_save fdf_set_ap fdf_set_encoding fdf_set_file fdf_set_flags fdf_set_javascript_action fdf_set_on_import_javascript fdf_set_opt fdf_set_status fdf_set_submit_form_action fdf_set_target_frame fdf_set_value fdf_set_version - - " Fileinfo functions - syn keyword phpCoreConstant contained FILEINFO_NONE FILEINFO_SYMLINK FILEINFO_MIME FILEINFO_COMPRESS FILEINFO_DEVICES FILEINFO_CONTINUE FILEINFO_PRESERVE_ATIME FILEINFO_RAW - syn keyword phpFunctions contained finfo_buffer finfo_close finfo_file finfo_open finfo_set_flags - - " Filepro functions - syn keyword phpFunctions contained filepro_fieldcount filepro_fieldname filepro_fieldtype filepro_fieldwidth filepro_retrieve filepro_rowcount filepro - - " Filesystem functions - syn keyword phpCoreConstant contained GLOB_BRACE GLOB_ONLYDIR GLOB_MARK GLOB_NOSORT GLOB_NOCHECK GLOB_NOESCAPE PATHINFO_DIRNAME PATHINFO_BASENAME PATHINFO_EXTENSION PATHINFO_FILENAME FILE_USE_INCLUDE_PATH FILE_APPEND FILE_IGNORE_NEW_LINES FILE_SKIP_EMPTY_LINES FILE_BINARY FILE_TEXT - syn keyword phpFunctions contained basename chgrp chmod chown clearstatcache copy delete dirname disk_free_space disk_total_space diskfreespace fclose feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents file fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype flock fnmatch fopen fpassthru fputcsv fputs fread fscanf fseek fstat ftell ftruncate fwrite glob is_dir is_executable is_file is_link is_readable is_uploaded_file is_writable is_writeable lchgrp lchown link linkinfo lstat mkdir move_uploaded_file parse_ini_file pathinfo pclose popen readfile readlink realpath rename rewind rmdir set_file_buffer stat symlink tempnam tmpfile touch umask unlink - - " Filter extension - syn keyword phpCoreConstant contained INPUT_POST INPUT_GET INPUT_COOKIE INPUT_ENV INPUT_SERVER INPUT_SESSION INPUT_REQUEST FILTER_FLAG_NONE FILTER_REQUIRE_SCALAR FILTER_REQUIRE_ARRAY FILTER_FORCE_ARRAY FILTER_NULL_ON_FAILURE FILTER_VALIDATE_INT FILTER_VALIDATE_BOOLEAN FILTER_VALIDATE_FLOAT FILTER_VALIDATE_REGEXP FILTER_VALIDATE_URL FILTER_VALIDATE_EMAIL FILTER_VALIDATE_IP FILTER_DEFAULT FILTER_UNSAFE_RAW FILTER_SANITIZE_STRING FILTER_SANITIZE_STRIPPED FILTER_SANITIZE_ENCODED FILTER_SANITIZE_SPECIAL_CHARS FILTER_SANITIZE_EMAIL FILTER_SANITIZE_URL FILTER_SANITIZE_NUMBER_INT FILTER_SANITIZE_NUMBER_FLOAT FILTER_SANITIZE_MAGIC_QUOTES FILTER_CALLBACK FILTER_FLAG_ALLOW_OCTAL FILTER_FLAG_ALLOW_HEX FILTER_FLAG_STRIP_LOW FILTER_FLAG_STRIP_HIGH FILTER_FLAG_ENCODE_LOW FILTER_FLAG_ENCODE_HIGH FILTER_FLAG_ENCODE_AMP FILTER_FLAG_NO_ENCODE_QUOTES FILTER_FLAG_EMPTY_STRING_NULL FILTER_FLAG_ALLOW_FRACTION FILTER_FLAG_ALLOW_THOUSAND FILTER_FLAG_ALLOW_SCIENTIFIC FILTER_FLAG_SCHEME_REQUIRED FILTER_FLAG_HOST_REQUIRED FILTER_FLAG_PATH_REQUIRED FILTER_FLAG_QUERY_REQUIRED FILTER_FLAG_IPV4 FILTER_FLAG_IPV6 FILTER_FLAG_NO_RES_RANGE FILTER_FLAG_NO_PRIV_RANGE - syn keyword phpFunctions contained filter_has_var filter_id filter_input_array filter_input filter_list filter_var_array filter_var - - " Firebird / interbase functions - syn keyword phpCoreConstant contained IBASE_DEFAULT IBASE_READ IBASE_WRITE IBASE_CONSISTENCY IBASE_CONCURRENCY IBASE_COMMITTED IBASE_WAIT IBASE_NOWAIT IBASE_FETCH_BLOBS IBASE_FETCH_ARRAYS IBASE_UNIXTIME IBASE_BKP_IGNORE_CHECKSUMS IBASE_BKP_IGNORE_LIMBO IBASE_BKP_METADATA_ONLY IBASE_BKP_NO_GARBAGE_COLLECT IBASE_BKP_OLD_DESCRIPTIONS IBASE_BKP_NON_TRANSPORTABLE IBASE_BKP_CONVERT IBASE_RES_DEACTIVATE_IDX IBASE_RES_NO_SHADOW IBASE_RES_NO_VALIDITY IBASE_RES_ONE_AT_A_TIME IBASE_RES_REPLACE IBASE_RES_CREATE IBASE_RES_USE_ALL_SPACE IBASE_PRP_PAGE_BUFFERS IBASE_PRP_SWEEP_INTERVAL IBASE_PRP_SHUTDOWN_DB IBASE_PRP_DENY_NEW_TRANSACTIONS IBASE_PRP_DENY_NEW_ATTACHMENTS IBASE_PRP_RESERVE_SPACE IBASE_PRP_RES_USE_FULL IBASE_PRP_RES IBASE_PRP_WRITE_MODE IBASE_PRP_WM_ASYNC IBASE_PRP_WM_SYNC IBASE_PRP_ACCESS_MODE IBASE_PRP_AM_READONLY IBASE_PRP_AM_READWRITE IBASE_PRP_SET_SQL_DIALECT IBASE_PRP_ACTIVATE IBASE_PRP_DB_ONLINE IBASE_RPR_CHECK_DB IBASE_RPR_IGNORE_CHECKSUM IBASE_RPR_KILL_SHADOWS IBASE_RPR_MEND_DB IBASE_RPR_VALIDATE_DB IBASE_RPR_FULL IBASE_RPR_SWEEP_DB IBASE_STS_DATA_PAGES IBASE_STS_DB_LOG IBASE_STS_HDR_PAGES IBASE_STS_IDX_PAGES IBASE_STS_SYS_RELATIONS IBASE_SVC_SERVER_VERSION IBASE_SVC_IMPLEMENTATION IBASE_SVC_GET_ENV IBASE_SVC_GET_ENV_LOCK IBASE_SVC_GET_ENV_MSG IBASE_SVC_USER_DBPATH IBASE_SVC_SVR_DB_INFO IBASE_SVC_GET_USERS - syn keyword phpFunctions contained ibase_add_user ibase_affected_rows ibase_backup ibase_blob_add ibase_blob_cancel ibase_blob_close ibase_blob_create ibase_blob_echo ibase_blob_get ibase_blob_import ibase_blob_info ibase_blob_open ibase_close ibase_commit_ret ibase_commit ibase_connect ibase_db_info ibase_delete_user ibase_drop_db ibase_errcode ibase_errmsg ibase_execute ibase_fetch_assoc ibase_fetch_object ibase_fetch_row ibase_field_info ibase_free_event_handler ibase_free_query ibase_free_result ibase_gen_id ibase_maintain_db ibase_modify_user ibase_name_result ibase_num_fields ibase_num_params ibase_param_info ibase_pconnect ibase_prepare ibase_query ibase_restore ibase_rollback_ret ibase_rollback ibase_server_info ibase_service_attach ibase_service_detach ibase_set_event_handler ibase_timefmt ibase_trans ibase_wait_event - - " FriDiBi functions - syn keyword phpCoreConstant contained FRIBIDI_CHARSET_UTF8 FRIBIDI_CHARSET_8859_6 FRIBIDI_CHARSET_8859_8 FRIBIDI_CHARSET_CP1255 FRIBIDI_CHARSET_CP1256 FRIBIDI_CHARSET_ISIRI_3342 FRIBIDI_CHARSET_CAP_RTL FRIBIDI_RTL FRIBIDI_LTR FRIBIDI_AUTO - syn keyword phpFunctions contained fribidi_log2vis - - " FrontBase functions - syn keyword phpCoreConstant contained FBSQL_ASSOC FBSQL_NUM FBSQL_BOTH FBSQL_LOCK_DEFERRED FBSQL_LOCK_OPTIMISTIC FBSQL_LOCK_PESSIMISTIC FBSQL_ISO_READ_UNCOMMITTED FBSQL_ISO_READ_COMMITTED FBSQL_ISO_REPEATABLE_READ FBSQL_ISO_SERIALIZABLE FBSQL_ISO_VERSIONED FBSQL_UNKNOWN FBSQL_STOPPED FBSQL_STARTING FBSQL_RUNNING FBSQL_STOPPING FBSQL_NOEXEC FBSQL_LOB_DIRECT FBSQL_LOB_HANDLE - syn keyword phpFunctions contained fbsql_affected_rows fbsql_autocommit fbsql_blob_size fbsql_change_user fbsql_clob_size fbsql_close fbsql_commit fbsql_connect fbsql_create_blob fbsql_create_clob fbsql_create_db fbsql_data_seek fbsql_database_password fbsql_database fbsql_db_query fbsql_db_status fbsql_drop_db fbsql_errno fbsql_error fbsql_fetch_array fbsql_fetch_assoc fbsql_fetch_field fbsql_fetch_lengths fbsql_fetch_object fbsql_fetch_row fbsql_field_flags fbsql_field_len fbsql_field_name fbsql_field_seek fbsql_field_table fbsql_field_type fbsql_free_result fbsql_get_autostart_info fbsql_hostname fbsql_insert_id fbsql_list_dbs fbsql_list_fields fbsql_list_tables fbsql_next_result fbsql_num_fields fbsql_num_rows fbsql_password fbsql_pconnect fbsql_query fbsql_read_blob fbsql_read_clob fbsql_result fbsql_rollback fbsql_rows_fetched fbsql_select_db fbsql_set_characterset fbsql_set_lob_mode fbsql_set_password fbsql_set_transaction fbsql_start_db fbsql_stop_db fbsql_table_name fbsql_tablename fbsql_username fbsql_warnings - - " FTP functions - syn keyword phpCoreConstant contained FTP_ASCII FTP_TEXT FTP_BINARY FTP_IMAGE FTP_TIMEOUT_SEC FTP_AUTOSEEK FTP_AUTORESUME FTP_FAILED FTP_FINISHED FTP_MOREDATA - syn keyword phpFunctions contained ftp_alloc ftp_cdup ftp_chdir ftp_chmod ftp_close ftp_connect ftp_delete ftp_exec ftp_fget ftp_fput ftp_get_option ftp_get ftp_login ftp_mdtm ftp_mkdir ftp_nb_continue ftp_nb_fget ftp_nb_fput ftp_nb_get ftp_nb_put ftp_nlist ftp_pasv ftp_put ftp_pwd ftp_quit ftp_raw ftp_rawlist ftp_rename ftp_rmdir ftp_set_option ftp_site ftp_size ftp_ssl_connect ftp_systype - - " Function Handling Functions - syn keyword phpFunctions contained call_user_func_array call_user_func create_function func_get_arg func_get_args func_num_args function_exists get_defined_functions register_shutdown_function register_tick_function unregister_tick_function - - " GeoIP Functions - syn keyword phpCoreConstant contained GEOIP_COUNTRY_EDITION GEOIP_REGION_EDITION_REV0 GEOIP_CITY_EDITION_REV0 GEOIP_ORG_EDITION GEOIP_ISP_EDITION GEOIP_CITY_EDITION_REV1 GEOIP_REGION_EDITION_REV1 GEOIP_PROXY_EDITION GEOIP_ASNUM_EDITION GEOIP_NETSPEED_EDITION GEOIP_DOMAIN_EDITION GEOIP_UNKNOWN_SPEED GEOIP_DIALUP_SPEED GEOIP_CABLEDSL_SPEED GEOIP_CORPORATE_SPEED - syn keyword phpFunctions contained geoip_country_code_by_name geoip_country_code3_by_name geoip_country_name_by_name geoip_database_info geoip_db_avail geoip_db_filename geoip_db_get_all_info geoip_id_by_name geoip_org_by_name geoip_record_by_name geoip_region_by_name - - " Gettext functions - syn keyword phpFunctions contained bind_textdomain_codeset bindtextdomain dcgettext dcngettext dgettext dngettext gettext ngettext textdomain - - " GMP Function - syn keyword phpCoreConstant contained GMP_ROUND_ZERO GMP_ROUND_PLUSINF GMP_ROUND_MINUSINF GMP_VERSION - syn keyword phpFunctions contained gmp_abs gmp_add gmp_and gmp_clrbit gmp_cmp gmp_com gmp_div_q gmp_div_qr gmp_div_r gmp_div gmp_divexact gmp_fact gmp_gcd gmp_gcdext gmp_hamdist gmp_init gmp_intval gmp_invert gmp_jacobi gmp_legendre gmp_mod gmp_mul gmp_neg gmp_nextprime gmp_or gmp_perfect_square gmp_popcount gmp_pow gmp_powm gmp_prob_prime gmp_random gmp_scan0 gmp_scan1 gmp_setbit gmp_sign gmp_sqrt gmp_sqrtrem gmp_strval gmp_sub gmp_testbit gmp_xor - - " gnupg Functions - syn keyword phpCoreConstant contained GNUPG_SIG_MODE_NORMAL GNUPG_SIG_MODE_DETACH GNUPG_SIG_MODE_CLEAR GNUPG_VALIDITY_UNKNOWN GNUPG_VALIDITY_UNDEFINED GNUPG_VALIDITY_NEVER GNUPG_VALIDITY_MARGINAL GNUPG_VALIDITY_FULL GNUPG_VALIDITY_ULTIMATE GNUPG_PROTOCOL_OpenPGP GNUPG_PROTOCOL_CMS GNUPG_SIGSUM_VALID GNUPG_SIGSUM_GREEN GNUPG_SIGSUM_RED GNUPG_SIGSUM_KEY_REVOKED GNUPG_SIGSUM_KEY_EXPIRED GNUPG_SIGSUM_KEY_MISSING GNUPG_SIGSUM_SIG_EXPIRED GNUPG_SIGSUM_CRL_MISSING GNUPG_SIGSUM_CRL_TOO_OLD GNUPG_SIGSUM_BAD_POLICY GNUPG_SIGSUM_SYS_ERROR GNUPG_ERROR_WARNING GNUPG_ERROR_EXCEPTION GNUPG_ERROR_SILENT - syn keyword phpFunctions contained gnupg_adddecryptkey gnupg_addencryptkey gnupg_addsignkey gnupg_cleardecryptkeys gnupg_clearencryptkeys gnupg_clearsignkeys gnupg_decrypt gnupg_decryptverify gnupg_encrypt gnupg_encryptsign gnupg_export gnupg_geterror gnupg_getprotocol gnupg_import gnupg_keyinfo gnupg_setarmor gnupg_seterrormode gnupg_setsignmode gnupg_sign gnupg_verify - - " Net_Gopher - syn keyword phpCoreConstant contained GOPHER_DOCUMENT GOPHER_DIRECTORY GOPHER_BINHEX GOPHER_DOSBINARY GOPHER_UUENCODED GOPHER_BINARY GOPHER_INFO GOPHER_HTTP GOPHER_UNKNOWN - syn keyword phpFunctions contained gopher_parsedir - - " hash functions - syn keyword phpCoreConstant contained HASH_HMAC - syn keyword phpFunctions contained hash_algos hash_file hash_final hash_hmac_file hash_hmac hash_init hash_update_file hash_update_stream hash_update hash - - " HTTP functions - " TODO: I've never seen these classes before ... make sure they work / are available - syn keyword phpCoreConstant contained HTTP_SUPPORT HTTP_SUPPORT_REQUESTS HTTP_SUPPORT_MAGICMIME HTTP_SUPPORT_ENCODINGS HTTP_SUPPORT_SSLREQUESTS HTTP_PARAMS_ALLOW_COMMA HTTP_PARAMS_ALLOW_FAILURE HTTP_PARAMS_RAISE_ERROR HTTP_PARAMS_DEFAULT HTTP_COOKIE_PARSE_RAW HTTP_COOKIE_SECURE HTTP_COOKIE_HTTPONLY HTTP_DEFLATE_LEVEL_DEF HTTP_DEFLATE_LEVEL_MIN HTTP_DEFLATE_LEVEL_MAX HTTP_DEFLATE_TYPE_ZLIB HTTP_DEFLATE_TYPE_GZIP HTTP_DEFLATE_TYPE_RAW HTTP_DEFLATE_STRATEGY_DEF HTTP_DEFLATE_STRATEGY_FILT HTTP_DEFLATE_STRATEGY_HUFF HTTP_DEFLATE_STRATEGY_RLE HTTP_DEFLATE_STRATEGY_FIXED HTTP_ENCODING_STREAM_FLUSH_NONE HTTP_ENCODING_STREAM_FLUSH_SYNC HTTP_ENCODING_STREAM_FLUSH_FULL HTTP_E_RUNTIME HTTP_E_INVALID_PARAM HTTP_E_HEADER HTTP_E_MALFORMED_HEADERS HTTP_E_REQUEST_METHOD HTTP_E_MESSAGE_TYPE HTTP_E_ENCODING HTTP_E_REQUEST HTTP_E_REQUEST_POOL HTTP_E_SOCKET HTTP_E_RESPONSE HTTP_E_URL HTTP_E_QUERYSTRING HTTP_MSG_NONE HTTP_MSG_REQUEST HTTP_MSG_RESPONSE HTTP_QUERYSTRING_TYPE_BOOL HTTP_QUERYSTRING_TYPE_INT HTTP_QUERYSTRING_TYPE_FLOAT HTTP_QUERYSTRING_TYPE_STRING - syn keyword phpCoreConstant contained HTTP_QUERYSTRING_TYPE_ARRAY HTTP_QUERYSTRING_TYPE_OBJECT HTTP_AUTH_BASIC HTTP_AUTH_DIGEST HTTP_AUTH_NTLM HTTP_AUTH_GSSNEG HTTP_AUTH_ANY HTTP_VERSION_ANY HTTP_VERSION_1_0 HTTP_VERSION_1_1 HTTP_SSL_VERSION_ANY HTTP_SSL_VERSION_TLSv1 HTTP_SSL_VERSION_SSLv3 HTTP_SSL_VERSION_SSLv2 HTTP_PROXY_SOCKS4 HTTP_PROXY_SOCKS5 HTTP_PROXY_HTTP HTTP_IPRESOLVE_V4 HTTP_IPRESOLVE_V6 HTTP_IPRESOLVE_ANY HTTP_METH_GET HTTP_METH_HEAD HTTP_METH_POST HTTP_METH_PUT HTTP_METH_DELETE HTTP_METH_OPTIONS HTTP_METH_TRACE HTTP_METH_CONNECT HTTP_METH_PROPFIND HTTP_METH_PROPPATCH HTTP_METH_MKCOL HTTP_METH_COPY HTTP_METH_MOVE HTTP_METH_LOCK HTTP_METH_UNLOCK HTTP_METH_VERSION_CONTROL HTTP_METH_REPORT HTTP_METH_CHECKOUT HTTP_METH_CHECKIN HTTP_METH_UNCHECKOUT HTTP_METH_MKWORKSPACE HTTP_METH_UPDATE HTTP_METH_LABEL HTTP_METH_MERGE HTTP_METH_BASELINE_CONTROL HTTP_METH_MKACTIVITY HTTP_METH_ACL HTTP_REDIRECT HTTP_REDIRECT_PERM HTTP_REDIRECT_FOUND HTTP_REDIRECT_POST HTTP_REDIRECT_PROXY HTTP_REDIRECT_TEMP HTTP_URL_REPLACE HTTP_URL_JOIN_PATH - syn keyword phpCoreConstant contained HTTP_URL_JOIN_QUERY HTTP_URL_STRIP_USER HTTP_URL_STRIP_PASS HTTP_URL_STRIP_AUTH HTTP_URL_STRIP_PORT HTTP_URL_STRIP_PATH HTTP_URL_STRIP_QUERY HTTP_URL_STRIP_FRAGMENT HTTP_URL_STRIP_ALL - syn keyword phpClasses contained HttpMessage HttpQueryString HttpDeflateStream HttpInflateStream HttpRequest HttpRequestPool HttpResponse - syn keyword phpFunctions contained http_cache_etag http_cache_last_modified http_chunked_decode http_deflate http_inflate http_get_request_body_stream http_get_request_body http_get_request_headers http_date http_support http_match_etag http_match_modified http_match_request_header http_build_cookie http_negotiate_charset http_negotiate_content_type http_negotiate_language ob_deflatehandler ob_etaghandler ob_inflatehandler http_parse_cookie http_parse_headers http_parse_message http_parse_params http_persistent_handles_count http_persistent_handles_ident http_persistent_handles_clean http_get http_head http_post_data http_post_fields http_put_data http_put_file http_put_stream http_request_method_exists http_request_method_name http_request_method_register http_request_method_unregister http_request http_request_body_encode http_redirect http_send_content_disposition http_send_content_type http_send_data http_send_file http_send_last_modified http_send_status http_send_stream http_throttle http_build_str http_build_url - - " Hyperwave functions - syn keyword phpCoreConstant contained HW_ATTR_LANG HW_ATTR_NR HW_ATTR_NONE - syn keyword phpFunctions contained hw_Array2Objrec hw_changeobject hw_Children hw_ChildrenObj hw_Close hw_Connect hw_connection_info hw_cp hw_Deleteobject hw_DocByAnchor hw_DocByAnchorObj hw_Document_Attributes hw_Document_BodyTag hw_Document_Content hw_Document_SetContent hw_Document_Size hw_dummy hw_EditText hw_Error hw_ErrorMsg hw_Free_Document hw_GetAnchors hw_GetAnchorsObj hw_GetAndLock hw_GetChildColl hw_GetChildCollObj hw_GetChildDocColl hw_GetChildDocCollObj hw_GetObject hw_GetObjectByQuery hw_GetObjectByQueryColl hw_GetObjectByQueryCollObj hw_GetObjectByQueryObj hw_GetParents hw_GetParentsObj hw_getrellink hw_GetRemote hw_getremotechildren hw_GetSrcByDestObj hw_GetText hw_getusername hw_Identify hw_InCollections hw_Info hw_InsColl hw_InsDoc hw_insertanchors hw_InsertDocument hw_InsertObject hw_mapid hw_Modifyobject hw_mv hw_New_Document hw_objrec2array hw_Output_Document hw_pConnect hw_PipeDocument hw_Root hw_setlinkroot hw_stat hw_Unlock hw_Who - - " Hyperwave API - syn keyword phpClasses contained HW_API HW_API_Object HW_API_Attribute HW_API_Error HW_API_Content HW_API_Reason - syn keyword phpFunctions contained hw_api_object hw_api_content hwapi_hgcsp hw_api_attribute - - " NOTE: i18n functions are not yet available - - " IBM DB2 - syn keyword phpCoreConstant contained DB2_BINARY DB2_CONVERT DB2_PASSTHRU DB2_SCROLLABLE DB2_FORWARD_ONLY DB2_PARAM_IN DB2_PARAM_OUT DB2_PARAM_INOUT DB2_PARAM_FILE DB2_AUTOCOMMIT_ON DB2_AUTOCOMMIT_OFF DB2_DOUBLE DB2_LONG DB2_CHAR DB2_CASE_NATURAL DB2_CASE_LOWER DB2_CASE_UPPER DB2_DEFERRED_PREPARE_ON DB2_DEFERRED_PREPARE_OFF - syn keyword phpFunctions contained db2_autocommit db2_bind_param db2_client_info db2_close db2_column_privileges db2_columns db2_commit db2_conn_error db2_conn_errormsg db2_connect db2_cursor_type db2_escape_string db2_exec db2_execute db2_fetch_array db2_fetch_assoc db2_fetch_both db2_fetch_object db2_fetch_row db2_field_display_size db2_field_name db2_field_num db2_field_precision db2_field_scale db2_field_type db2_field_width db2_foreign_keys db2_free_result db2_free_stmt db2_get_option db2_lob_read db2_next_result db2_num_fields db2_num_rows db2_pconnect db2_prepare db2_primary_keys db2_procedure_columns db2_procedures db2_result db2_rollback db2_server_info db2_set_option db2_special_columns db2_statistics db2_stmt_error db2_stmt_errormsg db2_table_privileges db2_tables - - " ICONV functions - syn keyword phpCoreConstant contained ICONV_IMPL ICONV_VERSION ICONV_MIME_DECODE_STRICT ICONV_MIME_DECODE_CONTINUE_ON_ERROR - syn keyword phpFunctions contained iconv_get_encoding iconv_mime_decode_headers iconv_mime_decode iconv_mime_encode iconv_set_encoding iconv_strlen iconv_strpos iconv_strrpos iconv_substr iconv ob_iconv_handler - - " ID3 functions - syn keyword phpCoreConstant contained ID3_V1_0 ID3_V1_1 ID3_V2_1 ID3_V2_2 ID3_V2_3 ID3_V2_4 ID3_BEST - syn keyword phpFunctions contained id3_get_frame_long_name id3_get_frame_short_name id3_get_genre_id id3_get_genre_list id3_get_genre_name id3_get_tag id3_get_version id3_remove_tag id3_set_tag - - " IIS functions - syn keyword phpCoreConstant contained IIS_READ IIS_WRITE IIS_EXECUTE IIS_SCRIPT IIS_ANONYMOUS IIS_BASIC IIS_NTLM IIS_STARTING IIS_STOPPED IIS_PAUSED IIS_RUNNING - syn keyword phpFunctions contained iis_add_server iis_get_dir_security iis_get_script_map iis_get_server_by_comment iis_get_server_by_path iis_get_server_rights iis_get_service_state iis_remove_server iis_set_app_settings iis_set_dir_security iis_set_script_map iis_set_server_rights iis_start_server iis_start_service iis_stop_server iis_stop_service - - " Image functions - syn keyword phpCoreConstant contained GD_VERSION GD_MAJOR_VERSION GD_MINOR_VERSION GD_RELEASE_VERSION GD_EXTRA_VERSION IMG_GIF IMG_JPG IMG_JPEG IMG_PNG IMG_WBMP IMG_XPM IMG_COLOR_TILED IMG_COLOR_STYLED IMG_COLOR_BRUSHED IMG_COLOR_STYLEDBRUSHED IMG_COLOR_TRANSPARENT IMG_ARC_ROUNDED IMG_ARC_PIE IMG_ARC_CHORD IMG_ARC_NOFILL IMG_ARC_EDGED IMG_GD2_RAW IMG_GD2_COMPRESSED IMG_EFFECT_REPLACE IMG_EFFECT_ALPHABLEND IMG_EFFECT_NORMAL IMG_EFFECT_OVERLAY IMG_FILTER_NEGATE IMG_FILTER_GRAYSCALE IMG_FILTER_BRIGHTNESS IMG_FILTER_CONTRAST IMG_FILTER_COLORIZE IMG_FILTER_EDGEDETECT IMG_FILTER_GAUSSIAN_BLUR IMG_FILTER_SELECTIVE_BLUR IMG_FILTER_EMBOSS IMG_FILTER_MEAN_REMOVAL IMG_FILTER_SMOOTH IMAGETYPE_GIF IMAGETYPE_JPEG IMAGETYPE_PNG IMAGETYPE_SWF IMAGETYPE_PSD IMAGETYPE_BMP IMAGETYPE_WBMP IMAGETYPE_XBM IMAGETYPE_TIFF_II IMAGETYPE_TIFF_MM IMAGETYPE_IFF IMAGETYPE_JB2 IMAGETYPE_JPC IMAGETYPE_JP2 IMAGETYPE_JPX IMAGETYPE_SWC IMAGETYPE_ICO PNG_NO_FILTER PNG_FILTER_NONE PNG_FILTER_SUB PNG_FILTER_UP PNG_FILTER_AVG PNG_FILTER_PAETH PNG_ALL_FILTERS - syn keyword phpFunctions contained gd_info getimagesize image_type_to_extension image_type_to_mime_type image2wbmp imagealphablending imageantialias imagearc imagechar imagecharup imagecolorallocate imagecolorallocatealpha imagecolorat imagecolorclosest imagecolorclosestalpha imagecolorclosesthwb imagecolordeallocate imagecolorexact imagecolorexactalpha imagecolormatch imagecolorresolve imagecolorresolvealpha imagecolorset imagecolorsforindex imagecolorstotal imagecolortransparent imageconvolution imagecopy imagecopymerge imagecopymergegray imagecopyresampled imagecopyresized imagecreate imagecreatefromgd2 imagecreatefromgd2part imagecreatefromgd imagecreatefromgif imagecreatefromjpeg imagecreatefrompng imagecreatefromstring imagecreatefromwbmp imagecreatefromxbm imagecreatefromxpm imagecreatetruecolor imagedashedline imagedestroy imageellipse imagefill imagefilledarc imagefilledellipse imagefilledpolygon imagefilledrectangle imagefilltoborder imagefilter imagefontheight - syn keyword phpFunctions contained imagefontwidth imageftbbox imagefttext imagegammacorrect imagegd2 imagegd imagegif imagegrabscreen imagegrabwindow imageinterlace imageistruecolor imagejpeg imagelayereffect imageline imageloadfont imagepalettecopy imagepng imagepolygon imagepsbbox imagepsencodefont imagepsextendfont imagepsfreefont imagepsloadfont imagepsslantfont imagepstext imagerectangle imagerotate imagesavealpha imagesetbrush imagesetpixel imagesetstyle imagesetthickness imagesettile imagestring imagestringup imagesx imagesy imagetruecolortopalette imagettfbbox imagettftext imagetypes imagewbmp imagexbm iptcembed iptcparse jpeg2wbmp png2wbmp - - " Imagick Image Library - " NOTE: this extension is experimental - " syn keyword phpClasses contained Imagick ImagickDraw ImagickPixel ImagickPixelIterator - - " IMAP POP3 and NNTP functions - syn keyword phpCoreConstant contained NIL OP_DEBUG OP_READONLY OP_ANONYMOUS OP_SHORTCACHE OP_SILENT OP_PROTOTYPE OP_HALFOPEN OP_EXPUNGE OP_SECURE CL_EXPUNGE FT_UID FT_PEEK FT_NOT FT_INTERNAL FT_PREFETCHTEXT ST_UID ST_SILENT ST_SET CP_UID CP_MOVE SE_UID SE_FREE SE_NOPREFETCH SO_FREE SO_NOSERVER SA_MESSAGES SA_RECENT SA_UNSEEN SA_UIDNEXT SA_UIDVALIDITY SA_ALL LATT_NOINFERIORS LATT_NOSELECT LATT_MARKED LATT_UNMARKED SORTDATE SORTARRIVAL SORTFROM SORTSUBJECT SORTTO SORTCC SORTSIZE TYPETEXT TYPEMULTIPART TYPEMESSAGE TYPEAPPLICATION TYPEAUDIO TYPEIMAGE TYPEVIDEO TYPEOTHER ENC7BIT ENC8BIT ENCBINARY ENCBASE64 ENCQUOTEDPRINTABLE ENCOTHER IMAP_OPENTIMEOUT IMAP_READTIMEOUT IMAP_WRITETIMEOUT IMAP_CLOSETIMEOUT LATT_REFERRAL LATT_HASCHILDREN LATT_HASNOCHILDREN TYPEMODEL - syn keyword phpFunctions contained imap_8bit imap_alerts imap_append imap_base64 imap_binary imap_body imap_bodystruct imap_check imap_clearflag_full imap_close imap_createmailbox imap_delete imap_deletemailbox imap_errors imap_expunge imap_fetch_overview imap_fetchbody imap_fetchheader imap_fetchstructure imap_get_quota imap_get_quotaroot imap_getacl imap_getmailboxes imap_getsubscribed imap_header imap_headerinfo imap_headers imap_last_error imap_list imap_listmailbox imap_listscan imap_listsubscribed imap_lsub imap_mail_compose imap_mail_copy imap_mail_move imap_mail imap_mailboxmsginfo imap_mime_header_decode imap_msgno imap_num_msg imap_num_recent imap_open imap_ping imap_qprint imap_renamemailbox imap_reopen imap_rfc822_parse_adrlist imap_rfc822_parse_headers imap_rfc822_write_address imap_savebody imap_scanmailbox imap_search imap_set_quota imap_setacl imap_setflag_full imap_sort imap_status imap_subscribe imap_thread imap_timeout imap_uid imap_undelete imap_unsubscribe imap_utf7_decode imap_utf7_encode imap_utf8 - - " Informix functions - syn keyword phpCoreConstant contained IFX_SCROLL IFX_HOLD IFX_LO_RDONLY IFX_LO_WRONLY IFX_LO_APPEND IFX_LO_RDWR IFX_LO_BUFFER IFX_LO_NOBUFFER - syn keyword phpFunctions contained ifx_affected_rows ifx_blobinfile_mode ifx_byteasvarchar ifx_close ifx_connect ifx_copy_blob ifx_create_blob ifx_create_char ifx_do ifx_error ifx_errormsg ifx_fetch_row ifx_fieldproperties ifx_fieldtypes ifx_free_blob ifx_free_char ifx_free_result ifx_get_blob ifx_get_char ifx_getsqlca ifx_htmltbl_result ifx_nullformat ifx_num_fields ifx_num_rows ifx_pconnect ifx_prepare ifx_query ifx_textasvarchar ifx_update_blob ifx_update_char ifxus_close_slob ifxus_create_slob ifxus_free_slob ifxus_open_slob ifxus_read_slob ifxus_seek_slob ifxus_tell_slob ifxus_write_slob - - " Ingres II Functions - syn keyword phpCoreConstant contained INGRES_ASSOC INGRES_NUM INGRES_BOTH INGRES_EXT_VERSION INGRES_API_VERSION INGRES_CURSOR_READONLY INGRES_CURSOR_UPDATE INGRES_DATE_MULTINATIONAL INGRES_DATE_MULTINATIONAL4 INGRES_DATE_FINNISH INGRES_DATE_ISO INGRES_DATE_ISO4 INGRES_DATE_GERMAN INGRES_DATE_MDY INGRES_DATE_DMY INGRES_DATE_YMD INGRES_MONEY_LEADING INGRES_MONEY_TRAILING INGRES_STRUCTURE_BTREE INGRES_STRUCTURE_CBTREE INGRES_STRUCTURE_HASH INGRES_STRUCTURE_CHASH INGRES_STRUCTURE_HEAP INGRES_STRUCTURE_CHEAP INGRES_STRUCTURE_ISAM INGRES_STRUCTURE_CISAM - syn keyword phpFunctions contained ingres_autocommit ingres_close ingres_commit ingres_connect ingres_cursor ingres_errno ingres_error ingres_errsqlstate ingres_fetch_array ingres_fetch_object ingres_fetch_row ingres_field_length ingres_field_name ingres_field_nullable ingres_field_precision ingres_field_scale ingres_field_type ingres_num_fields ingres_num_rows ingres_pconnect ingres_query ingres_rollback - - " IRC Gateway functions - syn keyword phpFunctions contained ircg_channel_mode ircg_disconnect ircg_eval_ecmascript_params ircg_fetch_error_msg ircg_get_username ircg_html_encode ircg_ignore_add ircg_ignore_del ircg_invite ircg_is_conn_alive ircg_join ircg_kick ircg_list ircg_lookup_format_messages ircg_lusers ircg_msg ircg_names ircg_nick ircg_nickname_escape ircg_nickname_unescape ircg_notice ircg_oper ircg_part ircg_pconnect ircg_register_format_messages ircg_set_current ircg_set_file ircg_set_on_die ircg_topic ircg_who ircg_whois - - " PHP/Java Integration - " NOTE: this extension is experimental - - " JSON functions - syn keyword phpFunctions contained json_decode json_encode - - " KADM5 - syn keyword phpCoreConstant contained KRB5_KDB_DISALLOW_POSTDATED KRB5_KDB_DISALLOW_FORWARDABLE KRB5_KDB_DISALLOW_TGT_BASED KRB5_KDB_DISALLOW_RENEWABLE KRB5_KDB_DISALLOW_PROXIABLE KRB5_KDB_DISALLOW_DUP_SKEY KRB5_KDB_DISALLOW_ALL_TIX KRB5_KDB_REQUIRES_PRE_AUTH KRB5_KDB_REQUIRES_HW_AUTH KRB5_KDB_REQUIRES_PWCHANGE KRB5_KDB_DISALLOW_SVR KRB5_KDB_PWCHANGE_SERVER KRB5_KDB_SUPPORT_DESMD5 KRB5_KDB_NEW_PRINC KADM5_PRINCIPAL KADM5_PRINC_EXPIRE_TIME KADM5_LAST_PW_CHANGE KADM5_PW_EXPIRATION KADM5_MAX_LIFE KADM5_MAX_RLIFE KADM5_MOD_NAME KADM5_MOD_TIME KADM5_KVNO KADM5_POLICY KADM5_CLEARPOLICY KADM5_LAST_SUCCESS KADM5_LAST_FAILED KADM5_FAIL_AUTH_COUNT KADM5_RANDKEY KADM5_ATTRIBUTES - syn keyword phpFunctions contained kadm5_chpass_principal kadm5_create_principal kadm5_delete_principal kadm5_destroy kadm5_flush kadm5_get_policies kadm5_get_principal kadm5_get_principals kadm5_init_with_password kadm5_modify_principal - - " LDAP functions - syn keyword phpCoreConstant contained LDAP_DEREF_NEVER LDAP_DEREF_SEARCHING LDAP_DEREF_FINDING LDAP_DEREF_ALWAYS LDAP_OPT_DEREF LDAP_OPT_SIZELIMIT LDAP_OPT_TIMELIMIT LDAP_OPT_NETWORK_TIMEOUT LDAP_OPT_PROTOCOL_VERSION LDAP_OPT_ERROR_NUMBER LDAP_OPT_REFERRALS LDAP_OPT_RESTART LDAP_OPT_HOST_NAME LDAP_OPT_ERROR_STRING LDAP_OPT_MATCHED_DN LDAP_OPT_SERVER_CONTROLS LDAP_OPT_CLIENT_CONTROLS LDAP_OPT_DEBUG_LEVEL GSLC_SSL_NO_AUTH GSLC_SSL_ONEWAY_AUTH GSLC_SSL_TWOWAY_AUTH - syn keyword phpFunctions contained ldap_8859_to_t61 ldap_add ldap_bind ldap_close ldap_compare ldap_connect ldap_count_entries ldap_delete ldap_dn2ufn ldap_err2str ldap_errno ldap_error ldap_explode_dn ldap_first_attribute ldap_first_entry ldap_first_reference ldap_free_result ldap_get_attributes ldap_get_dn ldap_get_entries ldap_get_option ldap_get_values_len ldap_get_values ldap_list ldap_mod_add ldap_mod_del ldap_mod_replace ldap_modify ldap_next_attribute ldap_next_entry ldap_next_reference ldap_parse_reference ldap_parse_result ldap_read ldap_rename ldap_sasl_bind ldap_search ldap_set_option ldap_set_rebind_proc ldap_sort ldap_start_tls ldap_t61_to_8859 ldap_unbind - - " libxml functions - syn keyword phpClasses contained LibXMLError - syn keyword phpCoreConstant contained LIBXML_COMPACT LIBXML_DTDATTR LIBXML_DTDLOAD LIBXML_DTDVALID LIBXML_NOBLANKS LIBXML_NOCDATA LIBXML_NOEMPTYTAG LIBXML_NOENT LIBXML_NOERROR LIBXML_NONET LIBXML_NOWARNING LIBXML_NOXMLDECL LIBXML_NSCLEAN LIBXML_XINCLUDE LIBXML_ERR_ERROR LIBXML_ERR_FATAL LIBXML_ERR_NONE LIBXML_ERR_WARNING LIBXML_VERSION LIBXML_DOTTED_VERSION - syn keyword phpFunctions contained libxml_clear_errors libxml_get_errors libxml_get_last_error libxml_set_streams_context libxml_use_internal_errors - - " Lotus Notes functions - " NOTE: experimental, no maintainer - " syn keyword phpFunctions contained notes_body notes_copy_db notes_create_db notes_create_note notes_drop_db notes_find_note notes_header_info notes_list_msgs notes_mark_read notes_mark_unread notes_nav_create notes_search notes_unread notes_version - - " LZF functions - syn keyword phpFunctions contained lzf_compress lzf_decompress lzf_optimized_for - - " Mail functions - syn keyword phpFunctions contained ezmlm_hash mail - - " Mailparse functions - syn keyword phpCoreConstant contained MAILPARSE_EXTRACT_OUTPUT MAILPARSE_EXTRACT_STREAM MAILPARSE_EXTRACT_RETURN - syn keyword phpFunctions contained mailparse_determine_best_xfer_encoding mailparse_msg_create mailparse_msg_extract_part_file mailparse_msg_extract_part mailparse_msg_extract_whole_part_file mailparse_msg_free mailparse_msg_get_part_data mailparse_msg_get_part mailparse_msg_get_structure mailparse_msg_parse_file mailparse_msg_parse mailparse_rfc822_parse_addresses mailparse_stream_encode mailparse_uudecode_all - - " Mathematical functions - syn keyword phpCoreConstant contained M_PI M_E M_LOG2E M_LOG10E M_LN2 M_LN10 M_PI_2 M_PI_4 M_1_PI M_2_PI M_SQRTPI M_2_SQRTPI M_SQRT2 M_SQRT3 M_SQRT1_2 M_LNPI M_EULER - syn keyword phpFunctions contained abs acos acosh asin asinh atan2 atan atanh base_convert bindec ceil cos cosh decbin dechex decoct deg2rad exp expm1 floor fmod getrandmax hexdec hypot is_finite is_infinite is_nan lcg_value log10 log1p log max min mt_getrandmax mt_rand mt_srand octdec pi pow rad2deg rand round sin sinh sqrt srand tan tanh - - " MaxDB functions - syn keyword phpClasses contained maxdb maxdb_stmt maxdb_result - syn keyword phpCoreConstant contained MAXDB_COMPNAME MAXDB_APPLICATION MAXDB_APPVERSION MAXDB_SQLMODE MAXDB_UNICODE MAXDB_TIMEOUT MAXDB_ISOLATIONLEVEL MAXDB_PACKETCOUNT MAXDB_STATEMENTCACHESIZE MAXDB_CURSORPREFIX MAXDB_ASSOC MAXDB_ASSOC_UPPER MAXDB_ASSOC_LOWER MAXDB_BOTH MAXDB_NUM - syn keyword phpFunctions contained maxdb_affected_rows maxdb_autocommit maxdb_bind_param maxdb_bind_result maxdb_change_user maxdb_character_set_name maxdb_client_encoding maxdb_close_long_data maxdb_close maxdb_commit maxdb_connect_errno maxdb_connect_error maxdb_connect maxdb_data_seek maxdb_debug maxdb_disable_reads_from_master maxdb_disable_rpl_parse maxdb_dump_debug_info maxdb_embedded_connect maxdb_enable_reads_from_master maxdb_enable_rpl_parse maxdb_errno maxdb_error maxdb_escape_string maxdb_execute maxdb_fetch_array maxdb_fetch_assoc maxdb_fetch_field_direct maxdb_fetch_field maxdb_fetch_fields maxdb_fetch_lengths maxdb_fetch_object maxdb_fetch_row maxdb_fetch maxdb_field_count maxdb_field_seek maxdb_field_tell maxdb_free_result maxdb_get_client_info maxdb_get_client_version maxdb_get_host_info maxdb_get_metadata maxdb_get_proto_info maxdb_get_server_info maxdb_get_server_version maxdb_info maxdb_init maxdb_insert_id maxdb_kill maxdb_master_query maxdb_more_results - syn keyword phpFunctions contained maxdb_multi_query maxdb_next_result maxdb_num_fields maxdb_num_rows maxdb_options maxdb_param_count maxdb_ping maxdb_prepare maxdb_query maxdb_real_connect maxdb_real_escape_string maxdb_real_query maxdb_report maxdb_rollback maxdb_rpl_parse_enabled maxdb_rpl_probe maxdb_rpl_query_type maxdb_select_db maxdb_send_long_data maxdb_send_query maxdb_server_end maxdb_server_init maxdb_set_opt maxdb_sqlstate maxdb_ssl_set maxdb_stat maxdb_stmt_affected_rows maxdb_stmt_bind_param maxdb_stmt_bind_result maxdb_stmt_close_long_data maxdb_stmt_close maxdb_stmt_data_seek maxdb_stmt_errno maxdb_stmt_error maxdb_stmt_execute maxdb_stmt_fetch maxdb_stmt_free_result maxdb_stmt_init maxdb_stmt_num_rows maxdb_stmt_param_count maxdb_stmt_prepare maxdb_stmt_reset maxdb_stmt_result_metadata maxdb_stmt_send_long_data maxdb_stmt_sqlstate maxdb_stmt_store_result maxdb_store_result maxdb_thread_id maxdb_thread_safe maxdb_use_result maxdb_warning_count - - " MCAL functions - syn keyword phpCoreConstant contained MCAL_SUNDAY MCAL_MONDAY MCAL_TUESDAY MCAL_WEDNESDAY MCAL_THURSDAY MCAL_FRIDAY MCAL_SATURDAY MCAL_JANUARY MCAL_FEBRUARY MCAL_MARCH MCAL_APRIL MCAL_MAY MCAL_JUNE MCAL_JULY MCAL_AUGUST MCAL_SEPTEMBER MCAL_OCTOBER MCAL_NOVEMBER MCAL_DECEMBER MCAL_RECUR_NONE MCAL_RECUR_DAILY MCAL_RECUR_WEEKLY MCAL_RECUR_MONTHLY_MDAY MCAL_RECUR_MONTHLY_WDAY MCAL_RECUR_YEARLY MCAL_M_SUNDAY MCAL_M_MONDAY MCAL_M_TUESDAY MCAL_M_WEDNESDAY MCAL_M_THURSDAY MCAL_M_FRIDAY MCAL_M_SATURDAY MCAL_M_WEEKDAYS MCAL_M_WEEKEND MCAL_M_ALLDAYS - syn keyword phpFunctions contained mcal_append_event mcal_close mcal_create_calendar mcal_date_compare mcal_date_valid mcal_day_of_week mcal_day_of_year mcal_days_in_month mcal_delete_calendar mcal_delete_event mcal_event_add_attribute mcal_event_init mcal_event_set_alarm mcal_event_set_category mcal_event_set_class mcal_event_set_description mcal_event_set_end mcal_event_set_recur_daily mcal_event_set_recur_monthly_mday mcal_event_set_recur_monthly_wday mcal_event_set_recur_none mcal_event_set_recur_weekly mcal_event_set_recur_yearly mcal_event_set_start mcal_event_set_title mcal_expunge mcal_fetch_current_stream_event mcal_fetch_event mcal_is_leap_year mcal_list_alarms mcal_list_events mcal_next_recurrence mcal_open mcal_popen mcal_rename_calendar mcal_reopen mcal_snooze mcal_store_event mcal_time_valid mcal_week_of_year - - " Mcrypt Encryption functions - syn keyword phpCoreConstant contained MCRYPT_MODE_ECB MCRYPT_MODE_CBC MCRYPT_MODE_CFB MCRYPT_MODE_OFB MCRYPT_MODE_NOFB MCRYPT_MODE_STREAM MCRYPT_ENCRYPT MCRYPT_DECRYPT MCRYPT_DEV_RANDOM MCRYPT_DEV_URANDOM MCRYPT_RAND MCRYPT_3DES MCRYPT_ARCFOUR_IV MCRYPT_ARCFOUR MCRYPT_BLOWFISH MCRYPT_CAST_128 MCRYPT_CAST_256 MCRYPT_CRYPT MCRYPT_DES MCRYPT_DES_COMPAT MCRYPT_ENIGMA MCRYPT_GOST MCRYPT_IDEA MCRYPT_LOKI97 MCRYPT_MARS MCRYPT_PANAMA MCRYPT_RIJNDAEL_128 MCRYPT_RIJNDAEL_192 MCRYPT_RIJNDAEL_256 MCRYPT_RC2 MCRYPT_RC4 MCRYPT_RC6 MCRYPT_RC6_128 MCRYPT_RC6_192 MCRYPT_RC6_256 MCRYPT_SAFER64 MCRYPT_SAFER128 MCRYPT_SAFERPLUS MCRYPT_SERPENT(libmcrypt MCRYPT_SERPENT_128 MCRYPT_SERPENT_192 MCRYPT_SERPENT_256 MCRYPT_SKIPJACK MCRYPT_TEAN MCRYPT_THREEWAY MCRYPT_TRIPLEDES MCRYPT_TWOFISH MCRYPT_TWOFISH128 MCRYPT_TWOFISH192 MCRYPT_TWOFISH256 MCRYPT_WAKE MCRYPT_XTEA - syn keyword phpFunctions contained mcrypt_cbc mcrypt_cfb mcrypt_create_iv mcrypt_decrypt mcrypt_ecb mcrypt_enc_get_algorithms_name mcrypt_enc_get_block_size mcrypt_enc_get_iv_size mcrypt_enc_get_key_size mcrypt_enc_get_modes_name mcrypt_enc_get_supported_key_sizes mcrypt_enc_is_block_algorithm_mode mcrypt_enc_is_block_algorithm mcrypt_enc_is_block_mode mcrypt_enc_self_test mcrypt_encrypt mcrypt_generic_deinit mcrypt_generic_end mcrypt_generic_init mcrypt_generic mcrypt_get_block_size mcrypt_get_cipher_name mcrypt_get_iv_size mcrypt_get_key_size mcrypt_list_algorithms mcrypt_list_modes mcrypt_module_close mcrypt_module_get_algo_block_size mcrypt_module_get_algo_key_size mcrypt_module_get_supported_key_sizes mcrypt_module_is_block_algorithm_mode mcrypt_module_is_block_algorithm mcrypt_module_is_block_mode mcrypt_module_open mcrypt_module_self_test mcrypt_ofb mdecrypt_generic - - " MCVE (Monetra) Payment functions - syn keyword phpCoreConstant contained M_PENDING M_DONE M_ERROR M_FAIL M_SUCCESS - syn keyword phpFunctions contained m_checkstatus m_completeauthorizations m_connect m_connectionerror m_deletetrans m_destroyconn m_destroyengine m_getcell m_getcellbynum m_getcommadelimited m_getheader m_initconn m_initengine m_iscommadelimited m_maxconntimeout m_monitor m_numcolumns m_numrows m_parsecommadelimited m_responsekeys m_responseparam m_returnstatus m_setblocking m_setdropfile m_setip m_setssl_cafile m_setssl_files m_setssl m_settimeout m_sslcert_gen_hash m_transactionssent m_transinqueue m_transkeyval m_transnew m_transsend m_uwait m_validateidentifier m_verifyconnection m_verifysslcert - - " Memcache functions - syn keyword phpClasses contained Memcache - syn keyword phpCoreConstant contained MEMCACHE_COMPRESSED MEMCACHE_HAVE_SESSION - syn keyword phpFunctions contained memcache_add memcache_add_server memcache_close memcache_connect memcache_debug memcache_decrement memcache_delete memcache_flush memcache_get memcache_get_extended_stats memcache_get_server_status memcache_get_stats memcache_get_version memcache_increment memcache_pconnect memcache_replace memcache_set memcache_set_compress_threshold memcache_set_server_params - - " MHash functions - syn keyword phpCoreConstant contained MHASH_ADLER32 MHASH_CRC32 MHASH_CRC32B MHASH_GOST MHASH_HAVAL128 MHASH_HAVAL160 MHASH_HAVAL192 MHASH_HAVAL256 MHASH_MD4 MHASH_MD5 MHASH_RIPEMD160 MHASH_SHA1 MHASH_SHA256 MHASH_TIGER MHASH_TIGER128 MHASH_TIGER160 - syn keyword phpFunctions contained mhash_count mhash_get_block_size mhash_get_hash_name mhash_keygen_s2k mhash - - " Mimetype functions - " NOTE: has been deprecated in favour of the Fileinfo extension - " syn keyword phpFunctions contained mime_content_type - - " Ming functions for flash - " NOTE: this extension is experimental - " syn keyword phpCoreConstant contained MING_NEW MING_ZLIB SWFBUTTON_HIT SWFBUTTON_DOWN SWFBUTTON_OVER SWFBUTTON_UP SWFBUTTON_MOUSEUPOUTSIDE SWFBUTTON_DRAGOVER SWFBUTTON_DRAGOUT SWFBUTTON_MOUSEUP SWFBUTTON_MOUSEDOWN SWFBUTTON_MOUSEOUT SWFBUTTON_MOUSEOVER SWFFILL_RADIAL_GRADIENT SWFFILL_LINEAR_GRADIENT SWFFILL_TILED_BITMAP SWFFILL_CLIPPED_BITMAP SWFTEXTFIELD_HASLENGTH SWFTEXTFIELD_NOEDIT SWFTEXTFIELD_PASSWORD SWFTEXTFIELD_MULTILINE SWFTEXTFIELD_WORDWRAP SWFTEXTFIELD_DRAWBOX SWFTEXTFIELD_NOSELECT SWFTEXTFIELD_HTML SWFTEXTFIELD_ALIGN_LEFT SWFTEXTFIELD_ALIGN_RIGHT SWFTEXTFIELD_ALIGN_CENTER SWFTEXTFIELD_ALIGN_JUSTIFY SWFACTION_ONLOAD SWFACTION_ENTERFRAME SWFACTION_UNLOAD SWFACTION_MOUSEMOVE SWFACTION_MOUSEDOWN SWFACTION_MOUSEUP SWFACTION_KEYDOWN SWFACTION_KEYUP SWFACTION_DATA - " syn keyword phpClasses contained SWFAction SWFBitmap SWFButton SWFDisplayItem SWFFill SWFFont SWFFontChar SWFGradient SWFMorph SWFMovie SWFPrebuiltClip SWFShape SWFSound SWFSoundInstance SWFSprite SWFText SWFTextField SWFVideoStream - " syn keyword phpFunctions contained ming_keypress ming_setcubicthreshold ming_setscale ming_setswfcompression ming_useconstants ming_useswfversion - - " Miscellaneous functions - " NOTE: php_check_syntax was removed after PHP 5.0.4 - " NOTE: some of the functions like exit() and die() are defined elsewhere - syn keyword phpCoreConstant contained CONNECTION_ABORTED CONNECTION_NORMAL CONNECTION_TIMEOUT __COMPILER_HALT_OFFSET__ - syn keyword phpFunctions contained connection_aborted connection_status connection_timeout constant define defined get_browser highlight_file highlight_string ignore_user_abort pack php_strip_whitespace show_source sleep sys_getloadavg time_nanosleep time_sleep_until uniqid unpack usleep - - " mnoGoSearch functions - syn keyword phpCoreConstant contained UDM_FIELD_URLID UDM_FIELD_URL UDM_FIELD_CONTENT UDM_FIELD_TITLE UDM_FIELD_KEYWORDS UDM_FIELD_DESC UDM_FIELD_DESCRIPTION UDM_FIELD_TEXT UDM_FIELD_SIZE UDM_FIELD_RATING UDM_FIELD_SCORE UDM_FIELD_MODIFIED UDM_FIELD_ORDER UDM_FIELD_CRC UDM_FIELD_CATEGORY UDM_FIELD_LANG UDM_FIELD_CHARSET UDM_PARAM_PAGE_SIZE UDM_PARAM_PAGE_NUM UDM_PARAM_SEARCH_MODE UDM_PARAM_CACHE_MODE UDM_PARAM_TRACK_MODE UDM_PARAM_PHRASE_MODE UDM_PARAM_CHARSET UDM_PARAM_LOCAL_CHARSET UDM_PARAM_BROWSER_CHARSET UDM_PARAM_STOPTABLE UDM_PARAM_STOP_TABLE UDM_PARAM_STOPFILE UDM_PARAM_STOP_FILE UDM_PARAM_WEIGHT_FACTOR UDM_PARAM_WORD_MATCH UDM_PARAM_MAX_WORD_LEN UDM_PARAM_MAX_WORDLEN UDM_PARAM_MIN_WORD_LEN UDM_PARAM_MIN_WORDLEN UDM_PARAM_ISPELL_PREFIXES UDM_PARAM_ISPELL_PREFIX UDM_PARAM_PREFIXES UDM_PARAM_PREFIX UDM_PARAM_CROSS_WORDS UDM_PARAM_CROSSWORDS UDM_PARAM_VARDIR UDM_PARAM_DATADIR UDM_PARAM_HLBEG UDM_PARAM_HLEND UDM_PARAM_SYNONYM UDM_PARAM_SEARCHD UDM_PARAM_QSTRING UDM_PARAM_REMOTE_ADDR UDM_LIMIT_CAT UDM_LIMIT_URL UDM_LIMIT_TAG UDM_LIMIT_LANG UDM_LIMIT_DATE UDM_PARAM_FOUND UDM_PARAM_NUM_ROWS UDM_PARAM_WORDINFO UDM_PARAM_WORD_INFO UDM_PARAM_SEARCHTIME UDM_PARAM_SEARCH_TIME UDM_PARAM_FIRST_DOC UDM_PARAM_LAST_DOC UDM_MODE_ALL UDM_MODE_ANY UDM_MODE_BOOL UDM_MODE_PHRASE UDM_CACHE_ENABLED UDM_CACHE_DISABLED UDM_TRACK_ENABLED UDM_TRACK_DISABLED UDM_PHRASE_ENABLED UDM_PHRASE_DISABLED UDM_CROSS_WORDS_ENABLED UDM_CROSSWORDS_ENABLED UDM_CROSS_WORDS_DISABLED UDM_CROSSWORDS_DISABLED UDM_PREFIXES_ENABLED UDM_PREFIX_ENABLED UDM_ISPELL_PREFIXES_ENABLED UDM_ISPELL_PREFIX_ENABLED UDM_PREFIXES_DISABLED UDM_PREFIX_DISABLED UDM_ISPELL_PREFIXES_DISABLED UDM_ISPELL_PREFIX_DISABLED UDM_ISPELL_TYPE_AFFIX UDM_ISPELL_TYPE_SPELL UDM_ISPELL_TYPE_DB UDM_ISPELL_TYPE_SERVER UDM_MATCH_WORD UDM_MATCH_BEGIN UDM_MATCH_SUBSTR UDM_MATCH_END - syn keyword phpFunctions contained udm_add_search_limit udm_alloc_agent_array udm_alloc_agent udm_api_version udm_cat_list udm_cat_path udm_check_charset udm_check_stored udm_clear_search_limits udm_close_stored udm_crc32 udm_errno udm_error udm_find udm_free_agent udm_free_ispell_data udm_free_res udm_get_doc_count udm_get_res_field udm_get_res_param udm_hash32 udm_load_ispell_data udm_open_stored udm_set_agent_param - - " Microsoft SQL server functions - syn keyword phpCoreConstant contained MSSQL_ASSOC MSSQL_NUM MSSQL_BOTH SQLTEXT SQLVARCHAR SQLCHAR SQLINT1 SQLINT2 SQLINT4 SQLBIT SQLFLT8 - syn keyword phpFunctions contained mssql_bind mssql_close mssql_connect mssql_data_seek mssql_execute mssql_fetch_array mssql_fetch_assoc mssql_fetch_batch mssql_fetch_field mssql_fetch_object mssql_fetch_row mssql_field_length mssql_field_name mssql_field_seek mssql_field_type mssql_free_result mssql_free_statement mssql_get_last_message mssql_guid_string mssql_init mssql_min_error_severity mssql_min_message_severity mssql_next_result mssql_num_fields mssql_num_rows mssql_pconnect mssql_query mssql_result mssql_rows_affected mssql_select_db - - " Mohawk Software Session Handler Functions - syn keyword phpFunctions contained msession_connect msession_count msession_create msession_destroy msession_disconnect msession_find msession_get_array msession_get_data msession_get msession_inc msession_list msession_listvar msession_lock msession_plugin msession_randstr msession_set_array msession_set_data msession_set msession_timeout msession_uniq msession_unlock - - " mSQL functions - syn keyword phpCoreConstant contained MSQL_ASSOC MSQL_NUM MSQL_BOTH - syn keyword phpFunctions contained msql_affected_rows msql_close msql_connect msql_create_db msql_createdb msql_data_seek msql_db_query msql_dbname msql_drop_db msql_error msql_fetch_array msql_fetch_field msql_fetch_object msql_fetch_row msql_field_flags msql_field_len msql_field_name msql_field_seek msql_field_table msql_field_type msql_fieldflags msql_fieldlen msql_fieldname msql_fieldtable msql_fieldtype msql_free_result msql_list_dbs msql_list_fields msql_list_tables msql_num_fields msql_num_rows msql_numfields msql_numrows msql_pconnect msql_query msql_regcase msql_result msql_select_db msql_tablename msql - - " Multibyte string functions - syn keyword phpCoreConstant contained MB_OVERLOAD_MAIL MB_OVERLOAD_STRING MB_OVERLOAD_REGEX MB_CASE_UPPER MB_CASE_LOWER MB_CASE_TITLE - syn keyword phpFunctions contained mb_check_encoding mb_convert_case mb_convert_encoding mb_convert_kana mb_convert_variables mb_decode_mimeheader mb_decode_numericentity mb_detect_encoding mb_detect_order mb_encode_mimeheader mb_encode_numericentity mb_ereg_match mb_ereg_replace mb_ereg_search_getpos mb_ereg_search_getregs mb_ereg_search_init mb_ereg_search_pos mb_ereg_search_regs mb_ereg_search_setpos mb_ereg_search mb_ereg mb_eregi_replace mb_eregi mb_get_info mb_http_input mb_http_output mb_internal_encoding mb_language mb_output_handler mb_parse_str mb_preferred_mime_name mb_regex_encoding mb_regex_set_options mb_send_mail mb_split mb_strcut mb_strimwidth mb_stripos mb_stristr mb_strlen mb_strpos mb_strrchr mb_strrichr mb_strripos mb_strrpos mb_strstr mb_strtolower mb_strtoupper mb_strwidth mb_substitute_character mb_substr_count mb_substr - - " muscat functions - " NOTE: Experimental, doesn't seem to be necessary any more - - " MySQL functions - syn keyword phpCoreConstant contained MYSQL_CLIENT_COMPRESS MYSQL_CLIENT_IGNORE_SPACE MYSQL_CLIENT_INTERACTIVE MYSQL_CLIENT_SSL MYSQL_ASSOC MYSQL_BOTH MYSQL_NUM - syn keyword phpFunctions contained mysql_affected_rows mysql_change_user mysql_client_encoding mysql_close mysql_connect mysql_create_db mysql_data_seek mysql_db_name mysql_db_query mysql_drop_db mysql_errno mysql_error mysql_escape_string mysql_fetch_array mysql_fetch_assoc mysql_fetch_field mysql_fetch_lengths mysql_fetch_object mysql_fetch_row mysql_field_flags mysql_field_len mysql_field_name mysql_field_seek mysql_field_table mysql_field_type mysql_free_result mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql_insert_id mysql_list_dbs mysql_list_fields mysql_list_processes mysql_list_tables mysql_num_fields mysql_num_rows mysql_pconnect mysql_ping mysql_query mysql_real_escape_string mysql_result mysql_select_db mysql_set_charset mysql_stat mysql_tablename mysql_thread_id mysql_unbuffered_query - - " MySQL Improved extension - syn keyword phpClasses contained mysqli mysqli_stmt mysqli_result - syn keyword phpCoreConstant contained MYSQLI_READ_DEFAULT_GROUP MYSQLI_READ_DEFAULT_FILE MYSQLI_OPT_CONNECT_TIMEOUT MYSQLI_OPT_LOCAL_INFILE MYSQLI_INIT_COMMAND MYSQLI_CLIENT_SSL MYSQLI_CLIENT_COMPRESS MYSQLI_CLIENT_INTERACTIVE MYSQLI_CLIENT_IGNORE_SPACE MYSQLI_CLIENT_NO_SCHEMA MYSQLI_CLIENT_MULTI_QUERIES MYSQLI_STORE_RESULT MYSQLI_USE_RESULT MYSQLI_ASSOC MYSQLI_NUM MYSQLI_BOTH MYSQLI_NOT_NULL_FLAG MYSQLI_PRI_KEY_FLAG MYSQLI_UNIQUE_KEY_FLAG MYSQLI_MULTIPLE_KEY_FLAG MYSQLI_BLOB_FLAG MYSQLI_UNSIGNED_FLAG MYSQLI_ZEROFILL_FLAG MYSQLI_AUTO_INCREMENT_FLAG MYSQLI_TIMESTAMP_FLAG MYSQLI_SET_FLAG MYSQLI_NUM_FLAG MYSQLI_PART_KEY_FLAG MYSQLI_GROUP_FLAG MYSQLI_TYPE_DECIMAL MYSQLI_TYPE_NEWDECIMAL MYSQLI_TYPE_BIT MYSQLI_TYPE_TINY MYSQLI_TYPE_SHORT MYSQLI_TYPE_LONG MYSQLI_TYPE_FLOAT MYSQLI_TYPE_DOUBLE MYSQLI_TYPE_NULL MYSQLI_TYPE_TIMESTAMP MYSQLI_TYPE_LONGLONG MYSQLI_TYPE_INT24 MYSQLI_TYPE_DATE MYSQLI_TYPE_TIME MYSQLI_TYPE_DATETIME MYSQLI_TYPE_YEAR MYSQLI_TYPE_NEWDATE MYSQLI_TYPE_ENUM MYSQLI_TYPE_SET MYSQLI_TYPE_TINY_BLOB MYSQLI_TYPE_MEDIUM_BLOB MYSQLI_TYPE_LONG_BLOB MYSQLI_TYPE_BLOB MYSQLI_TYPE_VAR_STRING MYSQLI_TYPE_STRING MYSQLI_TYPE_GEOMETRY MYSQLI_NEED_DATA MYSQLI_NO_DATA MYSQLI_DATA_TRUNCATED - syn keyword phpFunctions contained mysqli_affected_rows mysqli_autocommit mysqli_bind_param mysqli_bind_result mysqli_change_user mysqli_character_set_name mysqli_client_encoding mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_disable_reads_from_master mysqli_disable_rpl_parse mysqli_dump_debug_info mysqli_embedded_server_end mysqli_embedded_server_start mysqli_enable_reads_from_master mysqli_enable_rpl_parse mysqli_errno mysqli_error mysqli_escape_string mysqli_execute mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_fetch mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_version mysqli_get_host_info mysqli_get_metadata mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_get_warnings - syn keyword phpFunctions contained mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_master_query mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_param_count mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_report mysqli_rollback mysqli_rpl_parse_enabled mysqli_rpl_probe mysqli_rpl_query_type mysqli_select_db mysqli_send_long_data mysqli_send_query mysqli_server_end mysqli_server_init mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_set_opt mysqli_slave_query mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_affected_rows mysqli_stmt_attr_get mysqli_stmt_attr_set mysqli_stmt_bind_param mysqli_stmt_bind_result mysqli_stmt_close mysqli_stmt_data_seek mysqli_stmt_errno mysqli_stmt_error mysqli_stmt_execute mysqli_stmt_fetch mysqli_stmt_field_count mysqli_stmt_free_result mysqli_stmt_get_warnings - syn keyword phpFunctions contained mysqli_stmt_init mysqli_stmt_insert_id mysqli_stmt_num_rows mysqli_stmt_param_count mysqli_stmt_prepare mysqli_stmt_reset mysqli_stmt_result_metadata mysqli_stmt_send_long_data mysqli_stmt_sqlstate mysqli_stmt_store_result mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count - - " ncurses extension - " NOTE: this extension is experimental - syn keyword phpCoreConstant contained NCURSES_ERR NCURSES_COLOR_BLACK NCURSES_COLOR_WHITE NCURSES_COLOR_RED NCURSES_COLOR_GREEN NCURSES_COLOR_YELLOW NCURSES_COLOR_BLUE NCURSES_COLOR_CYAN NCURSES_COLOR_MAGENTA - " Keyboard - syn match phpCoreConstant contained /\/ - syn keyword phpCoreConstant contained NCURSES_KEY_DOWN NCURSES_KEY_UP NCURSES_KEY_LEFT NCURSES_KEY_RIGHT NCURSES_KEY_HOME NCURSES_KEY_BACKSPACE NCURSES_KEY_DL NCURSES_KEY_IL NCURSES_KEY_DC NCURSES_KEY_IC NCURSES_KEY_EIC NCURSES_KEY_CLEAR NCURSES_KEY_EOS NCURSES_KEY_EOL NCURSES_KEY_SF NCURSES_KEY_SR NCURSES_KEY_NPAGE NCURSES_KEY_PPAGE NCURSES_KEY_STAB NCURSES_KEY_CTAB NCURSES_KEY_CATAB NCURSES_KEY_SRESET NCURSES_KEY_RESET NCURSES_KEY_PRINT NCURSES_KEY_LL NCURSES_KEY_A1 NCURSES_KEY_A3 NCURSES_KEY_B2 NCURSES_KEY_C1 NCURSES_KEY_C3 NCURSES_KEY_BTAB NCURSES_KEY_BEG NCURSES_KEY_CANCEL NCURSES_KEY_CLOSE NCURSES_KEY_COMMAND NCURSES_KEY_COPY NCURSES_KEY_CREATE NCURSES_KEY_END NCURSES_KEY_EXIT NCURSES_KEY_FIND NCURSES_KEY_HELP NCURSES_KEY_MARK NCURSES_KEY_MESSAGE NCURSES_KEY_MOVE NCURSES_KEY_NEXT NCURSES_KEY_OPEN NCURSES_KEY_OPTIONS NCURSES_KEY_PREVIOUS NCURSES_KEY_REDO NCURSES_KEY_REFERENCE NCURSES_KEY_REFRESH NCURSES_KEY_REPLACE NCURSES_KEY_RESTART NCURSES_KEY_RESUME - syn keyword phpCoreConstant contained NCURSES_KEY_SAVE NCURSES_KEY_SBEG NCURSES_KEY_SCANCEL NCURSES_KEY_SCOMMAND NCURSES_KEY_SCOPY NCURSES_KEY_SCREATE NCURSES_KEY_SDC NCURSES_KEY_SDL NCURSES_KEY_SELECT NCURSES_KEY_SEND NCURSES_KEY_SEOL NCURSES_KEY_SEXIT NCURSES_KEY_SFIND NCURSES_KEY_SHELP NCURSES_KEY_SHOME NCURSES_KEY_SIC NCURSES_KEY_SLEFT NCURSES_KEY_SMESSAGE NCURSES_KEY_SMOVE NCURSES_KEY_SNEXT NCURSES_KEY_SOPTIONS NCURSES_KEY_SPREVIOUS NCURSES_KEY_SPRINT NCURSES_KEY_SREDO NCURSES_KEY_SREPLACE NCURSES_KEY_SRIGHT NCURSES_KEY_SRSUME NCURSES_KEY_SSAVE NCURSES_KEY_SSUSPEND NCURSES_KEY_UNDO NCURSES_KEY_MOUSE NCURSES_KEY_MAX - " Mouse - syn keyword phpCoreConstant contained NCURSES_BUTTON1_RELEASED NCURSES_BUTTON2_RELEASED NCURSES_BUTTON3_RELEASED NCURSES_BUTTON4_RELEASED NCURSES_BUTTON1_PRESSED NCURSES_BUTTON2_PRESSED NCURSES_BUTTON3_PRESSED NCURSES_BUTTON4_PRESSED NCURSES_BUTTON1_CLICKED NCURSES_BUTTON2_CLICKED NCURSES_BUTTON3_CLICKED NCURSES_BUTTON4_CLICKED NCURSES_BUTTON1_DOUBLE_CLICKED NCURSES_BUTTON2_DOUBLE_CLICKED NCURSES_BUTTON3_DOUBLE_CLICKED NCURSES_BUTTON4_DOUBLE_CLICKED NCURSES_BUTTON1_TRIPLE_CLICKED NCURSES_BUTTON2_TRIPLE_CLICKED NCURSES_BUTTON3_TRIPLE_CLICKED NCURSES_BUTTON4_TRIPLE_CLICKED NCURSES_BUTTON_CTRL NCURSES_BUTTON_SHIFT NCURSES_BUTTON_ALT NCURSES_ALL_MOUSE_EVENTS NCURSES_REPORT_MOUSE_POSITION - " Functions - syn keyword phpFunctions contained ncurses_addch ncurses_addchnstr ncurses_addchstr ncurses_addnstr ncurses_addstr ncurses_assume_default_colors ncurses_attroff ncurses_attron ncurses_attrset ncurses_baudrate ncurses_beep ncurses_bkgd ncurses_bkgdset ncurses_border ncurses_bottom_panel ncurses_can_change_color ncurses_cbreak ncurses_clear ncurses_clrtobot ncurses_clrtoeol ncurses_color_content ncurses_color_set ncurses_curs_set ncurses_def_prog_mode ncurses_def_shell_mode ncurses_define_key ncurses_del_panel ncurses_delay_output ncurses_delch ncurses_deleteln ncurses_delwin ncurses_doupdate ncurses_echo ncurses_echochar ncurses_end ncurses_erase ncurses_erasechar ncurses_filter ncurses_flash ncurses_flushinp ncurses_getch ncurses_getmaxyx ncurses_getmouse ncurses_getyx ncurses_halfdelay ncurses_has_colors ncurses_has_ic ncurses_has_il ncurses_has_key ncurses_hide_panel ncurses_hline ncurses_inch ncurses_init_color ncurses_init_pair - syn keyword phpFunctions contained ncurses_init ncurses_insch ncurses_insdelln ncurses_insertln ncurses_insstr ncurses_instr ncurses_isendwin ncurses_keyok ncurses_keypad ncurses_killchar ncurses_longname ncurses_meta ncurses_mouse_trafo ncurses_mouseinterval ncurses_mousemask ncurses_move_panel ncurses_move ncurses_mvaddch ncurses_mvaddchnstr ncurses_mvaddchstr ncurses_mvaddnstr ncurses_mvaddstr ncurses_mvcur ncurses_mvdelch ncurses_mvgetch ncurses_mvhline ncurses_mvinch ncurses_mvvline ncurses_mvwaddstr ncurses_napms ncurses_new_panel ncurses_newpad ncurses_newwin ncurses_nl ncurses_nocbreak ncurses_noecho ncurses_nonl ncurses_noqiflush ncurses_noraw ncurses_pair_content ncurses_panel_above ncurses_panel_below ncurses_panel_window ncurses_pnoutrefresh ncurses_prefresh ncurses_putp ncurses_qiflush ncurses_raw ncurses_refresh ncurses_replace_panel ncurses_reset_prog_mode ncurses_reset_shell_mode ncurses_resetty ncurses_savetty - syn keyword phpFunctions contained ncurses_scr_dump ncurses_scr_init ncurses_scr_restore ncurses_scr_set ncurses_scrl ncurses_show_panel ncurses_slk_attr ncurses_slk_attroff ncurses_slk_attron ncurses_slk_attrset ncurses_slk_clear ncurses_slk_color ncurses_slk_init ncurses_slk_noutrefresh ncurses_slk_refresh ncurses_slk_restore ncurses_slk_set ncurses_slk_touch ncurses_standend ncurses_standout ncurses_start_color ncurses_termattrs ncurses_termname ncurses_timeout ncurses_top_panel ncurses_typeahead ncurses_ungetch ncurses_ungetmouse ncurses_update_panels ncurses_use_default_colors ncurses_use_env ncurses_use_extended_names ncurses_vidattr ncurses_vline ncurses_waddch ncurses_waddstr ncurses_wattroff ncurses_wattron ncurses_wattrset ncurses_wborder ncurses_wclear ncurses_wcolor_set ncurses_werase ncurses_wgetch ncurses_whline ncurses_wmouse_trafo ncurses_wmove ncurses_wnoutrefresh ncurses_wrefresh ncurses_wstandend ncurses_wstandout ncurses_wvline - - " network functions - syn keyword phpCoreConstant contained LOG_CONS LOG_NDELAY LOG_ODELAY LOG_NOWAIT LOG_PERROR LOG_PID LOG_AUTH LOG_AUTHPRIV LOG_CRON LOG_DAEMON LOG_KERN LOG_LOCAL0 LOG_LPR LOG_MAIL LOG_NEWS LOG_SYSLOG LOG_USER LOG_UUCP LOG_EMERG LOG_ALERT LOG_CRIT LOG_ERR LOG_WARNING LOG_NOTICE LOG_INFO LOG_DEBUG DNS_A DNS_MX DNS_CNAME DNS_NS DNS_PTR DNS_HINFO DNS_SOA DNS_TXT DNS_ANY DNS_AAAA DNS_ALL - syn keyword phpFunctions contained checkdnsrr closelog debugger_off debugger_on define_syslog_variables dns_check_record dns_get_mx dns_get_record fsockopen gethostbyaddr gethostbyname gethostbynamel getmxrr getprotobyname getprotobynumber getservbyname getservbyport header headers_list headers_sent inet_ntop inet_pton ip2long long2ip openlog pfsockopen setcookie setrawcookie socket_get_status socket_set_blocking socket_set_timeout syslog - - " newt functions - syn keyword phpCoreConstant contained NEWT_EXIT_HOTKEY NEWT_EXIT_COMPONENT NEWT_EXIT_FDREADY NEWT_EXIT_TIMER NEWT_COLORSET_ROOT NEWT_COLORSET_BORDER NEWT_COLORSET_WINDOW NEWT_COLORSET_SHADOW NEWT_COLORSET_TITLE NEWT_COLORSET_BUTTON NEWT_COLORSET_ACTBUTTON NEWT_COLORSET_CHECKBOX NEWT_COLORSET_ACTCHECKBOX NEWT_COLORSET_ENTRY NEWT_COLORSET_LABEL NEWT_COLORSET_LISTBOX NEWT_COLORSET_ACTLISTBOX NEWT_COLORSET_TEXTBOX NEWT_COLORSET_ACTTEXTBOX NEWT_COLORSET_HELPLINE NEWT_COLORSET_ROOTTEXT NEWT_COLORSET_ROOTTEXT NEWT_COLORSET_EMPTYSCALE NEWT_COLORSET_FULLSCALE NEWT_COLORSET_DISENTRY NEWT_COLORSET_COMPACTBUTTON NEWT_COLORSET_ACTSELLISTBOX NEWT_COLORSET_SELLISTBOX NEWT_FLAGS_SET NEWT_FLAGS_RESET NEWT_FLAGS_TOGGLE NEWT_FLAG_RETURNEXIT NEWT_FLAG_HIDDEN NEWT_FLAG_SCROLL NEWT_FLAG_DISABLED NEWT_FLAG_BORDER NEWT_FLAG_WRAP NEWT_FLAG_NOF12 NEWT_FLAG_MULTIPLE NEWT_FLAG_SELECTED NEWT_FLAG_CHECKBOX NEWT_FLAG_PASSWORD NEWT_FLAG_SHOWCURSOR NEWT_FD_READ NEWT_FD_WRITE NEWT_FD_EXCEPT NEWT_CHECKBOXTREE_UNSELECTABLE - syn keyword phpCoreConstant contained NEWT_CHECKBOXTREE_HIDE_BOX NEWT_CHECKBOXTREE_COLLAPSED NEWT_CHECKBOXTREE_EXPANDED NEWT_CHECKBOXTREE_UNSELECTED NEWT_CHECKBOXTREE_SELECTED NEWT_ENTRY_SCROLL NEWT_ENTRY_HIDDEN NEWT_ENTRY_RETURNEXIT NEWT_ENTRY_DISABLED NEWT_LISTBOX_RETURNEXIT NEWT_TEXTBOX_WRAP NEWT_TEXTBOX_SCROLL NEWT_FORM_NOF12 NEWT_KEY_TAB NEWT_KEY_ENTER NEWT_KEY_SUSPEND NEWT_KEY_ESCAPE NEWT_KEY_RETURN NEWT_KEY_EXTRA_BASE NEWT_KEY_UP NEWT_KEY_DOWN NEWT_KEY_LEFT NEWT_KEY_RIGHT NEWT_KEY_BKSPC NEWT_KEY_DELETE NEWT_KEY_HOME NEWT_KEY_END NEWT_KEY_UNTAB NEWT_KEY_PGUP NEWT_KEY_PGDN NEWT_KEY_INSERT NEWT_KEY_F1 NEWT_KEY_F2 NEWT_KEY_F3 NEWT_KEY_F4 NEWT_KEY_F5 NEWT_KEY_F6 NEWT_KEY_F7 NEWT_KEY_F8 NEWT_KEY_F9 NEWT_KEY_F10 NEWT_KEY_F11 NEWT_KEY_F12 NEWT_KEY_RESIZE NEWT_ANCHOR_LEFT NEWT_ANCHOR_RIGHT NEWT_ANCHOR_TOP NEWT_ANCHOR_BOTTOM NEWT_GRID_FLAG_GROWX NEWT_GRID_FLAG_GROWY NEWT_GRID_EMPTY NEWT_GRID_COMPONENT NEWT_GRID_SUBGRID - syn keyword phpFunctions contained newt_bell newt_button_bar newt_button newt_centered_window newt_checkbox_get_value newt_checkbox_set_flags newt_checkbox_set_value newt_checkbox_tree_add_item newt_checkbox_tree_find_item newt_checkbox_tree_get_current newt_checkbox_tree_get_entry_value newt_checkbox_tree_get_multi_selection newt_checkbox_tree_get_selection newt_checkbox_tree_multi newt_checkbox_tree_set_current newt_checkbox_tree_set_entry_value newt_checkbox_tree_set_entry newt_checkbox_tree_set_width newt_checkbox_tree newt_checkbox newt_clear_key_buffer newt_cls newt_compact_button newt_component_add_callback newt_component_takes_focus newt_create_grid newt_cursor_off newt_cursor_on newt_delay newt_draw_form newt_draw_root_text newt_entry_get_value newt_entry_set_filter newt_entry_set_flags newt_entry_set newt_entry newt_finished newt_form_add_component newt_form_add_components newt_form_add_hot_key newt_form_destroy newt_form_get_current newt_form_run - syn keyword phpFunctions contained newt_form_set_background newt_form_set_height newt_form_set_size newt_form_set_timer newt_form_set_width newt_form_watch_fd newt_form newt_get_screen_size newt_grid_add_components_to_form newt_grid_basic_window newt_grid_free newt_grid_get_size newt_grid_h_close_stacked newt_grid_h_stacked newt_grid_place newt_grid_set_field newt_grid_simple_window newt_grid_v_close_stacked newt_grid_v_stacked newt_grid_wrapped_window_at newt_grid_wrapped_window newt_init newt_label_set_text newt_label newt_listbox_append_entry newt_listbox_clear_selection newt_listbox_clear newt_listbox_delete_entry newt_listbox_get_current newt_listbox_get_selection newt_listbox_insert_entry newt_listbox_item_count newt_listbox_select_item newt_listbox_set_current_by_key newt_listbox_set_current newt_listbox_set_data newt_listbox_set_entry newt_listbox_set_width newt_listbox newt_listitem_get_data newt_listitem_set newt_listitem newt_open_window - syn keyword phpFunctions contained newt_pop_help_line newt_pop_window newt_push_help_line newt_radio_get_current newt_radiobutton newt_redraw_help_line newt_reflow_text newt_refresh newt_resize_screen newt_resume newt_run_form newt_scale_set newt_scale newt_scrollbar_set newt_set_help_callback newt_set_suspend_callback newt_suspend newt_textbox_get_num_lines newt_textbox_reflowed newt_textbox_set_height newt_textbox_set_text newt_textbox newt_vertical_scrollbar newt_wait_for_key newt_win_choice newt_win_entries newt_win_menu newt_win_message newt_win_messagev newt_win_ternary - - " NSAPI functions - syn keyword phpFunctions contained nsapi_request_headers nsapi_response_headers nsapi_virtual - " NOTE: these functions are also implemented by the apache module - syn keyword phpCoreConstant contained apache_request_headers apache_response_headers getallheaders virtual - - " object aggregation functions - " NOTE: this extension is experimental - syn keyword phpFunctions contained aggregate_info aggregate_methods_by_list aggregate_methods_by_regexp aggregate_methods aggregate_properties_by_list aggregate_properties_by_regexp aggregate_properties aggregate aggregation_info deaggregate - - " object overloading functions - " NOTE: experimental and no longer needed in PHP 5 - " syn keyword phpFunctions contained overload - - - - - - " TODO: review function list from here: - syn keyword phpFunctions array_change_key_case array_chunk array_combine array_count_values array_diff_assoc array_diff_uassoc array_diff array_fill array_filter array_flip array_intersect_assoc array_intersect array_key_exists array_keys array_map array_merge_recursive array_merge array_multisort array_pad array_pop array_push array_rand array_reduce array_reverse array_search array_shift array_slice array_splice array_sum array_udiff_assoc array_udiff_uassoc array_udiff array_unique array_unshift array_values array_walk arsort asort compact count current each end extract in_array key krsort ksort natcasesort natsort next pos prev range reset rsort shuffle sizeof sort uasort uksort usort contained - syn keyword phpFunctions bcadd bccomp bcdiv bcmod bcmul bcpow bcpowmod bcscale bcsqrt bcsub contained - syn keyword phpFunctions bzclose bzcompress bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite contained - syn keyword phpFunctions cal_days_in_month cal_from_jd cal_info cal_to_jd easter_date easter_days frenchtojd gregoriantojd jddayofweek jdmonthname jdtofrench jdtogregorian jdtojewish jdtojulian jdtounix jewishtojd juliantojd unixtojd contained - syn keyword phpFunctions call_user_method_array call_user_method class_exists get_class_methods get_class_vars get_class get_declared_classes get_object_vars get_parent_class is_a is_subclass_of method_exists property_exists contained - syn keyword phpFunctions com VARIANT com_addref com_get com_invoke com_isenum com_load_typelib com_load com_propget com_propput com_propset com_release com_set contained - syn keyword phpFunctions cpdf_add_annotation cpdf_add_outline cpdf_arc cpdf_begin_text cpdf_circle cpdf_clip cpdf_close cpdf_closepath_fill_stroke cpdf_closepath_stroke cpdf_closepath cpdf_continue_text cpdf_curveto cpdf_end_text cpdf_fill_stroke cpdf_fill cpdf_finalize_page cpdf_finalize cpdf_global_set_document_limits cpdf_import_jpeg cpdf_lineto cpdf_moveto cpdf_newpath cpdf_open cpdf_output_buffer cpdf_page_init cpdf_place_inline_image cpdf_rect cpdf_restore cpdf_rlineto cpdf_rmoveto cpdf_rotate_text cpdf_rotate cpdf_save_to_file cpdf_save cpdf_scale cpdf_set_action_url cpdf_set_char_spacing cpdf_set_creator cpdf_set_current_page cpdf_set_font_directories cpdf_set_font_map_file cpdf_set_font cpdf_set_horiz_scaling cpdf_set_keywords cpdf_set_leading cpdf_set_page_animation cpdf_set_subject cpdf_set_text_matrix cpdf_set_text_pos cpdf_set_text_rendering cpdf_set_text_rise cpdf_set_title cpdf_set_viewer_preferences cpdf_set_word_spacing cpdf_setdash cpdf_setflat cpdf_setgray_fill cpdf_setgray_stroke cpdf_setgray cpdf_setlinecap cpdf_setlinejoin cpdf_setlinewidth cpdf_setmiterlimit cpdf_setrgbcolor_fill cpdf_setrgbcolor_stroke cpdf_setrgbcolor cpdf_show_xy cpdf_show cpdf_stringwidth cpdf_stroke cpdf_text cpdf_translate contained - syn keyword phpFunctions crack_check crack_closedict crack_getlastmessage crack_opendict contained - syn keyword phpFunctions ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_graph ctype_lower ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit contained - syn keyword phpFunctions curl_close curl_errno curl_error curl_exec curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_setopt curl_version contained - syn keyword phpFunctions cybercash_base64_decode cybercash_base64_encode cybercash_decr cybercash_encr contained - syn keyword phpFunctions cyrus_authenticate cyrus_bind cyrus_close cyrus_connect cyrus_query cyrus_unbind contained - syn keyword phpFunctions checkdate date getdate gettimeofday gmdate gmmktime gmstrftime localtime microtime mktime strftime strtotime time contained - syn keyword phpFunctions dba_close dba_delete dba_exists dba_fetch dba_firstkey dba_handlers dba_insert dba_key_split dba_list dba_nextkey dba_open dba_optimize dba_popen dba_replace dba_sync contained - syn keyword phpFunctions dbase_add_record dbase_close dbase_create dbase_delete_record dbase_get_header_info dbase_get_record_with_names dbase_get_record dbase_numfields dbase_numrecords dbase_open dbase_pack dbase_replace_record contained - syn keyword phpFunctions dblist dbmclose dbmdelete dbmexists dbmfetch dbmfirstkey dbminsert dbmnextkey dbmopen dbmreplace contained - syn keyword phpFunctions dbplus_add dbplus_aql dbplus_chdir dbplus_close dbplus_curr dbplus_errcode dbplus_errno dbplus_find dbplus_first dbplus_flush dbplus_freealllocks dbplus_freelock dbplus_freerlocks dbplus_getlock dbplus_getunique dbplus_info dbplus_last dbplus_lockrel dbplus_next dbplus_open dbplus_prev dbplus_rchperm dbplus_rcreate dbplus_rcrtexact dbplus_rcrtlike dbplus_resolve dbplus_restorepos dbplus_rkeys dbplus_ropen dbplus_rquery dbplus_rrename dbplus_rsecindex dbplus_runlink dbplus_rzap dbplus_savepos dbplus_setindex dbplus_setindexbynumber dbplus_sql dbplus_tcl dbplus_tremove dbplus_undo dbplus_undoprepare dbplus_unlockrel dbplus_unselect dbplus_update dbplus_xlockrel dbplus_xunlockrel contained - syn keyword phpFunctions dbx_close dbx_compare dbx_connect dbx_error dbx_escape_string dbx_fetch_row dbx_query dbx_sort contained - syn keyword phpFunctions dio_close dio_fcntl dio_open dio_read dio_seek dio_stat dio_tcsetattr dio_truncate dio_write contained - syn keyword phpFunctions chdir chroot dir closedir getcwd opendir readdir rewinddir scandir contained - syn keyword phpFunctions domxml_new_doc domxml_open_file domxml_open_mem domxml_version domxml_xmltree domxml_xslt_stylesheet_doc domxml_xslt_stylesheet_file domxml_xslt_stylesheet xpath_eval_expression xpath_eval xpath_new_context xptr_eval xptr_new_context contained - syn keyword phpMethods name specified value create_attribute create_cdata_section create_comment create_element_ns create_element create_entity_reference create_processing_instruction create_text_node doctype document_element dump_file dump_mem get_element_by_id get_elements_by_tagname html_dump_mem xinclude entities internal_subset name notations public_id system_id get_attribute_node get_attribute get_elements_by_tagname has_attribute remove_attribute set_attribute tagname add_namespace append_child append_sibling attributes child_nodes clone_node dump_node first_child get_content has_attributes has_child_nodes insert_before is_blank_node last_child next_sibling node_name node_type node_value owner_document parent_node prefix previous_sibling remove_child replace_child replace_node set_content set_name set_namespace unlink_node data target process result_dump_file result_dump_mem contained - syn keyword phpFunctions dotnet_load contained - syn keyword phpFunctions debug_backtrace debug_print_backtrace error_log error_reporting restore_error_handler set_error_handler trigger_error user_error contained - syn keyword phpFunctions escapeshellarg escapeshellcmd exec passthru proc_close proc_get_status proc_nice proc_open proc_terminate shell_exec system contained - syn keyword phpFunctions fam_cancel_monitor fam_close fam_monitor_collection fam_monitor_directory fam_monitor_file fam_next_event fam_open fam_pending fam_resume_monitor fam_suspend_monitor contained - syn keyword phpFunctions fbsql_affected_rows fbsql_autocommit fbsql_change_user fbsql_close fbsql_commit fbsql_connect fbsql_create_blob fbsql_create_clob fbsql_create_db fbsql_data_seek fbsql_database_password fbsql_database fbsql_db_query fbsql_db_status fbsql_drop_db fbsql_errno fbsql_error fbsql_fetch_array fbsql_fetch_assoc fbsql_fetch_field fbsql_fetch_lengths fbsql_fetch_object fbsql_fetch_row fbsql_field_flags fbsql_field_len fbsql_field_name fbsql_field_seek fbsql_field_table fbsql_field_type fbsql_free_result fbsql_get_autostart_info fbsql_hostname fbsql_insert_id fbsql_list_dbs fbsql_list_fields fbsql_list_tables fbsql_next_result fbsql_num_fields fbsql_num_rows fbsql_password fbsql_pconnect fbsql_query fbsql_read_blob fbsql_read_clob fbsql_result fbsql_rollback fbsql_select_db fbsql_set_lob_mode fbsql_set_transaction fbsql_start_db fbsql_stop_db fbsql_tablename fbsql_username fbsql_warnings contained - syn keyword phpFunctions fdf_add_doc_javascript fdf_add_template fdf_close fdf_create fdf_enum_values fdf_errno fdf_error fdf_get_ap fdf_get_attachment fdf_get_encoding fdf_get_file fdf_get_flags fdf_get_opt fdf_get_status fdf_get_value fdf_get_version fdf_header fdf_next_field_name fdf_open_string fdf_open fdf_remove_item fdf_save_string fdf_save fdf_set_ap fdf_set_encoding fdf_set_file fdf_set_flags fdf_set_javascript_action fdf_set_opt fdf_set_status fdf_set_submit_form_action fdf_set_target_frame fdf_set_value fdf_set_version contained - syn keyword phpFunctions filepro_fieldcount filepro_fieldname filepro_fieldtype filepro_fieldwidth filepro_retrieve filepro_rowcount filepro contained - syn keyword phpFunctions basename chgrp chmod chown clearstatcache copy delete dirname disk_free_space disk_total_space diskfreespace fclose feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents file fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype flock fnmatch fopen fpassthru fputs fread fscanf fseek fstat ftell ftruncate fwrite glob is_dir is_executable is_file is_link is_readable is_uploaded_file is_writable is_writeable link linkinfo lstat mkdir move_uploaded_file parse_ini_file pathinfo pclose popen readfile readlink realpath rename rewind rmdir set_file_buffer stat symlink tempnam tmpfile touch umask unlink contained - syn keyword phpFunctions fribidi_log2vis contained - syn keyword phpFunctions ftp_alloc ftp_cdup ftp_chdir ftp_chmod ftp_close ftp_connect ftp_delete ftp_exec ftp_fget ftp_fput ftp_get_option ftp_get ftp_login ftp_mdtm ftp_mkdir ftp_nb_continue ftp_nb_fget ftp_nb_fput ftp_nb_get ftp_nb_put ftp_nlist ftp_pasv ftp_put ftp_pwd ftp_quit ftp_raw ftp_rawlist ftp_rename ftp_rmdir ftp_set_option ftp_site ftp_size ftp_ssl_connect ftp_systype contained - syn keyword phpFunctions call_user_func_array call_user_func create_function func_get_arg func_get_args func_num_args function_exists get_defined_functions register_shutdown_function register_tick_function unregister_tick_function contained - syn keyword phpFunctions bind_textdomain_codeset bindtextdomain dcgettext dcngettext dgettext dngettext gettext ngettext textdomain contained - syn keyword phpFunctions gmp_abs gmp_add gmp_and gmp_clrbit gmp_cmp gmp_com gmp_div_q gmp_div_qr gmp_div_r gmp_div gmp_divexact gmp_fact gmp_gcd gmp_gcdext gmp_hamdist gmp_init gmp_intval gmp_invert gmp_jacobi gmp_legendre gmp_mod gmp_mul gmp_neg gmp_or gmp_perfect_square gmp_popcount gmp_pow gmp_powm gmp_prob_prime gmp_random gmp_scan0 gmp_scan1 gmp_setbit gmp_sign gmp_sqrt gmp_sqrtrem gmp_sqrtrm gmp_strval gmp_sub gmp_xor contained - syn keyword phpFunctions header headers_list headers_sent setcookie contained - syn keyword phpFunctions hw_api_attribute hwapi_hgcsp hw_api_content hw_api_object contained - syn keyword phpMethods key langdepvalue value values checkin checkout children mimetype read content copy dbstat dcstat dstanchors dstofsrcanchors count reason find ftstat hwstat identify info insert insertanchor insertcollection insertdocument link lock move assign attreditable count insert remove title value object objectbyanchor parents description type remove replace setcommitedversion srcanchors srcsofdst unlock user userlist contained - syn keyword phpFunctions hw_Array2Objrec hw_changeobject hw_Children hw_ChildrenObj hw_Close hw_Connect hw_connection_info hw_cp hw_Deleteobject hw_DocByAnchor hw_DocByAnchorObj hw_Document_Attributes hw_Document_BodyTag hw_Document_Content hw_Document_SetContent hw_Document_Size hw_dummy hw_EditText hw_Error hw_ErrorMsg hw_Free_Document hw_GetAnchors hw_GetAnchorsObj hw_GetAndLock hw_GetChildColl hw_GetChildCollObj hw_GetChildDocColl hw_GetChildDocCollObj hw_GetObject hw_GetObjectByQuery hw_GetObjectByQueryColl hw_GetObjectByQueryCollObj hw_GetObjectByQueryObj hw_GetParents hw_GetParentsObj hw_getrellink hw_GetRemote hw_getremotechildren hw_GetSrcByDestObj hw_GetText hw_getusername hw_Identify hw_InCollections hw_Info hw_InsColl hw_InsDoc hw_insertanchors hw_InsertDocument hw_InsertObject hw_mapid hw_Modifyobject hw_mv hw_New_Document hw_objrec2array hw_Output_Document hw_pConnect hw_PipeDocument hw_Root hw_setlinkroot hw_stat hw_Unlock hw_Who contained - syn keyword phpFunctions ibase_add_user ibase_affected_rows ibase_blob_add ibase_blob_cancel ibase_blob_close ibase_blob_create ibase_blob_echo ibase_blob_get ibase_blob_import ibase_blob_info ibase_blob_open ibase_close ibase_commit_ret ibase_commit ibase_connect ibase_delete_user ibase_drop_db ibase_errcode ibase_errmsg ibase_execute ibase_fetch_assoc ibase_fetch_object ibase_fetch_row ibase_field_info ibase_free_event_handler ibase_free_query ibase_free_result ibase_gen_id ibase_modify_user ibase_name_result ibase_num_fields ibase_num_params ibase_param_info ibase_pconnect ibase_prepare ibase_query ibase_rollback_ret ibase_rollback ibase_set_event_handler ibase_timefmt ibase_trans ibase_wait_event contained - syn keyword phpFunctions iconv_get_encoding iconv_mime_decode_headers iconv_mime_decode iconv_mime_encode iconv_set_encoding iconv_strlen iconv_strpos iconv_strrpos iconv_substr iconv ob_iconv_handler contained - syn keyword phpFunctions ifx_affected_rows ifx_blobinfile_mode ifx_byteasvarchar ifx_close ifx_connect ifx_copy_blob ifx_create_blob ifx_create_char ifx_do ifx_error ifx_errormsg ifx_fetch_row ifx_fieldproperties ifx_fieldtypes ifx_free_blob ifx_free_char ifx_free_result ifx_get_blob ifx_get_char ifx_getsqlca ifx_htmltbl_result ifx_nullformat ifx_num_fields ifx_num_rows ifx_pconnect ifx_prepare ifx_query ifx_textasvarchar ifx_update_blob ifx_update_char ifxus_close_slob ifxus_create_slob ifxus_free_slob ifxus_open_slob ifxus_read_slob ifxus_seek_slob ifxus_tell_slob ifxus_write_slob contained - syn keyword phpFunctions exif_imagetype exif_read_data exif_thumbnail gd_info getimagesize image_type_to_mime_type image2wbmp imagealphablending imageantialias imagearc imagechar imagecharup imagecolorallocate imagecolorallocatealpha imagecolorat imagecolorclosest imagecolorclosestalpha imagecolorclosesthwb imagecolordeallocate imagecolorexact imagecolorexactalpha imagecolormatch imagecolorresolve imagecolorresolvealpha imagecolorset imagecolorsforindex imagecolorstotal imagecolortransparent imagecopy imagecopymerge imagecopymergegray imagecopyresampled imagecopyresized imagecreate imagecreatefromgd2 imagecreatefromgd2part imagecreatefromgd imagecreatefromgif imagecreatefromjpeg imagecreatefrompng imagecreatefromstring imagecreatefromwbmp imagecreatefromxbm imagecreatefromxpm imagecreatetruecolor imagedashedline imagedestroy imageellipse imagefill imagefilledarc imagefilledellipse imagefilledpolygon imagefilledrectangle imagefilltoborder imagefontheight imagefontwidth imageftbbox imagefttext imagegammacorrect imagegd2 imagegd imagegif imageinterlace imageistruecolor imagejpeg imageline imageloadfont imagepalettecopy imagepng imagepolygon imagepsbbox imagepscopyfont imagepsencodefont imagepsextendfont imagepsfreefont imagepsloadfont imagepsslantfont imagepstext imagerectangle imagerotate imagesavealpha imagesetbrush imagesetpixel imagesetstyle imagesetthickness imagesettile imagestring imagestringup imagesx imagesy imagetruecolortopalette imagettfbbox imagettftext imagetypes imagewbmp iptcembed iptcparse jpeg2wbmp png2wbmp read_exif_data contained - syn keyword phpFunctions imap_8bit imap_alerts imap_append imap_base64 imap_binary imap_body imap_bodystruct imap_check imap_clearflag_full imap_close imap_createmailbox imap_delete imap_deletemailbox imap_errors imap_expunge imap_fetch_overview imap_fetchbody imap_fetchheader imap_fetchstructure imap_get_quota imap_get_quotaroot imap_getacl imap_getmailboxes imap_getsubscribed imap_header imap_headerinfo imap_headers imap_last_error imap_list imap_listmailbox imap_listscan imap_listsubscribed imap_lsub imap_mail_compose imap_mail_copy imap_mail_move imap_mail imap_mailboxmsginfo imap_mime_header_decode imap_msgno imap_num_msg imap_num_recent imap_open imap_ping imap_qprint imap_renamemailbox imap_reopen imap_rfc822_parse_adrlist imap_rfc822_parse_headers imap_rfc822_write_address imap_scanmailbox imap_search imap_set_quota imap_setacl imap_setflag_full imap_sort imap_status imap_subscribe imap_thread imap_timeout imap_uid imap_undelete imap_unsubscribe imap_utf7_decode imap_utf7_encode imap_utf8 contained - syn keyword phpFunctions assert_options assert dl extension_loaded get_cfg_var get_current_user get_defined_constants get_extension_funcs get_include_path get_included_files get_loaded_extensions get_magic_quotes_gpc get_magic_quotes_runtime get_required_files getenv getlastmod getmygid getmyinode getmypid getmyuid getopt getrusage ini_alter ini_get_all ini_get ini_restore ini_set main memory_get_usage php_ini_scanned_files php_logo_guid php_sapi_name php_uname phpcredits phpinfo phpversion putenv restore_include_path set_include_path set_magic_quotes_runtime set_time_limit version_compare zend_logo_guid zend_version contained - syn keyword phpFunctions ingres_autocommit ingres_close ingres_commit ingres_connect ingres_fetch_array ingres_fetch_object ingres_fetch_row ingres_field_length ingres_field_name ingres_field_nullable ingres_field_precision ingres_field_scale ingres_field_type ingres_num_fields ingres_num_rows ingres_pconnect ingres_query ingres_rollback contained - syn keyword phpFunctions ircg_channel_mode ircg_disconnect ircg_fetch_error_msg ircg_get_username ircg_html_encode ircg_ignore_add ircg_ignore_del ircg_is_conn_alive ircg_join ircg_kick ircg_lookup_format_messages ircg_msg ircg_nick ircg_nickname_escape ircg_nickname_unescape ircg_notice ircg_part ircg_pconnect ircg_register_format_messages ircg_set_current ircg_set_file ircg_set_on_die ircg_topic ircg_whois contained - syn keyword phpFunctions java_last_exception_clear java_last_exception_get contained - syn keyword phpFunctions ldap_8859_to_t61 ldap_add ldap_bind ldap_close ldap_compare ldap_connect ldap_count_entries ldap_delete ldap_dn2ufn ldap_err2str ldap_errno ldap_error ldap_explode_dn ldap_first_attribute ldap_first_entry ldap_first_reference ldap_free_result ldap_get_attributes ldap_get_dn ldap_get_entries ldap_get_option ldap_get_values_len ldap_get_values ldap_list ldap_mod_add ldap_mod_del ldap_mod_replace ldap_modify ldap_next_attribute ldap_next_entry ldap_next_reference ldap_parse_reference ldap_parse_result ldap_read ldap_rename ldap_search ldap_set_option ldap_set_rebind_proc ldap_sort ldap_start_tls ldap_t61_to_8859 ldap_unbind contained - syn keyword phpFunctions lzf_compress lzf_decompress lzf_optimized_for contained - syn keyword phpFunctions ezmlm_hash mail contained - syn keyword phpFunctions mailparse_determine_best_xfer_encoding mailparse_msg_create mailparse_msg_extract_part_file mailparse_msg_extract_part mailparse_msg_free mailparse_msg_get_part_data mailparse_msg_get_part mailparse_msg_get_structure mailparse_msg_parse_file mailparse_msg_parse mailparse_rfc822_parse_addresses mailparse_stream_encode mailparse_uudecode_all contained - syn keyword phpFunctions abs acos acosh asin asinh atan2 atan atanh base_convert bindec ceil cos cosh decbin dechex decoct deg2rad exp expm1 floor fmod getrandmax hexdec hypot is_finite is_infinite is_nan lcg_value log10 log1p log max min mt_getrandmax mt_rand mt_srand octdec pi pow rad2deg rand round sin sinh sqrt srand tan tanh contained - syn keyword phpFunctions mb_convert_case mb_convert_encoding mb_convert_kana mb_convert_variables mb_decode_mimeheader mb_decode_numericentity mb_detect_encoding mb_detect_order mb_encode_mimeheader mb_encode_numericentity mb_ereg_match mb_ereg_replace mb_ereg_search_getpos mb_ereg_search_getregs mb_ereg_search_init mb_ereg_search_pos mb_ereg_search_regs mb_ereg_search_setpos mb_ereg_search mb_ereg mb_eregi_replace mb_eregi mb_get_info mb_http_input mb_http_output mb_internal_encoding mb_language mb_output_handler mb_parse_str mb_preferred_mime_name mb_regex_encoding mb_regex_set_options mb_send_mail mb_split mb_strcut mb_strimwidth mb_strlen mb_strpos mb_strrpos mb_strtolower mb_strtoupper mb_strwidth mb_substitute_character mb_substr_count mb_substr contained - syn keyword phpFunctions mcal_append_event mcal_close mcal_create_calendar mcal_date_compare mcal_date_valid mcal_day_of_week mcal_day_of_year mcal_days_in_month mcal_delete_calendar mcal_delete_event mcal_event_add_attribute mcal_event_init mcal_event_set_alarm mcal_event_set_category mcal_event_set_class mcal_event_set_description mcal_event_set_end mcal_event_set_recur_daily mcal_event_set_recur_monthly_mday mcal_event_set_recur_monthly_wday mcal_event_set_recur_none mcal_event_set_recur_weekly mcal_event_set_recur_yearly mcal_event_set_start mcal_event_set_title mcal_expunge mcal_fetch_current_stream_event mcal_fetch_event mcal_is_leap_year mcal_list_alarms mcal_list_events mcal_next_recurrence mcal_open mcal_popen mcal_rename_calendar mcal_reopen mcal_snooze mcal_store_event mcal_time_valid mcal_week_of_year contained - syn keyword phpFunctions mcrypt_cbc mcrypt_cfb mcrypt_create_iv mcrypt_decrypt mcrypt_ecb mcrypt_enc_get_algorithms_name mcrypt_enc_get_block_size mcrypt_enc_get_iv_size mcrypt_enc_get_key_size mcrypt_enc_get_modes_name mcrypt_enc_get_supported_key_sizes mcrypt_enc_is_block_algorithm_mode mcrypt_enc_is_block_algorithm mcrypt_enc_is_block_mode mcrypt_enc_self_test mcrypt_encrypt mcrypt_generic_deinit mcrypt_generic_end mcrypt_generic_init mcrypt_generic mcrypt_get_block_size mcrypt_get_cipher_name mcrypt_get_iv_size mcrypt_get_key_size mcrypt_list_algorithms mcrypt_list_modes mcrypt_module_close mcrypt_module_get_algo_block_size mcrypt_module_get_algo_key_size mcrypt_module_get_supported_key_sizes mcrypt_module_is_block_algorithm_mode mcrypt_module_is_block_algorithm mcrypt_module_is_block_mode mcrypt_module_open mcrypt_module_self_test mcrypt_ofb mdecrypt_generic contained - syn keyword phpFunctions mcve_adduser mcve_adduserarg mcve_bt mcve_checkstatus mcve_chkpwd mcve_chngpwd mcve_completeauthorizations mcve_connect mcve_connectionerror mcve_deleteresponse mcve_deletetrans mcve_deleteusersetup mcve_deluser mcve_destroyconn mcve_destroyengine mcve_disableuser mcve_edituser mcve_enableuser mcve_force mcve_getcell mcve_getcellbynum mcve_getcommadelimited mcve_getheader mcve_getuserarg mcve_getuserparam mcve_gft mcve_gl mcve_gut mcve_initconn mcve_initengine mcve_initusersetup mcve_iscommadelimited mcve_liststats mcve_listusers mcve_maxconntimeout mcve_monitor mcve_numcolumns mcve_numrows mcve_override mcve_parsecommadelimited mcve_ping mcve_preauth mcve_preauthcompletion mcve_qc mcve_responseparam mcve_return mcve_returncode mcve_returnstatus mcve_sale mcve_setblocking mcve_setdropfile mcve_setip mcve_setssl_files mcve_setssl mcve_settimeout mcve_settle mcve_text_avs mcve_text_code mcve_text_cv mcve_transactionauth mcve_transactionavs mcve_transactionbatch mcve_transactioncv mcve_transactionid mcve_transactionitem mcve_transactionssent mcve_transactiontext mcve_transinqueue mcve_transnew mcve_transparam mcve_transsend mcve_ub mcve_uwait mcve_verifyconnection mcve_verifysslcert mcve_void contained - syn keyword phpFunctions mhash_count mhash_get_block_size mhash_get_hash_name mhash_keygen_s2k mhash contained - syn keyword phpFunctions mime_content_type contained - syn keyword phpFunctions ming_setcubicthreshold ming_setscale ming_useswfversion SWFAction SWFBitmap swfbutton_keypress SWFbutton SWFDisplayItem SWFFill SWFFont SWFGradient SWFMorph SWFMovie SWFShape SWFSprite SWFText SWFTextField contained - syn keyword phpMethods getHeight getWidth addAction addShape setAction setdown setHit setOver setUp addColor move moveTo multColor remove Rotate rotateTo scale scaleTo setDepth setName setRatio skewX skewXTo skewY skewYTo moveTo rotateTo scaleTo skewXTo skewYTo getwidth addEntry getshape1 getshape2 add nextframe output remove save setbackground setdimension setframes setrate streammp3 addFill drawCurve drawCurveTo drawLine drawLineTo movePen movePenTo setLeftFill setLine setRightFill add nextframe remove setframes addString getWidth moveTo setColor setFont setHeight setSpacing addstring align setbounds setcolor setFont setHeight setindentation setLeftMargin setLineSpacing setMargins setname setrightMargin contained - syn keyword phpFunctions connection_aborted connection_status connection_timeout constant define defined eval get_browser highlight_file highlight_string ignore_user_abort pack show_source sleep uniqid unpack usleep contained - syn keyword phpFunctions udm_add_search_limit udm_alloc_agent udm_api_version udm_cat_list udm_cat_path udm_check_charset udm_check_stored udm_clear_search_limits udm_close_stored udm_crc32 udm_errno udm_error udm_find udm_free_agent udm_free_ispell_data udm_free_res udm_get_doc_count udm_get_res_field udm_get_res_param udm_load_ispell_data udm_open_stored udm_set_agent_param contained - syn keyword phpFunctions msession_connect msession_count msession_create msession_destroy msession_disconnect msession_find msession_get_array msession_get msession_getdata msession_inc msession_list msession_listvar msession_lock msession_plugin msession_randstr msession_set_array msession_set msession_setdata msession_timeout msession_uniq msession_unlock contained - syn keyword phpFunctions msql_affected_rows msql_close msql_connect msql_create_db msql_createdb msql_data_seek msql_dbname msql_drop_db msql_dropdb msql_error msql_fetch_array msql_fetch_field msql_fetch_object msql_fetch_row msql_field_seek msql_fieldflags msql_fieldlen msql_fieldname msql_fieldtable msql_fieldtype msql_free_result msql_freeresult msql_list_dbs msql_list_fields msql_list_tables msql_listdbs msql_listfields msql_listtables msql_num_fields msql_num_rows msql_numfields msql_numrows msql_pconnect msql_query msql_regcase msql_result msql_select_db msql_selectdb msql_tablename msql contained - syn keyword phpFunctions mssql_bind mssql_close mssql_connect mssql_data_seek mssql_execute mssql_fetch_array mssql_fetch_assoc mssql_fetch_batch mssql_fetch_field mssql_fetch_object mssql_fetch_row mssql_field_length mssql_field_name mssql_field_seek mssql_field_type mssql_free_result mssql_free_statement mssql_get_last_message mssql_guid_string mssql_init mssql_min_error_severity mssql_min_message_severity mssql_next_result mssql_num_fields mssql_num_rows mssql_pconnect mssql_query mssql_result mssql_rows_affected mssql_select_db contained - syn keyword phpFunctions muscat_close muscat_get muscat_give muscat_setup_net muscat_setup contained - syn keyword phpFunctions mysql_affected_rows mysql_change_user mysql_client_encoding mysql_close mysql_connect mysql_create_db mysql_data_seek mysql_db_name mysql_db_query mysql_drop_db mysql_errno mysql_error mysql_escape_string mysql_fetch_array mysql_fetch_assoc mysql_fetch_field mysql_fetch_lengths mysql_fetch_object mysql_fetch_row mysql_field_flags mysql_field_len mysql_field_name mysql_field_seek mysql_field_table mysql_field_type mysql_free_result mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql_insert_id mysql_list_dbs mysql_list_fields mysql_list_processes mysql_list_tables mysql_num_fields mysql_num_rows mysql_pconnect mysql_ping mysql_query mysql_real_escape_string mysql_result mysql_select_db mysql_stat mysql_tablename mysql_thread_id mysql_unbuffered_query contained - syn keyword phpFunctions mysqli_affected_rows mysqli_autocommit mysqli_bind_param mysqli_bind_result mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect mysqli_data_seek mysqli_debug mysqli_disable_reads_from_master mysqli_disable_rpl_parse mysqli_dump_debug_info mysqli_enable_reads_from_master mysqli_enable_rpl_parse mysqli_errno mysqli_error mysqli_execute mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_fetch mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_client_info mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_master_query mysqli_num_fields mysqli_num_rows mysqli_options mysqli_param_count mysqli_ping mysqli_prepare_result mysqli_prepare mysqli_profiler mysqli_query mysqli_read_query_result mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reload mysqli_rollback mysqli_rpl_parse_enabled mysqli_rpl_probe mysqli_rpl_query_type mysqli_select_db mysqli_send_long_data mysqli_send_query mysqli_slave_query mysqli_ssl_set mysqli_stat mysqli_stmt_affected_rows mysqli_stmt_close mysqli_stmt_errno mysqli_stmt_error mysqli_stmt_store_result mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count contained - syn keyword phpFunctions ncurses_addch ncurses_addchnstr ncurses_addchstr ncurses_addnstr ncurses_addstr ncurses_assume_default_colors ncurses_attroff ncurses_attron ncurses_attrset ncurses_baudrate ncurses_beep ncurses_bkgd ncurses_bkgdset ncurses_border ncurses_bottom_panel ncurses_can_change_color ncurses_cbreak ncurses_clear ncurses_clrtobot ncurses_clrtoeol ncurses_color_content ncurses_color_set ncurses_curs_set ncurses_def_prog_mode ncurses_def_shell_mode ncurses_define_key ncurses_del_panel ncurses_delay_output ncurses_delch ncurses_deleteln ncurses_delwin ncurses_doupdate ncurses_echo ncurses_echochar ncurses_end ncurses_erase ncurses_erasechar ncurses_filter ncurses_flash ncurses_flushinp ncurses_getch ncurses_getmaxyx ncurses_getmouse ncurses_getyx ncurses_halfdelay ncurses_has_colors ncurses_has_ic ncurses_has_il ncurses_has_key ncurses_hide_panel ncurses_hline ncurses_inch ncurses_init_color ncurses_init_pair ncurses_init ncurses_insch ncurses_insdelln ncurses_insertln ncurses_insstr ncurses_instr ncurses_isendwin ncurses_keyok ncurses_keypad ncurses_killchar ncurses_longname ncurses_meta ncurses_mouse_trafo ncurses_mouseinterval ncurses_mousemask ncurses_move_panel ncurses_move ncurses_mvaddch ncurses_mvaddchnstr ncurses_mvaddchstr ncurses_mvaddnstr ncurses_mvaddstr ncurses_mvcur ncurses_mvdelch ncurses_mvgetch ncurses_mvhline ncurses_mvinch ncurses_mvvline ncurses_mvwaddstr ncurses_napms ncurses_new_panel ncurses_newpad ncurses_newwin ncurses_nl ncurses_nocbreak ncurses_noecho ncurses_nonl ncurses_noqiflush ncurses_noraw ncurses_pair_content ncurses_panel_above ncurses_panel_below ncurses_panel_window ncurses_pnoutrefresh ncurses_prefresh ncurses_putp ncurses_qiflush ncurses_raw ncurses_refresh ncurses_replace_panel ncurses_reset_prog_mode ncurses_reset_shell_mode ncurses_resetty ncurses_savetty ncurses_scr_dump ncurses_scr_init ncurses_scr_restore ncurses_scr_set ncurses_scrl ncurses_show_panel ncurses_slk_attr ncurses_slk_attroff ncurses_slk_attron ncurses_slk_attrset ncurses_slk_clear ncurses_slk_color ncurses_slk_init ncurses_slk_noutrefresh ncurses_slk_refresh ncurses_slk_restore ncurses_slk_set ncurses_slk_touch ncurses_standend ncurses_standout ncurses_start_color ncurses_termattrs ncurses_termname ncurses_timeout ncurses_top_panel ncurses_typeahead ncurses_ungetch ncurses_ungetmouse ncurses_update_panels ncurses_use_default_colors ncurses_use_env ncurses_use_extended_names ncurses_vidattr ncurses_vline ncurses_waddch ncurses_waddstr ncurses_wattroff ncurses_wattron ncurses_wattrset ncurses_wborder ncurses_wclear ncurses_wcolor_set ncurses_werase ncurses_wgetch ncurses_whline ncurses_wmouse_trafo ncurses_wmove ncurses_wnoutrefresh ncurses_wrefresh ncurses_wstandend ncurses_wstandout ncurses_wvline contained - syn keyword phpFunctions checkdnsrr closelog debugger_off debugger_on define_syslog_variables dns_check_record dns_get_mx dns_get_record fsockopen gethostbyaddr gethostbyname gethostbynamel getmxrr getprotobyname getprotobynumber getservbyname getservbyport ip2long long2ip openlog pfsockopen socket_get_status socket_set_blocking socket_set_timeout syslog contained - syn keyword phpFunctions yp_all yp_cat yp_err_string yp_errno yp_first yp_get_default_domain yp_master yp_match yp_next yp_order contained - syn keyword phpFunctions notes_body notes_copy_db notes_create_db notes_create_note notes_drop_db notes_find_note notes_header_info notes_list_msgs notes_mark_read notes_mark_unread notes_nav_create notes_search notes_unread notes_version contained - syn keyword phpFunctions nsapi_request_headers nsapi_response_headers nsapi_virtual contained - syn keyword phpFunctions aggregate_info aggregate_methods_by_list aggregate_methods_by_regexp aggregate_methods aggregate_properties_by_list aggregate_properties_by_regexp aggregate_properties aggregate aggregation_info deaggregate contained - syn keyword phpFunctions ocibindbyname ocicancel ocicloselob ocicollappend ocicollassign ocicollassignelem ocicollgetelem ocicollmax ocicollsize ocicolltrim ocicolumnisnull ocicolumnname ocicolumnprecision ocicolumnscale ocicolumnsize ocicolumntype ocicolumntyperaw ocicommit ocidefinebyname ocierror ociexecute ocifetch ocifetchinto ocifetchstatement ocifreecollection ocifreecursor ocifreedesc ocifreestatement ociinternaldebug ociloadlob ocilogoff ocilogon ocinewcollection ocinewcursor ocinewdescriptor ocinlogon ocinumcols ociparse ociplogon ociresult ocirollback ocirowcount ocisavelob ocisavelobfile ociserverversion ocisetprefetch ocistatementtype ociwritelobtofile ociwritetemporarylob contained - syn keyword phpFunctions odbc_autocommit odbc_binmode odbc_close_all odbc_close odbc_columnprivileges odbc_columns odbc_commit odbc_connect odbc_cursor odbc_data_source odbc_do odbc_error odbc_errormsg odbc_exec odbc_execute odbc_fetch_array odbc_fetch_into odbc_fetch_object odbc_fetch_row odbc_field_len odbc_field_name odbc_field_num odbc_field_precision odbc_field_scale odbc_field_type odbc_foreignkeys odbc_free_result odbc_gettypeinfo odbc_longreadlen odbc_next_result odbc_num_fields odbc_num_rows odbc_pconnect odbc_prepare odbc_primarykeys odbc_procedurecolumns odbc_procedures odbc_result_all odbc_result odbc_rollback odbc_setoption odbc_specialcolumns odbc_statistics odbc_tableprivileges odbc_tables contained - syn keyword phpFunctions openssl_csr_export_to_file openssl_csr_export openssl_csr_new openssl_csr_sign openssl_error_string openssl_free_key openssl_get_privatekey openssl_get_publickey openssl_open openssl_pkcs7_decrypt openssl_pkcs7_encrypt openssl_pkcs7_sign openssl_pkcs7_verify openssl_pkey_export_to_file openssl_pkey_export openssl_pkey_get_private openssl_pkey_get_public openssl_pkey_new openssl_private_decrypt openssl_private_encrypt openssl_public_decrypt openssl_public_encrypt openssl_seal openssl_sign openssl_verify openssl_x509_check_private_key openssl_x509_checkpurpose openssl_x509_export_to_file openssl_x509_export openssl_x509_free openssl_x509_parse openssl_x509_read contained - syn keyword phpFunctions ora_bind ora_close ora_columnname ora_columnsize ora_columntype ora_commit ora_commitoff ora_commiton ora_do ora_error ora_errorcode ora_exec ora_fetch_into ora_fetch ora_getcolumn ora_logoff ora_logon ora_numcols ora_numrows ora_open ora_parse ora_plogon ora_rollback contained - syn keyword phpFunctions flush ob_clean ob_end_clean ob_end_flush ob_flush ob_get_clean ob_get_contents ob_get_flush ob_get_length ob_get_level ob_get_status ob_gzhandler ob_implicit_flush ob_list_handlers ob_start output_add_rewrite_var output_reset_rewrite_vars contained - syn keyword phpFunctions overload contained - syn keyword phpFunctions ovrimos_close ovrimos_commit ovrimos_connect ovrimos_cursor ovrimos_exec ovrimos_execute ovrimos_fetch_into ovrimos_fetch_row ovrimos_field_len ovrimos_field_name ovrimos_field_num ovrimos_field_type ovrimos_free_result ovrimos_longreadlen ovrimos_num_fields ovrimos_num_rows ovrimos_prepare ovrimos_result_all ovrimos_result ovrimos_rollback contained - syn keyword phpFunctions pcntl_exec pcntl_fork pcntl_signal pcntl_waitpid pcntl_wexitstatus pcntl_wifexited pcntl_wifsignaled pcntl_wifstopped pcntl_wstopsig pcntl_wtermsig contained - syn keyword phpFunctions preg_grep preg_match_all preg_match preg_quote preg_replace_callback preg_replace preg_split contained - syn keyword phpFunctions pdf_add_annotation pdf_add_bookmark pdf_add_launchlink pdf_add_locallink pdf_add_note pdf_add_outline pdf_add_pdflink pdf_add_thumbnail pdf_add_weblink pdf_arc pdf_arcn pdf_attach_file pdf_begin_page pdf_begin_pattern pdf_begin_template pdf_circle pdf_clip pdf_close_image pdf_close_pdi_page pdf_close_pdi pdf_close pdf_closepath_fill_stroke pdf_closepath_stroke pdf_closepath pdf_concat pdf_continue_text pdf_curveto pdf_delete pdf_end_page pdf_end_pattern pdf_end_template pdf_endpath pdf_fill_stroke pdf_fill pdf_findfont pdf_get_buffer pdf_get_font pdf_get_fontname pdf_get_fontsize pdf_get_image_height pdf_get_image_width pdf_get_majorversion pdf_get_minorversion pdf_get_parameter pdf_get_pdi_parameter pdf_get_pdi_value pdf_get_value pdf_initgraphics pdf_lineto pdf_makespotcolor pdf_moveto pdf_new pdf_open_CCITT pdf_open_file pdf_open_gif pdf_open_image_file pdf_open_image pdf_open_jpeg pdf_open_memory_image pdf_open_pdi_page pdf_open_pdi pdf_open_png pdf_open_tiff pdf_open pdf_place_image pdf_place_pdi_page pdf_rect pdf_restore pdf_rotate pdf_save pdf_scale pdf_set_border_color pdf_set_border_dash pdf_set_border_style pdf_set_char_spacing pdf_set_duration pdf_set_font pdf_set_horiz_scaling pdf_set_info_author pdf_set_info_creator pdf_set_info_keywords pdf_set_info_subject pdf_set_info_title pdf_set_info pdf_set_leading pdf_set_parameter pdf_set_text_matrix pdf_set_text_pos pdf_set_text_rendering pdf_set_text_rise pdf_set_value pdf_set_word_spacing pdf_setcolor pdf_setdash pdf_setflat pdf_setfont pdf_setgray_fill pdf_setgray_stroke pdf_setgray pdf_setlinecap pdf_setlinejoin pdf_setlinewidth pdf_setmatrix pdf_setmiterlimit pdf_setpolydash pdf_setrgbcolor_fill pdf_setrgbcolor_stroke pdf_setrgbcolor pdf_show_boxed pdf_show_xy pdf_show pdf_skew pdf_stringwidth pdf_stroke pdf_translate contained - syn keyword phpFunctions pfpro_cleanup pfpro_init pfpro_process_raw pfpro_process pfpro_version contained - syn keyword phpFunctions pg_affected_rows pg_cancel_query pg_client_encoding pg_close pg_connect pg_connection_busy pg_connection_reset pg_connection_status pg_convert pg_copy_from pg_copy_to pg_dbname pg_delete pg_end_copy pg_escape_bytea pg_escape_string pg_fetch_all pg_fetch_array pg_fetch_assoc pg_fetch_object pg_fetch_result pg_fetch_row pg_field_is_null pg_field_name pg_field_num pg_field_prtlen pg_field_size pg_field_type pg_free_result pg_get_notify pg_get_pid pg_get_result pg_host pg_insert pg_last_error pg_last_notice pg_last_oid pg_lo_close pg_lo_create pg_lo_export pg_lo_import pg_lo_open pg_lo_read_all pg_lo_read pg_lo_seek pg_lo_tell pg_lo_unlink pg_lo_write pg_meta_data pg_num_fields pg_num_rows pg_options pg_pconnect pg_ping pg_port pg_put_line pg_query pg_result_error pg_result_seek pg_result_status pg_select pg_send_query pg_set_client_encoding pg_trace pg_tty pg_unescape_bytea pg_untrace pg_update contained - syn keyword phpFunctions posix_ctermid posix_get_last_error posix_getcwd posix_getegid posix_geteuid posix_getgid posix_getgrgid posix_getgrnam posix_getgroups posix_getlogin posix_getpgid posix_getpgrp posix_getpid posix_getppid posix_getpwnam posix_getpwuid posix_getrlimit posix_getsid posix_getuid posix_isatty posix_kill posix_mkfifo posix_setegid posix_seteuid posix_setgid posix_setpgid posix_setsid posix_setuid posix_strerror posix_times posix_ttyname posix_uname contained - syn keyword phpFunctions printer_abort printer_close printer_create_brush printer_create_dc printer_create_font printer_create_pen printer_delete_brush printer_delete_dc printer_delete_font printer_delete_pen printer_draw_bmp printer_draw_chord printer_draw_elipse printer_draw_line printer_draw_pie printer_draw_rectangle printer_draw_roundrect printer_draw_text printer_end_doc printer_end_page printer_get_option printer_list printer_logical_fontheight printer_open printer_select_brush printer_select_font printer_select_pen printer_set_option printer_start_doc printer_start_page printer_write contained - syn keyword phpFunctions pspell_add_to_personal pspell_add_to_session pspell_check pspell_clear_session pspell_config_create pspell_config_ignore pspell_config_mode pspell_config_personal pspell_config_repl pspell_config_runtogether pspell_config_save_repl pspell_new_config pspell_new_personal pspell_new pspell_save_wordlist pspell_store_replacement pspell_suggest contained - syn keyword phpFunctions qdom_error qdom_tree contained - syn keyword phpFunctions readline_add_history readline_clear_history readline_completion_function readline_info readline_list_history readline_read_history readline_write_history readline contained - syn keyword phpFunctions recode_file recode_string recode contained - syn keyword phpFunctions ereg_replace ereg eregi_replace eregi split spliti sql_regcase contained - syn keyword phpFunctions ftok msg_get_queue msg_receive msg_remove_queue msg_send msg_set_queue msg_stat_queue sem_acquire sem_get sem_release sem_remove shm_attach shm_detach shm_get_var shm_put_var shm_remove_var shm_remove contained - syn keyword phpFunctions sesam_affected_rows sesam_commit sesam_connect sesam_diagnostic sesam_disconnect sesam_errormsg sesam_execimm sesam_fetch_array sesam_fetch_result sesam_fetch_row sesam_field_array sesam_field_name sesam_free_result sesam_num_fields sesam_query sesam_rollback sesam_seek_row sesam_settransaction contained - syn keyword phpFunctions session_cache_expire session_cache_limiter session_decode session_destroy session_encode session_get_cookie_params session_id session_is_registered session_module_name session_name session_regenerate_id session_register session_save_path session_set_cookie_params session_set_save_handler session_start session_unregister session_unset session_write_close contained - syn keyword phpFunctions shmop_close shmop_delete shmop_open shmop_read shmop_size shmop_write contained - syn keyword phpFunctions snmp_get_quick_print snmp_set_quick_print snmpget snmprealwalk snmpset snmpwalk snmpwalkoid contained - syn keyword phpFunctions socket_accept socket_bind socket_clear_error socket_close socket_connect socket_create_listen socket_create_pair socket_create socket_get_option socket_getpeername socket_getsockname socket_iovec_add socket_iovec_alloc socket_iovec_delete socket_iovec_fetch socket_iovec_free socket_iovec_set socket_last_error socket_listen socket_read socket_readv socket_recv socket_recvfrom socket_recvmsg socket_select socket_send socket_sendmsg socket_sendto socket_set_block socket_set_nonblock socket_set_option socket_shutdown socket_strerror socket_write socket_writev contained - syn keyword phpFunctions sqlite_array_query sqlite_busy_timeout sqlite_changes sqlite_close sqlite_column sqlite_create_aggregate sqlite_create_function sqlite_current sqlite_error_string sqlite_escape_string sqlite_fetch_array sqlite_fetch_single sqlite_fetch_string sqlite_field_name sqlite_has_more sqlite_last_error sqlite_last_insert_rowid sqlite_libencoding sqlite_libversion sqlite_next sqlite_num_fields sqlite_num_rows sqlite_open sqlite_popen sqlite_query sqlite_rewind sqlite_seek sqlite_udf_decode_binary sqlite_udf_encode_binary sqlite_unbuffered_query contained - syn keyword phpFunctions stream_context_create stream_context_get_options stream_context_set_option stream_context_set_params stream_copy_to_stream stream_filter_append stream_filter_prepend stream_filter_register stream_get_contents stream_get_filters stream_get_line stream_get_meta_data stream_get_transports stream_get_wrappers stream_register_wrapper stream_select stream_set_blocking stream_set_timeout stream_set_write_buffer stream_socket_accept stream_socket_client stream_socket_get_name stream_socket_recvfrom stream_socket_sendto stream_socket_server stream_wrapper_register contained - syn keyword phpFunctions addcslashes addslashes bin2hex chop chr chunk_split convert_cyr_string count_chars crc32 crypt explode fprintf get_html_translation_table hebrev hebrevc html_entity_decode htmlentities htmlspecialchars implode join levenshtein localeconv ltrim md5_file md5 metaphone money_format nl_langinfo nl2br number_format ord parse_str print printf quoted_printable_decode quotemeta rtrim setlocale sha1_file sha1 similar_text soundex sprintf sscanf str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split str_word_count strcasecmp strchr strcmp strcoll strcspn strip_tags stripcslashes stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpos strrchr strrev strripos strrpos strspn strstr strtok strtolower strtoupper strtr substr_compare substr_count substr_replace substr trim ucfirst ucwords vprintf vsprintf wordwrap contained - syn keyword phpFunctions swf_actiongeturl swf_actiongotoframe swf_actiongotolabel swf_actionnextframe swf_actionplay swf_actionprevframe swf_actionsettarget swf_actionstop swf_actiontogglequality swf_actionwaitforframe swf_addbuttonrecord swf_addcolor swf_closefile swf_definebitmap swf_definefont swf_defineline swf_definepoly swf_definerect swf_definetext swf_endbutton swf_enddoaction swf_endshape swf_endsymbol swf_fontsize swf_fontslant swf_fonttracking swf_getbitmapinfo swf_getfontinfo swf_getframe swf_labelframe swf_lookat swf_modifyobject swf_mulcolor swf_nextid swf_oncondition swf_openfile swf_ortho2 swf_ortho swf_perspective swf_placeobject swf_polarview swf_popmatrix swf_posround swf_pushmatrix swf_removeobject swf_rotate swf_scale swf_setfont swf_setframe swf_shapearc swf_shapecurveto3 swf_shapecurveto swf_shapefillbitmapclip swf_shapefillbitmaptile swf_shapefilloff swf_shapefillsolid swf_shapelinesolid swf_shapelineto swf_shapemoveto swf_showframe swf_startbutton swf_startdoaction swf_startshape swf_startsymbol swf_textwidth swf_translate swf_viewport contained - syn keyword phpFunctions sybase_affected_rows sybase_close sybase_connect sybase_data_seek sybase_deadlock_retry_count sybase_fetch_array sybase_fetch_assoc sybase_fetch_field sybase_fetch_object sybase_fetch_row sybase_field_seek sybase_free_result sybase_get_last_message sybase_min_client_severity sybase_min_error_severity sybase_min_message_severity sybase_min_server_severity sybase_num_fields sybase_num_rows sybase_pconnect sybase_query sybase_result sybase_select_db sybase_set_message_handler sybase_unbuffered_query contained - syn keyword phpFunctions tidy_access_count tidy_clean_repair tidy_config_count tidy_diagnose tidy_error_count tidy_get_body tidy_get_config tidy_get_error_buffer tidy_get_head tidy_get_html_ver tidy_get_html tidy_get_output tidy_get_release tidy_get_root tidy_get_status tidy_getopt tidy_is_xhtml tidy_load_config tidy_parse_file tidy_parse_string tidy_repair_file tidy_repair_string tidy_reset_config tidy_save_config tidy_set_encoding tidy_setopt tidy_warning_count contained - syn keyword phpMethods attributes children get_attr get_nodes has_children has_siblings is_asp is_comment is_html is_jsp is_jste is_text is_xhtml is_xml next prev tidy_node contained - syn keyword phpFunctions token_get_all token_name contained - syn keyword phpFunctions base64_decode base64_encode get_meta_tags http_build_query parse_url rawurldecode rawurlencode urldecode urlencode contained - syn keyword phpFunctions doubleval empty floatval get_defined_vars get_resource_type gettype import_request_variables intval is_array is_bool is_callable is_double is_float is_int is_integer is_long is_null is_numeric is_object is_real is_resource is_scalar is_string isset print_r serialize settype strval unserialize unset var_dump var_export contained - syn keyword phpFunctions vpopmail_add_alias_domain_ex vpopmail_add_alias_domain vpopmail_add_domain_ex vpopmail_add_domain vpopmail_add_user vpopmail_alias_add vpopmail_alias_del_domain vpopmail_alias_del vpopmail_alias_get_all vpopmail_alias_get vpopmail_auth_user vpopmail_del_domain_ex vpopmail_del_domain vpopmail_del_user vpopmail_error vpopmail_passwd vpopmail_set_user_quota contained - syn keyword phpFunctions w32api_deftype w32api_init_dtype w32api_invoke_function w32api_register_function w32api_set_call_method contained - syn keyword phpFunctions wddx_add_vars wddx_deserialize wddx_packet_end wddx_packet_start wddx_serialize_value wddx_serialize_vars contained - syn keyword phpFunctions utf8_decode utf8_encode xml_error_string xml_get_current_byte_index xml_get_current_column_number xml_get_current_line_number xml_get_error_code xml_parse_into_struct xml_parse xml_parser_create_ns xml_parser_create xml_parser_free xml_parser_get_option xml_parser_set_option xml_set_character_data_handler xml_set_default_handler xml_set_element_handler xml_set_end_namespace_decl_handler xml_set_external_entity_ref_handler xml_set_notation_decl_handler xml_set_object xml_set_processing_instruction_handler xml_set_start_namespace_decl_handler xml_set_unparsed_entity_decl_handler contained - syn keyword phpFunctions xmlrpc_decode_request xmlrpc_decode xmlrpc_encode_request xmlrpc_encode xmlrpc_get_type xmlrpc_parse_method_descriptions xmlrpc_server_add_introspection_data xmlrpc_server_call_method xmlrpc_server_create xmlrpc_server_destroy xmlrpc_server_register_introspection_callback xmlrpc_server_register_method xmlrpc_set_type contained - syn keyword phpFunctions xslt_create xslt_errno xslt_error xslt_free xslt_output_process xslt_set_base xslt_set_encoding xslt_set_error_handler xslt_set_log xslt_set_sax_handler xslt_set_sax_handlers xslt_set_scheme_handler xslt_set_scheme_handlers contained - syn keyword phpFunctions yaz_addinfo yaz_ccl_conf yaz_ccl_parse yaz_close yaz_connect yaz_database yaz_element yaz_errno yaz_error yaz_es_result yaz_get_option yaz_hits yaz_itemorder yaz_present yaz_range yaz_record yaz_scan_result yaz_scan yaz_schema yaz_search yaz_set_option yaz_sort yaz_syntax yaz_wait contained - syn keyword phpFunctions zip_close zip_entry_close zip_entry_compressedsize zip_entry_compressionmethod zip_entry_filesize zip_entry_name zip_entry_open zip_entry_read zip_open zip_read contained - syn keyword phpFunctions gzclose gzcompress gzdeflate gzencode gzeof gzfile gzgetc gzgets gzgetss gzinflate gzopen gzpassthru gzputs gzread gzrewind gzseek gztell gzuncompress gzwrite readgzfile zlib_get_coding_type contained - syn keyword phpFunctions timezone_offset_get date_create - syn keyword phpFunctions date_default_timezone_set date_default_timezone_get - " ext SPL: - syn keyword phpFunctions spl_autoload_call spl_autoload_extensions spl_autoload_functions - syn keyword phpFunctions spl_autoload_register spl_autoload_unregister spl_autoload - syn keyword phpFunctions spl_classes spl_object_hash - syn keyword phpFunctions class_implements class_parents iterator_count iterator_to_array - - " }}}2 - - if s:show_baselib - syn keyword phpMethods query next_record num_rows affected_rows nf f p np num_fields haltmsg seek link_id query_id metadata table_names nextid connect halt free register unregister is_registered delete url purl self_url pself_url hidden_session add_query padd_query reimport_get_vars reimport_post_vars reimport_cookie_vars set_container set_tokenname release_token put_headers get_id get_id put_id freeze thaw gc reimport_any_vars start url purl login_if is_authenticated auth_preauth auth_loginform auth_validatelogin auth_refreshlogin auth_registerform auth_doregister start check have_perm permsum perm_invalid contained - syn keyword phpFunctions page_open page_close sess_load sess_save contained - endif - - -" }}}1 - -" {{{1 REVIEW: }}}1 - - -" Keyword -syn cluster phpClInClass add=phpClassDefine -syn keyword phpClassDefine contained var const -hi link phpClassDefine phpDefine - -if s:alt_arrays - syn cluster phpClExpressions add=phpArrayRegion - syn cluster phpClValues add=phpArrayRegionSimple - " TODO: should the error highlighting be optional??? - if s:fold_arrays - syn region phpArrayRegionSimple contained matchgroup=phpArrayParens start=/\/ - - syn keyword phpList contained list -endif - -" Operators - - -" Peter Hodge - added support for array-building operator -" to stop the relations from mixing this up -if s:alt_arrays - " highlight misuse of the '=>' operator - syn cluster phpClExpressions add=phpArrayPairError - syn match phpArrayPairError /=>/ contained display - - " the next match is used only in the correct places - syn match phpArrayPair /=>/ contained display -else - syn match phpOperator /=>/ contained display -endif - -" relations -" Peter Hodge, June 17 2006 -" - altered relations to match strict comparisons (=== and !==) -" - highlight the 'instanceof' operator as a relation operator -" rather than a structure, if comparison support is a priority. -syn cluster phpClExpressions add=phpRelation -syn match phpRelation contained display /===\=/ -syn match phpRelation contained display /!==\=/ -syn match phpRelation contained display /<<\@!=\=/ -syn match phpRelation contained display />>\@!=\=/ - -" 'instanceof' is also a relation, but may have alternate colours -syn cluster phpClExpressions add=phpInstanceof -syn keyword phpInstanceof contained instanceof - \ nextgroup=@phpClStructures,phpStructureHere skipwhite skipempty - -" how to treat '->'? - -" Note: this is always needed for inside strings -syn match phpPropertySelector contained display /->/ - -if ! s:smart_members - " NOTE: this match is for ANY '->' match, however the more specific - " phpPropertySelector or phpDynamicSelector may match instead - syn cluster phpClExpressions add=phpMemberSelector - syn match phpMemberSelector contained display /->/ - \ nextgroup=@phpClProperties,@phpClMembers,phpMemberHere skipwhite skipempty - -else - " by default all -> matches are property access - syn cluster phpClExpressions add=phpPropertySelector - - " make a match for a whole property name also - syn cluster phpClExpressions add=phpPropertyAccess - syn match phpPropertyAccess contained display /->\_s*\h\w*/ - \ contains=phpPropertySelector,@phpClProperties,phpPropertyHere - - " try match them as method calls first though - " NOTE: have taken out phpMethods (because it just wasn't accurate) - " but have added phpSpecialMethods because they are always special - syn cluster phpClExpressions add=phpMethodCall - syn cluster phpClMethodHere add=phpMethodCall - syn match phpMethodCall contained display /->\_s*\h\w*\_s*(\@=/ - \ contained display contains=phpMemberSelector,@phpClMethods - syn match phpMethodCall contained display /->\_s*\$\h\w*\_s*(\@=/ - \ contained display contains=phpIdentifier,phpMemberSelector - syn match phpMemberSelector contained display /->/ - - " for a dynamic {} property/method - if s:alt_properties - syn cluster phpClExpressions add=phpDynamicSelectorRegion - syn region phpDynamicSelectorRegion contained keepend extend - \ matchgroup=phpDynamicSelector start=/->\_s*{/ end=/}/ - \ contains=@phpClExpressions - endif - -" " highlight incorrect use of -> as an error -" syn cluster phpClExpressions add=phpMemberError -" syn match phpMemberError /->\%#\@!\%(\_s*\)\@>[a-z{_$]\@!/ contained display - -endif - -syn region phpIdentifierComplex contained display matchgroup=phpVarSelector start=/\${/ end=/}/ - \ keepend extend - \ contains=@phpClExpressions - -" create an identifier match for double-quoted strings: - -" Methoden - -" Peter Hodge - added 'clone' keyword here -" Define -syn cluster phpClExpressions add=phpObjectOperator -syn keyword phpObjectOperator contained new - \ nextgroup=@phpClClasses,@phpClInterfaces,phpStructureHere skipwhite skipempty -syn keyword phpObjectOperator contained clone - -" Todo -syn keyword phpTodo contained todo fixme xxx containedin=phpComment - -" Parent -if s:strict_blocks - syn cluster phpClExpressions add=phpBlockRegion - if s:folding == 2 - syn region phpBlockRegion matchgroup=phpBrace start=/{/ end=/}/ keepend extend - \ transparent contained - \ fold - else - syn region phpBlockRegion matchgroup=phpBrace start=/{/ end=/}/ keepend extend - \ transparent contained - if s:fold_manual - syn region phpBlockRegion matchgroup=phpBrace start='{\ze\s*//\s*fold\s*$\c' end='}' keepend extend - \ transparent contained - \ fold - endif - endif - - " parenthesis for a foreach() block, not found automatically - " (is triggered by a nextgroup=phpForeachRegion) - " Note: the 'display' option on a foreach region (the part inside the '()') - " would be bad, because it is possible for that to be spread over several - " lines (well, I do it myself) - if s:alt_arrays || s:alt_control_parents - syn region phpForeachRegion matchgroup=phpControlParent start=/(/ end=/)/ keepend extend - \ contained contains=@phpClExpressions,phpArrayPair - \ nextgroup=phpSemicolonNotAllowedHere skipwhite skipempty - endif - - " parenthesis for a for() block, not found automatically - " (is triggered by a nextgroup=phpForRegion) - if s:alt_arrays || s:alt_control_parents - syn region phpForRegion matchgroup=phpControlParent - \ start=/(/ end=/)/ keepend extend display - \ contained contains=@phpClExpressions,phpForSemicolon - \ nextgroup=phpSemicolonNotAllowedHere skipwhite skipempty - syn match phpForSemicolon contained display /[,;]/ - hi! link phpForSemicolon phpConditional - endif - - " special parent regions for 'if/while' blocks so we can catch a semicolon - " which shouldn't be at the end - " Note: having endings on those keywords helps speed things up alot. - if s:no_empty_construct - syn region phpConstructRegion keepend extend contained contains=@phpClExpressions - \ nextgroup=phpSemicolonNotAllowedHere skipwhite skipempty - \ matchgroup=phpControlParent start=/(/ end=/)/ - \ matchgroup=Error end=/}/ end=/\]/ - \ end=/\$\@/ - \ end=/\$\@/ - \ end=/\$\@/ - \ end=/\$\@/ - syn region phpSwitchConstructRegion keepend extend contained contains=@phpClExpressions - \ nextgroup=phpSemicolonNotAllowedHere,phpSwitchBlock skipwhite skipempty - \ matchgroup=phpControlParent start=/(/ end=/)/ - \ matchgroup=Error end=/}/ end=/\]/ - \ end=/\$\@/ - \ end=/\$\@/ - \ end=/\$\@/ - \ end=/\$\@/ - syn region phpDoWhileConstructRegion keepend extend contained contains=@phpClExpressions - \ matchgroup=phpControlParent start=/(/ end=/)\_s*;/ - \ matchgroup=Error end=/}/ end=/\]/ end=/;/ - \ end=/\$\@/ - \ end=/\$\@/ - \ end=/\$\@/ - \ end=/\$\@/ - endif - - " match up ( and ), as well as [ and ] - syn cluster phpClExpressions add=phpParentRegion,phpBracketRegion - syn region phpParentRegion contained keepend extend contains=@phpClExpressions - \ matchgroup=phpParent start=/(/ end=/)/ - \ matchgroup=Error end=/;/ end=/}/ end=/\]/ - " NOTE: the 'dispay' option on a [] region isn't so dangerous, as they are - " normally only one line - " TODO: does the 'display' option break folding for php_fold_arrays? The - " answer is YES - syn region phpBracketRegion contained keepend extend contains=@phpClExpressions - \ matchgroup=phpParent start=/\[/ end=/\]/ - \ matchgroup=Error end=/;/ - - " when a closing }, ) or ] is out of place ... - if s:parent_error_close - syn cluster phpClValues add=phpBraceError,phpParentError - syn match phpBraceError contained display /}/ - syn match phpParentError contained display /)/ - syn match phpParentError contained display /\]/ - endif - -else - syn match phpParent contained display /{/ - syn match phpParent contained display /}/ - syn match phpParent contained display /\[/ - syn match phpParent contained display /\]/ - syn match phpParent contained display /(/ - syn match phpParent contained display /)/ -endif - -syn cluster phpClTop add=phpFoldFunction,phpFoldClass,phpFoldInterface - -" PHP Region -if s:long_tags - syn region phpRegion matchgroup=phpRegionDelimiter start=// - \ keepend extend contains=@phpClTop -else - syn region phpRegion matchgroup=phpRegionDelimiter start=// - \ keepend extend contains=@phpClTop -endif - -syn region phpRegionSc matchgroup=phpRegionDelimiter - \ start=## - \ 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/vim_old/syntax/snippet.vim b/vim_old/syntax/snippet.vim deleted file mode 100644 index 5e919e7..0000000 --- a/vim_old/syntax/snippet.vim +++ /dev/null @@ -1,19 +0,0 @@ -" Syntax highlighting for snippet files (used for snipMate.vim) -" Hopefully this should make snippets a bit nicer to write! -syn match snipComment '^#.*' -syn match placeHolder '\${\d\+\(:.\{-}\)\=}' contains=snipCommand -syn match tabStop '\$\d\+' -syn match snipCommand '`.\{-}`' -syn match snippet '^snippet.*' transparent contains=multiSnipText,snipKeyword -syn match multiSnipText '\S\+ \zs.*' contained -syn match snipKeyword '^snippet'me=s+8 contained -syn match snipError "^[^#s\t].*$" - -hi link snipComment Comment -hi link multiSnipText String -hi link snipKeyword Keyword -hi link snipComment Comment -hi link placeHolder Special -hi link tabStop Special -hi link snipCommand String -hi link snipError Error