@@ -117,47 +117,46 @@ Module | Description
117
117
### Install modules for your own plugin
118
118
119
119
Use ` :Vitalize ` to install modules.
120
- Assuming your Vim plugin name is ` pluginname ` .
120
+ Assuming your Vim plugin name is ` your_plugin_name ` and plugin directory is ` your_plugin_dir ` .
121
121
Please see [ the help] ( doc/vitalizer.txt ) for more details.
122
122
123
123
``` vim
124
- :Vitalize --name=pluginname $HOME/.vim/bundle/pluginname /
124
+ :Vitalize --name=your_plugin_name $HOME/.vim/bundle/your_plugin_dir /
125
125
```
126
126
127
127
You can also install only specified modules; recommended for making your
128
128
repository size small, assuming you are going to upload it to a remote
129
129
repository
130
130
131
131
``` vim
132
- :Vitalize --name=pluginname $HOME/.vim/bundle/pluginname / Data.String Data.List
132
+ :Vitalize --name=your_plugin_name $HOME/.vim/bundle/your_plugin_dir / Data.String Data.List
133
133
```
134
134
135
135
### Use vital functions
136
136
137
- Assuming your Vim plugin name is ` pluginname ` . You can define your utility
138
- function set ` pluginname #util` just by
137
+ Assuming your Vim plugin name is ` your_plugin_name ` . You can define your utility
138
+ function set ` your_plugin_name #util` just by
139
139
140
140
``` vim
141
- let s:V = vital#pluginname#new()
142
- let s:process = s:V.import('System.Process')
141
+ let s:Process = vital#your_plugin_name#import('System.Process')
143
142
144
- function! pluginname #util#system(...)
145
- return s:process .execute(a:000)
143
+ function! your_plugin_name #util#system(...)
144
+ return s:Process .execute(a:000)
146
145
endfunction
147
146
" run
148
- " echo pluginname #util#system('echo','abc')
147
+ " echo your_plugin_name #util#system('echo','abc')
149
148
" -> $ echo abc
150
149
```
151
150
152
- and then you can call functions by ` pluginname #util#system()` , without taking care
151
+ and then you can call functions by ` your_plugin_name #util#system()` , without taking care
153
152
of ` vital.vim ` itself. It's all hidden.
154
153
155
154
Vital has module system. The below is an example to import/load a module
156
155
` Math ` and to call a function ` lcm() ` of the module.
157
156
158
157
``` vim
159
158
" Recommended way
160
- let s:M = vital#pluginname #import('Math')
159
+ let s:M = vital#your_plugin_name #import('Math')
161
160
call s:M.lcm([2, 3, 4])
162
161
" -> 12
163
162
```
166
165
167
166
``` vim
168
167
" Alternative way
169
- let s:V = vital#pluginname #new()
168
+ let s:V = vital#your_plugin_name #new()
170
169
let s:M = s:V.import('Math')
171
170
call s:M.lcm([2, 3, 4])
172
171
" -> 12
176
175
177
176
``` vim
178
177
" Alternative way only if you rarely use the module
179
- let s:V = vital#pluginname #new()
178
+ let s:V = vital#your_plugin_name #new()
180
179
call s:V.load('Math')
181
180
call s:V.Math.lcm([2, 3, 4])
182
181
" -> 12
186
185
187
186
``` vim
188
187
" Available, but we don't recommend this very much
189
- let s:V = vital#pluginname #new()
188
+ let s:V = vital#your_plugin_name #new()
190
189
call s:V.import('Math', s:)
191
190
call s:lcm([2, 3, 4])
192
191
" -> 12
0 commit comments