jsmdcui 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +76 -0
- package/LICENSE +22 -0
- package/README.md +285 -0
- package/package.json +17 -0
- package/project_structure.txt +35 -0
- package/runmd.mjs +240 -0
- package/runtime/colorschemes/atom-dark.micro +33 -0
- package/runtime/colorschemes/bubblegum.micro +31 -0
- package/runtime/colorschemes/cmc-16.micro +47 -0
- package/runtime/colorschemes/cmc-tc.micro +43 -0
- package/runtime/colorschemes/darcula.micro +34 -0
- package/runtime/colorschemes/default.micro +1 -0
- package/runtime/colorschemes/dracula-tc.micro +49 -0
- package/runtime/colorschemes/dukedark-tc.micro +38 -0
- package/runtime/colorschemes/dukelight-tc.micro +38 -0
- package/runtime/colorschemes/dukeubuntu-tc.micro +38 -0
- package/runtime/colorschemes/geany.micro +29 -0
- package/runtime/colorschemes/gotham.micro +29 -0
- package/runtime/colorschemes/gruvbox-tc.micro +29 -0
- package/runtime/colorschemes/gruvbox.micro +26 -0
- package/runtime/colorschemes/material-tc.micro +36 -0
- package/runtime/colorschemes/monokai-dark.micro +28 -0
- package/runtime/colorschemes/monokai.micro +34 -0
- package/runtime/colorschemes/one-dark.micro +39 -0
- package/runtime/colorschemes/railscast.micro +37 -0
- package/runtime/colorschemes/simple.micro +33 -0
- package/runtime/colorschemes/solarized-tc.micro +31 -0
- package/runtime/colorschemes/solarized.micro +30 -0
- package/runtime/colorschemes/sunny-day.micro +29 -0
- package/runtime/colorschemes/twilight.micro +40 -0
- package/runtime/colorschemes/zenburn.micro +30 -0
- package/runtime/help/actions.md +161 -0
- package/runtime/help/cdp.md +119 -0
- package/runtime/help/colors.md +421 -0
- package/runtime/help/commands.md +161 -0
- package/runtime/help/copypaste.md +149 -0
- package/runtime/help/defaultkeys.md +148 -0
- package/runtime/help/help.md +285 -0
- package/runtime/help/keybindings.md +355 -0
- package/runtime/help/linter.md +90 -0
- package/runtime/help/options.md +709 -0
- package/runtime/help/plugins.md +544 -0
- package/runtime/help/tutorial.md +112 -0
- package/runtime/jsplugins/cdp/cdp-server.js +1161 -0
- package/runtime/jsplugins/cdp/cdp.js +192 -0
- package/runtime/jsplugins/chapter/chapter.js +108 -0
- package/runtime/jsplugins/diff/diff.js +46 -0
- package/runtime/jsplugins/example/example.js +110 -0
- package/runtime/jsplugins/linter/linter.js +281 -0
- package/runtime/plugins/autoclose/autoclose.lua +75 -0
- package/runtime/plugins/ftoptions/ftoptions.lua +17 -0
- package/runtime/plugins/literate/README.md +5 -0
- package/runtime/plugins/literate/literate.lua +55 -0
- package/runtime/plugins/status/help/status.md +21 -0
- package/runtime/plugins/status/status.lua +62 -0
- package/runtime/syntax/LICENSE +22 -0
- package/runtime/syntax/PowerShell.yaml +128 -0
- package/runtime/syntax/README.md +63 -0
- package/runtime/syntax/ada.yaml +43 -0
- package/runtime/syntax/apacheconf.yaml +59 -0
- package/runtime/syntax/arduino.yaml +101 -0
- package/runtime/syntax/asciidoc.yaml +51 -0
- package/runtime/syntax/asm.yaml +123 -0
- package/runtime/syntax/ats.yaml +99 -0
- package/runtime/syntax/awk.yaml +44 -0
- package/runtime/syntax/b.yaml +87 -0
- package/runtime/syntax/bat.yaml +57 -0
- package/runtime/syntax/c.yaml +60 -0
- package/runtime/syntax/caddyfile.yaml +23 -0
- package/runtime/syntax/cake.yaml +7 -0
- package/runtime/syntax/clojure.yaml +38 -0
- package/runtime/syntax/cmake.yaml +42 -0
- package/runtime/syntax/coffeescript.yaml +56 -0
- package/runtime/syntax/colortest.yaml +19 -0
- package/runtime/syntax/conky.yaml +17 -0
- package/runtime/syntax/cpp.yaml +91 -0
- package/runtime/syntax/crontab.yaml +36 -0
- package/runtime/syntax/crystal.yaml +72 -0
- package/runtime/syntax/csharp.yaml +52 -0
- package/runtime/syntax/css.yaml +44 -0
- package/runtime/syntax/csx.yaml +8 -0
- package/runtime/syntax/cuda.yaml +68 -0
- package/runtime/syntax/cython.yaml +52 -0
- package/runtime/syntax/d.yaml +121 -0
- package/runtime/syntax/dart.yaml +46 -0
- package/runtime/syntax/default.yaml +10 -0
- package/runtime/syntax/dockerfile.yaml +36 -0
- package/runtime/syntax/dot.yaml +29 -0
- package/runtime/syntax/elixir.yaml +30 -0
- package/runtime/syntax/elm.yaml +38 -0
- package/runtime/syntax/erb.yaml +42 -0
- package/runtime/syntax/erlang.yaml +45 -0
- package/runtime/syntax/fish.yaml +48 -0
- package/runtime/syntax/forth.yaml +34 -0
- package/runtime/syntax/fortran.yaml +64 -0
- package/runtime/syntax/freebsd-kernel.yaml +14 -0
- package/runtime/syntax/fsharp.yaml +48 -0
- package/runtime/syntax/gdscript.yaml +61 -0
- package/runtime/syntax/gemini.yaml +19 -0
- package/runtime/syntax/gentoo-ebuild.yaml +48 -0
- package/runtime/syntax/gentoo-etc-portage.yaml +23 -0
- package/runtime/syntax/git-commit.yaml +35 -0
- package/runtime/syntax/git-config.yaml +14 -0
- package/runtime/syntax/git-rebase-todo.yaml +19 -0
- package/runtime/syntax/gleam.yaml +69 -0
- package/runtime/syntax/glsl.yaml +26 -0
- package/runtime/syntax/gnuplot.yaml +15 -0
- package/runtime/syntax/go.yaml +62 -0
- package/runtime/syntax/godoc.yaml +17 -0
- package/runtime/syntax/golo.yaml +73 -0
- package/runtime/syntax/gomod.yaml +31 -0
- package/runtime/syntax/graphql.yaml +47 -0
- package/runtime/syntax/groff.yaml +30 -0
- package/runtime/syntax/groovy.yaml +111 -0
- package/runtime/syntax/haml.yaml +16 -0
- package/runtime/syntax/hare.yaml +52 -0
- package/runtime/syntax/haskell.yaml +52 -0
- package/runtime/syntax/hc.yaml +52 -0
- package/runtime/syntax/html.yaml +70 -0
- package/runtime/syntax/html4.yaml +25 -0
- package/runtime/syntax/html5.yaml +25 -0
- package/runtime/syntax/ini.yaml +23 -0
- package/runtime/syntax/inputrc.yaml +14 -0
- package/runtime/syntax/java.yaml +37 -0
- package/runtime/syntax/javascript.yaml +124 -0
- package/runtime/syntax/jinja2.yaml +19 -0
- package/runtime/syntax/json.yaml +39 -0
- package/runtime/syntax/jsonnet.yaml +92 -0
- package/runtime/syntax/julia.yaml +57 -0
- package/runtime/syntax/justfile.yaml +40 -0
- package/runtime/syntax/keymap.yaml +27 -0
- package/runtime/syntax/kickstart.yaml +16 -0
- package/runtime/syntax/kotlin.yaml +66 -0
- package/runtime/syntax/kvlang.yaml +67 -0
- package/runtime/syntax/ledger.yaml +14 -0
- package/runtime/syntax/lfe.yaml +17 -0
- package/runtime/syntax/lilypond.yaml +26 -0
- package/runtime/syntax/lisp.yaml +17 -0
- package/runtime/syntax/log.yaml +92 -0
- package/runtime/syntax/lua.yaml +111 -0
- package/runtime/syntax/mail.yaml +25 -0
- package/runtime/syntax/makefile.yaml +38 -0
- package/runtime/syntax/man.yaml +12 -0
- package/runtime/syntax/markdown.yaml +49 -0
- package/runtime/syntax/mc.yaml +23 -0
- package/runtime/syntax/meson.yaml +51 -0
- package/runtime/syntax/micro.yaml +34 -0
- package/runtime/syntax/mpdconf.yaml +13 -0
- package/runtime/syntax/msbuild.yaml +6 -0
- package/runtime/syntax/nanorc.yaml +16 -0
- package/runtime/syntax/nftables.yaml +30 -0
- package/runtime/syntax/nginx.yaml +22 -0
- package/runtime/syntax/nim.yaml +27 -0
- package/runtime/syntax/nix.yaml +32 -0
- package/runtime/syntax/nu.yaml +114 -0
- package/runtime/syntax/objc.yaml +60 -0
- package/runtime/syntax/ocaml.yaml +43 -0
- package/runtime/syntax/octave.yaml +83 -0
- package/runtime/syntax/odin.yaml +64 -0
- package/runtime/syntax/pascal.yaml +45 -0
- package/runtime/syntax/patch.yaml +14 -0
- package/runtime/syntax/peg.yaml +16 -0
- package/runtime/syntax/perl.yaml +58 -0
- package/runtime/syntax/php.yaml +60 -0
- package/runtime/syntax/pkg-config.yaml +12 -0
- package/runtime/syntax/po.yaml +12 -0
- package/runtime/syntax/pony.yaml +37 -0
- package/runtime/syntax/pov.yaml +21 -0
- package/runtime/syntax/privoxy-action.yaml +14 -0
- package/runtime/syntax/privoxy-config.yaml +10 -0
- package/runtime/syntax/privoxy-filter.yaml +12 -0
- package/runtime/syntax/proto.yaml +40 -0
- package/runtime/syntax/prql.yaml +84 -0
- package/runtime/syntax/puppet.yaml +22 -0
- package/runtime/syntax/python2.yaml +60 -0
- package/runtime/syntax/python3.yaml +80 -0
- package/runtime/syntax/r.yaml +32 -0
- package/runtime/syntax/raku.yaml +42 -0
- package/runtime/syntax/reST.yaml +18 -0
- package/runtime/syntax/renpy.yaml +15 -0
- package/runtime/syntax/rpmspec.yaml +43 -0
- package/runtime/syntax/ruby.yaml +73 -0
- package/runtime/syntax/rust.yaml +78 -0
- package/runtime/syntax/sage.yaml +60 -0
- package/runtime/syntax/scad.yaml +53 -0
- package/runtime/syntax/scala.yaml +33 -0
- package/runtime/syntax/sed.yaml +13 -0
- package/runtime/syntax/sh.yaml +69 -0
- package/runtime/syntax/sls.yaml +15 -0
- package/runtime/syntax/smalltalk.yaml +55 -0
- package/runtime/syntax/solidity.yaml +41 -0
- package/runtime/syntax/sql.yaml +35 -0
- package/runtime/syntax/stata.yaml +67 -0
- package/runtime/syntax/svelte.yaml +27 -0
- package/runtime/syntax/swift.yaml +103 -0
- package/runtime/syntax/systemd.yaml +16 -0
- package/runtime/syntax/tcl.yaml +18 -0
- package/runtime/syntax/terraform.yaml +87 -0
- package/runtime/syntax/tex.yaml +32 -0
- package/runtime/syntax/toml.yaml +56 -0
- package/runtime/syntax/twig.yaml +55 -0
- package/runtime/syntax/typescript.yaml +49 -0
- package/runtime/syntax/v.yaml +80 -0
- package/runtime/syntax/vala.yaml +26 -0
- package/runtime/syntax/verilog.yaml +60 -0
- package/runtime/syntax/vhdl.yaml +37 -0
- package/runtime/syntax/vi.yaml +31 -0
- package/runtime/syntax/vue.yaml +64 -0
- package/runtime/syntax/xml.yaml +37 -0
- package/runtime/syntax/xresources.yaml +14 -0
- package/runtime/syntax/yaml.yaml +34 -0
- package/runtime/syntax/yum.yaml +12 -0
- package/runtime/syntax/zig.yaml +52 -0
- package/runtime/syntax/zscript.yaml +72 -0
- package/runtime/syntax/zsh.yaml +52 -0
- package/single-exe/README.md +80 -0
- package/single-exe/assetsHelper.js +90 -0
- package/single-exe/assetsLoader.mjs +85 -0
- package/single-exe/compiled.js +149 -0
- package/single-exe/entry.mjs +9 -0
- package/single-exe/packAssets.sh +7 -0
- package/src/buffer/backup.js +160 -0
- package/src/buffer/buffer.js +126 -0
- package/src/buffer/fixed3-codec.js +140 -0
- package/src/buffer/loc.js +38 -0
- package/src/buffer/message.js +29 -0
- package/src/config/clean.js +172 -0
- package/src/config/colorscheme.js +99 -0
- package/src/config/config.js +122 -0
- package/src/config/defaults.js +109 -0
- package/src/cui/rpc.mjs +259 -0
- package/src/cui/server.mjs +116 -0
- package/src/display/ansi-style.js +60 -0
- package/src/highlight/highlighter.js +243 -0
- package/src/highlight/parser.js +225 -0
- package/src/index.js +8009 -0
- package/src/lua/engine.js +71 -0
- package/src/platform/archive.js +50 -0
- package/src/platform/clipboard.js +278 -0
- package/src/platform/commands.js +137 -0
- package/src/plugins/js-bridge.js +983 -0
- package/src/plugins/manager.js +674 -0
- package/src/runtime/assets.js +90 -0
- package/src/runtime/compiled.js +25 -0
- package/src/runtime/encodings.js +10 -0
- package/src/runtime/registry.js +134 -0
- package/src/screen/cell-buffer.js +81 -0
- package/src/screen/events.js +263 -0
- package/src/screen/screen.js +142 -0
- package/src/screen/vt100.js +571 -0
- package/src/shell/shell.js +70 -0
- package/testapp.md +55 -0
- package/tests/backup.test.js +133 -0
- package/tests/cmphex3b64.js +95 -0
- package/tests/pty-demo.js +492 -0
- package/tests/wv-client.js +96 -0
- package/tui +5 -0
- package/wui +5 -0
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
# Keybindings
|
|
2
|
+
|
|
3
|
+
- bunmicro has a plethora of hotkeys that make it easy and powerful to use.
|
|
4
|
+
|
|
5
|
+
- Custom keybindings are not implemented in bunmicro for now
|
|
6
|
+
- For a list of actions like CursorUp
|
|
7
|
+
- Press Ctrl+E to show command prompt
|
|
8
|
+
- `> help actions`
|
|
9
|
+
- It is recommended to use jsplugins to register a command for such purposes
|
|
10
|
+
- Examples under runtime/jsplugins
|
|
11
|
+
- If you really wish to rebind keys, edit src/index.js and look for things like alt-d
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
- For a more user-friendly list with
|
|
15
|
+
explanations of what the default hotkeys are and what they do
|
|
16
|
+
- Press Ctrl+E to show command prompt
|
|
17
|
+
- `> help defaultkeys`
|
|
18
|
+
- a json formatted list of default keys is included at the end of this document
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
You can use Ctrl + arrows to move word by word (Alt + arrows for Mac). Alt + left and right
|
|
22
|
+
move the cursor to the start and end of the line (Ctrl + left/right for Mac), and Ctrl + up and down move the
|
|
23
|
+
cursor to the start and end of the buffer.
|
|
24
|
+
|
|
25
|
+
You can hold shift with all of these movement actions to select while moving.
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## Note for macOS
|
|
29
|
+
- By default, macOS terminals do not forward alt events and
|
|
30
|
+
instead insert unicode characters. To fix this, do the following:
|
|
31
|
+
|
|
32
|
+
* iTerm2: select `Esc+` for `Left Option Key` in `Preferences->Profiles->Keys`.
|
|
33
|
+
* Terminal.app: Enable `Use Option key as Meta key` in `Preferences->Profiles->Keyboard`.
|
|
34
|
+
|
|
35
|
+
### iTerm2
|
|
36
|
+
|
|
37
|
+
In iTerm2, you can do this in `Preferences->Profiles->Keys` then click the
|
|
38
|
+
`+`, input your keybinding, and for the `Action` select `Send Escape Sequence`.
|
|
39
|
+
For the above example your would type `ctrlback` into the box (the `\x1b`) is
|
|
40
|
+
automatically sent by iTerm2.
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
## Actions binding (not implemented)
|
|
44
|
+
|
|
45
|
+
The `StartOfTextToggle` and `SelectToStartOfTextToggle` actions toggle between
|
|
46
|
+
jumping to the start of the text (first) and start of the line.
|
|
47
|
+
|
|
48
|
+
The `CutLine` action cuts the current line and adds it to the previously cut
|
|
49
|
+
lines in the clipboard since the last paste (rather than just replaces the
|
|
50
|
+
clipboard contents with this line). So you can cut multiple, not necessarily
|
|
51
|
+
consecutive lines to the clipboard just by pressing `Ctrl-k` multiple times,
|
|
52
|
+
without selecting them. If you want the more traditional behavior i.e. just
|
|
53
|
+
rewrite the clipboard every time, you can use `CopyLine,DeleteLine` action
|
|
54
|
+
instead of `CutLine`.
|
|
55
|
+
|
|
56
|
+
You can also bind some mouse actions (these must be bound to mouse buttons)
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
MousePress
|
|
60
|
+
MouseDrag
|
|
61
|
+
MouseRelease
|
|
62
|
+
MouseMultiCursor
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Here is the list of all possible keys you can bind:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
Up
|
|
69
|
+
Down
|
|
70
|
+
Right
|
|
71
|
+
Left
|
|
72
|
+
UpLeft
|
|
73
|
+
UpRight
|
|
74
|
+
DownLeft
|
|
75
|
+
DownRight
|
|
76
|
+
Center
|
|
77
|
+
PageUp
|
|
78
|
+
PageDown
|
|
79
|
+
Home
|
|
80
|
+
End
|
|
81
|
+
Insert
|
|
82
|
+
Delete
|
|
83
|
+
Help
|
|
84
|
+
Exit
|
|
85
|
+
Clear
|
|
86
|
+
Cancel
|
|
87
|
+
Print
|
|
88
|
+
Pause
|
|
89
|
+
Backtab
|
|
90
|
+
F1
|
|
91
|
+
F2
|
|
92
|
+
F3
|
|
93
|
+
F4
|
|
94
|
+
F5
|
|
95
|
+
F6
|
|
96
|
+
F7
|
|
97
|
+
F8
|
|
98
|
+
F9
|
|
99
|
+
F10
|
|
100
|
+
F11
|
|
101
|
+
F12
|
|
102
|
+
F13
|
|
103
|
+
F14
|
|
104
|
+
F15
|
|
105
|
+
F16
|
|
106
|
+
F17
|
|
107
|
+
F18
|
|
108
|
+
F19
|
|
109
|
+
F20
|
|
110
|
+
F21
|
|
111
|
+
F22
|
|
112
|
+
F23
|
|
113
|
+
F24
|
|
114
|
+
F25
|
|
115
|
+
F26
|
|
116
|
+
F27
|
|
117
|
+
F28
|
|
118
|
+
F29
|
|
119
|
+
F30
|
|
120
|
+
F31
|
|
121
|
+
F32
|
|
122
|
+
F33
|
|
123
|
+
F34
|
|
124
|
+
F35
|
|
125
|
+
F36
|
|
126
|
+
F37
|
|
127
|
+
F38
|
|
128
|
+
F39
|
|
129
|
+
F40
|
|
130
|
+
F41
|
|
131
|
+
F42
|
|
132
|
+
F43
|
|
133
|
+
F44
|
|
134
|
+
F45
|
|
135
|
+
F46
|
|
136
|
+
F47
|
|
137
|
+
F48
|
|
138
|
+
F49
|
|
139
|
+
F50
|
|
140
|
+
F51
|
|
141
|
+
F52
|
|
142
|
+
F53
|
|
143
|
+
F54
|
|
144
|
+
F55
|
|
145
|
+
F56
|
|
146
|
+
F57
|
|
147
|
+
F58
|
|
148
|
+
F59
|
|
149
|
+
F60
|
|
150
|
+
F61
|
|
151
|
+
F62
|
|
152
|
+
F63
|
|
153
|
+
F64
|
|
154
|
+
CtrlSpace
|
|
155
|
+
Ctrl-a
|
|
156
|
+
Ctrl-b
|
|
157
|
+
Ctrl-c
|
|
158
|
+
Ctrl-d
|
|
159
|
+
Ctrl-e
|
|
160
|
+
Ctrl-f
|
|
161
|
+
Ctrl-g
|
|
162
|
+
Ctrl-h
|
|
163
|
+
Ctrl-i
|
|
164
|
+
Ctrl-j
|
|
165
|
+
Ctrl-k
|
|
166
|
+
Ctrl-l
|
|
167
|
+
Ctrl-m
|
|
168
|
+
Ctrl-n
|
|
169
|
+
Ctrl-o
|
|
170
|
+
Ctrl-p
|
|
171
|
+
Ctrl-q
|
|
172
|
+
Ctrl-r
|
|
173
|
+
Ctrl-s
|
|
174
|
+
Ctrl-t
|
|
175
|
+
Ctrl-u
|
|
176
|
+
Ctrl-v
|
|
177
|
+
Ctrl-w
|
|
178
|
+
Ctrl-x
|
|
179
|
+
Ctrl-y
|
|
180
|
+
Ctrl-z
|
|
181
|
+
CtrlLeftSq
|
|
182
|
+
CtrlBackslash
|
|
183
|
+
CtrlRightSq
|
|
184
|
+
CtrlCarat
|
|
185
|
+
CtrlUnderscore
|
|
186
|
+
Backspace
|
|
187
|
+
OldBackspace
|
|
188
|
+
Tab
|
|
189
|
+
Esc
|
|
190
|
+
Escape
|
|
191
|
+
Enter
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
You can also bind some mouse buttons (they may be bound to normal actions or
|
|
195
|
+
mouse actions)
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
MouseLeft
|
|
199
|
+
MouseLeftDrag
|
|
200
|
+
MouseLeftRelease
|
|
201
|
+
MouseMiddle
|
|
202
|
+
MouseMiddleDrag
|
|
203
|
+
MouseMiddleRelease
|
|
204
|
+
MouseRight
|
|
205
|
+
MouseRightDrag
|
|
206
|
+
MouseRightRelease
|
|
207
|
+
MouseWheelUp
|
|
208
|
+
MouseWheelDown
|
|
209
|
+
MouseWheelLeft
|
|
210
|
+
MouseWheelRight
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
# Default keybinding configuration.
|
|
216
|
+
|
|
217
|
+
A select few keybindings are different on MacOS compared to other
|
|
218
|
+
operating systems. This is because different OSes have different
|
|
219
|
+
conventions for text editing defaults.
|
|
220
|
+
|
|
221
|
+
```json
|
|
222
|
+
{
|
|
223
|
+
"Up": "CursorUp",
|
|
224
|
+
"Down": "CursorDown",
|
|
225
|
+
"Right": "CursorRight",
|
|
226
|
+
"Left": "CursorLeft",
|
|
227
|
+
"ShiftUp": "SelectUp",
|
|
228
|
+
"ShiftDown": "SelectDown",
|
|
229
|
+
"ShiftLeft": "SelectLeft",
|
|
230
|
+
"ShiftRight": "SelectRight",
|
|
231
|
+
"AltLeft": "WordLeft", (Mac)
|
|
232
|
+
"AltRight": "WordRight", (Mac)
|
|
233
|
+
"AltUp": "MoveLinesUp",
|
|
234
|
+
"AltDown": "MoveLinesDown",
|
|
235
|
+
"CtrlShiftRight": "SelectWordRight",
|
|
236
|
+
"CtrlShiftLeft": "SelectWordLeft",
|
|
237
|
+
"AltLeft": "StartOfTextToggle",
|
|
238
|
+
"AltRight": "EndOfLine",
|
|
239
|
+
"AltShiftRight": "SelectWordRight", (Mac)
|
|
240
|
+
"AltShiftLeft": "SelectWordLeft", (Mac)
|
|
241
|
+
"CtrlLeft": "StartOfText", (Mac)
|
|
242
|
+
"CtrlRight": "EndOfLine", (Mac)
|
|
243
|
+
"AltShiftLeft": "SelectToStartOfTextToggle",
|
|
244
|
+
"CtrlShiftLeft": "SelectToStartOfTextToggle", (Mac)
|
|
245
|
+
"ShiftHome": "SelectToStartOfTextToggle",
|
|
246
|
+
"AltShiftRight": "SelectToEndOfLine",
|
|
247
|
+
"CtrlShiftRight": "SelectToEndOfLine", (Mac)
|
|
248
|
+
"ShiftEnd": "SelectToEndOfLine",
|
|
249
|
+
"CtrlUp": "CursorStart",
|
|
250
|
+
"CtrlDown": "CursorEnd",
|
|
251
|
+
"CtrlShiftUp": "SelectToStart",
|
|
252
|
+
"CtrlShiftDown": "SelectToEnd",
|
|
253
|
+
"Alt-{": "ParagraphPrevious",
|
|
254
|
+
"Alt-}": "ParagraphNext",
|
|
255
|
+
"Enter": "InsertNewline",
|
|
256
|
+
"Ctrl-h": "Backspace",
|
|
257
|
+
"Backspace": "Backspace",
|
|
258
|
+
"Alt-CtrlH": "DeleteWordLeft",
|
|
259
|
+
"Alt-Backspace": "DeleteWordLeft",
|
|
260
|
+
"Tab": "Autocomplete|IndentSelection|InsertTab",
|
|
261
|
+
"Backtab": "OutdentSelection|OutdentLine",
|
|
262
|
+
"Ctrl-o": "OpenFile",
|
|
263
|
+
"Ctrl-s": "Save",
|
|
264
|
+
"Ctrl-f": "Find",
|
|
265
|
+
"Alt-F": "FindLiteral",
|
|
266
|
+
"Ctrl-n": "FindNext",
|
|
267
|
+
"Ctrl-p": "FindPrevious",
|
|
268
|
+
"Alt-[": "DiffPrevious|CursorStart",
|
|
269
|
+
"Alt-]": "DiffNext|CursorEnd",
|
|
270
|
+
"Ctrl-z": "Undo",
|
|
271
|
+
"Ctrl-y": "Redo",
|
|
272
|
+
"Ctrl-c": "Copy|CopyLine",
|
|
273
|
+
"Ctrl-x": "Cut|CutLine",
|
|
274
|
+
"Ctrl-k": "CutLine",
|
|
275
|
+
"Ctrl-d": "Duplicate|DuplicateLine",
|
|
276
|
+
"Ctrl-v": "Paste",
|
|
277
|
+
"Ctrl-a": "SelectAll",
|
|
278
|
+
"Ctrl-t": "AddTab",
|
|
279
|
+
"Alt-,": "PreviousTab|LastTab",
|
|
280
|
+
"Alt-.": "NextTab|FirstTab",
|
|
281
|
+
"Home": "StartOfText",
|
|
282
|
+
"End": "EndOfLine",
|
|
283
|
+
"CtrlHome": "CursorStart",
|
|
284
|
+
"CtrlEnd": "CursorEnd",
|
|
285
|
+
"PageUp": "CursorPageUp",
|
|
286
|
+
"PageDown": "CursorPageDown",
|
|
287
|
+
"CtrlPageUp": "PreviousTab|LastTab",
|
|
288
|
+
"CtrlPageDown": "NextTab|FirstTab",
|
|
289
|
+
"ShiftPageUp": "SelectPageUp",
|
|
290
|
+
"ShiftPageDown": "SelectPageDown",
|
|
291
|
+
"Ctrl-g": "ToggleHelp",
|
|
292
|
+
"Alt-g": "ToggleKeyMenu",
|
|
293
|
+
"Ctrl-r": "ToggleRuler",
|
|
294
|
+
"Ctrl-l": "command-edit:goto ",
|
|
295
|
+
"Delete": "Delete",
|
|
296
|
+
"Ctrl-b": "ShellMode",
|
|
297
|
+
"Ctrl-q": "Quit",
|
|
298
|
+
"Ctrl-e": "CommandMode",
|
|
299
|
+
"Ctrl-w": "NextSplit|FirstSplit",
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
// macro insert
|
|
303
|
+
// not implemented yet
|
|
304
|
+
"Ctrl-u": "ToggleMacro",
|
|
305
|
+
"Ctrl-j": "PlayMacro",
|
|
306
|
+
"Insert": "ToggleOverwriteMode",
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
// Emacs-style keybindings
|
|
310
|
+
// not implemented yet
|
|
311
|
+
"Alt-f": "WordRight",
|
|
312
|
+
"Alt-b": "WordLeft",
|
|
313
|
+
"Alt-a": "StartOfLine",
|
|
314
|
+
"Alt-e": "EndOfLine",
|
|
315
|
+
|
|
316
|
+
// Integration with file managers
|
|
317
|
+
// not implemented yet
|
|
318
|
+
"F2": "Save",
|
|
319
|
+
"F3": "Find",
|
|
320
|
+
"F4": "Quit",
|
|
321
|
+
"F7": "Find",
|
|
322
|
+
"F10": "Quit",
|
|
323
|
+
"Esc": "Escape",
|
|
324
|
+
|
|
325
|
+
// Mouse bindings
|
|
326
|
+
"MouseWheelUp": "ScrollUp",
|
|
327
|
+
"MouseWheelDown": "ScrollDown",
|
|
328
|
+
"MouseLeft": "MousePress",
|
|
329
|
+
"MouseLeftDrag": "MouseDrag",
|
|
330
|
+
"MouseLeftRelease": "MouseRelease",
|
|
331
|
+
"MouseMiddle": "PastePrimary",
|
|
332
|
+
"Ctrl-MouseLeft": "MouseMultiCursor",
|
|
333
|
+
|
|
334
|
+
// Multi-cursor bindings
|
|
335
|
+
// not implemented yet
|
|
336
|
+
"Alt-n": "SpawnMultiCursor",
|
|
337
|
+
"AltShiftUp": "SpawnMultiCursorUp",
|
|
338
|
+
"AltShiftDown": "SpawnMultiCursorDown",
|
|
339
|
+
"Alt-m": "SpawnMultiCursorSelect",
|
|
340
|
+
"Alt-p": "RemoveMultiCursor",
|
|
341
|
+
"Alt-c": "RemoveAllMultiCursors",
|
|
342
|
+
"Alt-x": "SkipMultiCursor",
|
|
343
|
+
}
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
## Final notes
|
|
348
|
+
|
|
349
|
+
- Note: On some old terminal emulators and on Windows machines, `Ctrl-h` should be used for backspace.
|
|
350
|
+
|
|
351
|
+
- Please note that terminal emulators are strange applications and micro only receives key events that the terminal decides to send.
|
|
352
|
+
- Some terminal emulators may not send certain events even if this document says micro can receive the event.
|
|
353
|
+
- To see exactly what micro receives from the terminal when you press a key,
|
|
354
|
+
- Press Ctrl+E to show command prompt
|
|
355
|
+
- then run the `> raw` command.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Linter
|
|
2
|
+
|
|
3
|
+
The linter plugin runs a compiler or linter on your source code
|
|
4
|
+
and parses the resulting output so that the messages and line numbers
|
|
5
|
+
can be viewed from within micro. By default, the plugin supports the
|
|
6
|
+
following filetypes and linters:
|
|
7
|
+
|
|
8
|
+
* **c**: gcc
|
|
9
|
+
* **c++**: g++
|
|
10
|
+
* **d**: dmd
|
|
11
|
+
* **d**: ldc2
|
|
12
|
+
* **d**: gdc
|
|
13
|
+
* **go**: go build
|
|
14
|
+
* **go**: go vet
|
|
15
|
+
* **haskell**: hlint
|
|
16
|
+
* **java**: javac
|
|
17
|
+
* **javascript**: jshint
|
|
18
|
+
* **javascript**: eslint
|
|
19
|
+
* **literate**: lit
|
|
20
|
+
* **lua**: luacheck
|
|
21
|
+
* **nim**: nim
|
|
22
|
+
* **nix**: nix-linter
|
|
23
|
+
* **objective-c**: clang
|
|
24
|
+
* **python**: flake8
|
|
25
|
+
* **python**: mypy
|
|
26
|
+
* **python**: pyflakes
|
|
27
|
+
* **python**: pylint
|
|
28
|
+
* **python**: ruff
|
|
29
|
+
* **rust**: cargo clippy
|
|
30
|
+
* **shell**: shfmt
|
|
31
|
+
* **shell**: shellcheck
|
|
32
|
+
* **swift**: swiftc (MacOS and Linux only)
|
|
33
|
+
* **yaml**: yamllint
|
|
34
|
+
|
|
35
|
+
If the linter plugin is enabled and the file corresponds to one of
|
|
36
|
+
these filetypes, each time the buffer is saved, or when the `> lint`
|
|
37
|
+
command is executed, micro will run the corresponding utility in the
|
|
38
|
+
background and display the messages when it completes.
|
|
39
|
+
|
|
40
|
+
The linter plugin also allows users to extend the supported filetypes.
|
|
41
|
+
From inside another micro plugin, the function `linter.makeLinter` can
|
|
42
|
+
be called to register a new filetype. Here is the spec for the `makeLinter`
|
|
43
|
+
function:
|
|
44
|
+
|
|
45
|
+
`linter.makeLinter(name, filetype, cmd, args, errorformat, os, whitelist, domatch, loffset, coffset, callback)`
|
|
46
|
+
|
|
47
|
+
* **name**: name of the linter
|
|
48
|
+
* **filetype**: filetype to check for to use linter
|
|
49
|
+
* **cmd**: main linter process that is executed
|
|
50
|
+
* **args**: arguments to pass to the linter process
|
|
51
|
+
* use %f to refer to the current file name
|
|
52
|
+
* use %d to refer to the current directory name
|
|
53
|
+
* **errorformat**: how to parse the linter/compiler process output
|
|
54
|
+
%f: file, %l: line number, %m: error/warning message
|
|
55
|
+
* **os**: list of OSs this linter is supported or unsupported on
|
|
56
|
+
optional param, default: {}
|
|
57
|
+
* **whitelist**: should the OS list be a blacklist (do not run the linter for these OSs)
|
|
58
|
+
or a whitelist (only run the linter for these OSs)
|
|
59
|
+
optional param, default: false (should blacklist)
|
|
60
|
+
* **domatch**: should the filetype be interpreted as a lua pattern to match with
|
|
61
|
+
the actual filetype, or should the linter only activate on an exact match
|
|
62
|
+
optional param, default: false (require exact match)
|
|
63
|
+
* **loffset**: line offset will be added to the line number returned by the linter
|
|
64
|
+
useful if the linter returns 0-indexed lines
|
|
65
|
+
optional param, default: 0
|
|
66
|
+
* **coffset**: column offset will be added to the col number returned by the linter
|
|
67
|
+
useful if the linter returns 0-indexed columns
|
|
68
|
+
optional param, default: 0
|
|
69
|
+
* **callback**: function to call before executing the linter, if it returns
|
|
70
|
+
false the lint is canceled. The callback is passed the buf.
|
|
71
|
+
optional param, default: nil
|
|
72
|
+
|
|
73
|
+
Below is an example for including a linter for any filetype using
|
|
74
|
+
the `misspell` linter which checks for misspelled words in a file.
|
|
75
|
+
|
|
76
|
+
```lua
|
|
77
|
+
function init()
|
|
78
|
+
-- uses the default linter plugin
|
|
79
|
+
-- matches any filetype
|
|
80
|
+
linter.makeLinter("misspell", "", "misspell", {"%f"}, "%f:%l:%c: %m", {}, false, true)
|
|
81
|
+
end
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Here is an example for a more typical use-case, where the linter will only match one filetype (C in this case):
|
|
85
|
+
|
|
86
|
+
```lua
|
|
87
|
+
function init()
|
|
88
|
+
linter.makeLinter("gcc", "c", "gcc", {"-fsyntax-only", "-Wall", "-Wextra", "%f"}, "%f:%l:%c:.+: %m")
|
|
89
|
+
end
|
|
90
|
+
```
|