-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathneorepl.txt
210 lines (168 loc) · 6.27 KB
/
neorepl.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
*neorepl.txt* - Neovim REPL for lua and vimscript
==============================================================================
:Repl [{lang}] *:Repl* *neorepl*
Starts a new REPL instance. Optional {lang} can be "lua" or "vim".
See |neorepl.new()| for starting a new instance with custom settings.
------------------------------------------------------------------------------
LUA API
*neorepl-api*
neorepl.new([{config}]) *neorepl.new()*
Starts a new REPL instance.
See |neorepl-config| for the list of available options.
>
require('neorepl').new({...})
<
neorepl.config({config}) *neorepl.config()*
Sets the default config.
See |neorepl-config| for the list of available options.
>
require('neorepl').config({...})
<
------------------------------------------------------------------------------
KEY BINDINGS
*neorepl-keys*
<Plug>(neorepl-eval-line) *<Plug>(neorepl-eval-line)*
Evaluate line(s) under cursor.
Default mapping: <CR>, <C-M>
<Plug>(neorepl-break-line) *<Plug>(neorepl-break-line)*
Break line at cursor. For insert mode only.
Default mapping: <NL>, <C-J>
<Plug>(neorepl-backspace) *<Plug>(neorepl-backspace)*
Backspace. Also deletes line breaks.
Default mapping: <BS>, <C-H>
<Plug>(neorepl-delete-word) *<Plug>(neorepl-delete-word)*
Delete word. Also deletes line breaks.
Default mapping: <C-W>
<Plug>(neorepl-hist-prev) *<Plug>(neorepl-hist-prev)*
Previous entry in the history.
Default mapping: <C-P>
<Plug>(neorepl-hist-next) *<Plug>(neorepl-hist-next)*
Next entry in the history.
Default mapping: <C-N>
<Plug>(neorepl-complete) *<Plug>(neorepl-complete)*
Trigger completion. For insert mode only.
Default mapping: <Tab>
<Plug>(neorepl-]]) *<Plug>(neorepl-]])*
<Plug>(neorepl-][) *<Plug>(neorepl-][)*
<Plug>(neorepl-[[) *<Plug>(neorepl-[[)*
<Plug>(neorepl-[]) *<Plug>(neorepl-[])*
Navigate through the sections. See |]]|, |][|, |[[|, |[]|.
Default mappings: ]] ][ [[ []
------------------------------------------------------------------------------
COMMANDS
*neorepl-commands*
/v[im] [{line}]
Switch language to vimscript. With {line} a vimscript expression is
evaluated once, without changing the language for the REPL.
/l[ua] [{line}]
Switch language to lua. With {line} a lua expression is evaluated once,
without changing the language for the REPL.
/b[uffer] [{buffer}]
Switch buffer context. Accepts values supported by |bufnr()|. 0 to disable.
Without arguments prints the current buffer.
/w[indow] [{window}]
Switch window context. Accepts |window-ID|s and values supported by
|winnr()|. 0 to disable. Without arguments prints the current window.
/i[nspect] [{bool}]
Enable or disable using |vim.inspect()| for printing returned lua values.
Without arguments prints the current value.
/ind[ent] [{num}]
Change output indentation. Without arguments prints the current value.
/h[elp]
Print help.
/c[lear]
Clear buffer.
/q[uit]
Close REPL instance.
------------------------------------------------------------------------------
USING WITH OTHER PLUGINS
*neorepl-using-with-other-plugins*
Some additional configuration might be needed to make neorepl work nicely with
other plugins.
Plugin comes with its own completion (not auto-completion! yet), so it's best
to disable any auto-completion plugins for the "neorepl" filetype. It can be
done by creating a "~/.config/nvim/ftplugin/neorepl.lua" file, and for example
disabling nvim-cmp:
>
require('cmp').setup.buffer({ enabled = false })
<
indent-blankline.nvim plugin could cause some visual glitches, you can disable
it in the same file with:
>
vim.b.indent_blankline_enabled = false
<
------------------------------------------------------------------------------
CONFIGURATION
*neorepl-config*
lang ~
Start REPL in either lua or vimscript mode.
Type: "lua" | "vim"
Default: "lua"
inspect ~
Use |vim.inspect()| for printing returned lua values.
Type: boolean
Default: true
indent ~
Output indentation level.
Type: number
Default: 0
startinsert ~
Start REPL in insert mode.
Type: boolean
Default: true
on_init ~
Run custom function after starting REPL. REPL buffer is passed as the
first argument.
Type: fun(bufnr: number)
Default: nil
env_lua ~
User defined lua environment.
Type: table | fun(env: table): table
Default: nil
buffer ~
Start REPL attached to the buffer. Accepts values supported by |bufnr()|.
0 for the current buffer.
Available only in |neorepl.new()|.
Type: number | string
Default: nil
window ~
Start REPL attached to the window. Accepts |window-ID|s and values
supported by |winnr()|. 0 for the current window.
Available only in |neorepl.new()|.
Type: number | string
Default: nil
histfile ~
Absolute path to history file.
Type: string
Default: $XDG_STATE_HOME/neorepl_history or $XDG_CACHE_HOME/neorepl_history
histmax ~
Max entries in the history.
Type: number
Default: 100
------------------------------------------------------------------------------
HIGHLIGHTING GROUPS
*neorepl-hl*
neoreplOutput ~
Output messages
Default: links to "String"
neoreplValue ~
Pretty printed values
Default: links to "Number"
neoreplError ~
Error messages
Default: links to "ErrorMsg"
neoreplInfo ~
REPL messages
Default: links to "Function"
neoreplLinebreak ~
Line breaks
Default: links to "Function"
------------------------------------------------------------------------------
COMMAND LINE COMPLETION
*neorepl-:lua*
You can enable the experimental neorepl completion for the :lua command with:
>
require('neorepl.cmdline')
<
==============================================================================
vim: ft=help sw=4 sts=4 et tw=78