Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vimjs - ES6 to vimscript bridge #1

Open
mklabs opened this issue May 31, 2016 · 0 comments
Open

vimjs - ES6 to vimscript bridge #1

mklabs opened this issue May 31, 2016 · 0 comments

Comments

@mklabs
Copy link
Member

mklabs commented May 31, 2016

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant