GithubHelp home page GithubHelp logo

jinzhongjia / znvim Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 1.0 153 KB

neovim remote rpc client implementation with zig

Home Page: https://jinzhongjia.github.io/znvim/

License: MIT License

Zig 100.00%
neovim neovim-remote zig zig-package

znvim's Introduction

znvim

znvim is a neovim remote rpc client implementation with zig.

This package is under developing!

Document

https://jinzhongjia.github.io/znvim/

Features

  • Implementation of multiple remote calling methods
  • Support all neovim rpc channels
  • Completely thread safe
  • Asynchronous

Getting Started

0.12.0 / 0.13.0

  1. Add to build.zig.zon
zig fetch --save https://github.com/jinzhongjia/znvim/archive/{commit or branch}.tar.gz
  1. Config build.zig
const znvim = b.dependency("znvim", .{
    .target = target,
    .optimize = optimize,
});

// add module
exe.root_module.addImport("znvim", znvim.module("znvim"));

To use this lib

You can find example on test fold!

Recommend to learn about what msgpack is (this lib uses zig-msgpack) and read neovim's API documentation.

znvim's People

Contributors

jinzhongjia avatar

Stargazers

 avatar Christopher Reed avatar Alejandro avatar Tim Culverhouse avatar KOGA Mitsuhiro avatar SuperWalle avatar  avatar

Watchers

 avatar  avatar

Forkers

rockorager

znvim's Issues

Reflector

My previous implementation was a piece of shit
Now I have to implement this library completely from scratch

Feature proposal: userdata in method callbacks

Wondering what you think of change the function signatures of ReqMethodType and NotifyMethodType from:

pub const ReqMethodType = *const fn (params: Payload, allocator: Allocator) ResultType;
pub const NotifyMethodType = *const fn (params: Payload, allocator: Allocator) void;

to:

pub const ReqMethodType = struct {
    userdata: ?*anyopaque = null,
    fn: *const fn (params: Payload, allocator: Allocator, userdata: ?*anyopaque) ResultType,
};
pub const NotifyMethodType = struct {
    userdata: ?*anyopaque = null,
    fn: *const fn (params: Payload, allocator: Allocator, userdata: ?*anyopaque) void,
};

This would allow embedders to pass along arbitrary userdata through each callback, preventing the need for global variables.

I can send in a PR if you are ok with this change.

Can I send signal from Neovim to trigger action in Zig?

Hello, and thank you very much for creating this library.

I'm trying to create an application that can interact with a live Neovim instance (via unix pipe) both ways back and forth.
I saw in your test file that connecting and sending commands to a live Neovim instance via unix pipe from Zig is possible.

However, I wonder if it's possible to, let's say, I press a keymap in Neovim, and my application in Zig receives that signal, and shows up.

Is this possible? Thank you very much!

Adding LICENSE to the project

Hello and thank you for creating the library and make it open source.
I really want to start using your library but I can't find any LICENSE file in the repo.
Could you please add a LICENSE file to indicate how permissive the usage of the code in this repo is?
Thank you kindly.

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.