Merge branch 'master' of github.com:Shougo/neosnippet
This commit is contained in:
commit
ff8b0b60c9
@ -65,8 +65,8 @@ imap <C-k> <Plug>(neosnippet_expand_or_jump)
|
|||||||
smap <C-k> <Plug>(neosnippet_expand_or_jump)
|
smap <C-k> <Plug>(neosnippet_expand_or_jump)
|
||||||
|
|
||||||
" SuperTab like snippets behavior.
|
" SuperTab like snippets behavior.
|
||||||
imap <expr><TAB> neosnippet#expandable() ? "\<Plug>(neosnippet_expand_or_jump)" : pumvisible() ? "\<C-n>" : "\<TAB>"
|
imap <expr><TAB> neosnippet#expandable() <Bar><bar> neosnippet#jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : pumvisible() ? "\<C-n>" : "\<TAB>"
|
||||||
smap <expr><TAB> neosnippet#expandable() ? "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
|
smap <expr><TAB> neosnippet#expandable() <Bar><bar> neosnippet#jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
|
||||||
|
|
||||||
" For snippet_complete marker.
|
" For snippet_complete marker.
|
||||||
if has('conceal')
|
if has('conceal')
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: neosnippet.vim
|
" FILE: neosnippet.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
||||||
" Last Modified: 02 Jan 2013.
|
" Last Modified: 07 Jan 2013.
|
||||||
" License: MIT license {{{
|
" License: MIT license {{{
|
||||||
" Permission is hereby granted, free of charge, to any person obtaining
|
" Permission is hereby granted, free of charge, to any person obtaining
|
||||||
" a copy of this software and associated documentation files (the
|
" a copy of this software and associated documentation files (the
|
||||||
@ -80,22 +80,9 @@ endfunction"}}}
|
|||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
function! neosnippet#expandable() "{{{
|
function! neosnippet#expandable() "{{{
|
||||||
let ret = 0
|
|
||||||
|
|
||||||
let snippets = neosnippet#get_snippets()
|
|
||||||
let cur_text = neosnippet#util#get_cur_text()
|
|
||||||
|
|
||||||
" Check snippet trigger.
|
" Check snippet trigger.
|
||||||
if s:get_cursor_snippet(snippets, cur_text) != ''
|
return s:get_cursor_snippet(
|
||||||
let ret += 1
|
\ neosnippet#get_snippets(), neosnippet#util#get_cur_text()) != ''
|
||||||
endif
|
|
||||||
|
|
||||||
" Check jumpable.
|
|
||||||
if neosnippet#jumpable()
|
|
||||||
let ret += 2
|
|
||||||
endif
|
|
||||||
|
|
||||||
return ret
|
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
function! neosnippet#jumpable() "{{{
|
function! neosnippet#jumpable() "{{{
|
||||||
" Found snippet placeholder.
|
" Found snippet placeholder.
|
||||||
|
@ -285,15 +285,14 @@ neosnippet#expandable()
|
|||||||
*neosnippet#expandable()*
|
*neosnippet#expandable()*
|
||||||
You can use this function with imap <expr>. It checks whether
|
You can use this function with imap <expr>. It checks whether
|
||||||
the cursor text is a snippet trigger or a placeholder. This is
|
the cursor text is a snippet trigger or a placeholder. This is
|
||||||
is useful to save key mappings. The return values of the
|
is useful to save key mappings.
|
||||||
function are:
|
Note: If you used to
|
||||||
|
|neocomplcache#sources#snippets_complete#expandable()|, you
|
||||||
0: not found
|
must use both |neosnippet#expandable()| and
|
||||||
1: the cursor text is a snippet trigger
|
|neosnippet#jumpable()|.
|
||||||
2: a placeholder exists in the current buffer
|
|
||||||
3: both found
|
|
||||||
>
|
>
|
||||||
imap <expr><C-l> neosnippet#expandable() ?
|
imap <expr><C-l>
|
||||||
|
\ neosnippet#expandable() <Bar><bar> neosnippet#jumpable() ?
|
||||||
\ "\<Plug>(neosnippet_expand_or_jump)" : "\<C-n>"
|
\ "\<Plug>(neosnippet_expand_or_jump)" : "\<C-n>"
|
||||||
<
|
<
|
||||||
*neocomplcache#sources#snippets_complete#expandable()*
|
*neocomplcache#sources#snippets_complete#expandable()*
|
||||||
@ -338,10 +337,10 @@ EXAMPLES *neosnippet-examples*
|
|||||||
xmap <C-l> <Plug>(neosnippet_start_unite_snippet_target)
|
xmap <C-l> <Plug>(neosnippet_start_unite_snippet_target)
|
||||||
|
|
||||||
" SuperTab like snippets behavior.
|
" SuperTab like snippets behavior.
|
||||||
"imap <expr><TAB> neosnippet#expandable() ?
|
"imap <expr><TAB> neosnippet#expandable() <Bar><bar> neosnippet#jumpable() ?
|
||||||
" \ "\<Plug>(neosnippet_expand_or_jump)"
|
" \ "\<Plug>(neosnippet_expand_or_jump)"
|
||||||
" \: pumvisible() ? "\<C-n>" : "\<TAB>"
|
" \: pumvisible() ? "\<C-n>" : "\<TAB>"
|
||||||
"smap <expr><TAB> neosnippet#expandable() ?
|
"smap <expr><TAB> neosnippet#expandable() <Bar><bar> neosnippet#jumpable() ?
|
||||||
" \ "\<Plug>(neosnippet_expand_or_jump)"
|
" \ "\<Plug>(neosnippet_expand_or_jump)"
|
||||||
" \: "\<TAB>"
|
" \: "\<TAB>"
|
||||||
|
|
||||||
@ -711,6 +710,9 @@ A: Please try below settings. It defines snipMate function.
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
CHANGELOG *neosnippet-changelog*
|
CHANGELOG *neosnippet-changelog*
|
||||||
|
|
||||||
|
2013-01-07
|
||||||
|
- Changed neosnippet#expandable() behavior.
|
||||||
|
|
||||||
2013-01-02
|
2013-01-02
|
||||||
- Improved initialization timing.
|
- Improved initialization timing.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user