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
+20-14Lines changed: 20 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,24 +76,27 @@ 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
79
81
},
80
82
window= {
81
83
border='double', -- single|double|rounded
82
84
height=0.6, -- percentage of main window
83
85
},
84
86
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='?'
87
+
toggle='`', -- toggle console
88
+
attach='<Leader>`', -- attach console to a buffer
89
+
quit='q', -- close console
90
+
eval='<CR>', -- evaluate code
91
+
eval_buffer='<S-CR>', -- evaluate whole buffer
92
+
kill_ps='<Leader>K', -- kill evaluation process
93
+
open='gf', -- open link
94
+
messages='M', -- load Neovim messages
95
+
save='S', -- save session
96
+
load='L', -- load session
97
+
resize_up='<C-Up>', -- resize up
98
+
resize_down='<C-Down>', -- resize down
99
+
help='?' -- help
97
100
},
98
101
}
99
102
```
@@ -108,7 +111,7 @@ opts = {
108
111
- Install, press the mapped key `` ` `` and start exploring.
109
112
- Enter code as normal, in insert mode.
110
113
- 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.
114
+
- 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
115
- The evaluation of the last line is returned and printed, so no `return` is needed in most cases.
113
116
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
117
The result of assignments on the last line will be also shown as virtual text.
@@ -142,7 +145,7 @@ If you want the context to be cleared before every execution, set `preserve_cont
142
145
143
146
There are two functions available within the console:
144
147
145
-
-`_ctx()` - will print the contents of the context
148
+
-`_ctx` - will print the contents of the context
146
149
-`_ctx_clear()` - clears the context
147
150
148
151
<br>
@@ -276,6 +279,9 @@ There are two functions available within the console:
276
279
277
280
<br>
278
281
282
+
- If you need to kill the evaluation process, press `<Leader>K`.
283
+
- 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()`.
284
+
279
285
## Alternatives and comparison
280
286
281
287
There are a number of alternatives available, notably:
0 commit comments