text stringlengths 0 2.02k |
|---|
Then I heard about Neovim and how it could do that asynchronously, so I set it up, but I was just like "This is just temporary. I'm sure Vim's gonna catch up, and I'm just gonna switch back to it." So I installed it and I did that alias, alias vim=nvim. And I still have that, and that's still how I invoke it, but that ... |
**TJ DeVries:** Yeah. Just to mention as well, Vim does have those capabilities now. It does have asynchronous jobs, and other things; I just figured I wanna throw that out there, in case people are interested in adding some of those things to their own vimconfig... But it does exist in both now. |
**Jerod Santo:** Yeah, that's one of the cool things that I've noticed... I wonder if Neovim is directly to blame or to accredit for this, but it seems like Vim's development picked up with regard to performance asynchronization, and certain things that maybe weren't being advanced, and maybe there was a little bit of ... |
**TJ DeVries:** I actually think that this is probably a common misconception. I think Bram likes implementing things that he thinks people are going to use, and it wasn't really clear from the community that this was an important thing for them to have previous to this... My personal opinion - obviously, I'm not insid... |
**Nick Nisi:** And to that point, both of them have async and other similar features, but have they arrived there in different ways? Is it different APIs, or ways to invoke async, for example? |
**TJ DeVries:** \[12:12\] Yeah, so to start external jobs, the jobs APIs aren't compatible. There are plugins that sort of wrap them to make them very similar, so you could have one that's shared and you call mysharedlib.startjob, or whatever; you could be doing that and sort experiencing working them in both... But th... |
**Nick Nisi:** And with the help of those community plugins, is the burden on plugin developers kind of lessened, or almost non-existent by that? Or does that kind of cause some issues? |
**TJ DeVries:** If all you wanna do is run a job asynchronously, then it is not incredibly difficult. There are other things that are much more difficult to maintain shims between, or some things that are very specific to Vim or very specific to Neovim that either haven't been unified or never will be. |
For example right now in Vim there's APIs -- they're all prefixed with popup\_. So there's popup\_create, or popup\_menu, or things like this, and they allow you to make little floaty windows. Neovim currently doesn't have those APIs, and we have not a shared floating window implementation underneath the hood, so it's ... |
**Jerod Santo:** So it sounds like the longer it goes, the less underpinnings they share. You mentioned that there was 1,000 patches or so in the 0.5 that were direct ports from Vim into Neovim. Do you expect over the course of Neovim's life that that number would decline over time, or do you think there's enough found... |
**TJ DeVries:** In general, I try not to predict the future too much, because it's a difficult game to play, but-- |
**Jerod Santo:** Well, what trend are you watching? Give us the trend. |
**TJ DeVries:** Yeah. In certain areas of the code I would see us still porting patches for a long time... And port is in some cases very loose; it might be literally just applying style differences and putting them in, and then porting tests written in Vim into Lua, because we write most of our tests in Lua... So some... |
\[16:15\] It's like "Okay, we simply just added this new argument to a Vimscript function. Okay, cool. We can try and port that over and then we can have that the same in both." But in other areas, there already exists no way to port patches. For example, for floating Windows code we have two separate implementations, ... |
But it may be that we in effect port some of those patches over in attempts to keep the community as close as we can, like with the example I gave of the popup APIs, where Neovim would still like to implement those so that people don't have to worry about which one they're writing for, and they can continue serving bot... |
**Break:** \[17:05\] |
**Jerod Santo:** So let's talk Lua. |
**TJ DeVries:** Yeah, that sounds good. |
**Jerod Santo:** On the Vim episode I asked everybody what frustrations they have with the editor, and Gary Bernhardt said "Vimscript." |
**TJ DeVries:** \[laughs\] |
**Gary Bernhardt:** I’m pretty good at complaining, so I’ll limit myself to just one thing… \[laughter\] Vimscript. To understand Vim’s relationship to its scripting language, let me contrast with Emacs. Emacs is almost like an operating system that happens to ship with an editor… And long-term Emacs users will effecti... |
So that is the most frustrating part of Vim for me, and it’s also one of the reasons that I avoid configuration when I can. I have a very sort of mostly stock Vim configuration, despite 15 years, and Vimscript is why. |
**Jerod Santo:** So this is something Neovim is taking head-on, isn't it? |
**TJ DeVries:** Yeah I think Neovim's choice of choosing Lua is what I would consider sort of like the de facto future of configuring Neovim. Not that it won't be possible to write Vimscript or that we will remove the engine, or anything like that. That is not happening. We will continue to support that and allow that ... |
\[20:15\] I think Lua has invigorated a lot of people to be interested in both contributing and sort of being able to explore making Neovim more their own. Not only is Lua a programming language that has lots of external libraries that you can install, with LuaRocks, and things like that, and there's a lot of other ext... |
It's true that Bram's working on vim9script and there will be performance improvements there. There's a lot of people I know that I've talked to personally that are excited to use Lua because there's applications outside of Neovim, that are like "Oh, I used this for scripting before in a video game" or "I've used this ... |
**Nick Nisi:** Give Neovim's architecture on top of LibUV, was JavaScript considered as a potential language? |
**TJ DeVries:** It was, I think, considered, but discarded. JavaScript's ability to be embedded easily inside of a C application is not considered one of its strong suits... As well as its minimalism. I mean, Lua can be run and is run inside of some Linux kernels. So the portability and the size and all of these other ... |
**Jerod Santo:** Yeah, it almost seems like Lua was purpose-built for use cases like this one. |
**TJ DeVries:** Yes, that is exactly what the design principles of Lua are; one of the primary design principles is embedability... So yes, this is exactly the case where you would wanna use Lua. You do not wanna use Lua to write your ten-million-line monolith; that is not the purpose of the language. The purpose of th... |
**Jerod Santo:** \[23:58\] Right. Now, Nick, I know that you've been porting your vimconfig over to Lua in the last couple of weeks, because as TJ mentioned, Neovim - you can configure it in Vimscript, and you can also configure it in Lua... You can have an init.vim or an -- is init.lua? Is it the same file name? |
**TJ DeVries:** Yup. |
**Jerod Santo:** Yeah, you can have either one. You should not have both. Both Nick, you had both here for a while; I don't know how you've been managing that. What's been in your experience? Because I don't think you've used Lua previous to this, is that right? |
**Nick Nisi:** That's right, I have not used Lua before this, and I initially was hesitant to even start, because I was just like "I don't wanna learn Lua. I don't have any practical application for it." But then I was like, "Wait a minute, I'm learning Vimscript. I don't have any practical application for that outside... |
**Jerod Santo:** Right. |
**Nick Nisi:** The thing that really pushed me into it -- as I've mentioned, I've been kind of a recent convert to that. I know that a lot of people have been using nightlies of Neovim, I guess 0.5 maybe I'd call it, the Lua support version, for a while... But I only recently jumped on that and started using it, and it... |
**Jerod Santo:** And that's not like losing your car keys, that's like losing weight. That's the kind of losing you wanna do. |
**Nick Nisi:** Exactly. But I guess from your perspective, TJ, would you say that there's a big benefit to converting your configuration to Lua, or is was the primary intention to be more like for plugin authors to be able to write more robust plugins? |
**TJ DeVries:** Yeah, so there's a couple aspects to chat about in that area. The first one is I don't think that we have yet implemented everything in Neovim to make it super-elegant and easy to write your entire configuration in Lua. That's going to take time. I have a work in progress PR for auto-commands, for examp... |
**Nick Nisi:** Yeah. I have a lot of Nvim execs in there for that stuff. |
**TJ DeVries:** Yeah, exactly. So that doesn't really give you any necessarily gain. So there's some parts of my config that are still in Vimscript, and probably will be for a long time. The other part too is if it's working really great for you, I don't see any reason to change it over. It's gonna work well to do a lo... |
\[27:47\] So I would say there are things that are nice about setting up your config in Lua. You can use closures really easily, and there's a lot of ergonomics about passing around functions or doing validation or whatever that is... But I don't see a whole lot of gain of just switching over to init.lua right now. I t... |
**TJ DeVries:** So maybe someday I would say without hesitation you should just port it over, but I think the primary focuses are much more about scripting the editor in a more deep and customizable way than just setting options, if that makes sense. |
**Nick Nisi:** For sure. And yeah, I think that from that translation a big thing that I really liked -- like, yeah, auto-commands and things like that, I'm just like... Basically, it's just a string of Lua in my config that's being run. But other things, like -- I've used a plugin for years called Vim Startify, that l... |
**TJ DeVries:** Yeah. |
**Nick Nisi:** Yeah, a Lua table to hold all of that information, and then just be able to access it from Vim... And I can do things like access other objects like that through the -- I think it's \_G for global... And then being able to access from Lua Vim functions through vim.fn - that stuff is really cool, being ab... |
**TJ DeVries:** If someone was starting today and they made their config in Lua, I wouldn't be like "Switch it back to Vimscript. It's better", or something. I wouldn't really do the same vice-versa either. If it's working for you and you're happy with the end result, there's no reason to spend a bunch of time switchin... |
**Jerod Santo:** Yeah. I made the decision that I was gonna start it in Lua, because I'm like "I'm starting fresh, I'm starting in Lua", and then Nick showed me his, and I'm like "Nah, I'm gonna go back to init.vim, because I can just copy-paste those right in when I want them, without thinking." |
**TJ DeVries:** \[laughs\] Totally. |
**Nick Nisi:** The other a little bit challenging thing is depending on if you spend your free time perusing dotfiles on GitHub, if you find something cool in Lua, you either have to translate it to Vim if you're not using Lua, or vice-versa... And understanding how to do that translation is going to be fun for everybo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.