2012-09-27 12:30:33 +00:00
|
|
|
"=============================================================================
|
|
|
|
" FILE: neosnippet.vim
|
|
|
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
2013-01-20 02:59:32 +00:00
|
|
|
" Last Modified: 20 Jan 2013.
|
2012-09-27 12:30:33 +00:00
|
|
|
" License: MIT license {{{
|
|
|
|
" Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
" a copy of this software and associated documentation files (the
|
|
|
|
" "Software"), to deal in the Software without restriction, including
|
|
|
|
" without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
" distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
" permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
" the following conditions:
|
|
|
|
"
|
|
|
|
" The above copyright notice and this permission notice shall be included
|
|
|
|
" in all copies or substantial portions of the Software.
|
|
|
|
"
|
|
|
|
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
|
|
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
|
|
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
|
|
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
|
|
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
" }}}
|
|
|
|
"=============================================================================
|
|
|
|
|
|
|
|
if exists('g:loaded_neosnippet')
|
|
|
|
finish
|
|
|
|
elseif v:version < 702
|
|
|
|
echoerr 'neosnippet does not work this version of Vim "' . v:version . '".'
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
|
|
|
|
let s:save_cpo = &cpo
|
|
|
|
set cpo&vim
|
|
|
|
|
2012-12-13 08:34:20 +00:00
|
|
|
" Obsolute options check. "{{{
|
2012-09-27 12:30:33 +00:00
|
|
|
"}}}
|
|
|
|
|
2012-12-13 08:34:20 +00:00
|
|
|
" Plugin key-mappings. "{{{
|
2012-09-27 15:42:34 +00:00
|
|
|
inoremap <silent><expr> <Plug>(neosnippet_expand_or_jump)
|
|
|
|
\ neosnippet#expand_or_jump_impl()
|
|
|
|
inoremap <silent><expr> <Plug>(neosnippet_jump_or_expand)
|
|
|
|
\ neosnippet#jump_or_expand_impl()
|
|
|
|
inoremap <silent><expr> <Plug>(neosnippet_expand)
|
|
|
|
\ neosnippet#expand_impl()
|
|
|
|
inoremap <silent><expr> <Plug>(neosnippet_jump)
|
|
|
|
\ neosnippet#jump_impl()
|
2012-10-29 20:09:50 +00:00
|
|
|
snoremap <silent><expr> <Plug>(neosnippet_expand_or_jump)
|
|
|
|
\ neosnippet#expand_or_jump_impl()
|
|
|
|
snoremap <silent><expr> <Plug>(neosnippet_jump_or_expand)
|
|
|
|
\ neosnippet#jump_or_expand_impl()
|
|
|
|
snoremap <silent><expr> <Plug>(neosnippet_expand)
|
|
|
|
\ neosnippet#expand_impl()
|
2012-09-27 15:42:34 +00:00
|
|
|
snoremap <silent><expr> <Plug>(neosnippet_jump)
|
|
|
|
\ neosnippet#jump_impl()
|
2012-09-27 12:30:33 +00:00
|
|
|
|
2012-10-29 20:09:50 +00:00
|
|
|
xnoremap <silent> <Plug>(neosnippet_get_selected_text)
|
|
|
|
\ :call neosnippet#get_selected_text(visualmode(), 1)<CR>
|
2012-10-29 10:27:18 +00:00
|
|
|
|
2012-09-27 12:30:33 +00:00
|
|
|
imap <silent> <Plug>(neocomplcache_snippets_expand)
|
2012-09-27 15:42:34 +00:00
|
|
|
\ <Plug>(neosnippet_expand_or_jump)
|
2012-09-27 12:30:33 +00:00
|
|
|
smap <silent> <Plug>(neocomplcache_snippets_expand)
|
2012-09-27 15:42:34 +00:00
|
|
|
\ <Plug>(neosnippet_expand_or_jump)
|
2012-09-27 12:30:33 +00:00
|
|
|
imap <silent> <Plug>(neocomplcache_snippets_jump)
|
2012-09-27 15:42:34 +00:00
|
|
|
\ <Plug>(neosnippet_jump_or_expand)
|
2012-09-27 12:30:33 +00:00
|
|
|
smap <silent> <Plug>(neocomplcache_snippets_jump)
|
2012-10-29 10:27:18 +00:00
|
|
|
\ <Plug>(neosnippet_expand_or_jump)
|
2012-09-27 12:30:33 +00:00
|
|
|
imap <silent> <Plug>(neocomplcache_snippets_force_expand)
|
2012-09-27 15:42:34 +00:00
|
|
|
\ <Plug>(neosnippet_expand)
|
2012-09-27 12:30:33 +00:00
|
|
|
smap <silent> <Plug>(neocomplcache_snippets_force_expand)
|
2012-09-27 15:42:34 +00:00
|
|
|
\ <Plug>(neosnippet_expand)
|
2012-09-27 12:30:33 +00:00
|
|
|
imap <silent> <Plug>(neocomplcache_snippets_force_jump)
|
2012-09-27 15:42:34 +00:00
|
|
|
\ <Plug>(neosnippet_jump)
|
2012-09-27 12:30:33 +00:00
|
|
|
smap <silent> <Plug>(neocomplcache_snippets_force_jump)
|
2012-09-27 15:42:34 +00:00
|
|
|
\ <Plug>(neosnippet_jump)
|
2012-09-30 09:04:48 +00:00
|
|
|
|
2012-10-29 22:38:37 +00:00
|
|
|
xnoremap <silent> <Plug>(neosnippet_expand_target)
|
|
|
|
\ :<C-u>call neosnippet#expand_target()<CR>
|
2012-10-31 05:50:50 +00:00
|
|
|
xnoremap <silent><expr> <Plug>(neosnippet_start_unite_snippet_target)
|
|
|
|
\ unite#sources#snippet_target#start()
|
2012-10-30 02:27:59 +00:00
|
|
|
xnoremap <silent> <Plug>(neosnippet_register_oneshot_snippet)
|
|
|
|
\ :<C-u>call neosnippet#register_oneshot_snippet()<CR>
|
2012-10-29 22:38:37 +00:00
|
|
|
|
2012-09-30 09:04:48 +00:00
|
|
|
imap <silent> <Plug>(neocomplcache_start_unite_snippet)
|
|
|
|
\ <Plug>(neosnippet_start_unite_snippet)
|
|
|
|
inoremap <expr><silent> <Plug>(neosnippet_start_unite_snippet)
|
|
|
|
\ unite#sources#snippet#start_complete()
|
2012-09-27 12:30:33 +00:00
|
|
|
"}}}
|
|
|
|
|
2012-12-13 08:34:20 +00:00
|
|
|
augroup neosnippet "{{{
|
2013-01-20 02:59:32 +00:00
|
|
|
autocmd CursorHold,CursorMovedI
|
|
|
|
\ * call neosnippet#_lazy_initialize()
|
2012-09-27 15:42:34 +00:00
|
|
|
augroup END"}}}
|
|
|
|
|
2012-12-13 08:34:20 +00:00
|
|
|
" Commands. "{{{
|
2012-09-30 10:10:25 +00:00
|
|
|
command! -nargs=? -complete=customlist,neosnippet#edit_complete
|
|
|
|
\ NeoSnippetEdit
|
|
|
|
\ call neosnippet#edit_snippets(<q-args>)
|
|
|
|
|
|
|
|
command! -nargs=? -complete=customlist,neosnippet#filetype_complete
|
|
|
|
\ NeoSnippetMakeCache
|
|
|
|
\ call neosnippet#make_cache(<q-args>)
|
|
|
|
|
|
|
|
command! -nargs=? -complete=customlist,neosnippet#filetype_complete
|
|
|
|
\ NeoComplCacheCachingSnippets
|
|
|
|
\ NeoSnippetMakeCache <args>
|
2012-09-30 08:45:41 +00:00
|
|
|
command! -nargs=? -complete=customlist,neosnippet#filetype_complete
|
|
|
|
\ NeoComplCacheEditSnippets
|
2012-09-30 10:10:25 +00:00
|
|
|
\ NeoSnippetEdit <args>
|
2012-09-30 08:45:41 +00:00
|
|
|
command! -nargs=? -complete=customlist,neosnippet#filetype_complete
|
|
|
|
\ NeoComplCacheEditRuntimeSnippets
|
2012-09-30 10:10:25 +00:00
|
|
|
\ NeoSnippetEdit -runtime <args>
|
2012-11-03 03:33:18 +00:00
|
|
|
|
|
|
|
command! -nargs=1 -complete=file
|
|
|
|
\ NeoSnippetSource
|
|
|
|
\ call neosnippet#source_file(<q-args>)
|
2012-09-30 08:45:41 +00:00
|
|
|
"}}}
|
|
|
|
|
2012-09-27 12:30:33 +00:00
|
|
|
let g:loaded_neosnippet = 1
|
|
|
|
|
|
|
|
let &cpo = s:save_cpo
|
|
|
|
unlet s:save_cpo
|
|
|
|
|
|
|
|
" __END__
|
|
|
|
" vim: foldmethod=marker
|