Merge pull request #206 from kikito/runtime-snippets-doc

Runtime snippets doc
This commit is contained in:
Shougo 2014-01-15 14:36:12 -08:00
commit e127812718
2 changed files with 25 additions and 27 deletions

View File

@ -11,17 +11,6 @@ snipMate.vim or snippetsEmu.vim. But since you can choose snippets with the
have less trouble using them, because you do not have to remember each snippet have less trouble using them, because you do not have to remember each snippet
name. name.
Note: Default snippets are required! You must install them or disable runtime
snippets by `g:neosnippet#disable_runtime_snippets`.
Default snippets files are available in:
[neosnippet-snippets](https://github.com/Shougo/neosnippet-snippets)
Note: neocomplcache/neocomplete is NOT required! But recommended.
Extra snippets files are available in:
[vim-snippets](https://github.com/honza/vim-snippets)
Installation Installation
------------ ------------
@ -29,6 +18,16 @@ To install neosnippet and other Vim plug-ins it is recommended to use one of the
popular package managers for Vim, rather than installing by drag and drop all popular package managers for Vim, rather than installing by drag and drop all
required files into your `.vim` folder. required files into your `.vim` folder.
Notes:
* Default snippets files are available in:
[neosnippet-snippets](https://github.com/Shougo/neosnippet-snippets)
* Installing default snippets is optional. If choose not to install them,
you must deactivate them with `g:neosnippet#disable_runtime_snippets`.
* neocomplcache/neocomplete is not required to use neosnippet, but it's highly recommended.
* Extra snippets files can be found in:
[vim-snippets](https://github.com/honza/vim-snippets).
### Manual (not recommended) ### Manual (not recommended)
1. Install the 1. Install the

View File

@ -52,15 +52,14 @@ INSTALL *neosnippet-install*
Note: If you want to complete snippets, you must install neocomplcache Note: If you want to complete snippets, you must install neocomplcache
(https://github.com/Shougo/neocomplcache.vim) or (https://github.com/Shougo/neocomplcache.vim) or
neocomplete(https://github.com/Shougo/neocomplete.vim). neocomplete(https://github.com/Shougo/neocomplete.vim). It's not required,
but highly recommended.
Note: Default snippets are required! You must install them or disable runtime
snippets by |g:neosnippet#disable_runtime_snippets|.
Default snippets files are available in: Default snippets files are available in:
https://github.com/Shougo/neosnippet-snippets https://github.com/Shougo/neosnippet-snippets
Note: neocomplcache or neocomplete is NOT required! But recommended. Note: Installing the default snippets is optional. If you choose not to install
them, you must disable them by |g:neosnippet#disable_runtime_snippets|.
Extra snippets files are available in: Extra snippets files are available in:
https://github.com/honza/vim-snippets https://github.com/honza/vim-snippets
@ -86,7 +85,7 @@ COMMANDS *neosnippet-commands*
Opens the snippets for a given [filetype] to edit. It automatically Opens the snippets for a given [filetype] to edit. It automatically
selects the current buffer's filetype unless you specify selects the current buffer's filetype unless you specify
another one by [filetype]. another one by [filetype].
If the path to [filetype] snippets is a directory, it If the path to [filetype] snippets is a directory, it
automatically selects "[filetype].snip" in the [filetype] automatically selects "[filetype].snip" in the [filetype]
subdirectory. subdirectory.
@ -106,7 +105,7 @@ COMMANDS *neosnippet-commands*
*neosnippet-edit-options-horizontal* *neosnippet-edit-options-horizontal*
-horizontal -horizontal
Split the window horizontally. Split the window horizontally.
Note: The behavior is undefined when both options are set. Note: The behavior is undefined when both options are set.
*neosnippet-edit-options-direction* *neosnippet-edit-options-direction*
@ -145,7 +144,7 @@ g:neosnippet#snippets_directory *g:neosnippet#snippets_directory*
User defined snippet files are read after the built-in snippet User defined snippet files are read after the built-in snippet
files. If redundant snippets occur they get overwritten and files. If redundant snippets occur they get overwritten and
only the last one remains. only the last one remains.
Note: The neosnippet plug-in loads file type snippets from Note: The neosnippet plug-in loads file type snippets from
several files if available. For example if you edit a "Vim" several files if available. For example if you edit a "Vim"
file it loads the snippets from: file it loads the snippets from:
@ -162,7 +161,7 @@ g:neosnippet#disable_select_mode_mappings
neosnippet performs the snippet completion. Usually it is neosnippet performs the snippet completion. Usually it is
better to leave it as it is. But if you have troubles with the better to leave it as it is. But if you have troubles with the
buffer switcher LustyJuggler you can switch them off. buffer switcher LustyJuggler you can switch them off.
The default value is 1. The default value is 1.
*g:neosnippet#disable_runtime_snippets* *g:neosnippet#disable_runtime_snippets*
@ -182,7 +181,7 @@ g:neosnippet#disable_runtime_snippets
let g:neosnippet#disable_runtime_snippets = { let g:neosnippet#disable_runtime_snippets = {
\ 'c' : 1, 'cpp' : 1, \ 'c' : 1, 'cpp' : 1,
\ } \ }
" which disables all runtime snippets " which disables all runtime snippets
let g:neosnippet#disable_runtime_snippets = { let g:neosnippet#disable_runtime_snippets = {
\ '_' : 1, \ '_' : 1,
@ -327,10 +326,10 @@ EXAMPLES *neosnippet-examples*
if has('conceal') if has('conceal')
set conceallevel=2 concealcursor=i set conceallevel=2 concealcursor=i
endif endif
" Enable snipMate compatibility feature. " Enable snipMate compatibility feature.
" let g:neosnippet#enable_snipmate_compatibility = 1 " let g:neosnippet#enable_snipmate_compatibility = 1
============================================================================== ==============================================================================
SNIPPET SYNTAX *neosnippet-snippet-syntax* SNIPPET SYNTAX *neosnippet-snippet-syntax*
@ -644,7 +643,7 @@ insert empty line in snippet end, you must insert placeholder.
alias shebang alias shebang
options head options head
#!/usr/bin/env ruby #!/usr/bin/env ruby
${0} ${0}
# This is invalid(ignores spaces lines!). # This is invalid(ignores spaces lines!).
@ -653,8 +652,8 @@ insert empty line in snippet end, you must insert placeholder.
alias shebang alias shebang
options head options head
#!/usr/bin/env ruby #!/usr/bin/env ruby
< <
============================================================================== ==============================================================================
UNITE SOURCES *neosnippet-unite-sources* UNITE SOURCES *neosnippet-unite-sources*
@ -667,7 +666,7 @@ neosnippet
But you can also execute it by ":Unite neosnippet". The But you can also execute it by ":Unite neosnippet". The
snippet source offers an edit action you can use to edit the snippet source offers an edit action you can use to edit the
snippet files. snippet files.
Example: Example:
> >
imap <C-s> <Plug>(neosnippet_start_unite_snippet) imap <C-s> <Plug>(neosnippet_start_unite_snippet)