Fix #218 add g:neosnippet#expand_word_boundary

This commit is contained in:
Shougo Matsushita 2014-03-11 21:28:47 +09:00
parent de82d40911
commit 5090af586c
4 changed files with 16 additions and 5 deletions

View File

@ -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: 01 Jan 2014. " Last Modified: 11 Mar 2014.
" 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
@ -38,6 +38,8 @@ call neosnippet#util#set_default(
\ 'g:neosnippet#disable_select_mode_mappings', 1) \ 'g:neosnippet#disable_select_mode_mappings', 1)
call neosnippet#util#set_default( call neosnippet#util#set_default(
\ 'g:neosnippet#enable_snipmate_compatibility', 0) \ 'g:neosnippet#enable_snipmate_compatibility', 0)
call neosnippet#util#set_default(
\ 'g:neosnippet#expand_word_boundary', 0)
"}}} "}}}
function! neosnippet#expandable_or_jumpable() "{{{ function! neosnippet#expandable_or_jumpable() "{{{

View File

@ -1,7 +1,7 @@
"============================================================================= "=============================================================================
" FILE: helpers.vim " FILE: helpers.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com> " AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 21 Nov 2013. " Last Modified: 11 Mar 2014.
" 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

View File

@ -1,7 +1,7 @@
"============================================================================= "=============================================================================
" FILE: parser.vim " FILE: parser.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com> " AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 21 Nov 2013. " Last Modified: 11 Mar 2014.
" 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
@ -238,7 +238,8 @@ function! neosnippet#parser#_initialize_snippet(dict, path, line, pattern, name)
endfunction"}}} endfunction"}}}
function! neosnippet#parser#_initialize_snippet_options() "{{{ function! neosnippet#parser#_initialize_snippet_options() "{{{
return { 'head' : 0, 'word' : 0, 'indent' : 0 } return { 'head' : 0, 'word' :
\ g:neosnippet#expand_word_boundary, 'indent' : 0 }
endfunction"}}} endfunction"}}}
let &cpo = s:save_cpo let &cpo = s:save_cpo

View File

@ -208,6 +208,13 @@ g:neosnippet#enable_preview *g:neosnippet#enable_preview*
If this variable is not 0, neosnippet will enable the preview If this variable is not 0, neosnippet will enable the preview
window feature in neocomplcache/neocomplete sources. window feature in neocomplcache/neocomplete sources.
The default value is 0.
*g:neosnippet#expand_word_boundary*
g:neosnippet#expand_word_boundary
It it is not 0, neosnippet will expand snippets by a word
boundary.
The default value is 0. The default value is 0.
*g:neosnippet#scope_aliases* *g:neosnippet#scope_aliases*
@ -698,7 +705,8 @@ FAQ *neosnippet-faq*
Q: What if I want to expand a snippet trigger after (, [, " etc...: Q: What if I want to expand a snippet trigger after (, [, " etc...:
A: You should use "options word" in the snippet definition. This changes the A: You should use "options word" in the snippet definition. This changes the
expansion behavior to a word boundary. expansion behavior to a word boundary or set
|g:neosnippet#enable_word_expand|.
> >
snippet date snippet date
options word options word