1 Star 0 Fork 0

鲍思泽/yo-dawg.nvim

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

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:

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.

Copyright © 2024 Alejandro "HiPhish" Sanchez Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
Lua 等 3 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/BesterBigWei/yo-dawg.nvim.git
[email protected]:BesterBigWei/yo-dawg.nvim.git
BesterBigWei
yo-dawg.nvim
yo-dawg.nvim
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385