Hacker News new | ask | show | jobs
by gnosis 5401 days ago
Thank you for that very stimulating defense of vimscript. Here are a few observations:

"First, there's just a ridiculous amount of plugins and such already made. Either they'd need to be ported to the new interface (an insane amount of work) or the old interface (Vimscript) would need to be maintained alongside the new. Neither option seems very practical."

As of now, www.vim.org contains 3,716 scripts. It would be a tremendous amount of work to rewrite them all. However, that would not be necessary. First of all, the vast majority of scripts on vim.org are abandoned after a version or two, and never get very many users (if any). Second, many scripts on vim.org are for outdated versions of vim (usually 6.x), and don't work on the newer (7.x) versions of vim anyway. They are also effectively abandoned. So they don't need to be rewritten either. Really, the important scripts that would need to be rewritten are the really popular ones, and there just aren't that many of them. It might be a fair amount of work, but not overwhelming.

"Second, the main advantage of Vimscript is that it uses the same commands you use every day while working with Vim. `edit foo.py` in a Vim plugin does the same thing as `:edit foo.py` in your daily routine. This makes it really easy to get your feet wet with Vim scripting -- in fact it makes it all but unavoidable."

It's true that there are some similarities between vimscript and the regular commands you'd use in ordinary vim editing, but there are also many differences -- such as functions, looping constructs, conditionals, lists and dictionaries, etc. I don't think losing the ability to use vim editing commands in scripting vim would really be a particularly big deal for most vim users, as most of them probably already know another scripting language anyway.

Finally, there's actually no reason to get rid of vimscript altogether. It would hurt no one if it remained an option for scripting vim. What does need to happen, however, is that more of vim needs to be opened up to being scripted from other languages. The existing language bindings are often pretty crippled compared to vimscript, and you often need to call vimscript from within those other languages to do everything you need, making the use of another language a superfluous waste of time. So what really needs to happen is to fully get rid of the dependency on vimscript, not to get rid of vimscript itself.