- Improved documentation.

This commit is contained in:
Shougo Matsushita 2012-09-30 18:13:49 +09:00
parent ba03d23a91
commit 83e20ff749
3 changed files with 44 additions and 30 deletions

View File

@ -120,7 +120,7 @@ function! neocomplcache#sources#snippets_complete#get_snippets()"{{{
return neosnippet#get_snippets() return neosnippet#get_snippets()
endfunction"}}} endfunction"}}}
function! neocomplcache#sources#snippets_complete#get_snippets_dir()"{{{ function! neocomplcache#sources#snippets_complete#get_snippets_dir()"{{{
return neosnippet#get_snippets_dir() return neosnippet#get_snippets_directory()
endfunction"}}} endfunction"}}}
let &cpo = s:save_cpo let &cpo = s:save_cpo

View File

@ -796,7 +796,7 @@ function! neosnippet#get_snippets()"{{{
return snippets return snippets
endfunction"}}} endfunction"}}}
function! neosnippet#get_snippets_dir()"{{{ function! neosnippet#get_snippets_directory()"{{{
return s:snippets_dir return s:snippets_dir
endfunction"}}} endfunction"}}}
function! neosnippet#get_filetype()"{{{ function! neosnippet#get_filetype()"{{{

View File

@ -72,7 +72,7 @@ COMMANDS *neosnippet-commands*
automatically. automatically.
This command edits a snippet file in This command edits a snippet file in
|g:neocomplcache_snippets_dir| with precedence. |g:neosnippet#snippets_directory| with precedence.
Re-cache will be done automatically when you save the file. Re-cache will be done automatically when you save the file.
:NeoComplCacheEditRuntimeSnippets [filetype] :NeoComplCacheEditRuntimeSnippets [filetype]
@ -164,16 +164,16 @@ KEY MAPPINGS *neosnippet-key-mappings*
Note: |<Plug>(neocomplcache_snippets_force_jump)| is Note: |<Plug>(neocomplcache_snippets_force_jump)| is
obsolute name. obsolute name.
i_<Plug>(neocomplcache_start_unite_snippet) i_<Plug>(neosnippet_start_snippet)
*i_<Plug>(neocomplcache_start_unite_snippet)* *i_<Plug>(neosnippet_start_snippet)*
Start unite snippet source. Start unite snippet source.
*<Plug>(neocomplcache_start_unite_snippet)* *<Plug>(neocomplcache_start_unite_snippet)*
Note: |<Plug>(neocomplcache_start_unite_snippet)| is obsolute Note: |<Plug>(neocomplcache_start_unite_snippet)| is obsolute
name. name.
neocomplcache#sources#snippets_complete#expandable() neosnippet#expandable()
*neocomplcache#sources#snippets_complete#expandable()* *neosnippet#expandable()*
Use this function with imap <expr>. It checks whether cursor Use this function with imap <expr>. It checks whether cursor
text is a snippet trigger or a placeholder exists in the text is a snippet trigger or a placeholder exists in the
current buffer. It's useful for saving keymappings. current buffer. It's useful for saving keymappings.
@ -183,39 +183,52 @@ neocomplcache#sources#snippets_complete#expandable()
2: a placeholder exists in the current buffer 2: a placeholder exists in the current buffer
3: both found 3: both found
> >
imap <expr><C-l> neocomplcache#sources#snippets_complete#expandable() ? imap <expr><C-l> neosnippet#expandable() ?
\ "\<Plug>(neocomplcache_snippets_expand)" : "\<C-n>" \ "\<Plug>(neosnippet_expand_or_jump)" : "\<C-n>"
< <
neocomplcache#sources#snippets_complete#force_expandable() *neocomplcache#sources#snippets_complete#expandable()*
*neocomplcache#sources#snippets_complete#force_expandable()* *neocomplcache#sources#snippets_complete#force_expandable()*
Use this function with imap <expr>. It checks whether cursor Note:
text is snippet trigger. Useful for saving keymappings. |neocomplcache#sources#snippets_complete#expandable()|
and
|neocomplcache#sources#snippets_complete#force_expandable()|
is obsolute name.
neocomplcache#sources#snippets_complete#jumpable() neosnippet#jumpable()
*neocomplcache#sources#snippets_complete#jumpable()* *neosnippet#jumpable()*
Use this function with imap <expr>. It checks whether cursor Use this function with imap <expr>. It checks whether cursor
text is an existing placeholder in current buffer. text is an existing placeholder in current buffer.
Useful for saving keymappings. Useful for saving keymappings.
*neocomplcache#sources#snippets_complete#jumpable()*
Note: |neocomplcache#sources#snippets_complete#jumpable()| is
obsolute name.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
FUNCTIONS *neosnippet-functions* FUNCTIONS *neosnippet-functions*
neocomplcache#sources#snippets_complete#get_snippets_dir() neosnippet#get_snippets_directory()
*neocomplcache#sources#snippets_complete#get_snippets_dir()* *neosnippet#get_snippets_directory()*
Gets snippet directories. This directories contain runtime Gets snippet directories. This directories contain runtime
snippets directories and |g:neocomplcache_snippets_dir| snippets directories and |g:neosnippet#snippets_directory|
directories. directories.
*neocomplcache#sources#snippets_complete#get_snippets_dir()*
Note:
|neocomplcache#sources#snippets_complete#get_snippets_dir()|
is obsolute name.
============================================================================== ==============================================================================
EXAMPLES *neosnippet-examples* EXAMPLES *neosnippet-examples*
> >
" Plugin key-mappings. " Plugin key-mappings.
imap <C-k> <Plug>(neosnippet_expand) imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand) smap <C-k> <Plug>(neosnippet_expand_or_jump)
" SuperTab like snippets behavior. " SuperTab like snippets behavior.
"imap <expr><TAB> neosnippet#expandable() ? "imap <expr><TAB> neosnippet#expandable() ?
" \ "\<Plug>(neosnippet_expand)" : pumvisible() ? "\<C-n>" : "\<TAB>" " \ "\<Plug>(neosnippet_expand_or_jump)"
" \: pumvisible() ? "\<C-n>" : "\<TAB>"
" For snippet_complete marker. " For snippet_complete marker.
if has('conceal') if has('conceal')
@ -264,11 +277,11 @@ Eval snippet feature is available.
If you use |:NeoComplCacheEditSnippets| command for easy snippet editing, the If you use |:NeoComplCacheEditSnippets| command for easy snippet editing, the
file will be loaded automatically when you save the file. file will be loaded automatically when you save the file.
Neocomplcache doesn't map snippet-expand key by default. If you want to use Neosnippet doesn't map snippet-expand key by default. If you want to use
snippet feature, you can define below mappings in your .vimrc: snippet feature, you can define below mappings in your .vimrc:
> >
imap <C-l> <Plug>(neocomplcache_snippets_expand) imap <C-l> <Plug>(neosnippet_expand_or_jump)
smap <C-l> <Plug>(neocomplcache_snippets_expand) smap <C-l> <Plug>(neosnippet_expand_or_jump)
< <
Placeholder feature is available. Placeholder feature is available.
@ -281,7 +294,7 @@ Placeholder feature is available.
endif endif
< <
'_' snippet feature is supported. '_' snippet is loaded in all filetypes. '_' snippet feature is supported. '_' snippet is loaded in all filetypes.
And neocomplcache can load snipMate snippets. And neosnippet can load snipMate snippets.
Alias feature is supported. Separator is ' ' or ','. Alias feature is supported. Separator is ' ' or ','.
> >
@ -297,7 +310,7 @@ The placeholder value can't contain new lines. Below snippet is illegal:
${3:# do smth}} ${3:# do smth}}
< <
Multi snippet feature is supported in snipMate. Multi snippet feature is supported in snipMate.
neocomplcache substitutes trigger and descriptions spaces to '_'. neosnippet substitutes trigger and descriptions spaces to '_'.
> >
snippet trigger description1 snippet trigger description1
hoge hoge
@ -305,7 +318,7 @@ neocomplcache substitutes trigger and descriptions spaces to '_'.
piyo piyo
< <
You choose snippet <C-n> or <C-p> and expand it with You choose snippet <C-n> or <C-p> and expand it with
|<Plug>(neocomplcache_snippets_expand)| key-mappings. |<Plug>(neosnippet_expand_or_jump)| key-mappings.
Nested placeholder feature is supported. Nested placeholder feature is supported.
But must escape inner '}'. '\' is eacape sequence. But must escape inner '}'. '\' is eacape sequence.
@ -313,7 +326,7 @@ But must escape inner '}'. '\' is eacape sequence.
snippet div snippet div
<div ${1:id="${2:someid\}"}>${3}</div>${4} <div ${1:id="${2:someid\}"}>${3}</div>${4}
< <
If you use hard tab for indentation in snippet file, neocomplcache will use If you use hard tab for indentation in snippet file, neosnippet will use
'shiftwidth' instead of Vim indent plugin. This feature is useful while some 'shiftwidth' instead of Vim indent plugin. This feature is useful while some
languages' indent files can not work very well (e.g.: PHP, Python). languages' indent files can not work very well (e.g.: PHP, Python).
> >
@ -327,14 +340,14 @@ UNITE SOURCES *neosnippet-unite-sources*
*neosnippet-unite-source-snippet* *neosnippet-unite-source-snippet*
snippet snippet
The candidates are neocomplcache snippets. The kinds are The candidates are neosnippet snippets. The kinds are
"snippet". Normally used in "snippet". Normally used in
|<Plug>(neocomplcache_start_unite_snippet)| mappings. |<Plug>(neosnippet_start_unite_snippet)| mappings.
But you can execute it by ":Unite snippet". But you can execute it by ":Unite snippet".
You can edit snippet file in "edit" action. You can edit snippet file in "edit" action.
Examples: Examples:
> >
imap <C-s> <Plug>(neocomplcache_start_unite_snippet) imap <C-s> <Plug>(neosnippet_start_unite_snippet)
< <
source actions source actions
@ -354,6 +367,7 @@ CHANGELOG *neosnippet-changelog*
- Deleted s:get_cursor_keyword_snippet(). - Deleted s:get_cursor_keyword_snippet().
- Improved for filetype. - Improved for filetype.
- Improved filetype complete. - Improved filetype complete.
- Improved documentation.
2012-09-27 2012-09-27
- Ver.3 development is started. - Ver.3 development is started.