|
2 | 2 | FileHeader |
3 | 3 | ========== |
4 | 4 |
|
5 | | -Overview |
6 | | -======== |
7 | | - |
8 | 5 | FileHeader is a powerful file templating plugin for SublimeText 2 and |
9 | 6 | SublimeText 3. It makes it easier to create new file with initial contents. It |
10 | 7 | also can add new header to an existed file or directory. |
11 | 8 |
|
12 | | -:Info: FileHeader, a powerful file templating plugin for ST2/ST3. |
13 | | -:Author: Lime YH.Shi |
14 | | - |
15 | 9 | Features |
16 | 10 | ========= |
17 | 11 |
|
@@ -48,12 +42,6 @@ this repository:: |
48 | 42 | Or download zip from Github, and put it in "Packages" directory |
49 | 43 | **(Preferences / Browse Packages)**. |
50 | 44 |
|
51 | | -Releases |
52 | | --------- |
53 | | - |
54 | | -See releases and logs `here <https://github.com/shiyanhui/FileHeader/releases>`_, |
55 | | -it's stable. |
56 | | - |
57 | 45 | Usage |
58 | 46 | ===== |
59 | 47 |
|
@@ -110,277 +98,8 @@ settings. **options** is the functional setting, **Default** is the default |
110 | 98 | language variables settings. Language variables setting will cover that in |
111 | 99 | **Default**. |
112 | 100 |
|
113 | | -.. code-block:: c++ |
114 | | - |
115 | | - { |
116 | | - /* |
117 | | - options |
118 | | - ======= |
119 | | - */ |
120 | | -
|
121 | | - /* |
122 | | - The datetime format. |
123 | | - |
124 | | - 0: "%Y-%m-%d %H:%M:%S" |
125 | | - 1: "%Y-%m-%d" |
126 | | - 2: "%H:%M:%S" |
127 | | - */ |
128 | | - "time_format": 0, |
129 | | - /* |
130 | | - The custom time format. It will format `create_time` and `last_modified_time` |
131 | | - instead of `time_format` if you set it. The time format refers to` |
132 | | - https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior`. |
133 | | - */ |
134 | | - "custom_time_format": "", |
135 | | - /* |
136 | | - Whether add template to the empty file. |
137 | | - |
138 | | - It's useful when you create new file through other command, for |
139 | | - example, the default Sublime Text's **New File...** or other plugin. |
140 | | - */ |
141 | | - "enable_add_template_to_empty_file": true, |
142 | | - /* |
143 | | - Set your custom template header path here, it is a directory in which |
144 | | - you write your own header files. The file name should be a language, |
145 | | - "Python.tmpl" for example. |
146 | | - */ |
147 | | - "custom_template_header_path": "", |
148 | | - /* |
149 | | - Set your custom template body path here, it is a directory in which |
150 | | - you write your own body files. The file name should be a language, |
151 | | - "Python.tmpl" for example. |
152 | | - |
153 | | - The template structure is: |
154 | | - |
155 | | - I am a file |
156 | | - ----------- |
157 | | - header |
158 | | - body |
159 | | - |
160 | | - */ |
161 | | - "custom_template_body_path": "", |
162 | | - /* |
163 | | - Whether show input panel when you add header. The default file which |
164 | | - you add header to is the current file you edit. |
165 | | - */ |
166 | | - "show_input_panel_when_add_header": true, |
167 | | - /* |
168 | | - Whether open file when you add header to files in the specified |
169 | | - directory. |
170 | | - */ |
171 | | - "open_file_when_add_header_to_directory": true, |
172 | | - /* |
173 | | - Whether enable add header to hidden directory. If false, FileHeader |
174 | | - won't add header to files under it. |
175 | | - */ |
176 | | - "enable_add_header_to_hidden_dir": false, |
177 | | - /* |
178 | | - Whether enable add header to hidden file. If false, FileHeader |
179 | | - won't add header to it. |
180 | | - */ |
181 | | - "enable_add_header_to_hidden_file": false, |
182 | | - /* |
183 | | - FileHeader judges programming language according file suffix. |
184 | | - |
185 | | - Default programming language if FileHeader judges failed when you |
186 | | - create new file. |
187 | | - */ |
188 | | - "syntax_when_not_match": "Text", |
189 | | - /* |
190 | | - FileHeader will judge programming language according to file suffix. |
191 | | - You can add more file suffix here. Note: language should be one of |
192 | | - that under **Default**. If FileHeader don't find the suffix, |
193 | | - FileHeader will set language as **syntax_when_not_match** above. |
194 | | - */ |
195 | | - "file_suffix_mapping": { |
196 | | - "as": "ActionScript", |
197 | | - "scpt": "AppleScript", |
198 | | - "asp": "ASP", |
199 | | - "aspx": "ASP", |
200 | | - "bat": "Batch File", |
201 | | - "cmd": "Batch File", |
202 | | - "c": "C", |
203 | | - "cs": "C#", |
204 | | - "cpp": "C++", |
205 | | - "clj": "Clojure", |
206 | | - "css": "CSS", |
207 | | - "D": "D", |
208 | | - "erl": "Erlang", |
209 | | - "go": "Go", |
210 | | - "groovy": "Groovy", |
211 | | - "hs": "Haskell", |
212 | | - "htm": "HTML", |
213 | | - "html": "HTML", |
214 | | - "java": "Java", |
215 | | - "js": "JavaScript", |
216 | | - "tex": "LaTeX", |
217 | | - "lsp": "Lisp", |
218 | | - "lua": "Lua", |
219 | | - "md": "Markdown", |
220 | | - "mat": "Matlab", |
221 | | - "m": "Objective-C", |
222 | | - "ml": "OCaml", |
223 | | - "p": "Pascal", |
224 | | - "pl": "Perl", |
225 | | - "php": "PHP", |
226 | | - "py": "Python", |
227 | | - "R": "R", |
228 | | - "rst": "RestructuredText", |
229 | | - "rb": "Ruby", |
230 | | - "scala": "Scala", |
231 | | - "sh": "ShellScript", |
232 | | - "sql": "SQL", |
233 | | - "tcl": "TCL", |
234 | | - "txt": "Text", |
235 | | - "xml": "XML" |
236 | | - }, |
237 | | - /* |
238 | | - Set special file suffix equivalence. Take `blade.php` for example, |
239 | | - FileHeader will initial file with suffix `blade.php` with that of `html`. |
240 | | - |
241 | | - */ |
242 | | - "extension_equivalence": { |
243 | | - "blade.php": "html", |
244 | | - }, |
245 | | -
|
246 | | - /* |
247 | | - Variables |
248 | | - ========= |
249 | | - */ |
250 | | -
|
251 | | - /* |
252 | | - Below is the variables you render templater. |
253 | | - */ |
254 | | - "Default": { |
255 | | - /* |
256 | | - Builtin Variables |
257 | | - ================= |
258 | | - |
259 | | - - create_time |
260 | | - |
261 | | - The file created time. It will be automatically set when you create |
262 | | - a new file if you use it. |
263 | | - |
264 | | - Can't be set custom. |
265 | | - |
266 | | - - author |
267 | | - |
268 | | - The file creator. |
269 | | - |
270 | | - FileHeader will set it automatically. If it's in |
271 | | - a git repository and the `user.name` has been set, `autor` |
272 | | - will set to `user.name`, otherwise it will be set to current |
273 | | - system user. |
274 | | - |
275 | | - Can be set custom. |
276 | | - |
277 | | - - last_modified_by |
278 | | - |
279 | | - The file last modified by who? It is specially useful when |
280 | | - cooperation programming. |
281 | | - |
282 | | - FileHeader will set it automatically. If it's in |
283 | | - a git repository and the `user.name` has been set, `autor` |
284 | | - will set to `user.name`, otherwise it will be set to current |
285 | | - system logined user. |
286 | | - |
287 | | - Can be set custom. |
288 | | - |
289 | | - - last_modified_time |
290 | | - |
291 | | - The file last modified time. |
292 | | - |
293 | | - FileHeader will set it automatically when you save the file. |
294 | | - |
295 | | - Can't be set custom. |
296 | | - |
297 | | - - file_path |
298 | | - |
299 | | - The absolute path of the current file. |
300 | | - |
301 | | - FileHeader will update it automatically when you change it. |
302 | | - |
303 | | - Can't be set custom. |
304 | | - |
305 | | - - file_name |
306 | | - |
307 | | - The name of current file with extension. |
308 | | - |
309 | | - FileHeader will update it automatically when you change it. |
310 | | - |
311 | | - Can't be set custom. |
312 | | - |
313 | | - - file_name_without_extension |
314 | | - |
315 | | - The name of current file without extension. |
316 | | - |
317 | | - FileHeader will update it automatically when you change it. |
318 | | - |
319 | | - Can't be set custom. |
320 | | - |
321 | | - - project_name |
322 | | - |
323 | | - The project name. |
324 | | - |
325 | | - Note: `project_name` only works in ST3. |
326 | | - |
327 | | - Can't be set custom. |
328 | | - */ |
329 | | -
|
330 | | - /* |
331 | | - Email |
332 | | - */ |
333 | | - "email": "email@example.com" |
334 | | -
|
335 | | - // You can add more here...... |
336 | | - }, |
337 | | - /* |
338 | | - You can set different variables in different languages. It will cover |
339 | | - that in "Default". |
340 | | - */ |
341 | | - "ASP": {}, |
342 | | - "ActionScript": {}, |
343 | | - "AppleScript": {}, |
344 | | - "Batch File": {}, |
345 | | - "C#": {}, |
346 | | - "C++": {}, |
347 | | - "CSS": {}, |
348 | | - "Clojure": {}, |
349 | | - "D": {}, |
350 | | - "Diff": {}, |
351 | | - "Erlang": {}, |
352 | | - "Go": {}, |
353 | | - "Graphviz": {}, |
354 | | - "Groovy": {}, |
355 | | - "HTML": {}, |
356 | | - "Haskell": {}, |
357 | | - "Java": {}, |
358 | | - "JavaScript": {}, |
359 | | - "LaTeX": {}, |
360 | | - "Lisp": {}, |
361 | | - "Lua": {}, |
362 | | - "Makefile": {}, |
363 | | - "Markdown": {}, |
364 | | - "Matlab": {}, |
365 | | - "OCaml": {}, |
366 | | - "Objective-C": {}, |
367 | | - "PHP": {}, |
368 | | - "Pascal": {}, |
369 | | - "Perl": {}, |
370 | | - "Python": {}, |
371 | | - "R": {}, |
372 | | - "RestructuredText": {}, |
373 | | - "Ruby": {}, |
374 | | - "SQL": {}, |
375 | | - "Scala": {}, |
376 | | - "ShellScript": {}, |
377 | | - "TCL": {}, |
378 | | - "Text": {}, |
379 | | - "Textile": {}, |
380 | | - "XML": {}, |
381 | | - "YAML": {} |
382 | | - } |
383 | | -
|
| 101 | +Open **Preferences => Package Settings => File Header => Settings - Default** |
| 102 | +for more details. |
384 | 103 |
|
385 | 104 | Template |
386 | 105 | ======== |
|
0 commit comments