Vim9 Script Feature-Complete
groups.google.com
groups.google.com
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-differencesAnd 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 :)
You can start experimenting with Lua and the new plugins whenever you're able to.
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.
"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/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.
I paid for an Oni2 licence and regret it, because it isn’t what I want, which is a MacVim.app wrapper for neovim.
If you like MacVim.app, there is _absolutely no GUI that is acceptable_ for neovim. I understand why, and I’m not interested in taking on the development myself. But until someone makes a GUI that is as well-integrated with macOS as MacVim.app, I will be using vim and not neovim.
First, clicking on a location didn't set the cursor. Especially when editing large files, I like to scroll in MacVim, click to set the cursor and then start typing. While I can do things like note the line number and jump, or scroll by moving the cursor with key commands, I find those less efficient.
Second, selecting text using the mouse didn't produce a selection that Vim knew about. I use this feature all the time in MacVim, to produce a visual selection which I then rewrap using `gq`, filter by piping the selection through an autoformatter like `rustfmt`, etc. Again, I can do this using keyboard navigation exclusively to make visual selections, but I find it easier to select using the mouse.
This seems to be something in Vim rather than a NeoVim-specific setting, as I tried the same thing with the standard Vim and it worked the same. The scrolling feel in the Terminal isn't as smooth as MacVim, but it's still pretty good.
On first open, a lot of the interface was unreadable because VimR seemed to be assuming a dark background, but I use a white background. `set bg=light` didn't fix it. `colorScheme=PaperColor` fixed it incidentally because it didn't find the color scheme and reverted to something legible, haha.
Next, I tried to set the font size for the navigator to something bigger because my eyes aren't that great. Although I can use `set guifont` to set the editor area font, the navigation area doesn't change. Presumably there's some way to fix it, I just haven't found it yet.
VimR looks cool and I really like having the navigator there IDE-style, but it seems like there will be a period of adjustment. Nothing new for someone accustomed to Vim, haha.
The main IDE-style features I've been going without in my ordinary day-to-day editing with MacVim are the autocompletion, suggestion, and hover-to-show-documentation. (I've started using ALE which is helpful but needs some tweaking before it's really usable.) It might be possible to get those with either MacVim or NeoVim, and it would be worth the configuration to set them up if so.
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.
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.
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/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/1057 seems to resolve it), https://github.com/neovide/neovide/issues/851, 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.
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.
Edit: got it, its called "Not Invited Here" syndrome.
Seems this has been said about every single language ever (except the first I guess?), even languages as Golang and Rust have gone through a phase where many question "why even build a new language when X does Y and Z perfectly fine already?", and then they end up really popular anyways as they solved some slice of problem(s) is a particular way that many like.
It might just have been that Vimscript didn't go the way it was intended to, or people moved towards different paradigms to doing modal editing in a sane(r) way, but maybe in some alternative universe, Vimscript became a popular scripting tool.
And golang initially started off as a replacement for C, and then pivoted because they couldn't achieve that purpose ... now, it's touted for simplicity. When Rust was a pet project of Graydon, it looked VERY different to what it is right now. My point is that vim9script as it stands right now doesn't solve any real world use case that lua wouldn't be better suited for. Maybe vim9script will be better for something else entirely in the future, and that will be, as you describe something people may like. But right now we don't even know what that is, and surely that can't be a reason to decide to go explore language design in such a large community such as the one vim has? It is definitely Bram's right to do so, but I fear that people will rather move to neovim or vscode or emacs than learn and write vim9script, and as a user of that community I think that would be bad.
Also, it's not like people were proclaiming vimscript was awesome you know. There's a talk from one of the core devs of vim-lsp on YouTube [1], on features of vimscript, and literally in every slide the presenter caveats the vimscript feature in one way or another. I find it hilarious, it's a perfect example of the frustration of when writing plugins with vimscript.
I have a dear place in my heart for tiny focused languages and think if Vim had stated they were going to suddenly make Wren, Gravity, Janet, etc first class languages, there would be less reluctance than a new thing.
Very, very rarely, lots of people find reasons use a language designed by (such) an idiot, anyway. We are lucky when the language is not terrible, because how good it is even more rarely affects whether it will take off.
In practice, languages almost always ride to popularity on the back of something else. C rode Unix, C++ rode C, Java rode Sun Microsystems' $billions and the promise of getting off Microsoft's framework-hell treadmill, C# rode .Net, Javascript rode HTML (and then web services because the same people were coding both, at first), Go rode Google and Docker. Lua got where it is by being really easy to embed, and being simple, powerful, not weird, and (lately) fast.
Python got there mostly the hard way, but also by being easy to embed and to extend with C ABI-compatible plugins, despite being weird and extra-super-slow.
Amazon, BTW, might be unique among IT behemoths in not hustling its own walled-garden language. (Or maybe I just don't know about it.)
I don't share that sentiment and I personally think that as amazon adopts rust it will gain rust community principles. But I'm probably wrong.
C++ has equally compelling advantages. If you write less code, you get less bugs, and more work done at less eyeball-hours. If you can do that 'zero-cost', with abstractions, a lot of people who care about performance are going to find that really exciting.
Rust basically continues this pattern.
Obviously you have to sort of win the lottery as well, because you need enough people to bring the language from clever-research-project to useful industrial tool, but I think the fundamental point is that successful languages have both luck, and a killer feature.
I imagine all of these languages will sink out of sight at some point, because it's just clear that as a culture we're in the very early days of living with computers, so these languages are a bit like bone needles or flint axes. I still think the innovations contained in them will go on to inform future development.
Then Bram started competing afterwards.
I don't think that vimscript is that bad. What i don't like about are the scope rules, i.e. special prefixes for function arguments, locals and globals. Also the call keyword is required for function calls and let keyword for assignments.
Anyway, Python can be used as a vim extension language, i am not sure if Lua is superior in this respect to python.
The term "JIT" is getting abused lately to describe what happens to users' eBPF code that runs in the Linux kernel, and Wasm that runs in browsers. In those, all types are known statically, code is compiled to a portable form offline, and transcribed to machine code before any execution, and none of the runtime instrumentation, analysis, and progressive rewriting occurs.
1 - https://groups.google.com/g/vim_dev/c/__gARXMigYE/m/iskHVwgU...
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.
(Can we stop hijacking Vim threads? Submit a FPP about neovim.)
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...
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.
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?
I love vim. I'm using neovim a fair bit now, too. How wonderful is it to be spoiled for choice?
I think it's great we have two vibrant lines of *vim development and the opportunity to learn the best lessons from each. Here, I think it's a bit of a bummer: neovim has proven lua to be pretty decent (as much as I dislike lua itself) and this would have been a decent place for vim itself to consider following.
As a result, we're going to have a plugins/scripts ecosystem that's more fragmented than it needs to be. Meh.
I for one are glad for NeoVIM improving upon VIM and pointing out some weaknesses.
Since NeoVIM was released, Bram has been improving VIM much faster than before and even added features like async I/O support, that he previously rejected.
There just happens to be some technical choices in vim that I don't agree with / don't find appealing, where neovim happens to have made an alternate technical choice that I do agree with / find appealing. vim9script is one of them, which is highly relevant to the submission. I apologize if I came across as hating someone else's hard work.
My point isn't about being concerned about a specific issue with vim9script per say, it's vim9script itself. If Bram and a bunch of core vim devs were spending time on their _extremely_ valuable time on anything, the last thing I'd want it to be would be a vimscript offspring. That is just my opinion, and that is truly the extent of my opinion. Again, I apologize to Bram and the core devs if that came across as anything else.
I have used vim for more than 10 years now (neovim for just 2 of those years), and I expect to be using vim / neovim for the rest of my life. And having written some useful but niche plugins for vim, I felt like expressing my opinion here about the direction of vim / vimscript / vim9script wasn't unreasonable.
I do question if a breaking change for a custom language is the right way to go.
Built in Lua support in Neovim (with LuaJIT) has done wonders for the plugin ecosystem.
There is a lot of activity, and a lot of pluings with great quality have quickly replaced older ones.
That's no surprise. LuaJIT is fast, much easier to write, has a has a sizeable ecosystem and a good LSP server.
Even an overhauled Vimscript won't be anything more than a odd niche language with worse performance.
I would have loved for Vim to also adopt Lua and the Lua API from Neovim to prevent a complete ecosystem split.
I just don't see how implementing a new language makes sense in this context, except for fun.
> I would have loved for Vim to also adopt Lua
Vim has supported Lua for a long time. Anyone who wants to really use Lua for Vim plugins already has the option of doing so.
How does that compare to writing Lua plugins for Neovim? Seemingly all search results for "write vim plugin in lua" are dominated by results for writing lua plugins for neovim. Does vanilla Vim have something like Neovim's "Remote Plugin" or how does it work?
But for the stuff that is available, you can either use the vim help to learn about it or search on vim's github issues / PRs, e.g. https://github.com/vim/vim/pull/7959. I'm curious if there are other ways to learn more about vim's lua interface, searching on google as you said does not give great results for vim, just neovim.
Really not sure why you would want to though
:help Lua
So you have the huge success of first-class Lua support in Neovim, and it's clear that there is a very real need for a better scripting language in Vim.
But not only do you skip Lua, and lose out on the work and plugins that has already been done, you decide to write yet another custom scripting language.
It's not as popular as vim per say, but it's definitely catching up. It's kinda silly to suggest otherwise.
By your own definition, Emacs is a “huge success”, therefore I’d expect you to extend that description to nvim, too.
[1]: https://insights.stackoverflow.com/survey/2021#section-most-...
They're promising 10x - 100x better performance (since vim9script is typed and will be compiled). Also -- you can mix vimscript and vim9script in a function, a file, or a module. This will let legacy modules or scripts stay mostly the same but port some of the slower-running bits to vim9script to gain the benefits without a giant effort to port the whole thing.
What happened to the orphanage in Uganda? Not a criticism, just curious about the change. It's fantastic that Bram uses Vim's platform to lead and encourage others to support those in need.
Just because you can write a programming / scripting language doesn't mean you should.
There are tons being developed already, why not just adopt one of those.
I support NeoVims decision of going the lua route.
Their twitch streams where they work on this are a lot of fun too.
set number " This is a comment in vimscript
set number # This is a comment in vim9script
There's going to be a LOT of porting of existing plugins for this to all work.
> This is not a breaking change. Everything that works on Vim8 script will continue to work.
So seems it won't require much porting unless people want to do the porting.
:e https://raw.githubusercontent.com/vim/vim/master/runtime/doc...