Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hiphish/yo-dawg.nvim
Convenience library for controlling a Neovim process embedded inside another Neovim process.
https://github.com/hiphish/yo-dawg.nvim
lua neovim neovim-plugin
Last synced: 3 months ago
JSON representation
Convenience library for controlling a Neovim process embedded inside another Neovim process.
- Host: GitHub
- URL: https://github.com/hiphish/yo-dawg.nvim
- Owner: HiPhish
- License: mit
- Created: 2024-01-31T22:02:50.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-02-02T19:03:11.000Z (about 1 year ago)
- Last Synced: 2024-05-13T16:00:00.464Z (9 months ago)
- Topics: lua, neovim, neovim-plugin
- Language: Lua
- Homepage:
- Size: 8.79 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
.. default-role:: code
#########
Yo-Dawg
#########Yo dawg, I heard you like Neovim, so I put a Neovim inside your Neovim so
you can edit while you edit.This is a thin wrapper plugin for Neovim that cuts down on the boilerplate code
for controlling an embedded Neovim process inside Neovim. Why would you want
to do that? For me it's about testing, if I write my tests in Busted_ I need
to test the plugin code in a separate Neovim process which is distinct from the
process running the test. This is not limited to testing though, it's a
general purpose-plugin. Think of it like Selenium_ for Neovim.Installation and configuration
##############################Install it like any other Neovim plugin. There is no configuration, this is
purely a library. Personally I like to install it as an optional plugin
(`:h :packadd`), but that's up to you.Usage
#####Here is a simple toy example:
.. code:: lua
local yd = require 'yo-dawg'
-- Start a new process using the default job options
local nvim = yd.start()-- Evaluate a Vim script expression
local result = nvim:eval('1 + 2')
-- Call an asynchronous method (does not wait for a result)
nvim:async_set_var('my_var', result)
-- Only synchronous methods can return values
local my_var = nvim:get_var('my_var')-- Terminate the Neovim process when done
yd.stop(nvim)Any Neovim API method (`:h API`) can be called as a method. To call the method
asynchronously prefix it with `async_`. This plugin is forwards compatible,
any new method will automatically be supported.Status of the plugin
####################It's done as far as I am concerned. It does one thing and does it well.
License
#######Licensed under the terms of the MIT (Expat) license. See the LICENSE_ file for
details... _Busted: https://lunarmodules.github.io/busted/
.. _Selenium: https://www.selenium.dev/
.. _LICENSE: LICENSE.txt