Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bfredl/nvim-luadev
REPL/debug console for nvim lua plugins
https://github.com/bfredl/nvim-luadev
nvim repl
Last synced: 3 days ago
JSON representation
REPL/debug console for nvim lua plugins
- Host: GitHub
- URL: https://github.com/bfredl/nvim-luadev
- Owner: bfredl
- License: mit
- Created: 2018-10-30T13:05:21.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-13T20:57:45.000Z (almost 2 years ago)
- Last Synced: 2025-01-15T13:55:14.408Z (10 days ago)
- Topics: nvim, repl
- Language: Lua
- Homepage:
- Size: 22.5 KB
- Stars: 281
- Watchers: 11
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-neovim - bfredl/nvim-luadev - REPL/debug console Lua plugins. The `:Luadev` command will open an scratch window which will show output from executing Lua code. (Neovim Lua Development / Quickfix)
README
# nvim-luadev
This plugins set up a REPL-like environment for developing lua plugins in Nvim.
The `:Luadev` command will open an scratch window which will show output from executing lua code.Use the folllowing mappings to execute lua code:
Binding | Action
------------------------- | ------
`(Luadev-RunLine)` | Execute the current line
`(Luadev-Run)` | Operator to execute lua code over a movement or text object.
`(Luadev-RunWord)` | Eval identifier under cursor, including `table.attr`
`(Luadev-Complete)` | in insert mode: complete (nested) global table fieldsIf the code is a expression, it will be evaluated, and the result shown with
`inspect.lua`. Otherwise it will be executed as a block of code. A top-level
`return` will cause the returned value to be inspected. A bare `nil` will not
be shown.Global `print()` is also redirected to the output buffer, but only when executing
code via this plugin. `require'luadev'.print(...)` can be used to print to the
buffer from some other context.Planned features:
- [x] autodetect expression vs statements
- [x] Fix `inspect.lua` to use `tostring()` on userdata (done on a local copy)
- [x] completion of global names and table attributes (WIP: basic implementation done)
- [x] make `(Luadev-Run)` a proper operator
- [ ] solution for step-wise execution of code with `local` assignments (such
as a flag to copy local values to an env)
- [x] tracebacks
- [ ] interactive debugging
- [x] debug helpers for async callbacks (WIP)