|
@@ -5,11 +5,9 @@ The Neosnippet plug-In adds snippet support to Vim. Snippets are
|
5
|
5
|
small templates for commonly used code that you can fill in on the
|
6
|
6
|
fly. To use snippets can increase your productivity in Vim a lot.
|
7
|
7
|
The functionality of this plug-in is quite similar to plug-ins like
|
8
|
|
-snipMate.vim or snippetsEmu.vim. But since you can choose snippets with the
|
9
|
|
-[neocomplcache](https://github.com/Shougo/neocomplcache.vim) /
|
10
|
|
-[neocomplete](https://github.com/Shougo/neocomplete.vim) interface, you might
|
11
|
|
-have less trouble using them, because you do not have to remember each snippet
|
12
|
|
-name.
|
|
8
|
+snipMate.vim. But since you can choose snippets with the
|
|
9
|
+[deoplete](https://github.com/Shougo/deoplete.nvim) interface, you might have
|
|
10
|
+less trouble using them, because you do not have to remember each snippet name.
|
13
|
11
|
|
14
|
12
|
Installation
|
15
|
13
|
------------
|
|
@@ -22,84 +20,73 @@ Notes:
|
22
|
20
|
|
23
|
21
|
* Vim 7.4 or above is needed.
|
24
|
22
|
|
|
23
|
+* Vim 8.0 or above or neovim is recommended.
|
|
24
|
+
|
25
|
25
|
* Default snippets files are available in:
|
26
|
26
|
[neosnippet-snippets](https://github.com/Shougo/neosnippet-snippets)
|
|
27
|
+
|
27
|
28
|
* Installing default snippets is optional. If choose not to install them,
|
28
|
29
|
you must deactivate them with `g:neosnippet#disable_runtime_snippets`.
|
29
|
|
-* neocomplcache/neocomplete is not required to use neosnippet, but it's highly recommended.
|
30
|
|
-* Extra snippets files can be found in:
|
31
|
|
- [vim-snippets](https://github.com/honza/vim-snippets).
|
32
|
30
|
|
33
|
|
-### Manual (not recommended)
|
|
31
|
+* deoplete is not required to use neosnippet, but it's highly recommended.
|
34
|
32
|
|
35
|
|
-1. Install the
|
36
|
|
- [neocomplcache](https://github.com/Shougo/neocomplcache.vim)/
|
37
|
|
- [neocomplete](https://github.com/Shougo/neocomplete.vim) and
|
38
|
|
- [neosnippet-snippets](https://github.com/Shougo/neosnippet-snippets)
|
39
|
|
- first.
|
40
|
|
-2. Put files in your Vim directory (usually `~/.vim/` or
|
41
|
|
- `%PROGRAMFILES%/Vim/vimfiles` on Windows).
|
|
33
|
+* Extra snippets files can be found in:
|
|
34
|
+ [vim-snippets](https://github.com/honza/vim-snippets).
|
42
|
35
|
|
43
|
36
|
### Vundle
|
44
|
37
|
|
45
|
|
-1. Setup the [vundle](https://github.com/gmarik/vundle) package manager
|
46
|
|
-2. Set the bundles for [neocomplcache](https://github.com/Shougo/neocomplcache)
|
47
|
|
- or [neocomplete](https://github.com/Shougo/neocomplete.vim)
|
48
|
|
- And [neosnippet](https://github.com/Shougo/neosnippet)
|
49
|
|
- And [neosnippet-snippets](https://github.com/Shougo/neosnippet-snippets)
|
50
|
|
-
|
51
|
38
|
```vim
|
52
|
|
- Plugin 'Shougo/neocomplcache'
|
53
|
|
- or
|
54
|
|
- Plugin 'Shougo/neocomplete'
|
|
39
|
+ Plugin 'Shougo/deoplete.nvim'
|
|
40
|
+ if !has('nvim')
|
|
41
|
+ Plugin 'roxma/nvim-yarp'
|
|
42
|
+ Plugin 'roxma/vim-hug-neovim-rpc'
|
|
43
|
+ endif
|
55
|
44
|
|
56
|
|
- Plugin 'Shougo/neosnippet'
|
|
45
|
+ Plugin 'Shougo/neosnippet.vim'
|
57
|
46
|
Plugin 'Shougo/neosnippet-snippets'
|
58
|
47
|
```
|
59
|
48
|
|
60
|
|
-3. Open up Vim and start installation with `:PluginInstall`
|
61
|
|
-
|
62
|
|
-### Neobundle
|
63
|
|
-
|
64
|
|
-1. Setup the [neobundle](https://github.com/Shougo/neobundle.vim) package manager
|
65
|
|
-2. Set the bundles for [neocomplcache](https://github.com/Shougo/neocomplcache)
|
66
|
|
- or [neocomplete](https://github.com/Shougo/neocomplete.vim)
|
67
|
|
- And [neosnippet](https://github.com/Shougo/neosnippet)
|
68
|
|
- And [neosnippet-snippets](https://github.com/Shougo/neosnippet-snippets)
|
|
49
|
+### dein.vim
|
69
|
50
|
|
70
|
51
|
```vim
|
71
|
|
- NeoBundle 'Shougo/neocomplcache'
|
72
|
|
- or
|
73
|
|
- NeoBundle 'Shougo/neocomplete'
|
74
|
|
-
|
75
|
|
- NeoBundle 'Shougo/neosnippet'
|
76
|
|
- NeoBundle 'Shougo/neosnippet-snippets'
|
|
52
|
+ call dein#add('Shougo/deoplete.nvim')
|
|
53
|
+ if !has('nvim')
|
|
54
|
+ call dein#add('roxma/nvim-yarp')
|
|
55
|
+ call dein#add('roxma/vim-hug-neovim-rpc')
|
|
56
|
+ endif
|
|
57
|
+ let g:deoplete#enable_at_startup = 1
|
|
58
|
+
|
|
59
|
+ call dein#add('Shougo/neosnippet.vim')
|
|
60
|
+ call dein#add('Shougo/neosnippet-snippets')
|
77
|
61
|
```
|
78
|
62
|
|
79
|
|
-3. Open up Vim and start installation with `:NeoBundleInstall`
|
80
|
|
-
|
81
|
|
-### VAM (vim-addon-manager)
|
82
|
|
-
|
83
|
|
-1. Setup the [vim-addon-manager](https://github.com/MarcWeber/vim-addon-manager)
|
84
|
|
- package manager.
|
85
|
|
-2. Add `neosnippet` to the list of addons in your vimrc:
|
|
63
|
+### vim-plug
|
86
|
64
|
|
87
|
65
|
```vim
|
88
|
|
- call vam#ActivateAddons(['neosnippet', 'neosnippet-snippets'])
|
|
66
|
+ if has('nvim')
|
|
67
|
+ Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
|
|
68
|
+ else
|
|
69
|
+ Plug 'Shougo/deoplete.nvim'
|
|
70
|
+ Plug 'roxma/nvim-yarp'
|
|
71
|
+ Plug 'roxma/vim-hug-neovim-rpc'
|
|
72
|
+ endif
|
|
73
|
+ let g:deoplete#enable_at_startup = 1
|
|
74
|
+
|
|
75
|
+ Plug 'Shougo/neosnippet.vim'
|
|
76
|
+ Plug 'Shougo/neosnippet-snippets'
|
89
|
77
|
```
|
90
|
78
|
|
91
|
|
- . Installation will start automatically when you open vim next time.
|
92
|
|
-
|
93
|
79
|
Configuration
|
94
|
80
|
-------------
|
95
|
81
|
|
96
|
82
|
This is an example `~/.vimrc` configuration for Neosnippet. It is assumed you
|
97
|
|
-already have Neocomplcache configured. With the settings of the example, you
|
98
|
|
-can use the following keys:
|
|
83
|
+already have deoplete configured. With the settings of the example, you can use
|
|
84
|
+the following keys:
|
99
|
85
|
|
100
|
|
-* `C-k` to select-and-expand a snippet from the Neocomplcache popup (Use `C-n`
|
|
86
|
+* `C-k` to select-and-expand a snippet from the deoplete popup (Use `C-n`
|
101
|
87
|
and `C-p` to select it). `C-k` can also be used to jump to the next field in
|
102
|
88
|
the snippet.
|
|
89
|
+
|
103
|
90
|
* `Tab` to select the next field to fill in the snippet.
|
104
|
91
|
|
105
|
92
|
```vim
|