Lua is such an underrated programming language, everything from how light it is to implement to how easy it is to learn and use. Didn't know Neovim was that capable if it were not for this awesome channel
@DistroTube2 жыл бұрын
Lua is alright. It's no Emacs Lisp. :D
@gimcrack5552 жыл бұрын
I really like Lua; I ran across a 2D gaming engine call LOVE and it was really easy to make games using this engine and programming language.
@zeocamo2 жыл бұрын
@@DistroTube emacs lisp is super super slow. so no it is no emacs lisp as it is better
@Anonymous40452 жыл бұрын
@@zeocamo Pure runtime speed doesn't determine how good a language is
@Little-bird-told-me2 жыл бұрын
@@DistroTube nice touché :)
@swapnendukarmakar85472 жыл бұрын
It's been a 2-3 days since I started configuring nvim in lua and I gotta say the process is really smooth so far.
@mke76052 жыл бұрын
I don’t agree with the statement that if you have too much config in vim, you should go to emacs. I’ve used both for a long time and for me, nvim is by far the better IDE of the two. But you’ll need quite a bit of configuration for that still.
@twb01092 жыл бұрын
Yeah, emacs is still not as good
@ioneocla65772 жыл бұрын
Once again, nvim IS a text editor, emacs HAS a text editor
@itzgoldenleonard2 жыл бұрын
For most people I think they go with vim/nvim because it's not an IDE. It is customizable enough to turn it into an IDE, but if you want an IDE, you're probably better off just using an actual IDE with vim emulation/keybindings. For me nothing can beat the clean distraction free environment that a simple text editor gives, and nvim (with a few plugins) is IMO the best text editor, but I havent tried emacs.
@heroe1486 Жыл бұрын
@@itzgoldenleonard If you're using neovim and not vim you're after LSP and such and are thus looking for IDE functionalities and not a bare bone simple text editor. Unless for you the term IDE is just for bloated jetbrains IDE/Visual studio etc and confier Vscode as a text editor too. Because neovim is capable of giving you Vscode's experience, vim emulation is often poor and it doesn't translate to the vim experience.
@heroe1486 Жыл бұрын
@@anonymousalexander6005 it's also "weird" to compare vim to your note taking applications, neovim with few plugins is litteraly a more efficient Vscode.
@musicalintuition2 жыл бұрын
For Lisp enthusiasts, Fennel compiles to Lua.
@Kalasklister13372 жыл бұрын
Hey DT please also do a video on neovim usage from a programming perspective. For sysadmin use the difference between vim and neovim is not that big but when it comes to programming and customization its a completely and totally different beast. Most people are not aware of the main selling points of neovim and that the bulk of new features added by the core team are geared towards programmers. My recommendation would be in your case to take some of your haskell projects, and setup 1. haskell LSP (on arch you can use haskell-language-server-bin ) 2. nvim-telescope (insanely good) 3. Understand what tree sitter is and take advantage of it 4. Make some snippets with LuaSnip 5. maybe use nvim-dap for haskell. I know your content is more sysadmin oriented but that does not mean that you can ignore some of the main value propositions of an application before comparing it to another one. Other content creators that really know the details and have good tutorials are e.g. TJ Devries, Chris@machine, DevOnDuty, ThePrimeagen Either way very happy to see that you brought up the Lua aspect and sparked more people's interest in the project.
@rsmith314162 жыл бұрын
You forgot step 6: Ask on reddit about why your environment suddenly stopped working and your language server is eating all your RAM :)
@Kalasklister13372 жыл бұрын
@@rsmith31416 I have not had environment problems, but some language servers really are terrible with large code bases :) For python do yourself a favor and use Jedi instead of Pyright. Given how new the concept is though i'm not surprised. What i like the most is how anyone can create their own language server and hook it up to any editor if the existing ones are not up for the task, so i expect to see cool stuff in the coming years.
@rsmith314162 жыл бұрын
@@Kalasklister1337 I can see its usefulness in some instances, however, for most users, a much lightweight, reliable and flexible setup is simply adding two lines in `after/ftplugin/.vim`, two lines in `compiler/.vim` and call it a day. I don't have much of a need for a language server. I have installed a few of them, but I was not particularly impressed. I found the `hover` capability to be the most useful feature and ended up replicating it without LSPs by using the newish popup implementations calling external commands.
@rsmith314162 жыл бұрын
@@anonymousalexander6005 You might as well have mentioned COBOL since no one talked about Bash either.
@esra_erimez2 жыл бұрын
I am very envious of your ability to nimbly adapt to new technologies
@YannMetalhead2 жыл бұрын
It's a habit; DT is always learning something new, so his brain is primed to learn and adapt.
@tuffgniuz2 жыл бұрын
Lua is really one of the best things that happened to neovim. Nice to see a channel such as DistroTube to cover it!
@marcosdly2 жыл бұрын
People have lengthy configs because at this point Neovim can be a full-featured IDE, just like vscode ended up becoming one. You can have one config for serious work and one for minor editing, though. You can access it with a shell alias (alias nvs="nvim -u path/to/seriousWorkConfig") or a custom variable/function inside Neovim, such as :lua seriousConfig() or :source $SERIOUS_CONFIG. If you end up becoming a Neovim enthusiast you can even code a popup menu to access your configurations, which will be loaded on the fly.
@theodorealenas31712 жыл бұрын
Oh yes exactly! I even have a minimal configuration for turning nvim into a sort of dmenu.
@marcosdly2 жыл бұрын
@@theodorealenas3171 This looks cool!
@popeye7472 жыл бұрын
Hi DT, Thanks for Lua video. You have made a terminal beast out of me. Presently using Awesome WM, NVIM and Kitty. All thanks to you. All the best.
@zahimeen2 жыл бұрын
If this man was my teacher in kindergarten, I would have passed. To this day I am learning my alphabet through khanacademy to prepare for my end of year test.
@xmvziron2 жыл бұрын
Lmao
@sunnyheheheh94012 жыл бұрын
What t f
@jemag2 жыл бұрын
Great video, although I disagree about the long config point. While, Emacs is superior as an all-encompassing software, I feel like Neovim is the superior development environment, at this point in time. So there is nothing wrong in having an exhaustive config to expand on that programming experience.
@AxWarhawk2 жыл бұрын
I highly recommend checking out chris@machine's KZbin channel. His Neovim videos and streams contain a lot of useful information.
@marioschroers73182 жыл бұрын
Oh yeah! I've started exactly this kind of project a while ago! Thanks, DT! 😎
@acatacho2 жыл бұрын
The accidental flashbang caught me of guard. I am new to vim and neovim and lua seems like an easy script to use to edti because vimscript looked convoluted.
@remrevo39442 жыл бұрын
Base16 actually doesn't only exists for nvim, but is basically a framework to tie templates of config files of different programs together with schemes of different color-schemes to have the same color-scheme in different programs. There are also different builders that automatically build these colorschemes and configure your programs appropriately, so you can use flavours apply to set all your programs to a specific color scheme.
@theodorealenas31712 жыл бұрын
The hell? I should have known! Why doesn't everybody talk about it
@remrevo39442 жыл бұрын
@Theodore Alenas No idea, I learned about it from Jon Gjengset's video about his desktop setup.
@giri80342 жыл бұрын
Nice video, hoping to see more neovim content :)
@DistroTube2 жыл бұрын
More to come!
@kennethlawson62052 жыл бұрын
Started rewriting my config yesterday and I am loving lua I might even switch to Awesome WM because of it
@Little-bird-told-me2 жыл бұрын
Are you tracking me ? I installed neovim yesterday, and today you make a video on it. Bravo ! next F-Droid :) the FOSS repository for Android. or maybe not
@nobyra2 жыл бұрын
This could not have come in a better time, started doing it this night. I discovered NvChad, a sort of neovim distribution, i recommend it for newcomers
@MisterConscio2 жыл бұрын
I have been messing with my neovim config these past days, i tried the 100% lua config, but in my opinion, it's kind of an unnecessary "complexity", i don't think lua is bad, i just think that the classic vimrc it's more simple to configure. In my use case, i prefer a hybrid config, somo files in vim script, others in lua, especially files like the lsp and treesitter configuration. I think you forgot to mention the vim runtimepath, which explain what file structure you should have on your nvim folder config, instead of just straight copying other config files. Also, you missed other important point of nvim, which is the native support for LSP (Language Server Protocol) and Treesitter.
@swapnendukarmakar85472 жыл бұрын
What a timing. I also started configuring my nvim in lua.
@MerkDolf2 жыл бұрын
Hey DT what do you actually use VIM, DOOM EMACS and the ilk for?
@Sqwert-g6h2 жыл бұрын
I can't seem to get packer to work. I tried your config as well and same issue. Know what I might be doing wrong?
@mesbahuddin53282 жыл бұрын
Please do a video about policykit and authentication agent
@ironmanlifts2 жыл бұрын
I configured my vanilla Emacs in Neovim lol. Hey DT, are you still using Doom or are you using your vanilla config?
@GajendraJena2 жыл бұрын
very nice content. what is the tool you are using to show the cpu, memory.. status on the status bar? It looks bery beautiful.
@zenitsu29892 жыл бұрын
Thanks dt, I was looking for a good online guide, your're the best.
@DistroTube2 жыл бұрын
Thanks! I too was looking for a good online guide but couldn't find anything simple and straightforward. Which is ultimately why I just decided to look at someone's dotfiles instead. For me, often it's easier just to look at other people's configs.
@zenitsu29892 жыл бұрын
@@DistroTube Yea true, looking into other people's dotfiles is the best solution in most cases. I tried something similar, looking into other people's code like the NvChad one which was too much Chad for me to understand.
@anon_y_mousse2 жыл бұрын
Seeing how convoluted Lua makes the configuration file, I'm absolutely sure I shouldn't use NeoVim. I don't like VimScript, and I have nothing against Lua in general, but as a configuration language, it just doesn't fit. Unless I decide that I need to write something myself, I don't see myself moving away from Vim anytime soon. I also don't get the double standard of disliking long configuration files for Vim but thinking they're okay for Emacs. Your configuration file should be as long as it needs to be, whether that be long or short, it doesn't matter. I don't know why you think it does.
@kevinklement26212 жыл бұрын
Totally agree with you about the double standard. I think once you get used to lua, especially if you use it in other contexts (like I do with AwesomeWM, Wezterm, etc.) the configuration doesn't seem so convoluted, but I can see why you'd get that impression at first.
@rsmith314162 жыл бұрын
I agree completely. As I said in other comment, language bindings are always horrible. Even for small configuration changes and convenience functions, vimscript (not to mention vim9 script) are a much better fit. The idea of having a short configuration file for vim/neovim comes from the fact that most users can benefit from native features, and therefore, only very minor changes are needed to have a great experience with most languages. The opposite is a recurrent trend nowadays: new users install too many plugins without understanding how to use vim well, which leads to many issues down the road.
@anon_y_mousse2 жыл бұрын
@@rsmith31416 I would wager that Emacs suffers that same issue. However, I'd agree that people should get used to the default experience before they go modifying things. Once they have an idea of how things work, I'd say go wild.
@kevinklement26212 жыл бұрын
@Anees Baloch True, Vimscript isn't as bad as people sometimes make it out to be. Neovim supports it fine, so you can continue to use it. Whether or not it's worth learning lua probably depends on whether or not you have other uses for it. I don't know anything about Vim9 at all.
@rsmith314162 жыл бұрын
@@anon_y_mousse Are you referring to the issue of language bindings? I think it is a bit different in emacs since the language used to run the program is the same language used for configuring it. And yes, once you have learned how to use vim well, then you can confidently change it as much as you want.
@BinarySmurf2 жыл бұрын
This is exactly why I like using micro as my terminal-based editor. I think with Neovim the power is there, but the level of complexity involved to configure and use what at the end of the day is a text editor turns me right off. This isn't what Linux is about (for me, anyway). More power to you if it floats your boat. 😁
@007arek2 жыл бұрын
Is it possible to make those configurations in the pure lua: vim.cmd 'colorscheme solarized8_high' vim.cmd 'syntax enable' vim.cmd sign define DiagnosticSignError text= texthl=DiagnosticSignError vim.cmd 'syntax spell toplevel'
@damian_madmansnest Жыл бұрын
there is vim.cmd.colorscheme('solarized8_high') now
@Zeioth2 жыл бұрын
Well to be fair vim is been there for how many years, maybe the author is right in the end. My main concern is about plugin compatibility between vim and neovim.
@thingsiplay2 жыл бұрын
I rewrote my entire Vim config in Vim9script.
@MiguelAngel-mf3yu2 жыл бұрын
where is the autocomplet coc.nvim ! no work in lua ! HELPME PLEASEEEEEEEEEEEEEEEEEE
@sunnyheheheh94012 жыл бұрын
I was waiting so long for this video , neovim configuration with lua by DT
@DistroTube2 жыл бұрын
Hope you enjoyed it!
@sunnyheheheh94012 жыл бұрын
@@DistroTube yes sir I did enjoy it
@slipcurve14102 жыл бұрын
i have a lot of nvim plugins but most of them are about coding. semantic highlighting, auto-completion, snippets, git integration etc. great thing about neovim is that lsp support is built-in now.
@casenc2 жыл бұрын
I was just trying to config my nvim! Perfect timing!
@cbbcbb68032 жыл бұрын
Can Lua allow you to change the start-up mode of NeoVim. I like editors to open with input mode to be the default. Did I miss something?
@andarsn2 жыл бұрын
With vim you can do this by running it with -c 'startinsert' I'm guessing it's the same with nvim
@cbbcbb68032 жыл бұрын
@@andarsn So it's something like vim -c nvim -c
@andarsn2 жыл бұрын
@@cbbcbb6803 it's: nvim -c 'startinsert' Tried it now, works like a charm!
@theodorealenas31712 жыл бұрын
Won't this give you bad habits? Won't you SSH into a server one day and start typing in normal mode?
@Aleod_2 жыл бұрын
I don't quite agree on the fact that neovim configs should be short.. In fact neovim has added API in lua to enable more convenient configuration. And lua is fast enough that it doesn't slow down the editor.
@rsmith314162 жыл бұрын
I think the point is that when you know how to use vim/neovim well, you don't need to install so many plugins or customize your editor so heavily. At least, that's the pattern I have seen in highly proficient vim/neovim users, as well as new users when they learn about vim's built-in features.
@Aleod_2 жыл бұрын
@@rsmith31416 as much as I used vim keybindings I found several aspects of it rough and a well thought configuration can make these rough edges rounder. I think of splits navigation with hydra + some plugin making splits more manageable.
@rsmith314162 жыл бұрын
@@Aleod_ Sure, but it is really difficult to have a huge vim/neovim configuration file by simply adding a few mappings to improve split navigation.
@Aleod_2 жыл бұрын
@@rsmith31416 not necessarily huge but as you add support for several languages extensions it does add up.
@rsmith314162 жыл бұрын
@@Aleod_ Maybe we have to establish how to define "huge". I would say more than 500 lines is starting to get in large category. In my case, I add support for several languages by adding literally two lines in `after/ftplugin/.vim` and two more lines in `compiler/.vim`.
@eritert2 жыл бұрын
Well this is way simpler than whatever i looked at about lua configs when it first came out.
@zeocamo2 жыл бұрын
2:16 this is where you are wrong DT, Neovim got all the stuff Emacs got as plugins, want LSP, fuzzy finder, magit, org-mode or a email client, there is a plugin for that, you name it neovim got it, but neovim also got Lua that is a c-like in speed language, super fast, and it do not need a demon to have a start time of ms. it got treesitter, for better and fast highlight and it can be use in plugins to understand the code and give you things like delete in function or swap args in a function neovim is the new emacs, just faster and better but thx for cover this.
@JarrodHenry2 жыл бұрын
I disagree that org-mode on neovim is nearly where emacs' version of it is. Can you do literate programming, connected between the segments, populate a table, and then use that to embed a graph made with graphviz or plantuml in the response? Or create a spreadsheeet with functions, tables, and then have it all exportable to latex through an exporter that basically renders it ready for publication, or to a website as HTML, or any number of other things? I don't say this as if neovim is bad, I like neovim, and I've used it regularly in the past. But orgmode is a real killer app and it's going to be awhile before neovim's lua versions of org out there do what emacs does... and that makes sense, orgmode's nearly 20 years old and has been a major mode in emacs core for 15 years.
@zeocamo2 жыл бұрын
@@JarrodHenry we got a plugin for the programming thing, and tables, export to html or any lang. we also got norg-mode that take org-mode and make it better. and the org-mode syntax is super fast with treesitter.
@JarrodHenry2 жыл бұрын
@@zeocamo So, here's an example of what I use org mode for in emacs, to show what I'm talking about. When a certain incident comes in at work (I'm a devops/SRE in on-call roles, normally a software engineer), I hit a button that captures a template to a file. As the incident progresses, I fill out different portions of this template using other capture-templates such as the first. These all go into this file, including shell scripts, python scripts, data sets, and other such things that are run (with results placed in the file.) After the incident is resolved and closed out, I export a Presentation (through latex-beamer), a handout for the presentation, a filled out incident response sheet to my company's format, a series of time clocked entities representing work done in this, and then it all gets filed into a ROAM style management/second brain system. All of these things are done by org-mode and very light amounts of elisp here and there. I tried to run this file through a neovim with norg-mode, and it doesn't yet have nearly all the capabilities. I searched for other plugins to do what I want, and I'm sure through bash scripting, pandoc, shell execing from neovim, and such I can get there... but almost all of this is present in org mode with very little work NOW. And this is just one of the workflows I use. So again, org-mode isn't just a bunch of outlines and a checklist. It's a LOT more than that and it's going to take a long while for norg-mode or any neovim org mode to reimplement it all.
@speedyfox90802 жыл бұрын
Me: ricing OpenBSD, and configuring nvim with vim script DT comes always at the best time!
@oalfodr2 жыл бұрын
I am one of users with crazy nvim config. I just want an IDE based on vim. Almost 40 percent of my dotfiles are lua files from nvim configs
@michaelcarnevale56202 жыл бұрын
Just finished my lua nvim config Last thing on my list is learning the Lush.nvim colorscheme creator plugin
@AndrewErwin732 жыл бұрын
You should look into LunarVim... it is pretty epic!
@vaishakhgk20062 жыл бұрын
I use Neovim as my main CodeEditor/IDE so am one of the guy who has big neovim config.
@AeriaVelocity2 жыл бұрын
Man, Neovim is *awesome*
@MrG0CE2 жыл бұрын
THERE'S SO MUCH TO ADD TO MAKE NVIM EVEN BETTER AFTER CONFIGURING IT ! THAT I STARTED LOOKING AT NVIM DISTROS AND LET ME TELL U NVCHAD AND LUNARVIM ARE AWESOME QUASI-READY TO USE CONFIGS !!!
@itsfish86722 жыл бұрын
GVDT, But i am still using vi.
@mallock85292 жыл бұрын
I like Lua but i think using it for a vim init script is a mistake. it's not declarative enough and pretty verbose
@Hyyfhkbe2 жыл бұрын
Thank you for this video. Exactly what I needed
@wisnoskij2 жыл бұрын
Considering that it seems like half the settings you might want to do are supposed to go in autocommands for some reason, and this just makes that even more verbose ad ugly, I dont see the benefit. And it is not really like anyone is programming in thier init.lua files so who cares if lua does a more elegant for loop, or you like how they handle classes or inheritance better. The real problem is all the plugins are in vimscript because everyoen wants to be backwards compatible, and all the usage and installation instructions are in vimscript.
@007arek2 жыл бұрын
I think I have more lua plugins. More plugins are written in vimscript but the trend is different. Luajit is just faster, so you can see benefits in something like autocompletion plugins.
@ReensBeanDip2 жыл бұрын
I'll keep my 2000+ line setup. I need it for work! haha
@ritchielrez16802 жыл бұрын
Hey DT, not everyone prefers Emacs ecosystem of Elisp. Neovim with it's modern lua ecosystem can allow us to make a IDE from the ground up. Sure 5000 thousand lines neovim config might sound absurd to others, but it's their choice, and modern Neovim allows you to how you want to edit text and source code.
@damian_madmansnest Жыл бұрын
I still don’t grok why people opt for a pure init.lua setup. This looks very much like the ‘horrible vimscript’ version, only with less legible syntax. I’d rather had most settings in legible vimscript and then used lua
@mkd1964 Жыл бұрын
1,000 lines is too long? You haven't looked at Lunar Vim's config, have you? 🙂
@livingcodex98782 жыл бұрын
*cries in nanoscript*
@thundreturtle2 жыл бұрын
only when you've written vim un rust is your work complete
@20pablo012 жыл бұрын
Huh, I just migrated my own config to lua a week ago and I've been having a blast thus far.
@muemmel202 жыл бұрын
Emacs has a completely different philosophy and a, imho, terrible and clunky scripting language. I hate most Lisps, especially those with tons of pointless parentheses. Neovim also has graphical frontends. You yourself made a video about one. Neovide. Neovim stays incredibly fast even with longer configs. I'm currently setting mine up as an IDE, mostly finished. It doesn't start up as fast as without plugins, but it''s still way below half a second. Emacs startup becomes very slow, very fast. You might argue that that's what the daemon is for...but I just don't need it. And starting emacsclient is still slower than nvim.I'm honestly not sure why you try to minimize (heh) Neovim. It's not like Emacs becomes worse by using Neovim for a similar use case.
@marioschroers73182 жыл бұрын
I have to agree. My initial reaction to this video was on the road, so I basically thought »Awesome, he's doing vim content again«, but watching it, I have to say this video is really poor. All he says is basically »Rewrite your shit in Lua, go grab from other people's configs, and if your config is longer than 10 lines, just use Emacs.« That's pretty disappointing. I think it's also belittling the way he now says »These Neovim users«, like a text editor was some kind of religious thing. I never understood why one would need to keep a demon running in the background to speed up startup times of a damn text editor. If that's needed, then I guess something is going really, really wrong. As for Neovide, this was indeed a Godsent recommendation. I've been using it ever since checking it out. Not really a thing needed, but a truly nice eye-candy XD And how does he assume packer was inspired by Emacs? Jesus. Pretty sad, he himself admits to not knowing anything about how packer actually works. This really is one of his worst videos, now that I think about it. And his content is usually great.
@astroid-ws4py2 жыл бұрын
Nice video, Thanks.
@N0zer02 жыл бұрын
hey, Mr. Leenkthie
@rsmith314162 жыл бұрын
It is very difficult to see this as an improvement. You basically replaced straightforward statements to change editor settings with a more verbose version of the same, but now using a layer of indirection and adding some callback hell just for good measure. You should take a look at vim9 script before criticizing it. It is such a huge improvement in performance and readability and in many applications, a domain-specific language is a much better choice. Lua is a great language but as a language binding for a text editor, it is terrible just like any other language binding available in vim (python, ruby and lua itself). If you want to customize your editor to the extent that you actually need a general-purpose programming language, then use emacs instead. Emacs was designed with that level of customization in mind and I say that as a vim/neovim user.
@JarrodHenry2 жыл бұрын
LUA is a first class citizen in neovim.
@rsmith314162 жыл бұрын
@@JarrodHenry I know that's the slogan, but as a language binding, Lua is by definition a second class citizen.
@JarrodHenry2 жыл бұрын
@@rsmith31416 vmiscript 9 is just as much a language binding.
@rsmith314162 жыл бұрын
@@JarrodHenry Not properly. It is certainly not as close to the source as emacs lisp, but it is a native configuration language, just like vimscript.
@derekw68112 жыл бұрын
neovim ftw
@WildWestDesigns2 жыл бұрын
It took me about 2wks to come up with my final config file for neovim. About 2oo lines of code, so not bad, alot of that due to autocomplete. A mixture of lua and vimscrpt. Emacs, I tried for about a month, I did not like it at all. Maybe not smart enough for it, dunno, but I just didn't like it.
@mke76052 жыл бұрын
I used Emacs exclusively for 4 years. Ended up with neovim for the last 3 years
@muddyexport56392 жыл бұрын
Thanks! I like that iteration of vim.
@YannMetalhead2 жыл бұрын
Good video.
@MerkDolf2 жыл бұрын
😅👍 👌
@batboy492 жыл бұрын
I set mine up with lua configuration last year...it is way easier to modify
@keltyll2 жыл бұрын
:colorscheme base16-black-metal FTW
@Parallax99992 жыл бұрын
not first!
@emacsking43102 жыл бұрын
Last
@marioschroers73182 жыл бұрын
Revisiting this video, I need to point out some criticism: This is obviously about Neovim, but all the time I keep hearing »Emacs«. It's like you publish a video about vim, but all the time try to convince people to actually use Emacs. That's a tad sad, and honestly, quite annoying and also distracting.