Skip to content

fritzy/node-neovim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Neovim Node RPC/Plugin Library

Install

npm install neovim

Usage

Types and functions are registered under the plugin RPC

var VimPlugin = require('neovim');
var util = require('util');
var async = require('async');

var UNIX = '/tmp/neovim1'

var vim = new VimPlugin(UNIX, function () {
    async.series([
        function (scb) {
            vim.rpc.command('au VimResized <buffer> call rpcnotify(0, "resized")', scb);
        },
        function (scb) {
            vim.rpc.subscribe("resized", scb);
        },
        function (scb) {
            vim.on('resized', function () {
                vim.rpc.get_current_window(function (window) {
                    window.get_height(function (height) {
                        window.get_width(function (width) {
                            console.log(util.format("size changed to: %dx%d", height, width));
                        });
                    });
                });
            });
            scb();
        }],
        function () {
            console.log("go ahead and resize the neovim window");
        }
    );
});

About

NeoVIM RPC lib for Node.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published