Skip to content

vimjs - ES6 to vimscript bridge #1

@mklabs

Description

@mklabs

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions