You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-10Lines changed: 24 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,8 @@
3
3
**lua-console.nvim** - is a handy scratch pad / REPL / debug console for Lua development and Neovim exploration and configuration.
4
4
Acts as a user friendly replacement of command mode - messages loop and as a handy scratch pad to store and test your code gists.
5
5
6
-
***Update: Although it originated as a tool for Lua development, it has now evolved into supporting other languages too. See [`evaluating other languages`](#evaluating-other-languages).***
6
+
7
+
***Update: although it originated as a tool for Lua development, it has now evolved into supporting other languages too. See [`evaluating other languages`](#evaluating-other-languages).***
7
8
8
9
<br/><imgsrc="doc/demo.gif">
9
10
@@ -52,6 +53,7 @@ config. If you want to delete a mapping - set its value to `false`.
52
53
53
54
<!-- config:start -->
54
55
`config.lua`
56
+
55
57
```lua
56
58
opts= {
57
59
buffer= {
@@ -139,10 +141,10 @@ There are two functions available within the console:
139
141
140
142
#### Setting up
141
143
142
-
- It is possible to setup external code executors for other languages. Evaluators for `ruby` and `racket` are working out of the box, support for other languages is coming.
144
+
- It is possible to setup external code executors for other languages. Evaluators for `ruby`,`racket` and `python` are working out of the box, support for other languages is coming.
143
145
Meanwhile, you can easily setup your own language.
144
-
- Below is the default configuration which can be overridden or extended by your custom config (`default_process_opts` will be
145
-
replaced by language specific opts), e.g. a possible config for `python` could be:
146
+
- Below is the default configuration, which can be overridden or extended by your custom config, where `default_process_opts` will be
147
+
replaced by language specific opts, e.g. a possible config for `python` could be:
146
148
147
149
```lua
148
150
require('lua-console').setup {
@@ -157,12 +159,11 @@ There are two functions available within the console:
157
159
}
158
160
```
159
161
160
-
- You can also setup a custom formatter to format the evaluator output before appending results to the console or buffer. Example is in the config.
@@ -209,23 +210,24 @@ There are two functions available within the console:
209
210
returnexternal_evaluators
210
211
```
211
212
<!-- config:end -->
212
-
213
213
</details>
214
214
215
+
- You can also setup a custom formatter to format the evaluator output before appending results to the console or buffer. Example is in the config.
216
+
217
+
215
218
#### Usage
216
219
217
220
- The language evaluator is determined either from (in order of precedence):
218
221
219
-
- The code prefix `===lang` on the line above your code snippet, in which case it only applies to the snippet directly below and it should be included in the selection
220
-
for evaluation. The prefix can be changed in the config.
222
+
- The code prefix `===lang` on the line above your code snippet, in which case it only applies to the snippet directly below. The prefix can be changed in the config.
221
223
- The code prefix on the top line of the console/buffer, in which case it applies to the whole buffer.
222
224
- The file type of the buffer.
225
+
223
226
<br/>
224
227
225
228
```racket
226
229
===racket
227
230
228
-
229
231
(define (log str)
230
232
(displayln (format "~v" str)))
231
233
@@ -243,6 +245,18 @@ There are two functions available within the console:
243
245
5.times { puts'Hey' }
244
246
```
245
247
248
+
- Code inside Lua comments will be sytax highlighted.
249
+
250
+
251
+
```python
252
+
[[===python
253
+
list = [1, 3, 5, 7, 9]
254
+
255
+
for val in a:
256
+
print(list)
257
+
]]
258
+
```
259
+
246
260
## Alternatives and comparison
247
261
248
262
There are a number of alternatives available, notably:
0 commit comments