From 83e20ff74910c65944b9a6d3412c0b914e55a60c Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Sun, 30 Sep 2012 18:13:49 +0900 Subject: [PATCH] - Improved documentation. --- .../sources/snippets_complete.vim | 2 +- autoload/neosnippet.vim | 2 +- doc/neosnippet.txt | 70 +++++++++++-------- 3 files changed, 44 insertions(+), 30 deletions(-) diff --git a/autoload/neocomplcache/sources/snippets_complete.vim b/autoload/neocomplcache/sources/snippets_complete.vim index 0b021a3..2c2d203 100644 --- a/autoload/neocomplcache/sources/snippets_complete.vim +++ b/autoload/neocomplcache/sources/snippets_complete.vim @@ -120,7 +120,7 @@ function! neocomplcache#sources#snippets_complete#get_snippets()"{{{ return neosnippet#get_snippets() endfunction"}}} function! neocomplcache#sources#snippets_complete#get_snippets_dir()"{{{ - return neosnippet#get_snippets_dir() + return neosnippet#get_snippets_directory() endfunction"}}} let &cpo = s:save_cpo diff --git a/autoload/neosnippet.vim b/autoload/neosnippet.vim index 6814560..b1d269d 100644 --- a/autoload/neosnippet.vim +++ b/autoload/neosnippet.vim @@ -796,7 +796,7 @@ function! neosnippet#get_snippets()"{{{ return snippets endfunction"}}} -function! neosnippet#get_snippets_dir()"{{{ +function! neosnippet#get_snippets_directory()"{{{ return s:snippets_dir endfunction"}}} function! neosnippet#get_filetype()"{{{ diff --git a/doc/neosnippet.txt b/doc/neosnippet.txt index f49a405..1252d2b 100644 --- a/doc/neosnippet.txt +++ b/doc/neosnippet.txt @@ -72,7 +72,7 @@ COMMANDS *neosnippet-commands* automatically. 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. :NeoComplCacheEditRuntimeSnippets [filetype] @@ -164,16 +164,16 @@ KEY MAPPINGS *neosnippet-key-mappings* Note: |(neocomplcache_snippets_force_jump)| is obsolute name. -i_(neocomplcache_start_unite_snippet) - *i_(neocomplcache_start_unite_snippet)* +i_(neosnippet_start_snippet) + *i_(neosnippet_start_snippet)* Start unite snippet source. *(neocomplcache_start_unite_snippet)* Note: |(neocomplcache_start_unite_snippet)| is obsolute name. -neocomplcache#sources#snippets_complete#expandable() - *neocomplcache#sources#snippets_complete#expandable()* +neosnippet#expandable() + *neosnippet#expandable()* Use this function with imap . It checks whether cursor text is a snippet trigger or a placeholder exists in the 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 3: both found > - imap neocomplcache#sources#snippets_complete#expandable() ? - \ "\(neocomplcache_snippets_expand)" : "\" + imap neosnippet#expandable() ? + \ "\(neosnippet_expand_or_jump)" : "\" < -neocomplcache#sources#snippets_complete#force_expandable() + *neocomplcache#sources#snippets_complete#expandable()* *neocomplcache#sources#snippets_complete#force_expandable()* - Use this function with imap . It checks whether cursor - text is snippet trigger. Useful for saving keymappings. + Note: + |neocomplcache#sources#snippets_complete#expandable()| + and + |neocomplcache#sources#snippets_complete#force_expandable()| + is obsolute name. -neocomplcache#sources#snippets_complete#jumpable() - *neocomplcache#sources#snippets_complete#jumpable()* +neosnippet#jumpable() + *neosnippet#jumpable()* Use this function with imap . It checks whether cursor text is an existing placeholder in current buffer. Useful for saving keymappings. + *neocomplcache#sources#snippets_complete#jumpable()* + Note: |neocomplcache#sources#snippets_complete#jumpable()| is + obsolute name. + ------------------------------------------------------------------------------ FUNCTIONS *neosnippet-functions* -neocomplcache#sources#snippets_complete#get_snippets_dir() - *neocomplcache#sources#snippets_complete#get_snippets_dir()* +neosnippet#get_snippets_directory() + *neosnippet#get_snippets_directory()* Gets snippet directories. This directories contain runtime - snippets directories and |g:neocomplcache_snippets_dir| + snippets directories and |g:neosnippet#snippets_directory| directories. + *neocomplcache#sources#snippets_complete#get_snippets_dir()* + Note: + |neocomplcache#sources#snippets_complete#get_snippets_dir()| + is obsolute name. + ============================================================================== EXAMPLES *neosnippet-examples* > " Plugin key-mappings. - imap (neosnippet_expand) - smap (neosnippet_expand) + imap (neosnippet_expand_or_jump) + smap (neosnippet_expand_or_jump) " SuperTab like snippets behavior. "imap neosnippet#expandable() ? - " \ "\(neosnippet_expand)" : pumvisible() ? "\" : "\" + " \ "\(neosnippet_expand_or_jump)" + " \: pumvisible() ? "\" : "\" " For snippet_complete marker. if has('conceal') @@ -264,11 +277,11 @@ Eval snippet feature is available. If you use |:NeoComplCacheEditSnippets| command for easy snippet editing, the 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: > - imap (neocomplcache_snippets_expand) - smap (neocomplcache_snippets_expand) + imap (neosnippet_expand_or_jump) + smap (neosnippet_expand_or_jump) < Placeholder feature is available. @@ -281,7 +294,7 @@ Placeholder feature is available. endif < '_' 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 ','. > @@ -297,7 +310,7 @@ The placeholder value can't contain new lines. Below snippet is illegal: ${3:# do smth}} < Multi snippet feature is supported in snipMate. -neocomplcache substitutes trigger and descriptions spaces to '_'. +neosnippet substitutes trigger and descriptions spaces to '_'. > snippet trigger description1 hoge @@ -305,7 +318,7 @@ neocomplcache substitutes trigger and descriptions spaces to '_'. piyo < You choose snippet or and expand it with -|(neocomplcache_snippets_expand)| key-mappings. +|(neosnippet_expand_or_jump)| key-mappings. Nested placeholder feature is supported. But must escape inner '}'. '\' is eacape sequence. @@ -313,7 +326,7 @@ But must escape inner '}'. '\' is eacape sequence. snippet div
${3}
${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 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* snippet - The candidates are neocomplcache snippets. The kinds are + The candidates are neosnippet snippets. The kinds are "snippet". Normally used in - |(neocomplcache_start_unite_snippet)| mappings. + |(neosnippet_start_unite_snippet)| mappings. But you can execute it by ":Unite snippet". You can edit snippet file in "edit" action. Examples: > - imap (neocomplcache_start_unite_snippet) + imap (neosnippet_start_unite_snippet) < source actions @@ -354,6 +367,7 @@ CHANGELOG *neosnippet-changelog* - Deleted s:get_cursor_keyword_snippet(). - Improved for filetype. - Improved filetype complete. +- Improved documentation. 2012-09-27 - Ver.3 development is started.