text
stringlengths
0
2.02k
**Jerod Santo:** Not the most transferable of skills... You know, you're not gonna put that on your resume. "I can translate configurations between Vimscript and Lua." Oh, wow.
**Nick Nisi:** Speak for yourself.
**Jerod Santo:** \[laughs\]
**TJ DeVries:** Speaking of translating Vimscript to Lua, there's an interesting project that I have on my long-term horizon to explore that I've already written a decent amount of stuff for, which is trying to basically transpile Vim9script, the new language that Bram is making, into Lua, and then keeping as much of t...
\[31:51\] One of my goals is like I would hope that we can keep Vim and Neovim as close and friendly as possible. No one on the Neovim team has any animosity with people on the Vim team, and I don't really think vice-versa either... So it's a long-term project that I can't decide if it's real or not, or how much of my ...
**Jerod Santo:** That's interesting... Because that's been one of my lines of questioning that I'm thinking about here, is that I'm starting to see most recently -- we'll get into tree-sitter and things like that, but most recently you're starting to see some plugins... There's one called Limelight, which is written in...
So I started wondering, will that start to pull people away from Vim onto Neovim? And it's interesting, your perspective of like, you don't necessarily want that to happen.
**TJ DeVries:** Yeah... I mean, some of them are just impossible, at least today. There's no way to get tree-sitter, or at least that I know of, inside of Vim. So no matter what you do, if you wanna build something on top of tree-sitter, which is a really powerful and interesting technology, that's gonna most likely en...
And even for me -- I will probably talk about Telescope a little bit, but Telescope is Neovim-only, because it uses a ton of Neovim-specific APIs that are only available in Neovim, and uses the window things in complicated and interesting ways, and it relies heavily on the fact that you have LuaJIT installed, and uses ...
So I think there will be plugins that exist that are only for Neovim, and there will be plugins that exist only for Vim, and that's fine... My goal, and the Neovim team goal, as I was trying to say before, is basically just like, we're not actively trying to make the community not work for both.
**Jerod Santo:** Well, I really appreciate that perspective, because so many times when there are projects and efforts like these, so often it's like a hostile takeover kind of a thing. Or it's a long con like "Well, we're gonna slowly take over..." At the end of the day it's Vim. It's a different Vim, it's a newer Vim...
**TJ DeVries:** Yeah. And I respect Bram a lot. He's made an incredible piece of software, and it's pretty bonkers if you just think about where it started to where it is now, and all the things that he's done for it... Plus, Neovim is literally a fork, so it's like, we share a bunch of code that we never wrote. I don'...
It frustrates me when I see it online between people as well. It's just like, if they wanna use Vim, that's cool. Why would you be mad about that? That just seems cool to have them do that. That's great.
**Jerod Santo:** Yeah. If you're gonna hate on something, hate on the Emacs people. Come on, what's wrong with you...?
**TJ DeVries:** I mean, Emacs is now closer to Vim and Neovim in spirit than many other places, right? Not to name any other names obviously, but... \[laughter\]
**Nick Nisi:** \[36:05\] Yeah. They need to join forced to take on the onslaught of the graphical editors...
**TJ DeVries:** \[laughs\] Exactly.
**Jerod Santo:** Oh yes, the evil of graphical editors from faraway lands...
**Nick Nisi:** In my browser now...
**TJ DeVries:** Yeah.
**Break**: \[36:17\]
**Jerod Santo:** So Nick, you mentioned that you were waiting for the Lua stuff to land or to be official... 0.5 came out this summer, July 2nd, I believe. A huge release. 4,000 commits. As I've mentioned before, a thousand of those were ports from Vim, but lots of new stuff... And the community rejoiced. I mean, this ...
**TJ DeVries:** Yeah, there was a lot of work. There was probably -- if I had to take a guess, probably 3-4 weeks of time of me just answering when will Neovim 0.5 come out; you know, just replying to messages like that online. \[laughs\] We started a meme on my Twitch channel; when people would ask that, we did !theru...
But in all seriousness, it's been a long time coming, and it was a culmination of a lot of really long-term project and vision that the team had. I can't take credit for all of it, or even probably I can't take credit for most of it, or anything... But seeing things like the LSP come to fruition - there's some fun hist...
\[40:08\] So for me, it's been very fun to see that finally released. It's been in my head for a long time, and other people who helped along the way, to finally implement it... And then as well putting in tree-sitter, which has also been sort of a long-term vision about making Neovim as an editor understand the text a...
**Jerod Santo:** Let's focus in on LSP, the Language Server Protocol. This one didn't make the Vim show, but I did ask each person what they FOMO-ed from other editors... And we wanted to keep it tight, so we dropped that section out, but I'll tell you, Drew Neil mentioned LSP specifically in VS Code.
**Drew Neil:** Yeah, well -- I come back to language servers again... About a year or two ago I started learning TypeScript, and I know that TypeScript has a very good language server. Pretty much language server and VS Code and TypeScript were all kind of invented under the same roof, so they're very well integrated.....
**Jerod Santo:** For those who don't even know what LSP is, could you just explain what it is, where it came from? And then we'll talk about it in the context of Neovim.
**TJ DeVries:** Yeah, sure. So LSP is a protocol designed by Microsoft; it's actually one of Microsoft's VS Code users to communicate and basically get the language smarts that it has... Its big goal is -- if you think about... You have m editors, in N languages, and when you wanna implement support for the next langua...
So LSP is basically a protocol designed to talk from editors to some sort of server that's giving you information about what you're editing. So if you have your cursor on somewhere in a document, you can say "Hey, what's the definition of this?" And so there's a protocol, textdocument/definition. You send that over the...
This is really powerful, because in theory - it's not always exactly like this - it'll turn the problem from m times N to m plus N, which is a much better problem to solve... And it's probably more like m plus N plus z; there's some extra work still that --
**Jerod Santo:** What's the z?
**TJ DeVries:** Yeah. It still has to happen. Some language servers have specific commands that only make sense for their language, or things like that... But that's okay; that's still a much more fun problem to solve. That's sort of the basics of what happened. And in the context of Neovim, what we saw was that this i...
\[44:17\] I recently implemented something for my work at Sourcegraph, where I implemented a go-to definition over LSP, but what it does instead of running something locally - it asks this external program where the definition of this thing is. So that was basically a way for me to do that. And I didn't -- I mean, obvi...
And then if I can do another plug for Lua in here - the way that we did this with Lua is that it's very easy, because everything is just a function. You can replace a function with a basically set of parameters, and an expected thing to happen, and replace it with some new behavior that's more suited to your purpose. I...
I wrote some Lua code that walks through the results and says "If this file ends with \_test or \_mock, discard it, and throw that away from my results." Generally at work we just have one result that remains, and then I just jump straight to there if there's only one left, otherwise I open quick fix list.
So that's really cool, because now I only have to press the button to jump to that implementation and it does exactly what I hope, only in Go code; and everywhere else it does the standard definition. So there's this concept and idea of like - the way that we wanted to design it was "This is just an interface for both ...
**Jerod Santo:** Good explanation.
**Nick Nisi:** It's just amazing. I'm trying to think of ways that I might implement this.
**TJ DeVries:** Nick, sometime you're welcome to come on my stream and we can work on implementing it for you, or something; it'll be fun. For some other case.
**Nick Nisi:** Absolutely. That'd be a lot of fun.
**Jerod Santo:** That does sound fun. So tell me about this client-server situation... Is this like a network server, or is this like an embedded binary that you call? How does it actually talk? Explain that.
**TJ DeVries:** Yeah, so LSP - the primary modes that people use to communicate are either just STDIN, STDOUT, or you can do it over TCP. Generally, if you're doing it over TCP, people just use some pipe and then pretend that it's TCP, or something like that, instead of actually doing TCP...
**Jerod Santo:** \[laughs\] Right...
**TJ DeVries:** But Neovim doesn't care what's on the other side. We take a list of commands, we spin up that thing, and start it, and then we have STDIN/STDOUT between the two, and we just send basically JSON over the wire for a request, and then they'll send JSON back over the wire to get to us, and it's just like a ...
So you could have anything on the other side. For example, gopls, the Go language server, is written in Go, and so it's just a Go binary on your machine that you say "gopls start up", you send basically a configuration request, so it can understand what directory am I in, what's part of this project, all those kinds of...
\[48:01\] There's also things like Microsoft's Pylance, which you can only run in VS Code, due to licensing concerns, but that's written in TypeScript... So it's not written in Python, it just does the analysis in TypeScript and then sends the responses... But you're just editing Python files; you don't care what it's ...
**Jerod Santo:** So let's say I wanted to teach Neovim a new language...
**TJ DeVries:** Yup.
**Jerod Santo:** Let's say I had a language called Ink, and I wanted it to understand Ink. Would I then provide my own LSP, or would I plug something into the LSP that Neovim ships with? How would I get it in there?