Plugins for vim-mode


#1

I’m new to the Atom community, and I find this project very intriguing. I come from a vim background, so I installed vim-mode right away to feel more at home. However, I’m missing some of the plugins that I’m used to, and I’m wondering if there’s any plan to make it possible to extend vim-mode with other packages.

For example, I love tpope’s vim-commentary plugin, which allows me to comment and uncomment lines in files of all different languages with gcc. I would like to port this plugin over to Atom for vim-mode users, and I’m wondering if there’s any mechanism to do that besides making a PR for vim-mode itself. Since the feature isn’t found in standard vim, I would imagine that it ought to be a standalone package.


#2

Does the built in cmd+/ solve the same problem? Or is that missing some key features?


#3

That works perfectly for commenting, but in principle I think the question still stands. There are hundreds of vim plugins, and it would be impractical to implement all of them directly in vim-mode.

But thanks @irrationalistic, that’s exactly what I was looking for :smile:


#4

Yeah, I totally hear you! Just wanted to give a quick solution :wink:


#5

I guess you have to choices here: you can either port the vim plugin to Atom or write a vim plugin language interpreter in javascript to embed in Atom, and use that to load and run existing vim plugins… Either way is not exactly straightforward I think…


#6

does vim use lisp, or is that only emacs?


#7

Looking at the source of the plugin specified in the OP it doesn’t seem like lisp at all… I fear a DSL to be involved.


#8

If you went to the big trouble of emulating that dsl you’d be a hero of vim users. And Atom would get a lot more users. oh well …


#9

The nice thing is that all the specs of that dsl seem to be stored into one single page: http://vimdoc.sourceforge.net/htmldoc/usr_41.html
How nice of vim! This looks like a fun and neverending project :smile: Now I have to understand how the hell I’m supposed to use coco/r with javascript…


#10

FWIW, coffeescript is an excellent language to run DSLs in. See atom/space-pen or in npm, teacup. And coffeescript is the native language for Atom.


#11

space-pen looks more like an exploitation of coffeescript’s syntax than a full parser-scanner-interpreter… Anyway I found PEG.js which seems quite interesting, and also two bindings for it for native coffeescript support:
https://www.npmjs.com/package/pegcoffee and https://www.npmjs.com/package/pegjs-coffee-plugin
Now I have to decide which to choose…


#12

vim uses vimscript, which is a little nicer than Intercal.


#13

Doesn’t the NeoVim project have a vimscript-to-Lua transpiler? Perhaps there is a Lua implementation in Javascript… But to be honest – shudder.


#14

The only thing I would use their vimscript-to-Lua transpiler is to steal their grammar files :smiley: Really, one interpreter is slow enough… I already wrote a Lua interpreter and if you don’t want to go JIT (and advanced) you’re going to face up big bottlenecks…