UNPKG

482 BJavaScriptView Raw
1'use strict';
2
3var readlineVim = require('readline-vim')
4 , wire = require('./wire')
5 , vim;
6
7module.exports = function hookVim(repl) {
8 vim = readlineVim(repl.rli);
9
10 // TODO: no clue why this doesn't work in here, but inside manage-plugins it does
11 // wire.on('emit-code.start', vim.forceInsert.bind(vim));
12
13 return vim;
14};
15
16// needs to be getter since vim is initialized only once bindings are applied
17module.exports.__defineGetter__('vim', function () { return vim; });