Hacker News new | past | comments | ask | show | jobs | submit login

What exactly is so bad about Vimscript? I've done a decent amount of scripting in it for my .vimrc, and even contributed patches to a few plugins and haven't noticed anything wrong with it. I'm a bit confused as to why people always make it seem like it's a pain to work with (I'm guessing the bad parts are the ones I've never had to deal with).



So right, I haven't tried writing anything serious in Vimscript, but the few times I tried it I was confused. At this point, it looks like someone took Lua, added a dash of Python, and then added "fixes" here and there because why the hell not. Like the fact that you can't put an array over multiple lines without adding a backslash (I guess?). The fact that you have not just == but ==? and ==#. Sure, there are reasons for this, but there shouldn't be. The fact that you can abbreviate everything, which sounds like a good idea, but sure makes code harder to read. The fact that there's no module system or anything, functions in the "standard library" are just there out in space (fortunately, they're named consistently and they have okay names). The fact that you have to scope functions because a capitalized function is Special. The fact that to call a function, you have to use call() because otherwise Vim interprets it as a command. (Unless it's scoped?) Oh, and Vim regexes don't conform to any standard you might be used to (except for \v, but I don't know that that conforms to).

So yeah I am not an expert. If I learn it, maybe it'll be better. It's a tool thing though. Vimscript isn't a very good tool compared to the other ones that exist now. I mean, doesn't Vim support other languages now? Why don't people use them at this point?


I find that Vimscript tends to be faster than the other languages in many cases, for one reason.

But probably the #1 reason to write a plugin in it is that your users don't have to run some flaky Makefile/Rakefile or install system dependencies in order to use your plugin.

This is most of the reason I jumped ship from Command-T to Ctrl-P as soon as it came out.

I will concede that Vimscript looks grody and I wouldn't write non-editor software in it, but it is really a DSL for configuring an editor on the fly, works great for that and doesn't really hold a huge number of shocks for someone who can handle things in the range of C, bash, etc.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: