8 ms·
I think it’s kind of crazy that vim9script is even a thing, especially when neovim has proven how much more viable lua is as a scripting language. Lua is way mo
by blindseer 5y ago
I think it’s kind of crazy that vim9script is even a thing, especially when neovim has proven how much more viable lua is as a scripting language. Lua is way more beginner friendly than vimscript or vim9script, with luajit you get killer performance, lua has an awesome language server implementation, it’s a saner programming language imo and so much more going for it. There’s even transpilers to convert typescript / other languages to lua. There’s plugins written in lua today that just wouldn’t be possible in vimscript or vim9script script.
Vim9script on the other hand seems like an exploration in PL, which I’m all for generally but not in a software like vim. Like, just imagine writing and maintaining something like magit or org mode in vim9script. It’s a large complicated piece of software, you'll have to write it using without any linter, formatter or language server (at least for the foreseeable future) and your skills are not transferable to any other tool. Just the sheer probability of better plugins existing and thriving in your ecosystem drop significantly once you choose to have vim9script as the scripting language. I’m curious to see how this all pans out but I’m not optimistic.
The worst part is that it doesn't appear that existing plugins will work in vim9script. Even the syntax for commenting is different:
set number " This is a comment in vimscript
set number # This is a comment in vim9script
See https://vimhelp.org/vim9.txt.html#vim9-differences https://vimhelp.org/vim9.txt.html#vim9-differences
And to get any performance improvement, plugin authors will have to do a LOT of work that is not compatible with their existing plugins.
I for one am glad neovim exists, and I encourage people to throw a few bucks their way :)
https://github.com/sponsors/neovim https://github.com/sponsors/neovim
- gtsop 5y agoI've avoided neovim because my current vim setup justworks™ and i trully depend on it for being productive on my job. As time goes by i really feel like i should switch based on how the two projects progress. Do you know of a resource that could hold my hand?
- rmadriz 5y agoWell in theory everything that works in vim will work in neovim (there's a few exceptions[^1]). So you really don't loose anything by installing neovim and using your same .vimrc for it. You can start experimenting with Lua and the new plugins whenever you're able to. [1]: https://github.com/neovim/neovim/issues/1716 https://github.com/neovim/neovim/issues/1716
- gtsop 5y agoThanks for all the replies, didn't know it was meant to be a drop-in replacement, will give it a try :)
- petepete 5y agoWhen I switched in 2018 my config essentially just worked, I had to replace a plugin that no longer worked but everything else went smoothly, the process took about ten minutes.
- junon 5y agoErr unless something has changed, everything that works in vim8 should work in neovim. It was a drop-in replacement for me. Nothing new to learn unless you're a plugin developer.
- the_duke 5y agoThe exception is the async API which was first implemented by Neovim, but Vim followed with something incompatible. Most plugins that need it are compatible with both though.
- rectang 5y agoI've been using MacVim for 15 years; it has been pretty much solid the entire time, and I'm used to its mouse integration. When I started out, I was doing a lot of cross-platform development and there was a Windows version of Vim which behaved almost the same. It was great to have a powerful text editing experience which was pretty much the same everywhere. I tried out NeoVim, but as far as I can tell, it seems to be terminal-only/keyboard-only? I can use Vim keyboard-only (certainly I do that all the time over ssh), but it's not my preference. My second choice for editing behind MacVim isn't NeoVim but VSCode, but I don't use VSCode with Vim bindings because in my experience grafting Vim bindings onto any editor not Vim won't be feature complete. In a perfect world, there would be an IDE which is truly a Vim-style modal editor at its core.
- andrewl 5y agoI just started looking into Neovim, and I had the same concern about it being terminal-only. But then I saw this on the Neovim site: "Graphical interfaces are not packaged with Neovim. GUIs are not limited by terminal capabilities and can choose to override the rendering of certain neovim elements (cursor, tabline, popup menu, etc)...See Neovim's wiki[1] for a list of many of the available GUIs." [1] https://github.com/neovim/neovim/wiki/Related-projects#gui https://github.com/neovim/neovim/wiki/Related-projects#gui
- rectang 5y agoThis looks interesting: https://github.com/asvetliakov/vscode-neovim https://github.com/asvetliakov/vscode-neovim > This extension uses a full embedded Neovim instance, no more half-complete VIM emulation! VSCode's native functionality is used for insert mode and editor commands, making the best use of both editors. I like lots of things about VSCode, but there are inefficiencies with editing that just drive me bananas so I keep falling back to good old familiar MacVim. For instance, line wrapping, auto-indenting, and mouse-select-then-rewrap in comments — comment support in the Vim ecosystem seems to have been designed by and for people who really care about good documentation, while I have to work much harder to get my comments and docs to look good when editing with VSCode. Hopefully the mechanism of embedding a full NeoVim instance will allow for a moe-or-less feature-complete Vim editing experince.
- petre 5y agoI have the same setup in both vim8 and neovim. It's symlinked over from neovim, because I like the xdg ~/.config dir better, keeps things tidier. Basically pathogen, lightline and vim polyglot. I use vim8 most if the time out of habbit. I like Lua better but I understand it has poor handling of strings and I don't know how that fares with and editor extension language.
- leephillips 5y agoHow is Lua’s string handling supposed to be poor?
- _TwoFinger 5y ago> it has poor handling of strings and I don't know how that fares with an editor extension language. I guess the parent refers to Lua treating strings as simple byte arrays, whereas a text editor has to deal with characters in various encodings, some of which can be multi-byte.
- deleted 5y ago[deleted]
- halostatue 5y agoI have set up a complex neovim configuration, but I don’t use it. Why? Because there’s not a _single_ neovim client that is as good as MacVim.app. I paid for Oni2 (I regret that; it’s _not_ a vim replacement). I have contributed code and time to helping a couple of other GUIs fix their issues. But they are all crap compared to MacVim.app. Until that is fixed, I don’t think that there’s a good reason to consider switching.
- unrealhoang 5y agoYou could take a look at neovide, it looks promising.
- halostatue 5y agoI tried it. For various reasons, it isn’t _quite_ there. It doesn’t build a .app bundle, which means that it can’t have a proper distribution with appropriate signing &c. that would give it access to various macOS features. It doesn’t have a menu (which _does_ matter). It doesn’t have a "release" build since May 2020, meaning that the only way to get a meaningful build is to build it yourself (not a big deal, but still). It doesn’t render fonts correctly, especially on macOS: https://github.com/neovide/neovide/issues/1096 https://github.com/neovide/neovide/issues/1096, https://github.com/neovide/neovide/issues/589 https://github.com/neovide/neovide/issues/589 (although it may be related to how font names are resolved, https://github.com/neovide/neovide/issues/776 https://github.com/neovide/neovide/issues/776; https://github.com/neovide/neovide/issues/1057 https://github.com/neovide/neovide/issues/1057 seems to resolve it), https://github.com/neovide/neovide/issues/851 https://github.com/neovide/neovide/issues/851, https://github.com/neovide/neovide/issues/283 https://github.com/neovide/neovide/issues/283. The last appears to be fixed, but the former two are problematic from my perspective as a replacement for MacVim.app.
- kubb 5y agoWas there some reason why Bram didn't go for Lua adoption, and instead opted for his own language? Is is the NIH syndrome only? Lua seems just a really good option as far as embeddable languages go. People love complaining about minor issues with it like the 1-based arrays, but building a new language from scratch is just not worth it, no matter how you look at it. Maybe I'm missing something here.
- Trex_Egg 5y agoWhat is NIH syndrome? Edit: got it, its called "Not Invited Here" syndrome.
- tyingq 5y agoVim and Lua evolved in similar timelines. It's plausible that vimscript was written without him knowing Lua was a choice.
- capableweb 5y agoI don't know about the timeline of Vimscript in particular, but seemingly Vim was first released in 1991 while Lua first 1993, so by the first release of Lua, Vim already existed by then. Not sure when Vimscript appeared though. On other trends (Google Trends to be specific), search volume for Lua only became larger than for Vim in 2004, with Lua hitting it's peak in 2009. Search volume for Vim would have been much larger before 2004 if we had a single search engine everyone could have used, but hard to know in afterhand I guess.
- coliveira 5y agoLua is already a supported scripting language in Vim.
- xigoi 5y agoBut it doesn't have first-class support like in Neovim.
- xvilka 5y agoI hope they will get enough money to hire someone full-time. That would be really awesome. I am proud sponsor of it myself.
- bin_bash 5y agoVimscript is like regex: no matter how long I write it I still don’t bother trying to read it. If something isn’t working I usually throw a good portion of my config away and start from scratch. I’ve been using neovim for a while now but just switched my config over to Lua yesterday. I’ve never seen a line of Lua before yesterday but I _already_ find it way easier to write than vimscript—which I’ve been writing since the early 2000s.
- wolverine876 5y agoPerhaps neovim isn't the Truth to which we all aspire, or care about. Certainly there are many, many ways to do things that are not newovim. If someone chooses one of those ways, 'why didn't you use neovim's way' isn't a serious question. (Can we stop hijacking Vim threads? Submit a FPP about neovim.)
- mlyle 5y agoThis is a reasonable question on the discussion of vimscript. Does it make sense to have tool-specific languages like this anymore? I don't love lua, but moving to a "standard" scripting language has a lot of value. And neovim proves that lua is viable, so...
- wolverine876 5y agoLet's be realistic: If people were really concerned with some issues with Vim9Script, they could address them in nearly infinite ways. Yet they choose neovim, again, and as some standard of truth or excellence (where else is neovim a standard of excellence for anything?). Every Vim discussion has neovim people finding ways to attack Vim. The signal is always negative which makes the signal meaningless - the source is just tuned to transmit negative. It's a major reason I don't consider neovim. Who wants to be involved in that community, defined it seems by hating someone else's hard work - which they are giving to the public for free - and being parasites on the other's reputation. Just do your own thing, in your own way, and do something wonderful - don't worry about criticizing others. Ugh.
- Taywee 5y agoI haven't seen what you're saying. I've seen people addressing specific problems, and suggesting specific solutions, and I really don't understand why neovim isn't a reasonable suggestion. Maybe you can point out some of these unreasonably negative comments for me. Neovim is literally people doing their own thing in their own way and succeeding. I don't understand your concerns or why you don't consider a solution to this problem to be viable just because it acknowledges the problem as a problem. Sounds a bit kafkaesque to me, to refuse to consider a solution because even bringing up the problem is considered too negative. How should neovim have done it? Do you think they should simply not have bothered?
- ibic 5y agoSimilar thoughts with me - Why can’t Vim just support lua scripts as Neovim’s way? Neovim can then omit the heredoc hack for lua scripting. And plug-in devs and vim users should be happier ass well.
- jbirer 5y agoNo language where array indexes begin with 1 can be called "powerful".