Skip to content

Commit 9696f02

Browse files
committed
vital.txt: same update as README
1 parent ae8b1b5 commit 9696f02

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

doc/vital.txt

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,35 +36,42 @@ Please read the docs of each module before using them.
3636
==============================================================================
3737
USAGE *Vital-usage*
3838

39-
Assuming your Vim plugin name is "ujihisa", you can define your utility
40-
function set 'ujihisa#util' just by
39+
Assuming your Vim plugin name is "pluginname". You can define your utility
40+
function set "pluginname#util" just by
4141
>
42-
let s:P = vital#ujihisa#new().import('Process')
43-
function! ujihisa#util#system(...)
44-
return call(s:P.system, a:000, s:P)
42+
let s:V = vital#pluginname#new()
43+
let s:process = s:V.import('System.Process')
44+
45+
function! pluginname#util#system(...)
46+
return s:process.execute(a:000)
4547
endfunction
4648
<
47-
and then you can call functions by 'ujihisa#util#system()', without taking
49+
and then you can call functions by 'pluginname#util#system()', without taking
4850
care of |vital.vim| itself. It's all hidden.
4951

5052
|Vital| has module system. The below is an example to import/load a module
51-
"data/ordered_set" and to call a function "f()" of the module.
53+
"Math" and to call a function "lcm()" of the module.
5254
>
53-
let s:V = vital#ujihisa#new()
54-
let s:O = s:V.import('Data.OrderedSet')
55-
call s:O.f()
55+
let s:M = vital#pluginname#import('Math')
56+
call s:M.lcm([2, 3, 4])
5657
<
5758
or
5859
>
59-
let s:V = vital#ujihisa#new()
60-
call s:V.load('Data.OrderedSet')
61-
call s:V.Data.OrderedSet.f()
60+
let s:V = vital#pluginname#new()
61+
let s:M = s:V.import('Math')
62+
call s:M.lcm([2, 3, 4])
6263
<
6364
or
6465
>
65-
let s:V = vital#ujihisa#new()
66-
call s:V.import('Data.OrderedSet', s:)
67-
call s:f()
66+
let s:V = vital#pluginname#new()
67+
call s:V.load('Math')
68+
call s:V.Math.lcm([2, 3, 4])
69+
<
70+
or
71+
>
72+
let s:V = vital#pluginname#new()
73+
call s:V.import('Math', s:)
74+
call s:lcm([2, 3, 4])
6875
<
6976
We recommend you to use a capital letter for a Vital module dictionary to
7077
assign as Vital convention. That makes your code more readable among Vital

0 commit comments

Comments
 (0)