neosnippet.vim/neosnippets/vim.snip

225 lines
4.1 KiB
Plaintext
Raw Normal View History

2012-02-02 04:33:35 +00:00
snippet if
abbr if endif
2012-10-21 08:51:07 +00:00
options head
2012-10-29 10:27:18 +00:00
if ${1:#:condition}
2013-02-01 02:47:59 +00:00
${0:TARGET}
2012-02-02 04:33:35 +00:00
endif
2012-10-21 08:51:07 +00:00
snippet elseif
options head
2012-10-30 08:53:14 +00:00
elseif ${1:#:condition}
2012-10-29 22:38:37 +00:00
${0:TARGET}
2012-02-02 04:33:35 +00:00
snippet ifelse
abbr if else endif
2012-10-21 08:51:07 +00:00
options head
2012-10-29 10:27:18 +00:00
if ${1:#:condition}
2013-02-01 02:47:59 +00:00
${2:TARGET}
2012-02-02 04:33:35 +00:00
else
2013-02-01 02:47:59 +00:00
${3}
2012-02-02 04:33:35 +00:00
endif
snippet for
abbr for in endfor
2012-10-21 08:51:07 +00:00
options head
2012-10-29 10:27:18 +00:00
for ${1:#:var} in ${2:#:list}
2013-02-01 02:47:59 +00:00
${0:TARGET}
2012-02-02 04:33:35 +00:00
endfor
snippet while
abbr while endwhile
2012-10-21 08:51:07 +00:00
options head
2012-10-29 10:27:18 +00:00
while ${1:#:condition}
2013-02-01 02:47:59 +00:00
${0:TARGET}
2012-02-02 04:33:35 +00:00
endwhile
snippet function
abbr func endfunc
alias func
2012-10-21 08:51:07 +00:00
options head
2012-10-29 10:27:18 +00:00
function! ${1:#:func_name}(${2})
2013-02-01 02:47:59 +00:00
${0:TARGET}
2012-02-02 04:33:35 +00:00
endfunction
snippet try
abbr try endtry
2012-10-21 08:51:07 +00:00
options head
2012-02-02 04:33:35 +00:00
try
2013-02-01 02:47:59 +00:00
${1:TARGET}
2012-10-29 10:27:18 +00:00
catch /${2:#:pattern}/
2013-02-01 02:47:59 +00:00
${3}
2012-02-02 04:33:35 +00:00
endtry
2012-10-28 09:58:55 +00:00
snippet tryfinally
abbr try ... finally ... endtry
alias tryf
options head
try
2013-02-01 02:47:59 +00:00
${1:TARGET}
2012-10-28 09:58:55 +00:00
finally
2013-02-01 02:47:59 +00:00
${2}
2012-10-28 09:58:55 +00:00
endtry
2012-10-19 02:02:08 +00:00
snippet catch
2013-07-14 01:37:49 +00:00
abbr catch /pattern/
2012-10-21 08:51:07 +00:00
options head
2012-10-29 10:27:18 +00:00
catch ${1:/${2:#:pattern: empty, E484, Vim(cmdname):{errmsg\\}\}/}
2012-10-19 02:02:08 +00:00
2012-10-29 02:22:37 +00:00
snippet echomsg
alias log
2012-10-21 08:51:07 +00:00
options head
2012-10-29 22:38:37 +00:00
echomsg string(${1:TARGET})
2012-02-02 04:33:35 +00:00
snippet command
abbr command call function
2012-10-21 08:51:07 +00:00
options head
2012-10-29 10:27:18 +00:00
command! ${1:#:command_name} call ${2:#:func_name}
2012-02-02 04:33:35 +00:00
snippet customlist
abbr customlist complete function
2012-10-21 08:51:07 +00:00
options head
2012-10-29 10:27:18 +00:00
function! ${1:#:func_name}(arglead, cmdline, cursorpos)
2013-02-01 02:47:59 +00:00
return filter(${2:#:list}, 'stridx(v:val, a:arglead) == 0')
2012-02-02 04:33:35 +00:00
endfunction
snippet augroup
abbr augroup with autocmds
2012-10-21 08:51:07 +00:00
options head
2012-10-30 08:53:14 +00:00
augroup ${1:#:augroup_name}
2013-02-01 02:47:59 +00:00
autocmd!
autocmd ${2:#:event}
augroup END
snippet redir
abbr redir => var
options head
2012-10-29 10:27:18 +00:00
redir => ${1:#:var}
2012-10-29 22:38:37 +00:00
${2::TARGET}
redir END
2012-12-01 15:44:38 +00:00
snippet NeoBundle
2013-01-22 01:49:21 +00:00
alias neobundle
2012-12-01 15:44:38 +00:00
abbr NeoBundle ''
NeoBundle '`getreg('+')=='' ? '<\`0\`>' : getreg('+')`'${0}
2013-01-22 01:48:34 +00:00
snippet NeoBundleLazy
2013-01-22 01:49:21 +00:00
alias neobundlelazy
2013-01-22 01:48:34 +00:00
abbr NeoBundleLazy ''
2013-02-24 06:34:45 +00:00
NeoBundleLazy '`getreg('+')=='' ? '<\`0\`>' : getreg('+')`', {
\ 'autoload' : {
\ ${0}
2013-01-22 01:48:34 +00:00
\ }}
2013-10-17 04:02:15 +00:00
snippet bundle_hooks
abbr neobundle hooks
let s:hooks = neobundle#get_hooks('${1}')
function! s:hooks.on_source(bundle)
${0}
endfunction
2013-10-24 02:48:26 +00:00
unlet s:hooks
2013-10-17 04:02:15 +00:00
2013-01-29 23:03:53 +00:00
snippet autoload
abbr autoload func endfunc
alias afunction afunc
2013-02-01 02:47:59 +00:00
options head
2013-01-29 23:03:53 +00:00
function! `substitute(matchstr(neosnippet#util#expand('%:p:r'), '/autoload/\zs.*$'), '/', '#', 'g')`#${1:#:func_name}(${2:#:args})
2013-02-01 02:47:59 +00:00
${0}
2013-01-29 23:03:53 +00:00
endfunction
2013-02-01 02:47:59 +00:00
snippet save_cpoptions
abbr let s:save_cpo = &cpo | set cpo&vim
alias s:save_cpo cpoptions
options head
let s:save_cpo = &cpo
set cpo&vim
${0}
let &cpo = s:save_cpo
unlet s:save_cpo
snippet g:loaded
abbr if exists('g:loaded_{plugin-name}')
alias loaded
options head
if exists('g:loaded_${1}')
finish
endif
${0}
let g:loaded_$1 = 1
snippet modeline
abbr " vim: {modeline}
" vim: ${0:foldmethod=marker}
snippet undo_ftplugin
abbr if !exists('b:undo_ftplugin')
alias b:undo_ftplugin
if !exists('b:undo_ftplugin')
let b:undo_ftplugin = ''
endif
${1}
let b:undo_ftplugin .= '
\ | setlocal ${2:#:option_name1< option_name2<...}
\'
2013-03-24 09:52:34 +00:00
snippet python
alias py
options head
abbr python <<EOF | EOF
python << EOF
${0}
EOF
snippet python3
alias py3
options head
abbr python3 <<EOF | EOF
python3 << EOF
${0}
EOF
snippet lua
options head
abbr lua <<EOF | EOF
lua << EOF
${0}
EOF
snippet save_pos
options head
abbr use pos save
let pos_save = getpos('.')
2013-09-26 02:43:39 +00:00
try
${0}
finally
call setpos('.', pos_save)
endtry
2013-03-24 09:52:34 +00:00
snippet save_register
options head
abbr use register save
let save_reg_$1 = getreg('${1}')
let save_regtype_$1 = getregtype('$1')
2013-09-26 02:43:39 +00:00
try
${0}
finally
call setreg('$1', save_reg_$1, save_regtype_$1)
endtry
snippet save_option
options head
abbr use option save
let $1_save = &${1}
let &$1 = ${2}
2013-09-26 02:43:39 +00:00
try
${0}
finally
let &$1 = $1_save
endtry