]> git.lizzy.rs Git - micro.git/blob - runtime/plugins/comment/help/comment.md
Bind Ctrl-/ (CtrlUnderscore) in comment plugin
[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 and `CtrlUnderscore`, which is equivalent in most terminals
6 to `Ctrl-/`. You can easily modify that in your `bindings.json`
7 file:
8
9 ```json
10 {
11     "Alt-g": "comment.comment"
12 }
13 ```
14
15 You can also execute a command which will do the same thing as
16 the binding:
17
18 ```
19 > comment
20 ```
21
22 If you have a selection, the plugin will comment all the lines
23 selected.
24
25 The comment type will be auto detected based on the filetype,
26 but it is only available for certain filetypes:
27
28 * apacheconf: `# %s`
29 * bat: `:: %s`
30 * c: `// %s`
31 * c++: `// %s`
32 * cmake: `# %s`
33 * conf: `# %s`
34 * crystal: `# %s`
35 * css: `/* %s */`
36 * d: `// %s`
37 * dart: `// %s`
38 * dockerfile: `# %s`
39 * elm: `-- %s`
40 * fish: `# %s`
41 * gdscript: `# %s`
42 * glsl: `// %s`
43 * go: `// %s`
44 * haskell: `-- %s`
45 * html: `<!-- %s -->`
46 * ini: `; %s`
47 * java: `// %s`
48 * javascript: `// %s`
49 * jinja2: `{# %s #}`
50 * julia: `# %s`
51 * kotlin: `// %s`
52 * lua: `-- %s`
53 * markdown: `<!-- %s -->`
54 * nginx: `# %s`
55 * nim: `# %s`
56 * objc: `// %s`
57 * pascal: `{ %s }`
58 * perl: `# %s`
59 * php: `// %s`
60 * pony: `// %s`
61 * powershell: `# %s`
62 * proto: `// %s`
63 * python: `# %s`
64 * python3: `# %s`
65 * ruby: `# %s`
66 * rust: `// %s`
67 * scala: `// %s`
68 * shell: `# %s`
69 * sql: `-- %s`
70 * swift: `// %s`
71 * tex: `% %s`
72 * toml: `# %s`
73 * twig: `{# %s #}`
74 * v: `// %s`
75 * xml: `<!-- %s -->`
76 * yaml: `# %s`
77 * zig: `// %s`
78 * zscript: `// %s`
79 * zsh: `# %s`
80
81 If your filetype is not available here, you can simply modify
82 the `commenttype` option:
83
84 ```
85 set commenttype "/* %s */"
86 ```
87
88 Or in your `settings.json`:
89
90 ```json
91 {
92     "*.c": {
93         "commenttype": "/* %s */"
94     }
95 }
96 ```