-
-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathdoge.txt
188 lines (132 loc) · 8.3 KB
/
doge.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
*doge.txt* (Do)cumentation (Ge)nerator
Kim 金可明 *doge*
==============================================================================
CONTENTS *doge-contents*
1. Introduction.................................................|doge-intro|
2. Configuration...............................................|doge-config|
3. Commands..................................................|doge-commands|
4. Functions................................................|doge-functions|
1. Preprocessors....................................|doge-preprocessors|
==============================================================================
INTRODUCTION *doge-intro*
We all love documentation because it makes our codebases easier to understand,
yet no one has time to write it in a good and proper way.
Vim-doge is a (Do)cumentation (Ge)nerator which will generate a proper
documentation skeleton based on certain expressions (mainly functions). Simply
put your cursor on a function, press `<Leader>d`, jump quickly through TODO
items using `<Tab>` and `<S-Tab>` to quickly add descriptions and go on
coding!
==============================================================================
CONFIGURATION *doge-config*
*g:doge_install_path*
(Default: /path/to/vim-doge)
The path where the bin/ directory will be installed and loaded from.
*g:doge_enable_mappings*
(Default: 1)
Whether to enable built-in mappings.
*g:doge_mapping*
(Default: '<Leader>d')
The mapping to trigger vim-doge. The mapping accepts a count, to select a
specific doc standard, if more than one is defined.
*g:doge_buffer_mappings*
(Default: 1)
Mappings to jump forward/backward are applied as buffer mappings when
interactive mode starts and removed when it ends.
*g:doge_mapping_comment_jump_forward*
(Default: '<Tab>')
The mapping to jump forward to the next TODO item in a comment. Requires
|g:doge_comment_interactive| to be enabled.
*g:doge_mapping_comment_jump_backward*
(Default: '<S-Tab>')
The mapping to jump backward to the previous TODO item in a comment. Requires
|g:doge_comment_interactive| to be enabled.
*g:doge_comment_interactive*
(Default: 1)
Jumps interactively through all TODO items in the generated comment.
*g:doge_comment_jump_wrap*
(Default: 1)
Continue to cycle among placeholders when reaching the start or end.
*g:doge_comment_jump_modes*
(Default: ['n', 'i', 's'])
Defines the modes in which doge will jump forward and backward when
interactive mode is active. For example: removing 'i' would allow you to use
<Tab> for autocompletion in insert mode.
==============================================================================
COMMANDS *doge-commands*
:DogeGenerate {doc_standard} *:DogeGenerate*
Command to generate documentation. The `{doc_standard}` accepts a count or a
string as argument, and it can complete the available doc standards for the
current buffer.
The numeric value should point to an index key from the
`b:doge_supported_doc_standards` variable.
The string value should point to a doc standard name listed in the
`b:doge_supported_doc_standards` variable.
==============================================================================
FUNCTIONS *doge-functions*
doge#run_parser() *doge#run_parser()*
Run the vim-doge-helper in order to parse the user's code and generate the
actual docblock to be inserted later on.
doge#generate({arg}) *doge#generate()*
Main function used for generating documentation.
arg: Either a count (0 by default) or a string (empty by default).
doge#activate() *doge#activate()*
Activate doge buffer mappings, if option is set.
doge#deactivate() *doge#deactivate()*
Deactivate doge mappings and unlet buffer variable. Can print a message with
the reason of deactivation/termination.
doge#command_complete() *doge#command_complete()*
Return a list of supported doc standards for the current buffer.
doge#on_filetype_change() *doge#on_filetype_change()*
This function will be triggered on the FileType autocmd and will apply
aliases
doge#install() *doge#install()*
Install the necessary dependencies.
doge#buffer#get_doc_standard({filetype}) *doge#buffer#get_doc_standard()*
'filetype': The filetype where we initialized the b:doge_doc_standard.
Returns the current active doc standard.
doge#comment#jump({direction}) *doge#comment#jump()*
Jumps to the previous and next TODO item in the comment based on the
b:doge_interactive variable. Requires |g:doge_comment_interactive| to be
enabled. The {direction} can be of the following values: 'forward' |
'backward'
doge#comment#update_interactive_comment_info()
*doge#comment#update_interactive_comment_info()*
This function is trigged by the auto-command TextChangedI and will update
the b:doge_interactive variable where needed. Requires
|g:doge_comment_interactive| to be enabled.
doge#comment#deactivate_when_done() *doge#comment#deactivate_when_done()*
This function is trigged by the auto-commands InsertLeave and TextChanged
and will deactivate doge when there are no more TODO items left. Requires
|g:doge_comment_interactive| to be enabled.
doge#indent#add({indent}, {text}) *doge#indent#add()*
Indent a string based on a given line its indent, based on the user setting.
doge#utils#count({word} [, {lnum_start}, {lnum_end} ]) *doge#utils#count()*
Returns the amount of occurences of a word.
The 2nd and 3rd arguments, named lnum_start and lnum_end, can be used to
limit the count in-between a range of lines. The default value for the range
will be '%', indicating a full buffer count. NOTE: When lnum_start is a
bigger number than lnum_end then these values will be flipped to ensure a
correct range format.
doge#utils#deepextend() *doge#utils#deepextend()*
Recursively merge nested dictionaries and/or lists. a:1 is the base
dictionary and every other parameter will be merged onto a:1.
If you append '1' as the last argument then this will indicate that lists
will be merged together instead overwritten. Example:
doge#utils#deepextend({'a': ['foo']}, {'a': ['bar']}, 1)
The above will result in: {'a': ['foo', 'bar']} instead of {'a': ['bar']}.
doge#utils#keyseq({seq}) *doge#utils#keyseq()*
Creates a sequence of keys which can be used as a return value for mappings.
Useful when returning a dynamic value such as a user-configurable setting.
doge#utils#placeholder() *doge#utils#placeholder()*
Returns the todo-pattern that is used for interactive mode
doge#utils#trim({string}) *doge#utils#trim()*
Utility for compatibility with vim versions without the trim() function.
doge#utils#get_filetype() *doge#utils#get_filetype()*
Get the current filetype. Returns the original filetype if the current
filetype is an alias.
==============================================================================
PREPROCESSORS *doge-preprocessors*
Preprocess functions are called for specific filetypes when doge is generating
a comment. The following preprocess functions are available:
doge#preprocessors#<language>#alter_parser_args(parser_args)
vim:tw=78:ts=8:ft=help:norl: