Removing old vim stuff
parent
d8b391a75d
commit
d9eed1ab9a
@ -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'
|
|
@ -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 <silent> <tab> <c-r>=TriggerSnippet()<cr>
|
|
||||||
snor <silent> <tab> <esc>i<right><c-r>=TriggerSnippet()<cr>
|
|
||||||
ino <silent> <s-tab> <c-r>=BackwardsSnippet()<cr>
|
|
||||||
snor <silent> <s-tab> <esc>i<right><c-r>=BackwardsSnippet()<cr>
|
|
||||||
ino <silent> <c-r><tab> <c-r>=ShowAvailableSnips()<cr>
|
|
||||||
|
|
||||||
" 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 <bs> b<bs>
|
|
||||||
snor <right> <esc>a
|
|
||||||
snor <left> <esc>bi
|
|
||||||
snor ' b<bs>'
|
|
||||||
snor ` b<bs>`
|
|
||||||
snor % b<bs>%
|
|
||||||
snor U b<bs>U
|
|
||||||
snor ^ b<bs>^
|
|
||||||
snor \ b<bs>\
|
|
||||||
snor <c-x> b<bs><c-x>
|
|
||||||
|
|
||||||
" 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
|
|
@ -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 <silent> i i<C-r>=<SID>feedPopup()<CR>
|
|
||||||
nnoremap <silent> a a<C-r>=<SID>feedPopup()<CR>
|
|
||||||
nnoremap <silent> R R<C-r>=<SID>feedPopup()<CR>
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
"
|
|
||||||
function acp#disable()
|
|
||||||
call s:unmapForMappingDriven()
|
|
||||||
augroup AcpGlobalAutoCommand
|
|
||||||
autocmd!
|
|
||||||
augroup END
|
|
||||||
nnoremap i <Nop> | nunmap i
|
|
||||||
nnoremap a <Nop> | nunmap a
|
|
||||||
nnoremap R <Nop> | 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("\<C-r>=TriggerSnippet()\<CR>", "n")
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
return 1
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
"
|
|
||||||
function acp#onPopupPost()
|
|
||||||
" to clear <C-r>= expression on command-line
|
|
||||||
echo ''
|
|
||||||
if pumvisible()
|
|
||||||
inoremap <silent> <expr> <C-h> acp#onBs()
|
|
||||||
inoremap <silent> <expr> <BS> acp#onBs()
|
|
||||||
" a command to restore to original text and select the first match
|
|
||||||
return (s:behavsCurrent[s:iBehavs].command =~# "\<C-p>" ? "\<C-n>\<Up>"
|
|
||||||
\ : "\<C-p>\<Down>")
|
|
||||||
endif
|
|
||||||
let s:iBehavs += 1
|
|
||||||
if len(s:behavsCurrent) > s:iBehavs
|
|
||||||
call s:setCompletefunc()
|
|
||||||
return printf("\<C-e>%s\<C-r>=acp#onPopupPost()\<CR>",
|
|
||||||
\ 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 "\<C-e>"
|
|
||||||
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 "\<BS>"
|
|
||||||
endif
|
|
||||||
return "\<C-e>\<BS>"
|
|
||||||
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',
|
|
||||||
\ '-', '_', '~', '^', '.', ',', ':', '!', '#', '=', '%', '$', '@', '<', '>', '/', '\',
|
|
||||||
\ '<Space>', '<C-h>', '<BS>', ]
|
|
||||||
for key in s:keysMappingDriven
|
|
||||||
execute printf('inoremap <silent> %s %s<C-r>=<SID>feedPopup()<CR>',
|
|
||||||
\ 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 <C-e>
|
|
||||||
" 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 <C-e>.
|
|
||||||
call s:setTempOption(s:GROUP1, 'textwidth', 0)
|
|
||||||
call s:setCompletefunc()
|
|
||||||
call feedkeys(s:behavsCurrent[s:iBehavs].command . "\<C-r>=acp#onPopupPost()\<CR>", 'n')
|
|
||||||
return '' " this function is called by <C-r>=
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
"
|
|
||||||
function s:finishPopup(fGroup1)
|
|
||||||
inoremap <C-h> <Nop> | iunmap <C-h>
|
|
||||||
inoremap <BS> <Nop> | iunmap <BS>
|
|
||||||
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:
|
|
@ -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 ? "\<tab>" : 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 <cr> 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 "\<esc>".l.'v'.s:origWordLen."l\<c-g>"
|
|
||||||
endif
|
|
||||||
return s:origWordLen == 1 ? "\<esc>".l.'gh'
|
|
||||||
\ : "\<esc>".l.'v'.(s:origWordLen - 1)."l\<c-g>"
|
|
||||||
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
|
|
@ -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:
|
|
@ -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)
|
|
||||||
|
|
@ -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<rows; i+=1 ) /* set pointers */
|
|
||||||
m[i] = m[i-1] + columns;
|
|
||||||
return m;
|
|
||||||
} /* ---------- end of function calloc_double_matrix ---------- */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* === FUNCTION ======================================================================
|
|
||||||
* Name: free_matrix_double
|
|
||||||
* Description: Free a dynamic double-matrix.
|
|
||||||
* =====================================================================================
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
free_double_matrix ( double **m )
|
|
||||||
{
|
|
||||||
free(*m); /* free data array */
|
|
||||||
free( m); /* free pointer array */
|
|
||||||
return ;
|
|
||||||
} /* ---------- end of function free_double_matrix ---------- */
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
|||||||
|
|
||||||
/*
|
|
||||||
* === FUNCTION ======================================================================
|
|
||||||
* Name: calloc_int_matrix
|
|
||||||
* Description: Allocate a dynamic int-matrix of size rows*columns; return a pointer.
|
|
||||||
* =====================================================================================
|
|
||||||
*/
|
|
||||||
int**
|
|
||||||
calloc_int_matrix ( int rows, int columns )
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
int **m;
|
|
||||||
m = calloc ( rows, sizeof(int*) ); /* allocate pointer array */
|
|
||||||
assert( m != NULL ); /* abort if allocation failed */
|
|
||||||
*m = calloc ( rows*columns, sizeof(int) ); /* allocate data array */
|
|
||||||
assert(*m != NULL ); /* abort if allocation failed */
|
|
||||||
for ( i=1; i<rows; i+=1 ) /* set pointers */
|
|
||||||
m[i] = m[i-1] + columns;
|
|
||||||
return m;
|
|
||||||
} /* ---------- end of function calloc_int_matrix ---------- */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* === FUNCTION ======================================================================
|
|
||||||
* Name: free_int_matrix
|
|
||||||
* Description: Free a dynamic int-matrix.
|
|
||||||
* =====================================================================================
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
free_int_matrix ( int **m )
|
|
||||||
{
|
|
||||||
free(*m); /* free data array */
|
|
||||||
free( m); /* free pointer array */
|
|
||||||
return ;
|
|
||||||
} /* ---------- end of function free_int_matrix ---------- */
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
|||||||
#include <errno.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* === 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 ---------- */
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
|||||||
#include <cstdlib>
|
|
||||||
#include <fstream>
|
|
||||||
#include <iomanip>
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
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 ----------
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
|||||||
|
|
||||||
// === FUNCTION ======================================================================
|
|
||||||
// Name: print_array
|
|
||||||
// Description: Print an array with one dimension.
|
|
||||||
// Use
|
|
||||||
// print_array<T,w>( *matrix, n1*n2, n2, "matrix" );
|
|
||||||
// for
|
|
||||||
// T matrix[n1][n2];
|
|
||||||
// =====================================================================================
|
|
||||||
template <class T, int width>
|
|
||||||
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<n; i+=1 ) {
|
|
||||||
if( i%nrow == 0 )
|
|
||||||
cout << endl << setw(6) << i << " | ";
|
|
||||||
cout << "" << setw(width) << fixed << setprecision(2) << array[i];
|
|
||||||
}
|
|
||||||
cout << endl << endl;
|
|
||||||
return ;
|
|
||||||
} // ---------- end of function print_double_array ----------
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
|||||||
|
|
||||||
/*
|
|
||||||
* === FUNCTION ======================================================================
|
|
||||||
* Name: print_double_array
|
|
||||||
* Description: Print a double-array with one dimension.
|
|
||||||
* Use
|
|
||||||
* print_int_array( *matrix, n1*n2, n2, "matrix" );
|
|
||||||
* for
|
|
||||||
* double matrix[n1][n2];
|
|
||||||
* =====================================================================================
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
print_double_array ( double array[], /* array to print */
|
|
||||||
int n, /* number of elements to print */
|
|
||||||
int nrow, /* number of elements per row */
|
|
||||||
char *arrayname /* array name */
|
|
||||||
)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
printf ("\n\n array \"%s\", length %d\n", arrayname, n );
|
|
||||||
printf ("\n index | content\n" );
|
|
||||||
printf ( " ------+-" );
|
|
||||||
for ( i = 0; i < nrow; i += 1 )
|
|
||||||
printf ( "---------" );
|
|
||||||
for ( i=0; i<n; i+=1 )
|
|
||||||
{
|
|
||||||
if( i%nrow == 0 )
|
|
||||||
printf ("\n%6d | ", i );
|
|
||||||
printf (" %8.2f", array[i] );
|
|
||||||
}
|
|
||||||
printf ("\n\n");
|
|
||||||
return ;
|
|
||||||
} /* ---------- end of function print_double_array ---------- */
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
|||||||
|
|
||||||
/*
|
|
||||||
* === FUNCTION ======================================================================
|
|
||||||
* Name: print_int_array
|
|
||||||
* Description: Print an int-array with one dimension.
|
|
||||||
* Use
|
|
||||||
* print_int_array( *matrix, n1*n2, n2, "matrix" );
|
|
||||||
* for
|
|
||||||
* int matrix[n1][n2];
|
|
||||||
* =====================================================================================
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
print_int_array ( int array[], /* array to print */
|
|
||||||
int n, /* number of elements to print */
|
|
||||||
int nrow, /* number of elements per row */
|
|
||||||
char *arrayname /* array name */
|
|
||||||
)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
printf ("\n\n array \"%s\", length %d\n", arrayname, n );
|
|
||||||
printf ("\n index | content\n" );
|
|
||||||
printf ( " ------+-" );
|
|
||||||
for ( i = 0; i < nrow; i += 1 )
|
|
||||||
printf ( "-------" );
|
|
||||||
for ( i=0; i<n; i+=1 )
|
|
||||||
{
|
|
||||||
if( i%nrow == 0 )
|
|
||||||
printf ("\n%6d | ", i );
|
|
||||||
printf (" %6d", array[i] );
|
|
||||||
}
|
|
||||||
printf ("\n\n");
|
|
||||||
return ;
|
|
||||||
} /* ---------- end of function print_int_array ---------- */
|
|
||||||
|
|
@ -1,410 +0,0 @@
|
|||||||
================================================================================
|
|
||||||
RELEASE NOTES FOR VERSION 5.10
|
|
||||||
================================================================================
|
|
||||||
- The plugin now handles different template styles without editing and
|
|
||||||
reloading the main template file.
|
|
||||||
- The number of template styles is not limited.
|
|
||||||
- New hotkey and ex-command to switch template styles.
|
|
||||||
- Template styles can automatically be related to file extensions.
|
|
||||||
- indent(1) errors will be presented in a quickfix error window.
|
|
||||||
- Comment alignment improved.
|
|
||||||
- Minor improvements.
|
|
||||||
|
|
||||||
================================================================================
|
|
||||||
RELEASE NOTES FOR VERSION 5.9
|
|
||||||
================================================================================
|
|
||||||
+ Two additional hotkeys (+ ex commands) for preprocessor statements.
|
|
||||||
+ Compile-link-run: improved error detection.
|
|
||||||
+ Menu Run: hardcopy can print any buffer.
|
|
||||||
+ Several minor improvements and bugfixes.
|
|
||||||
|
|
||||||
================================================================================
|
|
||||||
RELEASE NOTES FOR VERSION 5.8
|
|
||||||
================================================================================
|
|
||||||
+ Hotkeys are shown in the menus.
|
|
||||||
+ File browser for code snippets and templates choosable (2 global variables).
|
|
||||||
+ Two new hotkeys: include file description (implementation, header).
|
|
||||||
+ New menu item: namespace alias
|
|
||||||
+ Bugfix: wrapper script for use of a xterm could not handle parameters containing blanks.
|
|
||||||
+ Several minor improvements.
|
|
||||||
|
|
||||||
================================================================================
|
|
||||||
RELEASE NOTES FOR VERSION 5.7
|
|
||||||
================================================================================
|
|
||||||
+ 4 new hotkeys : insert file section comments (C/C++/H), special comments,
|
|
||||||
keyword comments.
|
|
||||||
+ Adjusting end-of-line comment adjustment improved.
|
|
||||||
|
|
||||||
================================================================================
|
|
||||||
RELEASE NOTES FOR VERSION 5.6
|
|
||||||
================================================================================
|
|
||||||
+ Jump targets (templates) and mapping Ctrl-j can be switched off.
|
|
||||||
+ Yet unused jump targets will be highlighted after a file is opened.
|
|
||||||
+ Statements menu: else block (key mapping \se).
|
|
||||||
+ Handling of <SPLIT> 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 {<CR> .
|
|
||||||
+ 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 <S-F2> 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.
|
|
||||||
|
|
||||||
|
|
Binary file not shown.
@ -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<n; x+=1 )' \hfill (n,v,i)\\
|
|
||||||
\hline \verb'\in' & \verb'for( x=n-1; 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..> 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'/*<CR>' & \verb'/*'\hfill (i)\newline\verb' * |'\newline\verb' */'\\
|
|
||||||
\hline \verb'{<CR>' & \verb'{'\hfill (i)\newline\verb' |'\newline\verb'}' \\
|
|
||||||
\hline \verb'{<CR>' & \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}
|
|
@ -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/
|
|
||||||
|
|
@ -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 <s-down> <c-w>w
|
|
||||||
nmap <s-up> <c-w>W
|
|
||||||
nmap <s-left> <c-w>h
|
|
||||||
nmap <s-right> <c-w>l
|
|
||||||
"
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
" some additional hot keys
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
" S-F3 - call gvim file browser
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
map <silent> <s-F3> :silent browse confirm e<CR>
|
|
||||||
imap <silent> <s-F3> <Esc>:silent browse confirm e<CR>
|
|
||||||
"
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
" toggle insert mode <--> 'normal mode with the <RightMouse>-key
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
"
|
|
||||||
nmap <RightMouse> <Insert>
|
|
||||||
imap <RightMouse> <ESC>
|
|
||||||
"
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
" use font with clearly distinguishable brackets : ()[]{}
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
"set guifont=Luxi\ Mono\ 14
|
|
||||||
"
|
|
@ -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
|
|
@ -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 <Tab> 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 <C-Esc> :close<CR>
|
|
||||||
inoremap <C-Esc> <C-C>:close<CR>
|
|
||||||
"
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
" Fast switching between buffers
|
|
||||||
" The current buffer will be saved before switching to the next one.
|
|
||||||
" Choose :bprevious or :bnext
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
noremap <silent> <s-tab> :if &modifiable && !&readonly &&
|
|
||||||
\ &modified <CR> :write<CR> :endif<CR>:bprevious<CR>
|
|
||||||
inoremap <silent> <s-tab> <C-C>:if &modifiable && !&readonly &&
|
|
||||||
\ &modified <CR> :write<CR> :endif<CR>:bprevious<CR>
|
|
||||||
"
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
" Leave the editor with Ctrl-q (KDE): Write all changed buffers and exit Vim
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
nnoremap <C-q> :wqall<CR>
|
|
||||||
"
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
" 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 <silent> <F2> :write<CR>
|
|
||||||
map <silent> <F3> :Explore<CR>
|
|
||||||
nmap <silent> <F4> :exe ":ptag ".expand("<cword>")<CR>
|
|
||||||
map <silent> <F5> :copen<CR>
|
|
||||||
map <silent> <F6> :cclose<CR>
|
|
||||||
map <silent> <F7> :cp<CR>
|
|
||||||
map <silent> <F8> :cn<CR>
|
|
||||||
"
|
|
||||||
imap <silent> <F2> <Esc>:write<CR>
|
|
||||||
imap <silent> <F3> <Esc>:Explore<CR>
|
|
||||||
imap <silent> <F4> <Esc>:exe ":ptag ".expand("<cword>")<CR>
|
|
||||||
imap <silent> <F5> <Esc>:copen<CR>
|
|
||||||
imap <silent> <F6> <Esc>:cclose<CR>
|
|
||||||
imap <silent> <F7> <Esc>:cp<CR>
|
|
||||||
imap <silent> <F8> <Esc>:cn<CR>
|
|
||||||
"
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
" Fast switching between buffers
|
|
||||||
" The current buffer will be saved before switching to the next one.
|
|
||||||
" Choose :bprevious or :bnext
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
"
|
|
||||||
map <silent> <s-tab> <Esc>:if &modifiable && !&readonly &&
|
|
||||||
\ &modified <CR> :write<CR> :endif<CR>:bprevious<CR>
|
|
||||||
imap <silent> <s-tab> <Esc>:if &modifiable && !&readonly &&
|
|
||||||
\ &modified <CR> :write<CR> :endif<CR>:bprevious<CR>
|
|
||||||
"
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
" Leave the editor with Ctrl-q : Write all changed buffers and exit Vim
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
nmap <C-q> :wqa<CR>
|
|
||||||
"
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
" comma always followed by a space
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
inoremap , ,<Space>
|
|
||||||
"
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
" autocomplete parenthesis, brackets and braces
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
inoremap ( ()<Left>
|
|
||||||
inoremap [ []<Left>
|
|
||||||
inoremap { {}<Left>
|
|
||||||
"
|
|
||||||
vnoremap ( s()<Esc>P<Right>%
|
|
||||||
vnoremap [ s[]<Esc>P<Right>%
|
|
||||||
vnoremap { s{}<Esc>P<Right>%
|
|
||||||
"
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
" autocomplete quotes (visual and select mode)
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
xnoremap ' s''<Esc>P<Right>
|
|
||||||
xnoremap " s""<Esc>P<Right>
|
|
||||||
xnoremap ` s``<Esc>P<Right>
|
|
||||||
"
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
" 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 <silent> <F11> <Esc><Esc>:Tlist<CR>
|
|
||||||
inoremap <silent> <F11> <Esc><Esc>:Tlist<CR>
|
|
||||||
|
|
||||||
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")
|
|
||||||
|
|
@ -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
|
|
@ -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 ==
|
|
||||||
$
|
|
@ -1,178 +0,0 @@
|
|||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== comment.end-of-line-comment == append ==
|
|
||||||
/* <CURSOR> */
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== comment.frame ==
|
|
||||||
/*-----------------------------------------------------------------------------
|
|
||||||
* <CURSOR>
|
|
||||||
*-----------------------------------------------------------------------------*/
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== comment.function ==
|
|
||||||
/*
|
|
||||||
* === FUNCTION ======================================================================
|
|
||||||
* Name: |?FUNCTION_NAME|
|
|
||||||
* Description: <CURSOR>
|
|
||||||
* =====================================================================================
|
|
||||||
*/
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== comment.method ==
|
|
||||||
/*
|
|
||||||
*--------------------------------------------------------------------------------------
|
|
||||||
* Class: |?CLASSNAME|
|
|
||||||
* Method: |?CLASSNAME| :: |?METHODNAME|
|
|
||||||
* Description: <CURSOR>
|
|
||||||
*--------------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== comment.class ==
|
|
||||||
/*
|
|
||||||
* =====================================================================================
|
|
||||||
* Class: |?CLASSNAME|
|
|
||||||
* Description: <CURSOR>
|
|
||||||
* =====================================================================================
|
|
||||||
*/
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== comment.file-description == start ==
|
|
||||||
/*
|
|
||||||
* =====================================================================================
|
|
||||||
*
|
|
||||||
* Filename: |FILENAME|
|
|
||||||
*
|
|
||||||
* Description: <CURSOR>
|
|
||||||
*
|
|
||||||
* Version: 1.0
|
|
||||||
* Created: |DATE| |TIME|
|
|
||||||
* Revision: none
|
|
||||||
* Compiler: gcc
|
|
||||||
*
|
|
||||||
* Author: |AUTHOR| (|AUTHORREF|), |EMAIL|
|
|
||||||
* Company: |COMPANY|
|
|
||||||
*
|
|
||||||
* =====================================================================================
|
|
||||||
*/
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== comment.file-description-header == start ==
|
|
||||||
/*
|
|
||||||
* =====================================================================================
|
|
||||||
*
|
|
||||||
* Filename: |FILENAME|
|
|
||||||
*
|
|
||||||
* Description: <CURSOR>
|
|
||||||
*
|
|
||||||
* 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|: <CURSOR> */
|
|
||||||
== comment.keyword-compiler == append ==
|
|
||||||
/* :COMPILER:|DATE| |TIME|:|AUTHORREF|: <CURSOR> */
|
|
||||||
== comment.keyword-todo == append ==
|
|
||||||
/* :TODO:|DATE| |TIME|:|AUTHORREF|: <CURSOR> */
|
|
||||||
== comment.keyword-tricky == append ==
|
|
||||||
/* :TRICKY:|DATE| |TIME|:|AUTHORREF|: <CURSOR> */
|
|
||||||
== comment.keyword-warning == append ==
|
|
||||||
/* :WARNING:|DATE| |TIME|:|AUTHORREF|: <CURSOR> */
|
|
||||||
== comment.keyword-workaround == append ==
|
|
||||||
/* :WORKAROUND:|DATE| |TIME|:|AUTHORREF|: <CURSOR> */
|
|
||||||
== comment.keyword-keyword == append ==
|
|
||||||
/* :|?KEYWORD:u|:|DATE| |TIME|:|AUTHORREF|: <CURSOR> */
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== comment.special-empty == append ==
|
|
||||||
/* EMPTY */<CURSOR>
|
|
||||||
== comment.special-fall-through == append ==
|
|
||||||
/* FALL THROUGH */<CURSOR>
|
|
||||||
== comment.special-implicit-type-conversion == append ==
|
|
||||||
/* IMPLICIT TYPE CONVERSION */<CURSOR>
|
|
||||||
== comment.special-no-return == append ==
|
|
||||||
/* NO RETURN */<CURSOR>
|
|
||||||
== comment.special-not-reached == append ==
|
|
||||||
/* NOT REACHED */<CURSOR>
|
|
||||||
== comment.special-remains-to-be-implemented == append ==
|
|
||||||
/* REMAINS TO BE IMPLEMENTED */<CURSOR>
|
|
||||||
== comment.special-constant-type-is-long == append ==
|
|
||||||
/* constant type is long */<CURSOR>
|
|
||||||
== comment.special-constant-type-is-unsigned == append ==
|
|
||||||
/* constant type is unsigned */<CURSOR>
|
|
||||||
== comment.special-constant-type-is-unsigned-long == append ==
|
|
||||||
/* constant type is unsigned long */<CURSOR>
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
@ -1,487 +0,0 @@
|
|||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
$
|
|
||||||
== cpp.cin ==
|
|
||||||
cin >> <CURSOR>;
|
|
||||||
$
|
|
||||||
== cpp.cout ==
|
|
||||||
cout << <CURSOR> << endl;
|
|
||||||
$
|
|
||||||
== cpp.cout-operator == insert ==
|
|
||||||
<< "<CURSOR>"
|
|
||||||
$
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.output-manipulator-boolalpha == insert ==
|
|
||||||
<< boolalpha <CURSOR>
|
|
||||||
== cpp.output-manipulator-dec == insert ==
|
|
||||||
<< dec <CURSOR>
|
|
||||||
== cpp.output-manipulator-endl == insert ==
|
|
||||||
<< endl <CURSOR>
|
|
||||||
== cpp.output-manipulator-fixed == insert ==
|
|
||||||
<< fixed <CURSOR>
|
|
||||||
== cpp.output-manipulator-flush == insert ==
|
|
||||||
<< flush <CURSOR>
|
|
||||||
== cpp.output-manipulator-hex == insert ==
|
|
||||||
<< hex <CURSOR>
|
|
||||||
== cpp.output-manipulator-internal == insert ==
|
|
||||||
<< internal <CURSOR>
|
|
||||||
== cpp.output-manipulator-left == insert ==
|
|
||||||
<< left <CURSOR>
|
|
||||||
== cpp.output-manipulator-oct == insert ==
|
|
||||||
<< oct <CURSOR>
|
|
||||||
== cpp.output-manipulator-right == insert ==
|
|
||||||
<< right <CURSOR>
|
|
||||||
== cpp.output-manipulator-scientific == insert ==
|
|
||||||
<< scientific <CURSOR>
|
|
||||||
== cpp.output-manipulator-setbase == insert ==
|
|
||||||
<< setbase(10<CURSOR>)
|
|
||||||
== cpp.output-manipulator-setfill == insert ==
|
|
||||||
<< setfill(<CURSOR>)
|
|
||||||
== cpp.output-manipulator-setiosflag == insert ==
|
|
||||||
<< setiosflags(<CURSOR>)
|
|
||||||
== cpp.output-manipulator-setprecision == insert ==
|
|
||||||
<< setprecision(6<CURSOR>)
|
|
||||||
== cpp.output-manipulator-setw == insert ==
|
|
||||||
<< setw(0<CURSOR>)
|
|
||||||
== cpp.output-manipulator-showbase == insert ==
|
|
||||||
<< showbase <CURSOR>
|
|
||||||
== cpp.output-manipulator-showpoint == insert ==
|
|
||||||
<< showpoint <CURSOR>
|
|
||||||
== cpp.output-manipulator-showpos == insert ==
|
|
||||||
<< showpos <CURSOR>
|
|
||||||
== cpp.output-manipulator-uppercase == insert ==
|
|
||||||
<< uppercase <CURSOR>
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.method-implementation ==
|
|
||||||
void<CURSOR>
|
|
||||||
|?CLASSNAME|::|?METHODNAME| ( <+argument list+> )
|
|
||||||
{
|
|
||||||
return ;
|
|
||||||
} /* ----- end of method |CLASSNAME|::|?METHODNAME| ----- */
|
|
||||||
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.accessor-implementation ==
|
|
||||||
/*
|
|
||||||
*--------------------------------------------------------------------------------------
|
|
||||||
* Class: |?CLASSNAME|
|
|
||||||
* Method: get_|?ATTRIBUTE|
|
|
||||||
*--------------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
inline int<CURSOR>
|
|
||||||
|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: <CURSOR>
|
|
||||||
* =====================================================================================
|
|
||||||
*/
|
|
||||||
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| ()
|
|
||||||
{<CURSOR>
|
|
||||||
} /* ----- end of method |CLASSNAME|::|CLASSNAME| (constructor) ----- */
|
|
||||||
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.class-using-new-definition ==
|
|
||||||
/*
|
|
||||||
* =====================================================================================
|
|
||||||
* Class: |?CLASSNAME:c|
|
|
||||||
* Description: <CURSOR>
|
|
||||||
* =====================================================================================
|
|
||||||
*/
|
|
||||||
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| ()
|
|
||||||
{<CURSOR>
|
|
||||||
} /* ----- 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: <CURSOR>
|
|
||||||
* =====================================================================================
|
|
||||||
*/
|
|
||||||
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<CURSOR> |?CLASSNAME|<T>::|?METHODNAME| ( <+argument list+> )
|
|
||||||
{
|
|
||||||
return ;
|
|
||||||
} /* ----- end of method |CLASSNAME|<T>::|METHODNAME| ----- */
|
|
||||||
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.template-accessor-implementation ==
|
|
||||||
/*
|
|
||||||
*--------------------------------------------------------------------------------------
|
|
||||||
* Class: |?CLASSNAME|
|
|
||||||
* Method: get_|?ATTRIBUTE|
|
|
||||||
*--------------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
template < class T >
|
|
||||||
inline int<CURSOR> |CLASSNAME|<T>::get_|ATTRIBUTE| ( )
|
|
||||||
{
|
|
||||||
return |ATTRIBUTE|;
|
|
||||||
} /* ----- end of method |CLASSNAME|<T>::get_|ATTRIBUTE| ----- */
|
|
||||||
|
|
||||||
/*
|
|
||||||
*--------------------------------------------------------------------------------------
|
|
||||||
* Class: |CLASSNAME|
|
|
||||||
* Method: set_|ATTRIBUTE|
|
|
||||||
*--------------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
template < class T >
|
|
||||||
inline void |CLASSNAME|<T>::set_|ATTRIBUTE| ( <+argument list+> )
|
|
||||||
{
|
|
||||||
|ATTRIBUTE| = value;
|
|
||||||
return ;
|
|
||||||
} /* ----- end of method |CLASSNAME|<T>::set_|ATTRIBUTE| ----- */
|
|
||||||
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.template-class-definition ==
|
|
||||||
/*
|
|
||||||
* =====================================================================================
|
|
||||||
* Class: |?CLASSNAME:c|
|
|
||||||
* Description: <CURSOR>
|
|
||||||
* =====================================================================================
|
|
||||||
*/
|
|
||||||
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| ()
|
|
||||||
{<CURSOR>
|
|
||||||
} /* ---------- end of constructor of template class |CLASSNAME| ---------- */
|
|
||||||
|
|
||||||
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.template-class-using-new-definition ==
|
|
||||||
/*
|
|
||||||
* =====================================================================================
|
|
||||||
* Class: |?CLASSNAME:c|
|
|
||||||
* Description: <CURSOR>
|
|
||||||
* =====================================================================================
|
|
||||||
*/
|
|
||||||
|
|
||||||
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| ()
|
|
||||||
{<CURSOR>
|
|
||||||
} /* ---------- 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 <class T>
|
|
||||||
void<CURSOR> |?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.<CURSOR> ;
|
|
||||||
return os;
|
|
||||||
} /* ----- end of function operator << ----- */
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.operator-out ==
|
|
||||||
istream &
|
|
||||||
operator >> ( istream & is, |?CLASSNAME| & obj )
|
|
||||||
{
|
|
||||||
is >> obj.<CURSOR> ;
|
|
||||||
return is;
|
|
||||||
} /* ----- end of function operator >> ----- */
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.try-catch ==
|
|
||||||
try {
|
|
||||||
<SPLIT>}
|
|
||||||
catch ( const <CURSOR> &ExceptObj ) { /* handle exception: */
|
|
||||||
}
|
|
||||||
catch (...) { /* handle exception: unspecified */
|
|
||||||
}
|
|
||||||
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.catch ==
|
|
||||||
catch ( <CURSOR>const &ExceptObj ) { /* handle exception: */
|
|
||||||
<SPLIT>}
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.catch-points ==
|
|
||||||
catch (...) { /* handle exception: */
|
|
||||||
<SPLIT>}
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.extern ==
|
|
||||||
extern "C" {<CURSOR>
|
|
||||||
<SPLIT>}
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.open-input-file ==
|
|
||||||
char *ifs_file_name = "<CURSOR>"; /* 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);
|
|
||||||
}
|
|
||||||
<SPLIT>{-continue here-}
|
|
||||||
ifs.close (); /* close ifstream */
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.open-output-file ==
|
|
||||||
char *ofs_file_name = "<CURSOR>"; /* 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);
|
|
||||||
}
|
|
||||||
<SPLIT>{-continue here-}
|
|
||||||
ofs.close (); /* close ofstream */
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.namespace-std ==
|
|
||||||
using namespace std;
|
|
||||||
== cpp.namespace ==
|
|
||||||
using namespace |?NAMESPACE|;
|
|
||||||
== cpp.namespace-block ==
|
|
||||||
namespace |?NAMESPACE| {<CURSOR>
|
|
||||||
<SPLIT>} /* ----- end of namespace |NAMESPACE| ----- */
|
|
||||||
== cpp.namespace-alias ==
|
|
||||||
namespace |?NAMESPACE_ALIAS| = {-original namespace name-};
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.rtti-typeid == insert ==
|
|
||||||
typeid(<CURSOR><SPLIT>)
|
|
||||||
$
|
|
||||||
== cpp.rtti-static-cast == insert ==
|
|
||||||
static_cast<>(<CURSOR><SPLIT>)
|
|
||||||
$
|
|
||||||
== cpp.rtti-const-cast == insert ==
|
|
||||||
const_cast<>(<CURSOR><SPLIT>)
|
|
||||||
$
|
|
||||||
== cpp.rtti-reinterpret-cast == insert ==
|
|
||||||
reinterpret_cast<>(<CURSOR><SPLIT>)
|
|
||||||
$
|
|
||||||
== cpp.rtti-dynamic-cast == insert ==
|
|
||||||
dynamic_cast<>(<CURSOR><SPLIT>)
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
@ -1,133 +0,0 @@
|
|||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== idioms.function ==
|
|
||||||
/*
|
|
||||||
* === FUNCTION ======================================================================
|
|
||||||
* Name: |?FUNCTION_NAME|
|
|
||||||
* Description:
|
|
||||||
* =====================================================================================
|
|
||||||
*/
|
|
||||||
void<CURSOR>
|
|
||||||
|FUNCTION_NAME| ( <+argument list+> )
|
|
||||||
{
|
|
||||||
<SPLIT> return <+return value+>;
|
|
||||||
} /* ----- end of function |FUNCTION_NAME| ----- */
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== idioms.function-static ==
|
|
||||||
/*
|
|
||||||
* === FUNCTION ======================================================================
|
|
||||||
* Name: |?FUNCTION_NAME|
|
|
||||||
* Description:
|
|
||||||
* =====================================================================================
|
|
||||||
*/
|
|
||||||
static void<CURSOR>
|
|
||||||
|FUNCTION_NAME| ( <+argument list+> )
|
|
||||||
{
|
|
||||||
<SPLIT> return <+return value+>;
|
|
||||||
} /* ----- end of static function |FUNCTION_NAME| ----- */
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== idioms.main ==
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* === FUNCTION ======================================================================
|
|
||||||
* Name: main
|
|
||||||
* Description:
|
|
||||||
* =====================================================================================
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
main ( int argc, char *argv[] )
|
|
||||||
{<CURSOR>
|
|
||||||
<SPLIT> return EXIT_SUCCESS;
|
|
||||||
} /* ---------- end of function main ---------- */
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== idioms.enum ==
|
|
||||||
enum |?ENUM_NAME| {<CURSOR>
|
|
||||||
<SPLIT>}; /* ---------- end of enum |ENUM_NAME| ---------- */
|
|
||||||
|
|
||||||
typedef enum |ENUM_NAME| |ENUM_NAME:c|;
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== idioms.struct ==
|
|
||||||
struct |?STRUCT_NAME| {<CURSOR>
|
|
||||||
<SPLIT>}; /* ---------- end of struct |STRUCT_NAME| ---------- */
|
|
||||||
|
|
||||||
typedef struct |STRUCT_NAME| |STRUCT_NAME:c|;
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== idioms.union ==
|
|
||||||
union |?UNION_NAME| {<CURSOR>
|
|
||||||
<SPLIT>}; /* ---------- end of union |UNION_NAME| ---------- */
|
|
||||||
|
|
||||||
typedef union |UNION_NAME| |UNION_NAME:c|;
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== idioms.printf == insert ==
|
|
||||||
printf ( "<CURSOR>\n" );
|
|
||||||
== idioms.scanf == insert ==
|
|
||||||
scanf ( "<CURSOR>", & );
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== idioms.calloc ==
|
|
||||||
|?POINTER| = calloc ( (size_t)(<CURSOR><+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(<CURSOR><+TYPE+>) );
|
|
||||||
if ( |POINTER|==NULL ) {
|
|
||||||
fprintf ( stderr, "\ndynamic memory allocation failed\n" );
|
|
||||||
exit (EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
free (|POINTER|);
|
|
||||||
|POINTER| = NULL;
|
|
||||||
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== idioms.sizeof == insert ==
|
|
||||||
sizeof(<CURSOR><SPLIT>)
|
|
||||||
== idioms.assert == insert ==
|
|
||||||
assert(<CURSOR><SPLIT>);
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== idioms.open-input-file ==
|
|
||||||
FILE *|?FILEPOINTER|; /* input-file pointer */
|
|
||||||
char *|FILEPOINTER|_file_name = "<CURSOR>"; /* 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);
|
|
||||||
}
|
|
||||||
<SPLIT>{-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 = "<CURSOR>"; /* 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);
|
|
||||||
}
|
|
||||||
<SPLIT>{-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|, "<CURSOR>\n", );
|
|
||||||
== idioms.fscanf == insert ==
|
|
||||||
fscanf ( |?FILEPOINTER|, "<CURSOR>", & );
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
@ -1,49 +0,0 @@
|
|||||||
$-------------------------------------------------------------------------
|
|
||||||
== preprocessor.include-global ==
|
|
||||||
#include <<CURSOR>>
|
|
||||||
$-------------------------------------------------------------------------
|
|
||||||
== preprocessor.include-local ==
|
|
||||||
#include "<CURSOR>"
|
|
||||||
$-------------------------------------------------------------------------
|
|
||||||
== preprocessor.define ==
|
|
||||||
#define <CURSOR> /* */
|
|
||||||
$-------------------------------------------------------------------------
|
|
||||||
== preprocessor.undefine ==
|
|
||||||
#undef <CURSOR> /* */
|
|
||||||
$-------------------------------------------------------------------------
|
|
||||||
== preprocessor.if-else-endif ==
|
|
||||||
#if |?CONDITION:u|
|
|
||||||
<CURSOR><SPLIT>
|
|
||||||
#else /* ----- not |CONDITION| ----- */
|
|
||||||
<+ELSE PART+>
|
|
||||||
#endif /* ----- not |CONDITION| ----- */
|
|
||||||
$-------------------------------------------------------------------------
|
|
||||||
== preprocessor.ifdef-else-endif ==
|
|
||||||
#ifdef |?CONDITION:u|
|
|
||||||
<CURSOR><SPLIT>
|
|
||||||
#else /* ----- not |CONDITION| ----- */
|
|
||||||
<+ELSE PART+>
|
|
||||||
#endif /* ----- not |CONDITION| ----- */
|
|
||||||
$-------------------------------------------------------------------------
|
|
||||||
== preprocessor.ifndef-else-endif ==
|
|
||||||
#ifndef |?CONDITION:u|
|
|
||||||
<CURSOR><SPLIT>
|
|
||||||
#else /* ----- not |CONDITION| ----- */
|
|
||||||
<+ELSE PART+>
|
|
||||||
#endif /* ----- not |CONDITION| ----- */
|
|
||||||
$-------------------------------------------------------------------------
|
|
||||||
== preprocessor.ifndef-def-endif ==
|
|
||||||
#ifndef |?BASENAME:L|_INC
|
|
||||||
#define |BASENAME|_INC
|
|
||||||
<CURSOR><SPLIT>
|
|
||||||
#endif /* ----- #ifndef |BASENAME|_INC ----- */
|
|
||||||
$-------------------------------------------------------------------------
|
|
||||||
== preprocessor.error ==
|
|
||||||
#error "<CURSOR>" /* */
|
|
||||||
$-------------------------------------------------------------------------
|
|
||||||
== preprocessor.line ==
|
|
||||||
#line <CURSOR> /* */
|
|
||||||
$-------------------------------------------------------------------------
|
|
||||||
== preprocessor.pragma ==
|
|
||||||
#pragma <CURSOR> /* */
|
|
||||||
$-------------------------------------------------------------------------
|
|
@ -1,69 +0,0 @@
|
|||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.do-while ==
|
|
||||||
do {
|
|
||||||
<SPLIT>} while ( <CURSOR> ); /* ----- end do-while ----- */
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.for ==
|
|
||||||
for ( <CURSOR>; ; )
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.for-block ==
|
|
||||||
for ( <CURSOR>; ; ) {
|
|
||||||
<SPLIT>}
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.if ==
|
|
||||||
if ( <CURSOR> )
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.if-block ==
|
|
||||||
if ( <CURSOR> ) {
|
|
||||||
<SPLIT><-IF PART->
|
|
||||||
}
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.if-else ==
|
|
||||||
if ( <CURSOR> )
|
|
||||||
<SPLIT>else
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.if-block-else ==
|
|
||||||
if ( <CURSOR> ) {
|
|
||||||
<SPLIT><-IF PART->
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
<-ELSE PART->
|
|
||||||
}
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.else-block ==
|
|
||||||
else {
|
|
||||||
<CURSOR><SPLIT>
|
|
||||||
}
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.while ==
|
|
||||||
while ( <CURSOR> )
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.while-block ==
|
|
||||||
while ( <CURSOR> ) {
|
|
||||||
<SPLIT>}
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.switch ==
|
|
||||||
switch ( <CURSOR> ) {
|
|
||||||
case <-LABEL->:
|
|
||||||
<SPLIT>break;
|
|
||||||
|
|
||||||
case <-LABEL->:
|
|
||||||
break;
|
|
||||||
|
|
||||||
case <-LABEL->:
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
} /* ----- end switch ----- */
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.case ==
|
|
||||||
case <CURSOR>:
|
|
||||||
break;
|
|
||||||
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.block ==
|
|
||||||
{
|
|
||||||
<CURSOR><SPLIT>
|
|
||||||
}
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
@ -1,168 +0,0 @@
|
|||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== comment.end-of-line-comment == append ==
|
|
||||||
// <CURSOR>
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== comment.frame ==
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
// <CURSOR>
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== comment.function ==
|
|
||||||
// === FUNCTION ======================================================================
|
|
||||||
// Name: |?FUNCTION_NAME|
|
|
||||||
// Description: <CURSOR>
|
|
||||||
// =====================================================================================
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== comment.method ==
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
// Class: |?CLASSNAME|
|
|
||||||
// Method: |?METHODNAME|
|
|
||||||
// Description: <CURSOR>
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== comment.class ==
|
|
||||||
// =====================================================================================
|
|
||||||
// Class: |?CLASSNAME|
|
|
||||||
// Description: <CURSOR>
|
|
||||||
// =====================================================================================
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== comment.file-description == start ==
|
|
||||||
// =====================================================================================
|
|
||||||
//
|
|
||||||
// Filename: |FILENAME|
|
|
||||||
//
|
|
||||||
// Description: <CURSOR>
|
|
||||||
//
|
|
||||||
// Version: 1.0
|
|
||||||
// Created: |DATE| |TIME|
|
|
||||||
// Revision: none
|
|
||||||
// Compiler: g++
|
|
||||||
//
|
|
||||||
// Author: |AUTHOR| (|AUTHORREF|), |EMAIL|
|
|
||||||
// Company: |COMPANY|
|
|
||||||
//
|
|
||||||
// =====================================================================================
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== comment.file-description-header == start ==
|
|
||||||
// =====================================================================================
|
|
||||||
//
|
|
||||||
// Filename: |FILENAME|
|
|
||||||
//
|
|
||||||
// Description: <CURSOR>
|
|
||||||
//
|
|
||||||
// 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|: <CURSOR>
|
|
||||||
== comment.keyword-compiler == append ==
|
|
||||||
// :COMPILER:|DATE| |TIME|:|AUTHORREF|: <CURSOR>
|
|
||||||
== comment.keyword-todo == append ==
|
|
||||||
// :TODO:|DATE| |TIME|:|AUTHORREF|: <CURSOR>
|
|
||||||
== comment.keyword-tricky == append ==
|
|
||||||
// :TRICKY:|DATE| |TIME|:|AUTHORREF|: <CURSOR>
|
|
||||||
== comment.keyword-warning == append ==
|
|
||||||
// :WARNING:|DATE| |TIME|:|AUTHORREF|: <CURSOR>
|
|
||||||
== comment.keyword-workaround == append ==
|
|
||||||
// :WORKAROUND:|DATE| |TIME|:|AUTHORREF|: <CURSOR>
|
|
||||||
== comment.keyword-keyword == append ==
|
|
||||||
// :|?KEYWORD:u|:|DATE| |TIME|:|AUTHORREF|: <CURSOR>
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== comment.special-empty == append ==
|
|
||||||
// EMPTY<CURSOR>
|
|
||||||
== comment.special-fall-through == append ==
|
|
||||||
// FALL THROUGH<CURSOR>
|
|
||||||
== comment.special-implicit-type-conversion == append ==
|
|
||||||
// IMPLICIT TYPE CONVERSION<CURSOR>
|
|
||||||
== comment.special-no-return == append ==
|
|
||||||
// NO RETURN<CURSOR>
|
|
||||||
== comment.special-not-reached == append ==
|
|
||||||
// NOT REACHED<CURSOR>
|
|
||||||
== comment.special-remains-to-be-implemented == append ==
|
|
||||||
// REMAINS TO BE IMPLEMENTED<CURSOR>
|
|
||||||
== comment.special-constant-type-is-long == append ==
|
|
||||||
// constant type is long<CURSOR>
|
|
||||||
== comment.special-constant-type-is-unsigned == append ==
|
|
||||||
// constant type is unsigned<CURSOR>
|
|
||||||
== comment.special-constant-type-is-unsigned-long == append ==
|
|
||||||
// constant type is unsigned long<CURSOR>
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
@ -1,450 +0,0 @@
|
|||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
$
|
|
||||||
== cpp.cin ==
|
|
||||||
cin >> <CURSOR>;
|
|
||||||
$
|
|
||||||
== cpp.cout ==
|
|
||||||
cout << <CURSOR> << endl;
|
|
||||||
$
|
|
||||||
== cpp.cout-operator == insert ==
|
|
||||||
<< "<CURSOR>"
|
|
||||||
$
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.output-manipulator-boolalpha == insert ==
|
|
||||||
<< boolalpha <CURSOR>
|
|
||||||
== cpp.output-manipulator-dec == insert ==
|
|
||||||
<< dec <CURSOR>
|
|
||||||
== cpp.output-manipulator-endl == insert ==
|
|
||||||
<< endl <CURSOR>
|
|
||||||
== cpp.output-manipulator-fixed == insert ==
|
|
||||||
<< fixed <CURSOR>
|
|
||||||
== cpp.output-manipulator-flush == insert ==
|
|
||||||
<< flush <CURSOR>
|
|
||||||
== cpp.output-manipulator-hex == insert ==
|
|
||||||
<< hex <CURSOR>
|
|
||||||
== cpp.output-manipulator-internal == insert ==
|
|
||||||
<< internal <CURSOR>
|
|
||||||
== cpp.output-manipulator-left == insert ==
|
|
||||||
<< left <CURSOR>
|
|
||||||
== cpp.output-manipulator-oct == insert ==
|
|
||||||
<< oct <CURSOR>
|
|
||||||
== cpp.output-manipulator-right == insert ==
|
|
||||||
<< right <CURSOR>
|
|
||||||
== cpp.output-manipulator-scientific == insert ==
|
|
||||||
<< scientific <CURSOR>
|
|
||||||
== cpp.output-manipulator-setbase == insert ==
|
|
||||||
<< setbase(10<CURSOR>)
|
|
||||||
== cpp.output-manipulator-setfill == insert ==
|
|
||||||
<< setfill(<CURSOR>)
|
|
||||||
== cpp.output-manipulator-setiosflag == insert ==
|
|
||||||
<< setiosflags(<CURSOR>)
|
|
||||||
== cpp.output-manipulator-setprecision == insert ==
|
|
||||||
<< setprecision(6<CURSOR>)
|
|
||||||
== cpp.output-manipulator-setw == insert ==
|
|
||||||
<< setw(0<CURSOR>)
|
|
||||||
== cpp.output-manipulator-showbase == insert ==
|
|
||||||
<< showbase <CURSOR>
|
|
||||||
== cpp.output-manipulator-showpoint == insert ==
|
|
||||||
<< showpoint <CURSOR>
|
|
||||||
== cpp.output-manipulator-showpos == insert ==
|
|
||||||
<< showpos <CURSOR>
|
|
||||||
== cpp.output-manipulator-uppercase == insert ==
|
|
||||||
<< uppercase <CURSOR>
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.method-implementation ==
|
|
||||||
void<CURSOR>
|
|
||||||
|?CLASSNAME|::|?METHODNAME| ( <+argument list+> )
|
|
||||||
{
|
|
||||||
return ;
|
|
||||||
} // ----- end of method |CLASSNAME|::|METHODNAME| -----
|
|
||||||
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.accessor-implementation ==
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
// Class: |?CLASSNAME|
|
|
||||||
// Method: get_|?ATTRIBUTE|
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
inline int<CURSOR>
|
|
||||||
|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: <CURSOR>
|
|
||||||
// =====================================================================================
|
|
||||||
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| ()
|
|
||||||
{<CURSOR>
|
|
||||||
} // ----- end of method |CLASSNAME|::|CLASSNAME| (constructor) -----
|
|
||||||
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.class-using-new-definition ==
|
|
||||||
// =====================================================================================
|
|
||||||
// Class: |?CLASSNAME:c|
|
|
||||||
// Description: <CURSOR>
|
|
||||||
// =====================================================================================
|
|
||||||
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| ()
|
|
||||||
{<CURSOR>
|
|
||||||
} // ----- 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: <CURSOR>
|
|
||||||
// =====================================================================================
|
|
||||||
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<CURSOR> |?CLASSNAME|<T>::|?METHODNAME| ( <+argument list+> )
|
|
||||||
{
|
|
||||||
return ;
|
|
||||||
} // ----- end of method |CLASSNAME|<T>::|METHODNAME| -----
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.template-accessor-implementation ==
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
// Class: |?CLASSNAME|
|
|
||||||
// Method: get_|?ATTRIBUTE|
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
template < class T >
|
|
||||||
inline int<CURSOR> |CLASSNAME|<T>::get_|ATTRIBUTE| ( )
|
|
||||||
{
|
|
||||||
return |ATTRIBUTE|;
|
|
||||||
} // ----- end of method |CLASSNAME|<T>::get_|ATTRIBUTE| -----
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
// Class: |CLASSNAME|
|
|
||||||
// Method: set_|ATTRIBUTE|
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
template < class T >
|
|
||||||
inline void |CLASSNAME|<T>::set_|ATTRIBUTE| ( <+argument list+> )
|
|
||||||
{
|
|
||||||
|ATTRIBUTE| = value;
|
|
||||||
return ;
|
|
||||||
} // ----- end of method |CLASSNAME|<T>::set_|ATTRIBUTE| -----
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.template-class-definition ==
|
|
||||||
// =====================================================================================
|
|
||||||
// Class: |?CLASSNAME:c|
|
|
||||||
// Description: <CURSOR>
|
|
||||||
// =====================================================================================
|
|
||||||
|
|
||||||
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| <T>:: |CLASSNAME| ()
|
|
||||||
{<CURSOR>
|
|
||||||
} // ----- end of constructor of template class |CLASSNAME| -----
|
|
||||||
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.template-class-using-new-definition ==
|
|
||||||
// =====================================================================================
|
|
||||||
// Class: |?CLASSNAME:c|
|
|
||||||
// Description: <CURSOR>
|
|
||||||
// =====================================================================================
|
|
||||||
|
|
||||||
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|<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 )
|
|
||||||
{<CURSOR>
|
|
||||||
} // ----- 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 )
|
|
||||||
{
|
|
||||||
if ( this != &other ) {
|
|
||||||
}
|
|
||||||
return *this;
|
|
||||||
} // ----- end of assignment operator of template class |CLASSNAME| -----
|
|
||||||
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.template-function ==
|
|
||||||
template <class T>
|
|
||||||
void<CURSOR> |?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.<CURSOR> ;
|
|
||||||
return os;
|
|
||||||
} // ----- end of function operator << -----
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.operator-out ==
|
|
||||||
istream &
|
|
||||||
operator >> ( istream & is, |?CLASSNAME| & obj )
|
|
||||||
{
|
|
||||||
is >> obj.<CURSOR> ;
|
|
||||||
return is;
|
|
||||||
} // ----- end of function operator >> -----
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.try-catch ==
|
|
||||||
try {
|
|
||||||
<SPLIT>}
|
|
||||||
catch ( const <CURSOR> &ExceptObj ) { // handle exception:
|
|
||||||
}
|
|
||||||
catch (...) { // handle exception: unspecified
|
|
||||||
}
|
|
||||||
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.catch ==
|
|
||||||
catch ( <CURSOR>const &ExceptObj ) { // handle exception:
|
|
||||||
<SPLIT>}
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.catch-points ==
|
|
||||||
catch (...) { // handle exception:
|
|
||||||
<SPLIT>}
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.extern ==
|
|
||||||
extern "C" {<CURSOR>
|
|
||||||
<SPLIT>}
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.open-input-file ==
|
|
||||||
string ifs_file_name = "<CURSOR>"; // 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);
|
|
||||||
}
|
|
||||||
<SPLIT>{-continue here-}
|
|
||||||
ifs.close (); // close ifstream
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.open-output-file ==
|
|
||||||
string ofs_file_name = "<CURSOR>"; // 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);
|
|
||||||
}
|
|
||||||
<SPLIT>{-continue here-}
|
|
||||||
ofs.close (); // close ofstream
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.namespace-std ==
|
|
||||||
using namespace std;
|
|
||||||
== cpp.namespace ==
|
|
||||||
using namespace |?NAMESPACE|;
|
|
||||||
== cpp.namespace-block ==
|
|
||||||
namespace |?NAMESPACE| {<CURSOR>
|
|
||||||
<SPLIT>} // ----- end of namespace |NAMESPACE| -----
|
|
||||||
== cpp.namespace-alias ==
|
|
||||||
namespace |?NAMESPACE_ALIAS| = {-original namespace name-};
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== cpp.rtti-typeid == insert ==
|
|
||||||
typeid(<CURSOR><SPLIT>)
|
|
||||||
$
|
|
||||||
== cpp.rtti-static-cast == insert ==
|
|
||||||
static_cast<>(<CURSOR><SPLIT>)
|
|
||||||
$
|
|
||||||
== cpp.rtti-const-cast == insert ==
|
|
||||||
const_cast<>(<CURSOR><SPLIT>)
|
|
||||||
$
|
|
||||||
== cpp.rtti-reinterpret-cast == insert ==
|
|
||||||
reinterpret_cast<>(<CURSOR><SPLIT>)
|
|
||||||
$
|
|
||||||
== cpp.rtti-dynamic-cast == insert ==
|
|
||||||
dynamic_cast<>(<CURSOR><SPLIT>)
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
@ -1,109 +0,0 @@
|
|||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== idioms.function ==
|
|
||||||
void<CURSOR>
|
|
||||||
|?FUNCTION_NAME| ( <+argument list+> )
|
|
||||||
{
|
|
||||||
<SPLIT> return <+return value+>;
|
|
||||||
} // ----- end of function |FUNCTION_NAME| -----
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== idioms.function-static ==
|
|
||||||
static void<CURSOR>
|
|
||||||
|?FUNCTION_NAME| ( <+argument list+> )
|
|
||||||
{
|
|
||||||
<SPLIT> return <+return value+>;
|
|
||||||
} // ----- end of static function |FUNCTION_NAME| -----
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== idioms.main ==
|
|
||||||
#include <cstdlib>
|
|
||||||
|
|
||||||
int
|
|
||||||
main ( int argc, char *argv[] )
|
|
||||||
{<CURSOR>
|
|
||||||
<SPLIT> return EXIT_SUCCESS;
|
|
||||||
} // ---------- end of function main ----------
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== idioms.enum ==
|
|
||||||
enum |?ENUM_NAME| {<CURSOR>
|
|
||||||
<SPLIT>}; // ---------- end of enum |ENUM_NAME| ----------
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== idioms.struct ==
|
|
||||||
struct |?STRUCT_NAME| {<CURSOR>
|
|
||||||
<SPLIT>}; // ---------- end of struct |STRUCT_NAME| ----------
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== idioms.union ==
|
|
||||||
union |?UNION_NAME| {<CURSOR>
|
|
||||||
<SPLIT>}; // ---------- end of union |UNION_NAME| ----------
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== idioms.printf == insert ==
|
|
||||||
printf ( "<CURSOR>\n" );
|
|
||||||
== idioms.scanf == insert ==
|
|
||||||
scanf ( "<CURSOR>", & );
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== idioms.calloc ==
|
|
||||||
|?POINTER| = calloc ( (size_t)(<CURSOR><+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(<CURSOR><+TYPE+>) );
|
|
||||||
if ( |POINTER|==NULL ) {
|
|
||||||
fprintf ( stderr, "\ndynamic memory allocation failed\n" );
|
|
||||||
exit (EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
free (|POINTER|);
|
|
||||||
|POINTER| = NULL;
|
|
||||||
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== idioms.sizeof == insert ==
|
|
||||||
sizeof(<CURSOR><SPLIT>)
|
|
||||||
== idioms.assert == insert ==
|
|
||||||
assert(<CURSOR><SPLIT>);
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== idioms.open-input-file ==
|
|
||||||
FILE *|?FILEPOINTER|; // input-file pointer
|
|
||||||
char *|FILEPOINTER|_file_name = "<CURSOR>"; // 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);
|
|
||||||
}
|
|
||||||
<SPLIT>{-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 = "<CURSOR>"; // 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);
|
|
||||||
}
|
|
||||||
<SPLIT>{-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|, "<CURSOR>\n", );
|
|
||||||
== idioms.fscanf == insert ==
|
|
||||||
fscanf ( |?FILEPOINTER|, "<CURSOR>", & );
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
@ -1,50 +0,0 @@
|
|||||||
$-------------------------------------------------------------------------
|
|
||||||
== preprocessor.include-global ==
|
|
||||||
#include <<CURSOR>>
|
|
||||||
$-------------------------------------------------------------------------
|
|
||||||
== preprocessor.include-local ==
|
|
||||||
#include "<CURSOR>"
|
|
||||||
$-------------------------------------------------------------------------
|
|
||||||
== preprocessor.define ==
|
|
||||||
#define <CURSOR> //
|
|
||||||
$-------------------------------------------------------------------------
|
|
||||||
== preprocessor.undefine ==
|
|
||||||
#undef <CURSOR> //
|
|
||||||
$-------------------------------------------------------------------------
|
|
||||||
== preprocessor.if-else-endif ==
|
|
||||||
#if |?CONDITION:u|
|
|
||||||
<CURSOR><SPLIT>
|
|
||||||
#else // ----- not |CONDITION| -----
|
|
||||||
<+ELSE PART+>
|
|
||||||
|
|
||||||
#endif // ----- not |CONDITION| -----
|
|
||||||
$-------------------------------------------------------------------------
|
|
||||||
== preprocessor.ifdef-else-endif ==
|
|
||||||
#ifdef |?CONDITION:u|
|
|
||||||
<CURSOR><SPLIT>
|
|
||||||
#else // ----- not |CONDITION| -----
|
|
||||||
<+ELSE PART+>
|
|
||||||
#endif // ----- not |CONDITION| -----
|
|
||||||
$-------------------------------------------------------------------------
|
|
||||||
== preprocessor.ifndef-else-endif ==
|
|
||||||
#ifndef |?CONDITION:u|
|
|
||||||
<CURSOR><SPLIT>
|
|
||||||
#else // ----- not |CONDITION| -----
|
|
||||||
<+ELSE PART+>
|
|
||||||
#endif // ----- not |CONDITION| -----
|
|
||||||
$-------------------------------------------------------------------------
|
|
||||||
== preprocessor.ifndef-def-endif ==
|
|
||||||
#ifndef |?BASENAME:L|_INC
|
|
||||||
#define |BASENAME|_INC
|
|
||||||
<CURSOR><SPLIT>
|
|
||||||
#endif // ----- #ifndef |BASENAME|_INC -----
|
|
||||||
$-------------------------------------------------------------------------
|
|
||||||
== preprocessor.error ==
|
|
||||||
#error "<CURSOR>" //
|
|
||||||
$-------------------------------------------------------------------------
|
|
||||||
== preprocessor.line ==
|
|
||||||
#line <CURSOR> //
|
|
||||||
$-------------------------------------------------------------------------
|
|
||||||
== preprocessor.pragma ==
|
|
||||||
#pragma <CURSOR> //
|
|
||||||
$-------------------------------------------------------------------------
|
|
@ -1,72 +0,0 @@
|
|||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.do-while ==
|
|
||||||
do {
|
|
||||||
<SPLIT>} while ( <CURSOR> ); // ----- end do-while -----
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.for ==
|
|
||||||
for ( <CURSOR>; ; )
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.for-block ==
|
|
||||||
for ( <CURSOR>; ; ) {
|
|
||||||
<SPLIT>}
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.if ==
|
|
||||||
if ( <CURSOR> )
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.if-block ==
|
|
||||||
if ( <CURSOR> ) {
|
|
||||||
<SPLIT><-IF PART->
|
|
||||||
}
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.if-else ==
|
|
||||||
if ( <CURSOR> )
|
|
||||||
<SPLIT>else
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.if-block-else ==
|
|
||||||
if ( <CURSOR> ) {
|
|
||||||
<SPLIT><-IF PART->
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
<+ELSE PART+>
|
|
||||||
}
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.else-block ==
|
|
||||||
else {
|
|
||||||
<CURSOR><SPLIT>
|
|
||||||
}
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.while ==
|
|
||||||
while ( <CURSOR> )
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.while-block ==
|
|
||||||
while ( <CURSOR> ) {
|
|
||||||
<SPLIT>}
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.switch ==
|
|
||||||
switch ( <CURSOR> ) {
|
|
||||||
case 1:
|
|
||||||
<SPLIT>break;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
} // ----- end switch -----
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.case ==
|
|
||||||
case <CURSOR>:
|
|
||||||
break;
|
|
||||||
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
== statements.block ==
|
|
||||||
{
|
|
||||||
<CURSOR><SPLIT>
|
|
||||||
}
|
|
||||||
$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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ファイルをランタイムディレクトリに展開します。
|
|
||||||
|
|
||||||
以下のようにファイルが配置されるはずです。
|
|
||||||
>
|
|
||||||
<your runtime directory>/plugin/acp.vim
|
|
||||||
<your runtime directory>/doc/acp.txt
|
|
||||||
...
|
|
||||||
<
|
|
||||||
もしランタイムディレクトリが他のプラグインとごた混ぜになるのが嫌なら、ファイル
|
|
||||||
を新規ディレクトリに配置し、そのディレクトリのパスを 'runtimepath' に追加して
|
|
||||||
ください。アンインストールも楽になります。
|
|
||||||
|
|
||||||
その後 FuzzyFinder のヘルプを有効にするためにタグファイルを更新してください。
|
|
||||||
詳しくは|add-local-help|を参照してください。
|
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
使い方 *acp-usage*
|
|
||||||
|
|
||||||
このプラグインがインストールされていれば、自動ポップアップは vim の開始時から
|
|
||||||
有効になります。
|
|
||||||
|
|
||||||
カーソル直前のテキストに応じて、利用する補完の種類を切り替えます。デフォルトの
|
|
||||||
補完動作は次の通りです:
|
|
||||||
|
|
||||||
補完モード filetype カーソル直前のテキスト ~
|
|
||||||
キーワード補完 * 2文字のキーワード文字
|
|
||||||
ファイル名補完 * ファイル名文字 + パスセパレータ
|
|
||||||
+ 0文字以上のファイル名文字
|
|
||||||
オムニ補完 ruby ".", "::" or 単語を構成する文字以外 + ":"
|
|
||||||
オムニ補完 python "."
|
|
||||||
オムニ補完 xml "<", "</" or ("<" + ">"以外の文字列 + " ")
|
|
||||||
オムニ補完 html/xhtml "<", "</" or ("<" + ">"以外の文字列 + " ")
|
|
||||||
オムニ補完 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 = "\<C-n>"
|
|
||||||
<
|
|
||||||
キーワード補完のコマンド。このオプションには普通 "\<C-n>" か "\<C-p>"
|
|
||||||
を設定します。
|
|
||||||
|
|
||||||
*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" が "<C-x><C-u>" のときだけ
|
|
||||||
意味があります。
|
|
||||||
|
|
||||||
"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 <ns9tks@DELETE-ME.gmail.com>
|
|
||||||
ライセンス: 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:
|
|
||||||
|
|
@ -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:
|
|
||||||
>
|
|
||||||
<your runtime directory>/plugin/acp.vim
|
|
||||||
<your runtime directory>/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 "<", "</" or ("<" + non-">" characters + " ")
|
|
||||||
Omni html/xhtml "<", "</" or ("<" + non-">" 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 = "\<C-n>"
|
|
||||||
<
|
|
||||||
Command for keyword completion. This option is usually set "\<C-n>" or
|
|
||||||
"\<C-p>".
|
|
||||||
|
|
||||||
*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 "<C-x><C-u>".
|
|
||||||
|
|
||||||
"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 <BS> 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 "\<C-p>" cause a problem which inserts a match without
|
|
||||||
<CR> 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 "\<C-n>".
|
|
||||||
- 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 <C-p> or <C-x><C-p>, the command to
|
|
||||||
restore the original text (in on_popup_post()) must be reverted, too.
|
|
||||||
- BUG: When using a custom completion function (<C-x><C-u>) 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 <C-X><C-...> 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 <ns9tks@DELETE-ME.gmail.com>
|
|
||||||
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:
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -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 <tab>.
|
|
||||||
|
|
||||||
For instance, in a C file using the default installation of snipMate.vim, if
|
|
||||||
you type "for<tab>" 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 <tab> 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 <shift-tab>.
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
SYNTAX *snippet-syntax*
|
|
||||||
|
|
||||||
Snippets can be defined in two ways. They can be in their own file, named
|
|
||||||
after their trigger in 'snippets/<filetype>/<trigger>.snippet', or they can be
|
|
||||||
defined together in a 'snippets/<filetype>.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 <div> tag, and then allow
|
|
||||||
the user to press <tab> to go to the middle of it:
|
|
||||||
>
|
|
||||||
snippet div
|
|
||||||
<div id="${1}">
|
|
||||||
${2}
|
|
||||||
</div>
|
|
||||||
<
|
|
||||||
*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 <tab> 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
|
|
||||||
<option value="${1:option}">${2:$1}</option>
|
|
||||||
|
|
||||||
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<tab>" 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/<filetype>/<trigger>/<name>.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/<filetype>/<trigger>.snippet'. If the snippet has
|
|
||||||
multiple matches, it should look like this:
|
|
||||||
'snippets/<filetype>/<trigger>/<name>.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_<Tab>*
|
|
||||||
If you would like to see what snippets are available, simply type <c-r><tab>
|
|
||||||
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 <tab> <c-r>=TriggerSnippet()<cr>
|
|
||||||
snor <tab> <esc>i<right><c-r>=TriggerSnippet()<cr>
|
|
||||||
|
|
||||||
to this: >
|
|
||||||
ino <c-j> <c-r>=TriggerSnippet()<cr>
|
|
||||||
snor <c-j> <esc>i<right><c-r>=TriggerSnippet()<cr>
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
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] <shift-tab> 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.: >
|
|
||||||
|
|
||||||
'<div${1: id="${2:some_id}}">${3}</div>'
|
|
||||||
<
|
|
||||||
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 <tab>, 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 <at> gmail <dot> com
|
|
||||||
|
|
||||||
I greatly appreciate any suggestions or improvements offered for the script.
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
|
|
||||||
vim:tw=78:ts=8:ft=help:norl:
|
|
File diff suppressed because it is too large
Load Diff
@ -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_<Tab> snipMate.txt /*i_CTRL-R_<Tab>*
|
|
||||||
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*
|
|
@ -1,2 +0,0 @@
|
|||||||
" Jade
|
|
||||||
autocmd BufNewFile,BufReadPost *.jade set filetype=jade
|
|
@ -1,436 +0,0 @@
|
|||||||
" ------------------------------------------------------------------------------
|
|
||||||
"
|
|
||||||
" Vim filetype plugin file
|
|
||||||
"
|
|
||||||
" Language : C / C++
|
|
||||||
" Plugin : c.vim
|
|
||||||
" Maintainer : Fritz Mehner <mehner@fh-swf.de>
|
|
||||||
" 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 <buffer> <silent> <A-F9> :call C_Compile()<CR>:call C_HlMessage()<CR>
|
|
||||||
imap <buffer> <silent> <A-F9> <C-C>:call C_Compile()<CR>:call C_HlMessage()<CR>
|
|
||||||
"
|
|
||||||
map <buffer> <silent> <F9> :call C_Link()<CR>:call C_HlMessage()<CR>
|
|
||||||
imap <buffer> <silent> <F9> <C-C>:call C_Link()<CR>:call C_HlMessage()<CR>
|
|
||||||
"
|
|
||||||
map <buffer> <silent> <C-F9> :call C_Run()<CR>
|
|
||||||
imap <buffer> <silent> <C-F9> <C-C>:call C_Run()<CR>
|
|
||||||
"
|
|
||||||
map <buffer> <silent> <S-F9> :call C_Arguments()<CR>
|
|
||||||
imap <buffer> <silent> <S-F9> <C-C>:call C_Arguments()<CR>
|
|
||||||
"
|
|
||||||
" ---------- alternate file plugin (a.vim) ----------------------
|
|
||||||
"
|
|
||||||
if exists("loaded_alternateFile")
|
|
||||||
map <buffer> <silent> <S-F2> :A<CR>
|
|
||||||
imap <buffer> <silent> <S-F2> <C-C>:A<CR>
|
|
||||||
endif
|
|
||||||
"
|
|
||||||
command! -nargs=1 -complete=customlist,C_CFileSectionList CFileSection call C_CFileSectionListInsert (<f-args>)
|
|
||||||
command! -nargs=1 -complete=customlist,C_HFileSectionList HFileSection call C_HFileSectionListInsert (<f-args>)
|
|
||||||
command! -nargs=1 -complete=customlist,C_KeywordCommentList KeywordComment call C_KeywordCommentListInsert (<f-args>)
|
|
||||||
command! -nargs=1 -complete=customlist,C_SpecialCommentList SpecialComment call C_SpecialCommentListInsert (<f-args>)
|
|
||||||
command! -nargs=1 -complete=customlist,C_StdLibraryIncludesList IncludeStdLibrary call C_StdLibraryIncludesInsert (<f-args>)
|
|
||||||
command! -nargs=1 -complete=customlist,C_C99LibraryIncludesList IncludeC99Library call C_C99LibraryIncludesInsert (<f-args>)
|
|
||||||
command! -nargs=1 -complete=customlist,C_CppLibraryIncludesList IncludeCppLibrary call C_CppLibraryIncludesInsert (<f-args>)
|
|
||||||
command! -nargs=1 -complete=customlist,C_CppCLibraryIncludesList IncludeCppCLibrary call C_CppCLibraryIncludesInsert(<f-args>)
|
|
||||||
command! -nargs=1 -complete=customlist,C_StyleList CStyle call C_Style (<f-args>)
|
|
||||||
|
|
||||||
" ---------- KEY MAPPINGS : MENU ENTRIES -------------------------------------
|
|
||||||
" ---------- comments menu ------------------------------------------------
|
|
||||||
"
|
|
||||||
noremap <buffer> <silent> <LocalLeader>cl :call C_LineEndComment()<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>cl <Esc>:call C_LineEndComment()<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>cl <Esc>:call C_MultiLineEndComments()<CR>a
|
|
||||||
noremap <buffer> <silent> <LocalLeader>cj :call C_AdjustLineEndComm("a")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>cj <Esc>:call C_AdjustLineEndComm("v")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>cj <Esc>:call C_AdjustLineEndComm("a")<CR>a
|
|
||||||
noremap <buffer> <silent> <LocalLeader>cs :call C_GetLineEndCommCol()<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>c* :call C_CodeComment("a","yes")<CR>:nohlsearch<CR>j
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>c* <Esc>:call C_CodeComment("v","yes")<CR>:nohlsearch<CR>j
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>cc :call C_CodeComment("a","no")<CR>:nohlsearch<CR>j
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>cc <Esc>:call C_CodeComment("v","no")<CR>:nohlsearch<CR>j
|
|
||||||
noremap <buffer> <silent> <LocalLeader>co :call C_CommentCode("a")<CR>:nohlsearch<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>co <Esc>:call C_CommentCode("v")<CR>:nohlsearch<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>cfr :call C_InsertTemplate("comment.frame")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>cfu :call C_InsertTemplate("comment.function")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>cme :call C_InsertTemplate("comment.method")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>ccl :call C_InsertTemplate("comment.class")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>cfdi :call C_InsertTemplate("comment.file-description")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>cfdh :call C_InsertTemplate("comment.file-description-header")<CR>
|
|
||||||
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>cfr <Esc>:call C_InsertTemplate("comment.frame")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>cfu <Esc>:call C_InsertTemplate("comment.function")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>cme <Esc>:call C_InsertTemplate("comment.method")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>ccl <Esc>:call C_InsertTemplate("comment.class")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>cfdi <Esc>:call C_InsertTemplate("comment.file-description")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>cfdh <Esc>:call C_InsertTemplate("comment.file-description-header")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>cd <Esc>:call C_InsertDateAndTime('d')<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>cd <Esc>:call C_InsertDateAndTime('d')<CR>a
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>cd s<Esc>:call C_InsertDateAndTime('d')<CR>a
|
|
||||||
noremap <buffer> <silent> <LocalLeader>ct <Esc>:call C_InsertDateAndTime('dt')<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>ct <Esc>:call C_InsertDateAndTime('dt')<CR>a
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>ct s<Esc>:call C_InsertDateAndTime('dt')<CR>a
|
|
||||||
"
|
|
||||||
" call the above defined commands:
|
|
||||||
"
|
|
||||||
noremap <buffer> <LocalLeader>ccs <Esc>:CFileSection<Space>
|
|
||||||
noremap <buffer> <LocalLeader>chs <Esc>:HFileSection<Space>
|
|
||||||
noremap <buffer> <LocalLeader>ckc <Esc>:KeywordComment<Space>
|
|
||||||
noremap <buffer> <LocalLeader>csc <Esc>:SpecialComment<Space>
|
|
||||||
"
|
|
||||||
inoremap <buffer> <LocalLeader>ccs <Esc>:CFileSection<Space>
|
|
||||||
inoremap <buffer> <LocalLeader>chs <Esc>:HFileSection<Space>
|
|
||||||
inoremap <buffer> <LocalLeader>ckc <Esc>:KeywordComment<Space>
|
|
||||||
inoremap <buffer> <LocalLeader>csc <Esc>:SpecialComment<Space>
|
|
||||||
"
|
|
||||||
" ---------- statements menu ------------------------------------------------
|
|
||||||
"
|
|
||||||
noremap <buffer> <silent> <LocalLeader>sd :call C_InsertTemplate("statements.do-while")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>sd <Esc>:call C_InsertTemplate("statements.do-while", "v")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>sd <Esc>:call C_InsertTemplate("statements.do-while")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>sf :call C_InsertTemplate("statements.for")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>sf <Esc>:call C_InsertTemplate("statements.for")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>sfo :call C_InsertTemplate("statements.for-block")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>sfo <Esc>:call C_InsertTemplate("statements.for-block", "v")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>sfo <Esc>:call C_InsertTemplate("statements.for-block")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>si :call C_InsertTemplate("statements.if")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>si <Esc>:call C_InsertTemplate("statements.if")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>sif :call C_InsertTemplate("statements.if-block")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>sif <Esc>:call C_InsertTemplate("statements.if-block", "v")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>sif <Esc>:call C_InsertTemplate("statements.if-block")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>sie :call C_InsertTemplate("statements.if-else")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>sie <Esc>:call C_InsertTemplate("statements.if-else", "v")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>sie <Esc>:call C_InsertTemplate("statements.if-else")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>sife :call C_InsertTemplate("statements.if-block-else")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>sife <Esc>:call C_InsertTemplate("statements.if-block-else", "v")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>sife <Esc>:call C_InsertTemplate("statements.if-block-else")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>se :call C_InsertTemplate("statements.else-block")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>se <Esc>:call C_InsertTemplate("statements.else-block", "v")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>se <Esc>:call C_InsertTemplate("statements.else-block")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>sw :call C_InsertTemplate("statements.while")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>sw <Esc>:call C_InsertTemplate("statements.while")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>swh :call C_InsertTemplate("statements.while-block")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>swh <Esc>:call C_InsertTemplate("statements.while-block", "v")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>swh <Esc>:call C_InsertTemplate("statements.while-block")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>ss :call C_InsertTemplate("statements.switch")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>ss <Esc>:call C_InsertTemplate("statements.switch", "v")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>ss <Esc>:call C_InsertTemplate("statements.switch")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>sc :call C_InsertTemplate("statements.case")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>sc <Esc>:call C_InsertTemplate("statements.case")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>s{ :call C_InsertTemplate("statements.block")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>s{ <Esc>:call C_InsertTemplate("statements.block", "v")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>s{ <Esc>:call C_InsertTemplate("statements.block")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>sb :call C_InsertTemplate("statements.block")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>sb <Esc>:call C_InsertTemplate("statements.block", "v")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>sb <Esc>:call C_InsertTemplate("statements.block")<CR>
|
|
||||||
"
|
|
||||||
" ---------- preprocessor menu ----------------------------------------------
|
|
||||||
""
|
|
||||||
noremap <buffer> <LocalLeader>ps :IncludeStdLibrary<Space>
|
|
||||||
inoremap <buffer> <LocalLeader>ps <Esc>:IncludeStdLibrary<Space>
|
|
||||||
noremap <buffer> <LocalLeader>pc :IncludeC99Library<Space>
|
|
||||||
inoremap <buffer> <LocalLeader>pc <Esc>:IncludeC99Library<Space>
|
|
||||||
noremap <buffer> <LocalLeader>+ps :IncludeCppLibrary<Space>
|
|
||||||
inoremap <buffer> <LocalLeader>+ps <Esc>:IncludeCppLibrary<Space>
|
|
||||||
noremap <buffer> <LocalLeader>+pc :IncludeCppCLibrary<Space>
|
|
||||||
inoremap <buffer> <LocalLeader>+pc <Esc>:IncludeCppC9Library<Space>
|
|
||||||
"
|
|
||||||
noremap <buffer> <silent> <LocalLeader>p< :call C_InsertTemplate("preprocessor.include-global")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>p" :call C_InsertTemplate("preprocessor.include-local")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>pd :call C_InsertTemplate("preprocessor.define")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>pu :call C_InsertTemplate("preprocessor.undefine")<CR>
|
|
||||||
"
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>p< <Esc>:call C_InsertTemplate("preprocessor.include-global")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>p" <Esc>:call C_InsertTemplate("preprocessor.include-local")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>pd <Esc>:call C_InsertTemplate("preprocessor.define")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>pu <Esc>:call C_InsertTemplate("preprocessor.undefine")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>pie :call C_InsertTemplate("preprocessor.if-else-endif")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>pid :call C_InsertTemplate("preprocessor.ifdef-else-endif")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>pin :call C_InsertTemplate("preprocessor.ifndef-else-endif")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>pind :call C_InsertTemplate("preprocessor.ifndef-def-endif")<CR>
|
|
||||||
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>pie <Esc>:call C_InsertTemplate("preprocessor.if-else-endif", "v")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>pid <Esc>:call C_InsertTemplate("preprocessor.ifdef-else-endif", "v")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>pin <Esc>:call C_InsertTemplate("preprocessor.ifndef-else-endif", "v")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>pind <Esc>:call C_InsertTemplate("preprocessor.ifndef-def-endif", "v")<CR>
|
|
||||||
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>pie <Esc>:call C_InsertTemplate("preprocessor.if-else-endif")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>pid <Esc>:call C_InsertTemplate("preprocessor.ifdef-else-endif")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>pin <Esc>:call C_InsertTemplate("preprocessor.ifndef-else-endif")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>pind <Esc>:call C_InsertTemplate("preprocessor.ifndef-def-endif")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>pi0 :call C_PPIf0("a")<CR>2ji
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>pi0 <Esc>:call C_PPIf0("a")<CR>2ji
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>pi0 <Esc>:call C_PPIf0("v")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>pr0 :call C_PPIf0Remove()<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>pr0 <Esc>:call C_PPIf0Remove()<CR>
|
|
||||||
"
|
|
||||||
noremap <buffer> <silent> <LocalLeader>pe :call C_InsertTemplate("preprocessor.error")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>pl :call C_InsertTemplate("preprocessor.line")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>pp :call C_InsertTemplate("preprocessor.pragma")<CR>
|
|
||||||
"
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>pe <Esc>:call C_InsertTemplate("preprocessor.error")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>pl <Esc>:call C_InsertTemplate("preprocessor.line")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>pp <Esc>:call C_InsertTemplate("preprocessor.pragma")<CR>
|
|
||||||
"
|
|
||||||
" ---------- idioms menu ----------------------------------------------------
|
|
||||||
"
|
|
||||||
noremap <buffer> <silent> <LocalLeader>if :call C_InsertTemplate("idioms.function")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>if <Esc>:call C_InsertTemplate("idioms.function", "v")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>if <Esc>:call C_InsertTemplate("idioms.function")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>isf :call C_InsertTemplate("idioms.function-static")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>isf <Esc>:call C_InsertTemplate("idioms.function-static", "v")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>isf <Esc>:call C_InsertTemplate("idioms.function-static")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>im :call C_InsertTemplate("idioms.main")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>im <Esc>:call C_InsertTemplate("idioms.main", "v")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>im <Esc>:call C_InsertTemplate("idioms.main")<CR>
|
|
||||||
"
|
|
||||||
noremap <buffer> <silent> <LocalLeader>i0 :call C_CodeFor("up" , "a")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>i0 <Esc>:call C_CodeFor("up" , "v")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>i0 <Esc>:call C_CodeFor("up" , "a")<CR>i
|
|
||||||
noremap <buffer> <silent> <LocalLeader>in :call C_CodeFor("down", "a")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>in <Esc>:call C_CodeFor("down", "v")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>in <Esc>:call C_CodeFor("down", "a")<CR>i
|
|
||||||
"
|
|
||||||
noremap <buffer> <silent> <LocalLeader>ie :call C_InsertTemplate("idioms.enum")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>ie <Esc>:call C_InsertTemplate("idioms.enum" , "v")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>ie <Esc>:call C_InsertTemplate("idioms.enum")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>is :call C_InsertTemplate("idioms.struct")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>is <Esc>:call C_InsertTemplate("idioms.struct", "v")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>is <Esc>:call C_InsertTemplate("idioms.struct")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>iu :call C_InsertTemplate("idioms.union")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>iu <Esc>:call C_InsertTemplate("idioms.union" , "v")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>iu <Esc>:call C_InsertTemplate("idioms.union")<CR>
|
|
||||||
"
|
|
||||||
noremap <buffer> <silent> <LocalLeader>ip :call C_InsertTemplate("idioms.printf")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>ip <Esc>:call C_InsertTemplate("idioms.printf")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>isc :call C_InsertTemplate("idioms.scanf")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>isc <Esc>:call C_InsertTemplate("idioms.scanf")<CR>
|
|
||||||
"
|
|
||||||
noremap <buffer> <silent> <LocalLeader>ica :call C_InsertTemplate("idioms.calloc")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>ica <Esc>:call C_InsertTemplate("idioms.calloc")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>ima :call C_InsertTemplate("idioms.malloc")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>ima <Esc>:call C_InsertTemplate("idioms.malloc")<CR>
|
|
||||||
"
|
|
||||||
noremap <buffer> <silent> <LocalLeader>isi :call C_InsertTemplate("idioms.sizeof")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>isi <Esc>:call C_InsertTemplate("idioms.sizeof")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>isi <Esc>:call C_InsertTemplate("idioms.sizeof", "v")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>ias :call C_InsertTemplate("idioms.assert")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>ias <Esc>:call C_InsertTemplate("idioms.assert", "v")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>ias <Esc>:call C_InsertTemplate("idioms.assert")<CR>
|
|
||||||
"
|
|
||||||
noremap <buffer> <silent> <LocalLeader>ii :call C_InsertTemplate("idioms.open-input-file")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>ii <Esc>:call C_InsertTemplate("idioms.open-input-file")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>ii <Esc>:call C_InsertTemplate("idioms.open-input-file", "v")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>io :call C_InsertTemplate("idioms.open-output-file")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>io <Esc>:call C_InsertTemplate("idioms.open-output-file")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>io <Esc>:call C_InsertTemplate("idioms.open-output-file", "v")<CR>
|
|
||||||
"
|
|
||||||
" ---------- snippet menu ----------------------------------------------------
|
|
||||||
"
|
|
||||||
noremap <buffer> <silent> <LocalLeader>nr :call C_CodeSnippet("r")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>nw :call C_CodeSnippet("w")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>nw <Esc>:call C_CodeSnippet("wv")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>ne :call C_CodeSnippet("e")<CR>
|
|
||||||
"
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>nr <Esc>:call C_CodeSnippet("r")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>nw <Esc>:call C_CodeSnippet("w")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>ne <Esc>:call C_CodeSnippet("e")<CR>
|
|
||||||
"
|
|
||||||
noremap <buffer> <silent> <LocalLeader>np :call C_ProtoPick("n")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>np <Esc>:call C_ProtoPick("v")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>ni :call C_ProtoInsert()<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>nc :call C_ProtoClear()<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>ns :call C_ProtoShow()<CR>
|
|
||||||
"
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>np <Esc>:call C_ProtoPick("n")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>ni <Esc>:call C_ProtoInsert()<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>nc <Esc>:call C_ProtoClear()<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>ns <Esc>:call C_ProtoShow()<CR>
|
|
||||||
"
|
|
||||||
noremap <buffer> <silent> <LocalLeader>ntl :call C_EditTemplates("local")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>ntg :call C_EditTemplates("global")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>ntr :call C_RereadTemplates()<CR>
|
|
||||||
noremap <buffer> <LocalLeader>nts <Esc>:CStyle<Space>
|
|
||||||
"
|
|
||||||
" ---------- C++ menu ----------------------------------------------------
|
|
||||||
"
|
|
||||||
noremap <buffer> <silent> <LocalLeader>+co :call C_InsertTemplate("cpp.cout")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>+co <Esc>:call C_InsertTemplate("cpp.cout")<CR>
|
|
||||||
"
|
|
||||||
noremap <buffer> <silent> <LocalLeader>+c :call C_InsertTemplate("cpp.class-definition")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>+c <Esc>:call C_InsertTemplate("cpp.class-definition")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>+cn :call C_InsertTemplate("cpp.class-using-new-definition")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>+cn <Esc>:call C_InsertTemplate("cpp.class-using-new-definition")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>+ci :call C_InsertTemplate("cpp.class-implementation")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>+ci <Esc>:call C_InsertTemplate("cpp.class-implementation")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>+cni :call C_InsertTemplate("cpp.class-using-new-implementation")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>+cni <Esc>:call C_InsertTemplate("cpp.class-using-new-implementation")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>+mi :call C_InsertTemplate("cpp.method-implementation")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>+mi <Esc>:call C_InsertTemplate("cpp.method-implementation")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>+ai :call C_InsertTemplate("cpp.accessor-implementation")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>+ai <Esc>:call C_InsertTemplate("cpp.accessor-implementation")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>+tc :call C_InsertTemplate("cpp.template-class-definition")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>+tc <Esc>:call C_InsertTemplate("cpp.template-class-definition")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>+tcn :call C_InsertTemplate("cpp.template-class-using-new-definition")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>+tcn <Esc>:call C_InsertTemplate("cpp.template-class-using-new-definition")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>+tci :call C_InsertTemplate("cpp.template-class-implementation")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>+tci <Esc>:call C_InsertTemplate("cpp.template-class-implementation")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>+tcni :call C_InsertTemplate("cpp.template-class-using-new-implementation")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>+tcni <Esc>:call C_InsertTemplate("cpp.template-class-using-new-implementation")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>+tmi :call C_InsertTemplate("cpp.template-method-implementation")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>+tmi <Esc>:call C_InsertTemplate("cpp.template-method-implementation")<CR>
|
|
||||||
noremap <buffer> <silent> <LocalLeader>+tai :call C_InsertTemplate("cpp.template-accessor-implementation")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>+tai <Esc>:call C_InsertTemplate("cpp.template-accessor-implementation")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>+tf :call C_InsertTemplate("cpp.template-function")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>+tf <Esc>:call C_InsertTemplate("cpp.template-function")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>+ec :call C_InsertTemplate("cpp.error-class")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>+ec <Esc>:call C_InsertTemplate("cpp.error-class")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>+tr :call C_InsertTemplate("cpp.try-catch")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>+tr <Esc>:call C_InsertTemplate("cpp.try-catch", "v")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>+tr <Esc>:call C_InsertTemplate("cpp.try-catch")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>+ca :call C_InsertTemplate("cpp.catch")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>+ca <Esc>:call C_InsertTemplate("cpp.catch", "v")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>+ca <Esc>:call C_InsertTemplate("cpp.catch")<CR>
|
|
||||||
|
|
||||||
noremap <buffer> <silent> <LocalLeader>+c. :call C_InsertTemplate("cpp.catch-points")<CR>
|
|
||||||
vnoremap <buffer> <silent> <LocalLeader>+c. <Esc>:call C_InsertTemplate("cpp.catch-points", "v")<CR>
|
|
||||||
inoremap <buffer> <silent> <LocalLeader>+c. <Esc>:call C_InsertTemplate("cpp.catch-points")<CR>
|
|
||||||
"
|
|
||||||
" ---------- run menu --------------------------------------------------------
|
|
||||||
"
|
|
||||||
map <buffer> <silent> <LocalLeader>rc :call C_Compile()<CR>:call C_HlMessage()<CR>
|
|
||||||
map <buffer> <silent> <LocalLeader>rl :call C_Link()<CR>:call C_HlMessage()<CR>
|
|
||||||
map <buffer> <silent> <LocalLeader>rr :call C_Run()<CR>
|
|
||||||
map <buffer> <silent> <LocalLeader>ra :call C_Arguments()<CR>
|
|
||||||
map <buffer> <silent> <LocalLeader>rm :call C_Make()<CR>
|
|
||||||
map <buffer> <silent> <LocalLeader>rma :call C_MakeArguments()<CR>
|
|
||||||
map <buffer> <silent> <LocalLeader>rp :call C_SplintCheck()<CR>:call C_HlMessage()<CR>
|
|
||||||
map <buffer> <silent> <LocalLeader>rpa :call C_SplintArguments()<CR>
|
|
||||||
map <buffer> <silent> <LocalLeader>rd :call C_Indent()<CR>
|
|
||||||
map <buffer> <silent> <LocalLeader>rh :call C_Hardcopy("n")<CR>
|
|
||||||
map <buffer> <silent> <LocalLeader>rs :call C_Settings()<CR>
|
|
||||||
"
|
|
||||||
vmap <buffer> <silent> <LocalLeader>rh <C-C>:call C_Hardcopy("v")<CR>
|
|
||||||
"
|
|
||||||
imap <buffer> <silent> <LocalLeader>rc <C-C>:call C_Compile()<CR>:call C_HlMessage()<CR>
|
|
||||||
imap <buffer> <silent> <LocalLeader>rl <C-C>:call C_Link()<CR>:call C_HlMessage()<CR>
|
|
||||||
imap <buffer> <silent> <LocalLeader>rr <C-C>:call C_Run()<CR>
|
|
||||||
imap <buffer> <silent> <LocalLeader>ra <C-C>:call C_Arguments()<CR>
|
|
||||||
imap <buffer> <silent> <LocalLeader>rm <C-C>:call C_Make()<CR>
|
|
||||||
imap <buffer> <silent> <LocalLeader>rma <C-C>:call C_MakeArguments()<CR>
|
|
||||||
imap <buffer> <silent> <LocalLeader>rp <C-C>:call C_SplintCheck()<CR>:call C_HlMessage()<CR>
|
|
||||||
imap <buffer> <silent> <LocalLeader>rpa <C-C>:call C_SplintArguments()<CR>
|
|
||||||
imap <buffer> <silent> <LocalLeader>rd <C-C>:call C_Indent()<CR>
|
|
||||||
imap <buffer> <silent> <LocalLeader>rh <C-C>:call C_Hardcopy("n")<CR>
|
|
||||||
imap <buffer> <silent> <LocalLeader>rs <C-C>:call C_Settings()<CR>
|
|
||||||
if has("unix")
|
|
||||||
map <buffer> <silent> <LocalLeader>rx :call C_XtermSize()<CR>
|
|
||||||
imap <buffer> <silent> <LocalLeader>rx <C-C>:call C_XtermSize()<CR>
|
|
||||||
endif
|
|
||||||
map <buffer> <silent> <LocalLeader>ro :call C_Toggle_Gvim_Xterm()<CR>
|
|
||||||
imap <buffer> <silent> <LocalLeader>ro <C-C>:call C_Toggle_Gvim_Xterm()<CR>
|
|
||||||
"
|
|
||||||
" Abraxas CodeCheck (R)
|
|
||||||
"
|
|
||||||
if executable("check")
|
|
||||||
map <buffer> <silent> <LocalLeader>rk :call C_CodeCheck()<CR>:call C_HlMessage()<CR>
|
|
||||||
map <buffer> <silent> <LocalLeader>rka :call C_CodeCheckArguments()<CR>
|
|
||||||
imap <buffer> <silent> <LocalLeader>rk <C-C>:call C_CodeCheck()<CR>:call C_HlMessage()<CR>
|
|
||||||
imap <buffer> <silent> <LocalLeader>rka <C-C>:call C_CodeCheckArguments()<CR>
|
|
||||||
endif
|
|
||||||
" ---------- plugin help -----------------------------------------------------
|
|
||||||
"
|
|
||||||
map <buffer> <silent> <LocalLeader>hp :call C_HelpCsupport()<CR>
|
|
||||||
imap <buffer> <silent> <LocalLeader>hp <C-C>:call C_HelpCsupport()<CR>
|
|
||||||
map <buffer> <silent> <LocalLeader>hm :call C_Help("m")<CR>
|
|
||||||
imap <buffer> <silent> <LocalLeader>hm <C-C>:call C_Help("m")<CR>
|
|
||||||
"
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
" additional mapping : complete a classical C comment: '/*' => '/* | */'
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
inoremap <buffer> /* /*<Space><Space>*/<Left><Left><Left>
|
|
||||||
vnoremap <buffer> /* s/*<Space><Space>*/<Left><Left><Left><Esc>p
|
|
||||||
"
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
" additional mapping : complete a classical C multi-line comment:
|
|
||||||
" '/*<CR>' => /*
|
|
||||||
" * |
|
|
||||||
" */
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
inoremap <buffer> /*<CR> /*<CR><CR>/<Esc>kA<Space>
|
|
||||||
"
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
" additional mapping : {<CR> always opens a block
|
|
||||||
"-------------------------------------------------------------------------------
|
|
||||||
inoremap <buffer> {<CR> {<CR>}<Esc>O
|
|
||||||
vnoremap <buffer> {<CR> S{<CR>}<Esc>Pk=iB
|
|
||||||
"
|
|
||||||
"
|
|
||||||
if !exists("g:C_Ctrl_j") || ( exists("g:C_Ctrl_j") && g:C_Ctrl_j != 'off' )
|
|
||||||
nmap <buffer> <silent> <C-j> i<C-R>=C_JumpCtrlJ()<CR>
|
|
||||||
imap <buffer> <silent> <C-j> <C-R>=C_JumpCtrlJ()<CR>
|
|
||||||
endif
|
|
@ -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
|
|
@ -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:
|
|
@ -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,*<Return>,},],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:
|
|
File diff suppressed because it is too large
Load Diff
@ -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' : "\<C-x>\<C-u>",
|
|
||||||
\ 'completefunc' : g:acp_behaviorUserDefinedFunction,
|
|
||||||
\ 'meets' : g:acp_behaviorUserDefinedMeets,
|
|
||||||
\ 'repeat' : 0,
|
|
||||||
\ })
|
|
||||||
endfor
|
|
||||||
endif
|
|
||||||
"---------------------------------------------------------------------------
|
|
||||||
for key in keys(behavs)
|
|
||||||
call add(behavs[key], {
|
|
||||||
\ 'command' : "\<C-x>\<C-u>",
|
|
||||||
\ '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' : "\<C-x>\<C-f>",
|
|
||||||
\ 'meets' : 'acp#meetsForFile',
|
|
||||||
\ 'repeat' : 1,
|
|
||||||
\ })
|
|
||||||
endfor
|
|
||||||
"---------------------------------------------------------------------------
|
|
||||||
call add(behavs.ruby, {
|
|
||||||
\ 'command' : "\<C-x>\<C-o>",
|
|
||||||
\ 'meets' : 'acp#meetsForRubyOmni',
|
|
||||||
\ 'repeat' : 0,
|
|
||||||
\ })
|
|
||||||
"---------------------------------------------------------------------------
|
|
||||||
call add(behavs.python, {
|
|
||||||
\ 'command' : "\<C-x>\<C-o>",
|
|
||||||
\ 'meets' : 'acp#meetsForPythonOmni',
|
|
||||||
\ 'repeat' : 0,
|
|
||||||
\ })
|
|
||||||
"---------------------------------------------------------------------------
|
|
||||||
call add(behavs.perl, {
|
|
||||||
\ 'command' : "\<C-x>\<C-o>",
|
|
||||||
\ 'meets' : 'acp#meetsForPerlOmni',
|
|
||||||
\ 'repeat' : 0,
|
|
||||||
\ })
|
|
||||||
"---------------------------------------------------------------------------
|
|
||||||
call add(behavs.xml, {
|
|
||||||
\ 'command' : "\<C-x>\<C-o>",
|
|
||||||
\ 'meets' : 'acp#meetsForXmlOmni',
|
|
||||||
\ 'repeat' : 1,
|
|
||||||
\ })
|
|
||||||
"---------------------------------------------------------------------------
|
|
||||||
call add(behavs.html, {
|
|
||||||
\ 'command' : "\<C-x>\<C-o>",
|
|
||||||
\ 'meets' : 'acp#meetsForHtmlOmni',
|
|
||||||
\ 'repeat' : 1,
|
|
||||||
\ })
|
|
||||||
"---------------------------------------------------------------------------
|
|
||||||
call add(behavs.xhtml, {
|
|
||||||
\ 'command' : "\<C-x>\<C-o>",
|
|
||||||
\ 'meets' : 'acp#meetsForHtmlOmni',
|
|
||||||
\ 'repeat' : 1,
|
|
||||||
\ })
|
|
||||||
"---------------------------------------------------------------------------
|
|
||||||
call add(behavs.css, {
|
|
||||||
\ 'command' : "\<C-x>\<C-o>",
|
|
||||||
\ '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', "\<C-n>")
|
|
||||||
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:
|
|
File diff suppressed because it is too large
Load Diff
@ -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 "<tab>".
|
|
||||||
"
|
|
||||||
" 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 == "<tab>"
|
|
||||||
let SuperTabKey = "\<c-n>"
|
|
||||||
elseif g:SuperTabMappingBackward == "<tab>"
|
|
||||||
let SuperTabKey = "\<c-p>"
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if pumvisible() " Update snippet if completion is used, or deal with supertab
|
|
||||||
if exists('SuperTabKey')
|
|
||||||
call feedkeys(SuperTabKey) | return ''
|
|
||||||
endif
|
|
||||||
call feedkeys("\<esc>a", 'n') " Close completion menu
|
|
||||||
call feedkeys("\<tab>") | 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 "\<tab>"
|
|
||||||
endf
|
|
||||||
|
|
||||||
fun! BackwardsSnippet()
|
|
||||||
if exists('g:snipPos') | return snipMate#jumpTabStop(1) | endif
|
|
||||||
|
|
||||||
if exists('g:SuperTabMappingForward')
|
|
||||||
if g:SuperTabMappingBackward == "<s-tab>"
|
|
||||||
let SuperTabKey = "\<c-p>"
|
|
||||||
elseif g:SuperTabMappingForward == "<s-tab>"
|
|
||||||
let SuperTabKey = "\<c-n>"
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
if exists('SuperTabKey')
|
|
||||||
call feedkeys(SuperTabKey)
|
|
||||||
return ''
|
|
||||||
endif
|
|
||||||
return "\<s-tab>"
|
|
||||||
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
|
|
File diff suppressed because it is too large
Load Diff
@ -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")`
|
|
@ -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)
|
|
@ -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
|
|
@ -1,30 +0,0 @@
|
|||||||
# Read File Into Vector
|
|
||||||
snippet readfile
|
|
||||||
std::vector<char> 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 */}
|
|
||||||
};
|
|
@ -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
|
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""
|
|
||||||
"http://www.w3.org/TR/html4/strict.dtd">
|
|
||||||
snippet doctype HTML 4.01 Transitional
|
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""
|
|
||||||
"http://www.w3.org/TR/html4/loose.dtd">
|
|
||||||
snippet doctype HTML 5
|
|
||||||
<!DOCTYPE HTML>
|
|
||||||
snippet doctype XHTML 1.0 Frameset
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
||||||
snippet doctype XHTML 1.0 Strict
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
||||||
snippet doctype XHTML 1.0 Transitional
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
snippet doctype XHTML 1.1
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
|
||||||
# HTML Doctype 4.01 Strict
|
|
||||||
snippet docts
|
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""
|
|
||||||
"http://www.w3.org/TR/html4/strict.dtd">
|
|
||||||
# HTML Doctype 4.01 Transitional
|
|
||||||
snippet doct
|
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""
|
|
||||||
"http://www.w3.org/TR/html4/loose.dtd">
|
|
||||||
# HTML Doctype 5
|
|
||||||
snippet doct5
|
|
||||||
<!DOCTYPE HTML>
|
|
||||||
# XHTML Doctype 1.0 Frameset
|
|
||||||
snippet docxf
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
|
|
||||||
# XHTML Doctype 1.0 Strict
|
|
||||||
snippet docxs
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
||||||
# XHTML Doctype 1.0 Transitional
|
|
||||||
snippet docxt
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
# XHTML Doctype 1.1
|
|
||||||
snippet docx
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
|
||||||
snippet html
|
|
||||||
<html>
|
|
||||||
${1}
|
|
||||||
</html>
|
|
||||||
snippet xhtml
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
${1}
|
|
||||||
</html>
|
|
||||||
snippet body
|
|
||||||
<body>
|
|
||||||
${1}
|
|
||||||
</body>
|
|
||||||
snippet head
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="content-type" content="text/html; charset=utf-8"`Close()`>
|
|
||||||
|
|
||||||
<title>${1:`substitute(Filename('', 'Page Title'), '^.', '\u&', '')`}</title>
|
|
||||||
${2}
|
|
||||||
</head>
|
|
||||||
snippet title
|
|
||||||
<title>${1:`substitute(Filename('', 'Page Title'), '^.', '\u&', '')`}</title>${2}
|
|
||||||
snippet script
|
|
||||||
<script type="text/javascript" charset="utf-8">
|
|
||||||
${1}
|
|
||||||
</script>${2}
|
|
||||||
snippet scriptsrc
|
|
||||||
<script src="${1}.js" type="text/javascript" charset="utf-8"></script>${2}
|
|
||||||
snippet style
|
|
||||||
<style type="text/css" media="${1:screen}">
|
|
||||||
${2}
|
|
||||||
</style>${3}
|
|
||||||
snippet base
|
|
||||||
<base href="${1}" target="${2}"`Close()`>
|
|
||||||
snippet r
|
|
||||||
<br`Close()[1:]`>
|
|
||||||
snippet div
|
|
||||||
<div id="${1:name}">
|
|
||||||
${2}
|
|
||||||
</div>
|
|
||||||
# Embed QT Movie
|
|
||||||
snippet movie
|
|
||||||
<object width="$2" height="$3" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
|
|
||||||
codebase="http://www.apple.com/qtactivex/qtplugin.cab">
|
|
||||||
<param name="src" value="$1"`Close()`>
|
|
||||||
<param name="controller" value="$4"`Close()`>
|
|
||||||
<param name="autoplay" value="$5"`Close()`>
|
|
||||||
<embed src="${1:movie.mov}"
|
|
||||||
width="${2:320}" height="${3:240}"
|
|
||||||
controller="${4:true}" autoplay="${5:true}"
|
|
||||||
scale="tofit" cache="true"
|
|
||||||
pluginspage="http://www.apple.com/quicktime/download/"
|
|
||||||
`Close()[1:]`>
|
|
||||||
</object>${6}
|
|
||||||
snippet fieldset
|
|
||||||
<fieldset id="$1">
|
|
||||||
<legend>${1:name}</legend>
|
|
||||||
|
|
||||||
${3}
|
|
||||||
</fieldset>
|
|
||||||
snippet form
|
|
||||||
<form action="${1:`Filename('$1_submit')`}" method="${2:get}" accept-charset="utf-8">
|
|
||||||
${3}
|
|
||||||
|
|
||||||
|
|
||||||
<p><input type="submit" value="Continue →"`Close()`></p>
|
|
||||||
</form>
|
|
||||||
snippet h1
|
|
||||||
<h1 id="${1:heading}">${2:$1}</h1>
|
|
||||||
snippet input
|
|
||||||
<input type="${1:text/submit/hidden/button}" name="${2:some_name}" value="${3}"`Close()`>${4}
|
|
||||||
snippet label
|
|
||||||
<label for="${2:$1}">${1:name}</label><input type="${3:text/submit/hidden/button}" name="${4:$2}" value="${5}" id="${6:$2}"`Close()`>${7}
|
|
||||||
snippet link
|
|
||||||
<link rel="${1:stylesheet}" href="${2:/css/master.css}" type="text/css" media="${3:screen}" charset="utf-8"`Close()`>${4}
|
|
||||||
snippet mailto
|
|
||||||
<a href="mailto:${1:joe@example.com}?subject=${2:feedback}">${3:email me}</a>
|
|
||||||
snippet meta
|
|
||||||
<meta name="${1:name}" content="${2:content}"`Close()`>${3}
|
|
||||||
snippet opt
|
|
||||||
<option value="${1:option}">${2:$1}</option>${3}
|
|
||||||
snippet optt
|
|
||||||
<option>${1:option}</option>${2}
|
|
||||||
snippet select
|
|
||||||
<select name="${1:some_name}" id="${2:$1}">
|
|
||||||
<option value="${3:option}">${4:$3}</option>
|
|
||||||
</select>${5}
|
|
||||||
snippet table
|
|
||||||
<table border="${1:0}">
|
|
||||||
<tr><th>${2:Header}</th></tr>
|
|
||||||
<tr><th>${3:Data}</th></tr>
|
|
||||||
</table>${4}
|
|
||||||
snippet textarea
|
|
||||||
<textarea name="${1:Name}" rows="${2:8}" cols="${3:40}">${4}</textarea>${5}
|
|
@ -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}
|
|
@ -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}
|
|
@ -1,54 +0,0 @@
|
|||||||
snippet def
|
|
||||||
<%def name="${1:name}">
|
|
||||||
${2:}
|
|
||||||
</%def>
|
|
||||||
snippet call
|
|
||||||
<%call expr="${1:name}">
|
|
||||||
${2:}
|
|
||||||
</%call>
|
|
||||||
snippet doc
|
|
||||||
<%doc>
|
|
||||||
${1:}
|
|
||||||
</%doc>
|
|
||||||
snippet text
|
|
||||||
<%text>
|
|
||||||
${1:}
|
|
||||||
</%text>
|
|
||||||
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 <!%
|
|
||||||
<!% ${1:} %>
|
|
||||||
snippet inherit
|
|
||||||
<%inherit file="${1:filename}" />
|
|
||||||
snippet include
|
|
||||||
<%include file="${1:filename}" />
|
|
||||||
snippet namespace
|
|
||||||
<%namespace file="${1:name}" />
|
|
||||||
snippet page
|
|
||||||
<%page args="${1:}" />
|
|
@ -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];
|
|
@ -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 = <FILE>; close FILE }${3}
|
|
@ -1,216 +0,0 @@
|
|||||||
snippet php
|
|
||||||
<?php
|
|
||||||
${1}
|
|
||||||
?>
|
|
||||||
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}
|
|
@ -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}
|
|
@ -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
|
|
@ -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
|
|
@ -1,7 +0,0 @@
|
|||||||
# snippets for making snippets :)
|
|
||||||
snippet snip
|
|
||||||
snippet ${1:trigger}
|
|
||||||
${2}
|
|
||||||
snippet msnip
|
|
||||||
snippet ${1:trigger} ${2:description}
|
|
||||||
${3}
|
|
@ -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
|
|
@ -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}
|
|
@ -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
|
|
@ -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}
|
|
||||||
}
|
|
@ -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 "\\\@<!\%(\\\\\)*\\\%(\\\ze#{\|#\ze{\)"
|
|
||||||
|
|
||||||
syn region jadeAttributeString start=+\%(=\s*\)\@<='+ skip=+\%(\\\\\)*\\'+ end=+'+ contains=jadeInterpolation
|
|
||||||
syn region jadeAttributeString start=+\%(:\s*\)\@<='+ skip=+\%(\\\\\)*\\'+ end=+'+ contains=jadeInterpolation
|
|
||||||
syn region jadeAttributeString start=+\%(=\s*\)\@<="+ skip=+\%(\\\\\)*\\'+ end=+"+ contains=jadeInterpolation
|
|
||||||
syn region jadeAttributeString start=+\%(:\s*\)\@<="+ skip=+\%(\\\\\)*\\'+ end=+"+ contains=jadeInterpolation
|
|
||||||
|
|
||||||
syn region jadeJavascriptFilter matchgroup=jadeFilter start="^\z(\s*\):javascript\s*$" end="^\%(\z1 \| *$\)\@!" contains=@htmlJavaScript
|
|
||||||
syn region jadeMarkdownFilter matchgroup=jadeFilter start="^\z(\s*\):markdown\s*$" end="^\%(\z1 \| *$\)\@!"
|
|
||||||
|
|
||||||
syn region jadeJavascriptBlock start="^\z(\s*\)script" nextgroup=@jadeComponent,jadeError end="^\%(\z1 \| *$\)\@!" contains=@jadeTop,@htmlJavascript keepend
|
|
||||||
syn region jadeCssBlock start="^\z(\s*\)style" nextgroup=@jadeComponent,jadeError end="^\%(\z1 \| *$\)\@!" contains=@jadeTop,@htmlCss keepend
|
|
||||||
|
|
||||||
syn match jadeError "\$" contained
|
|
||||||
|
|
||||||
hi def link jadeTag Special
|
|
||||||
hi def link jadeAttributeString String
|
|
||||||
hi def link jadeAttributesDelimiter Identifier
|
|
||||||
hi def link jadeIdChar Special
|
|
||||||
hi def link jadeClassChar Special
|
|
||||||
hi def link jadeId Identifier
|
|
||||||
hi def link jadeClass Type
|
|
||||||
hi def link jadeInterpolationDelimiter Delimiter
|
|
||||||
hi def link jadeFilter PreProc
|
|
||||||
hi def link jadeDocType PreProc
|
|
||||||
hi def link jadeComment Comment
|
|
||||||
|
|
||||||
let b:current_syntax = "jade"
|
|
||||||
|
|
||||||
if main_syntax == "jade"
|
|
||||||
unlet main_syntax
|
|
||||||
endif
|
|
@ -1,246 +0,0 @@
|
|||||||
" Vim syntax file
|
|
||||||
" Language: JavaScript
|
|
||||||
" Maintainer: Yi Zhao (ZHAOYI) <zzlinux AT hotmail DOT com>
|
|
||||||
" 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 <sfile>: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*\)\@<!\<\w\+\(\s*:\)\@=/
|
|
||||||
|
|
||||||
"" JavaScript Prototype
|
|
||||||
syntax keyword javaScriptPrototype prototype
|
|
||||||
|
|
||||||
"" Programm Keywords
|
|
||||||
syntax keyword javaScriptSource import export
|
|
||||||
syntax keyword javaScriptType const this undefined var void yield
|
|
||||||
syntax keyword javaScriptOperator delete new in instanceof let typeof
|
|
||||||
syntax keyword javaScriptBoolean true false
|
|
||||||
syntax keyword javaScriptNull null
|
|
||||||
|
|
||||||
"" Statement Keywords
|
|
||||||
syntax keyword javaScriptConditional if else
|
|
||||||
syntax keyword javaScriptRepeat do while for
|
|
||||||
syntax keyword javaScriptBranch break continue switch case default return
|
|
||||||
syntax keyword javaScriptStatement try catch throw with finally
|
|
||||||
|
|
||||||
syntax keyword javaScriptGlobalObjects Array Boolean Date Function Infinity JavaArray JavaClass JavaObject JavaPackage Math Number NaN Object Packages RegExp String Undefined java netscape sun
|
|
||||||
|
|
||||||
syntax keyword javaScriptExceptions Error EvalError RangeError ReferenceError SyntaxError TypeError URIError
|
|
||||||
|
|
||||||
syntax keyword javaScriptFutureKeys abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public
|
|
||||||
|
|
||||||
"" DOM/HTML/CSS specified things
|
|
||||||
|
|
||||||
" DOM2 Objects
|
|
||||||
syntax keyword javaScriptGlobalObjects DOMImplementation DocumentFragment Document Node NodeList NamedNodeMap CharacterData Attr Element Text Comment CDATASection DocumentType Notation Entity EntityReference ProcessingInstruction
|
|
||||||
syntax keyword javaScriptExceptions DOMException
|
|
||||||
|
|
||||||
" DOM2 CONSTANT
|
|
||||||
syntax keyword javaScriptDomErrNo INDEX_SIZE_ERR DOMSTRING_SIZE_ERR HIERARCHY_REQUEST_ERR WRONG_DOCUMENT_ERR INVALID_CHARACTER_ERR NO_DATA_ALLOWED_ERR NO_MODIFICATION_ALLOWED_ERR NOT_FOUND_ERR NOT_SUPPORTED_ERR INUSE_ATTRIBUTE_ERR INVALID_STATE_ERR SYNTAX_ERR INVALID_MODIFICATION_ERR NAMESPACE_ERR INVALID_ACCESS_ERR
|
|
||||||
syntax keyword javaScriptDomNodeConsts ELEMENT_NODE ATTRIBUTE_NODE TEXT_NODE CDATA_SECTION_NODE ENTITY_REFERENCE_NODE ENTITY_NODE PROCESSING_INSTRUCTION_NODE COMMENT_NODE DOCUMENT_NODE DOCUMENT_TYPE_NODE DOCUMENT_FRAGMENT_NODE NOTATION_NODE
|
|
||||||
|
|
||||||
" HTML events and internal variables
|
|
||||||
syntax case ignore
|
|
||||||
syntax keyword javaScriptHtmlEvents onblur onclick oncontextmenu ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onresize
|
|
||||||
syntax case match
|
|
||||||
|
|
||||||
" Follow stuff should be highligh within a special context
|
|
||||||
" While it can't be handled with context depended with Regex based highlight
|
|
||||||
" So, turn it off by default
|
|
||||||
if exists("javascript_enable_domhtmlcss")
|
|
||||||
|
|
||||||
" DOM2 things
|
|
||||||
syntax match javaScriptDomElemAttrs contained /\%(nodeName\|nodeValue\|nodeType\|parentNode\|childNodes\|firstChild\|lastChild\|previousSibling\|nextSibling\|attributes\|ownerDocument\|namespaceURI\|prefix\|localName\|tagName\)\>/
|
|
||||||
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 /\<function\>/ nextgroup=javaScriptFuncName skipwhite
|
|
||||||
syntax match javaScriptOpAssign /=\@<!=/ nextgroup=javaScriptFuncBlock skipwhite skipempty
|
|
||||||
syntax region javaScriptFuncName contained matchgroup=javaScriptFuncName start=/\%(\$\|\w\)*\s*(/ end=/)/ contains=javaScriptLineComment,javaScriptComment nextgroup=javaScriptFuncBlock skipwhite skipempty
|
|
||||||
syntax region javaScriptFuncBlock contained matchgroup=javaScriptFuncBlock start="{" end="}" contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrB,javaScriptParen,javaScriptBracket,javaScriptBlock fold
|
|
||||||
|
|
||||||
if &l:filetype=='javascript' && !&diff
|
|
||||||
" Fold setting
|
|
||||||
" Redefine the foldtext (to show a JS function outline) and foldlevel
|
|
||||||
" only if the entire buffer is JavaScript, but not if JavaScript syntax
|
|
||||||
" is embedded in another syntax (e.g. HTML).
|
|
||||||
setlocal foldmethod=syntax
|
|
||||||
setlocal foldlevel=4
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
syntax keyword javaScriptFunction function
|
|
||||||
setlocal foldmethod<
|
|
||||||
setlocal foldlevel<
|
|
||||||
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_javascript_syn_inits")
|
|
||||||
if version < 508
|
|
||||||
let did_javascript_syn_inits = 1
|
|
||||||
command -nargs=+ HiLink hi link <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
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
|
|
@ -1,305 +0,0 @@
|
|||||||
" Vim syntax file
|
|
||||||
" Language: LESS Cascading Style Sheets
|
|
||||||
" Maintainer: Leaf Corcoran <leafot@gmail.com>
|
|
||||||
" Modifier: Bryan J Swift <bryan@bryanjswift.com>
|
|
||||||
" 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 "\<table\>"
|
|
||||||
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 "\<transparent\>"
|
|
||||||
syn match cssColor contained "\<white\>"
|
|
||||||
syn match cssColor contained "#[0-9A-Fa-f]\{3\}\>"
|
|
||||||
syn match cssColor contained "#[0-9A-Fa-f]\{6\}\>"
|
|
||||||
"syn match cssColor contained "\<rgb\s*(\s*\d\+\(\.\d*\)\=%\=\s*,\s*\d\+\(\.\d*\)\=%\=\s*,\s*\d\+\(\.\d*\)\=%\=\s*)"
|
|
||||||
syn region cssURL contained matchgroup=cssFunctionName start="\<url\s*(" end=")" oneline keepend
|
|
||||||
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgb\|clip\|attr\|counter\|rect\)\s*(" end=")" oneline keepend
|
|
||||||
|
|
||||||
syn match cssImportant contained "!\s*important\>"
|
|
||||||
|
|
||||||
syn keyword cssCommonAttr contained auto none inherit
|
|
||||||
syn keyword cssCommonAttr contained top bottom
|
|
||||||
syn keyword cssCommonAttr contained medium normal
|
|
||||||
|
|
||||||
syn match cssFontProp contained "\<font\>\(-\(family\|style\|variant\|weight\|size\(-adjust\)\=\|stretch\)\>\)\="
|
|
||||||
syn match cssFontAttr contained "\<\(sans-\)\=\<serif\>"
|
|
||||||
syn match cssFontAttr contained "\<small\>\(-\(caps\|caption\)\>\)\="
|
|
||||||
syn match cssFontAttr contained "\<x\{1,2\}-\(large\|small\)\>"
|
|
||||||
syn match cssFontAttr contained "\<message-box\>"
|
|
||||||
syn match cssFontAttr contained "\<status-bar\>"
|
|
||||||
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 "\<caption\>"
|
|
||||||
syn keyword cssFontAttr contained large smaller larger
|
|
||||||
syn keyword cssFontAttr contained narrower wider
|
|
||||||
|
|
||||||
syn keyword cssColorProp contained color
|
|
||||||
syn match cssColorProp contained "\<background\(-\(color\|image\|attachment\|position\)\)\="
|
|
||||||
syn keyword cssColorAttr contained center scroll fixed
|
|
||||||
syn match cssColorAttr contained "\<repeat\(-[xy]\)\=\>"
|
|
||||||
syn match cssColorAttr contained "\<no-repeat\>"
|
|
||||||
|
|
||||||
syn match cssTextProp "\<\(\(word\|letter\)-spacing\|text\(-\(decoration\|transform\|align\|index\|shadow\)\)\=\|vertical-align\|unicode-bidi\|line-height\)\>"
|
|
||||||
syn match cssTextAttr contained "\<line-through\>"
|
|
||||||
syn match cssTextAttr contained "\<text-indent\>"
|
|
||||||
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 "\<border-\(\(\(top\|right\|bottom\|left\)-\)\=\(width\|color\|style\)\)\=\>"
|
|
||||||
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 "\<counter-\(reset\|increment\)\>"
|
|
||||||
syn match cssGeneratedContentProp contained "\<list-style\(-\(type\|position\|image\)\)\=\>"
|
|
||||||
syn match cssGeneratedContentAttr contained "\<\(no-\)\=\(open\|close\)-quote\>"
|
|
||||||
syn match cssAuralAttr contained "\<lower\>"
|
|
||||||
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 "\<page\(-break-\(before\|after\|inside\)\)\=\>"
|
|
||||||
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 "\<outline\(-\(width\|style\|color\)\)\=\>"
|
|
||||||
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 "\<marker\>"
|
|
||||||
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 "\<table\(-\(row-gorup\|\(header\|footer\)-group\|row\|column\(-group\)\=\|cell\|caption\)\)\=\>"
|
|
||||||
syn keyword cssRenderAttr contained static relative absolute fixed
|
|
||||||
syn keyword cssRenderAttr contained ltr rtl embed bidi-override pre nowrap
|
|
||||||
syn match cssRenderAttr contained "\<bidi-override\>"
|
|
||||||
|
|
||||||
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 "\<spell-out\>"
|
|
||||||
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 "\<first\(-\(line\|letter\|child\)\)\=\>"
|
|
||||||
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 <args>
|
|
||||||
else
|
|
||||||
command -nargs=+ HiLink hi def link <args>
|
|
||||||
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
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -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
|
|
Loading…
Reference in New Issue