Skip to content

Latest commit

 

History

History
42 lines (36 loc) · 1.09 KB

README.md

File metadata and controls

42 lines (36 loc) · 1.09 KB

#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");
        }
    );
});