]> git.lizzy.rs Git - micro.git/blob - runtime/plugins/comment/help/comment.md
better top
[micro.git] / runtime / plugins / comment / help / comment.md
1 # Comment Plugin
2
3 The comment plugin provides auto commenting/uncommenting.
4 The default binding to comment/uncomment a line is `Alt-/`,
5 but you can easily modify that in your `bindings.json` file:
6
7 ```json
8 {
9     "Alt-g": "comment.comment"
10 }
11 ```
12
13 You can also execute a command which will do the same thing as
14 the binding:
15
16 ```
17 > comment
18 ```
19
20 If you have a selection, the plugin will comment all the lines
21 selected.
22
23 The comment type will be auto detected based on the filetype,
24 but it is only available for certain filetypes:
25
26 * c: `// %s`
27 * c++: `// %s`
28 * d: `// %s`
29 * go: `// %s`
30 * html: `<!-- %s -->`
31 * java: `// %s`
32 * javascript: `// %s`
33 * julia: `# %s`
34 * lua: `-- %s`
35 * perl: `# %s`
36 * php: `// %s`
37 * python: `# %s`
38 * python3: `# %s`
39 * ruby: `# %s`
40 * rust: `// %s`
41 * shell: `# %s`
42 * swift: `// %s`
43
44 If your filetype is not available here, you can simply modify
45 the `commenttype` option:
46
47 ```
48 set commenttype "/* %s */"
49 ```
50
51 Or in your `settings.json`:
52
53 ```json
54 {
55     "*.c": {
56         "commenttype": "/* %s */"
57     }
58 }
59 ```
60