Giter VIP home page Giter VIP logo

nvim-luadev's Introduction

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
<Plug>(Luadev-RunLine) Execute the current line
<Plug>(Luadev-Run) Operator to execute lua code over a movement or text object.
<Plug>(Luadev-RunWord) Eval identifier under cursor, including table.attr
<Plug>(Luadev-Complete) in insert mode: complete (nested) global table fields

If 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:

  • autodetect expression vs statements
  • Fix inspect.lua to use tostring() on userdata (done on a local copy)
  • completion of global names and table attributes (WIP: basic implementation done)
  • make <Plug>(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)
  • tracebacks
  • interactive debugging
  • debug helpers for async callbacks (WIP)

nvim-luadev's People

Contributors

bfredl avatar mizlan avatar muniter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nvim-luadev's Issues

:Luadev error E944

With Nvim current master, :Luadev command gives me this error:

E5105: Error while calling lua chunk: ...config/nvim/pack/minpac/start/nvim-luadev/lua/luadev.lua:14: Vim(return):E944: Reverse range in character class

Weird, that line is:

a.nvim_buf_set_name(buf, "[nvim-lua]")

but sure enough, if I change "[nvim-lua]" to "foo" then the error goes away and a "foo" buffer is created. (But it does not have REPL features, just a normal empty buffer, presumably because the plugin is looking for [nvim-lua] buffer.)

Maybe a bug in nvim_buf_set_name() ?

`:vert` not supported

Expected behavior: :vert Luadev causes the split to be vertical.
Actual behavior: the split is horizontal, just like :Luadev.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.