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
+21-14Lines changed: 21 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,24 +76,28 @@ opts = {
76
76
preserve_context=true, -- preserve results between evaluations
77
77
strip_local=true, -- remove local identifier from source code
78
78
print_one_line_results=true, -- prints one line results, even if already shown as virtual text
79
+
notify_result=false, -- notify result
80
+
clear_before_eval=false, -- clear output below result prefix before evaluation of the whole buffer
81
+
process_timeout=2*1e5, -- number of instructions to process before timeout
79
82
},
80
83
window= {
81
84
border='double', -- single|double|rounded
82
85
height=0.6, -- percentage of main window
83
86
},
84
87
mappings= {
85
-
toggle='`',
86
-
attach='<Leader>`',
87
-
quit='q',
88
-
eval='<CR>',
89
-
eval_buffer='<S-CR>',
90
-
open='gf',
91
-
messages='M',
92
-
save='S',
93
-
load='L',
94
-
resize_up='<C-Up>',
95
-
resize_down='<C-Down>',
96
-
help='?'
88
+
toggle='`', -- toggle console
89
+
attach='<Leader>`', -- attach console to a buffer
90
+
quit='q', -- close console
91
+
eval='<CR>', -- evaluate code
92
+
eval_buffer='<S-CR>', -- evaluate whole buffer
93
+
kill_ps='<Leader>K', -- kill evaluation process
94
+
open='gf', -- open link
95
+
messages='M', -- load Neovim messages
96
+
save='S', -- save session
97
+
load='L', -- load session
98
+
resize_up='<C-Up>', -- resize up
99
+
resize_down='<C-Down>', -- resize down
100
+
help='?' -- help
97
101
},
98
102
}
99
103
```
@@ -108,7 +112,7 @@ opts = {
108
112
- Install, press the mapped key `` ` `` and start exploring.
109
113
- Enter code as normal, in insert mode.
110
114
- Hit `Enter` in normal mode to evaluate a variable, statement or an expression in the current line.
111
-
- Visually select a region or range of lines and press `Enter` to evaluate the code in the range or use `<S-Enter>` to evaluate the whole console.
115
+
- Visually select a region or a range of lines and press `Enter` to evaluate the code in the range or use `<S-Enter>` to evaluate the whole console.
112
116
- The evaluation of the last line is returned and printed, so no `return` is needed in most cases.
113
117
To avoid noise, if the return of your execution is `nil`, e.g. from a loop or a function without return, it will not be printed, but shown as virtual text.
114
118
The result of assignments on the last line will be also shown as virtual text.
@@ -142,7 +146,7 @@ If you want the context to be cleared before every execution, set `preserve_cont
142
146
143
147
There are two functions available within the console:
144
148
145
-
-`_ctx()` - will print the contents of the context
149
+
-`_ctx` - will print the contents of the context
146
150
-`_ctx_clear()` - clears the context
147
151
148
152
<br>
@@ -276,6 +280,9 @@ There are two functions available within the console:
276
280
277
281
<br>
278
282
283
+
- If you need to kill the evaluation process, press `<Leader>K`.
284
+
- You can use `_ex` command to get a reference to the evaluator process, which can be queried for status with `:is_closing()` and stopped with `:kill()`.
285
+
279
286
## Alternatives and comparison
280
287
281
288
There are a number of alternatives available, notably:
0 commit comments