old idea, came back again (first attempt: https://github.com/mklabs/jsvim)
- Write VIM plugins as ES6 class / scripts
- Implement function / commands in JS, generates appropriate vimscript
- Relies on STDOUT result (
node file.js --vim --command => JSON)
- Autoload generated API mapping ES6 class
this.command(':Foo', (args) => {
this.echo('Args: ', args)
})
function! vimjs#node(type, ...)
let cmd = join(a:000, ' ')
let flag = '--' . type
return system('node plugin.js --vim ' . flag . ' -- ' . cmd)
endfunction
command! -nargs=+ Foo call vimjs#node('command', <args>)
:Foo bar tabac
Args: bar tabac
old idea, came back again (first attempt: https://github.com/mklabs/jsvim)
node file.js --vim --command => JSON)