How I Setup Neovim Plugins With Lua

  Рет қаралды 14,914

Jake Wiesler

Jake Wiesler

Күн бұрын

Пікірлер: 36
@KENTOSI
@KENTOSI 3 жыл бұрын
Great overview man. I was just re-arranging my plugins today and ended up on your website that eventually brought me here. Weird that you just a put out a video a few hours ago too. Subscribed!
@jakewies
@jakewies 3 жыл бұрын
@Kentosi people helping people! That's what it's all about :D Glad to have you!
@ultrat00n
@ultrat00n 3 жыл бұрын
This is really a good video, this took me a few minutes to find.
@yaap777
@yaap777 2 жыл бұрын
Perfect, simple, and useful video. Thanks a lot.
@jj0b
@jj0b 3 жыл бұрын
Loving this series! Thank you! Keep it up!
@jakewies
@jakewies 3 жыл бұрын
Thanks Jason!
@maddison0
@maddison0 2 жыл бұрын
12:27 It's worth noting the way Lua package caching works. If somewhere in your config you use `require"package.subpackage"` and somewhere else you use `require"package/subpackage"`, subpackage to effectively be loaded twice. This can be an issue if subpackage maintains some kind of state, you could end up with two separate copies of the state. This has happened to me before and caused some things to break, and it took forever to figure out what was wrong. It seems the best thing to do is always use ".", not "/", as your separator.
@sibouras792
@sibouras792 3 жыл бұрын
looking forward to the next videos, please cover treesitter and lsp as well
@jakewies
@jakewies 3 жыл бұрын
Glad you are liking it! LSP and TreeSitter are definitely on the list of topics to discuss :D
@MrKristian252
@MrKristian252 2 жыл бұрын
Very informative, thank you! Would be interested to hear if you have switched to packer?
@jakewies
@jakewies 2 жыл бұрын
I have switched to packer. Seems like the. go to plugin manager for neovim right now.
@mosslnnx
@mosslnnx 3 жыл бұрын
Thanks Jake , 👍
@jakewies
@jakewies 3 жыл бұрын
No problem!
@willernst
@willernst 3 жыл бұрын
I recently spent a bit of effort optimizing my startup time and tried putting my various config files into the plugin directory, based on a Reddit comment to try to avoid using requires to load them. It shaved almost 150 ms off my startup time. I found this video while trying to find out if this was a bad idea for any reason as I don't see anyone doing it. It also solves the name collision issue without needing the namespace prefixing or extra directory depth.
@jakewies
@jakewies 3 жыл бұрын
Hey Will thanks for the reply! So you're saying that putting your plugin configs into the plugin/ dir has increased startup time? As I mentioned towards the end I am considering the plugin/ dir for plugin config and the lua/ dir for other stuff like settings, remaps, autocommands, utilities etc.
@willernst
@willernst 3 жыл бұрын
To make sure we're on the same page, it improved my startup time, meaning it started up faster. I forget what led my down this rabbit hole, I think it was either verbose git messages that pop up your editor or the zsh command to open the current command in the editor. Either way, it defaulted to vim, which now that I've adopted neovim entirely, was missing my bindings and plugins. But when I changed the editor to neovim the editor popup when from instant to a slight pause, so I started looking into profiling startup time and looking for optimizations. By moving my configs to implicit loading in the plugin directory I was able to factor out a number of require statements and it ended up decreasing the startup time by about 1/8th of a second. Trivial, sure, but it was about a 30% improvement for these quick, brief loads.
@glidersuzuki5572
@glidersuzuki5572 3 жыл бұрын
The issue here is that, if you want to not load a plugin config, then you have to move that file from plugin directory. When placing them in lua folder (or anywhere else) you can just comment out that line. This becomes harder when you have have plugins.
@willernst
@willernst 3 жыл бұрын
@@glidersuzuki5572 That hasn't been too bad. I've just changed the file extension and that disables the loading. It's not as convenient or visable as commenting out a requires statement though, and I'm honestly not a big fan of the "spooky behavior". I want to do some more profiling to see what the gains really are here and if it's worth it. Maybe I'll use some checks to load a lighter config when I want the quick, instant load editor.
@glidersuzuki5572
@glidersuzuki5572 3 жыл бұрын
@@willernst yes, you can change the file extension to anything other than .vim or .lua but I still find it a hassle. I have too many plugins, 40+
@glidersuzuki5572
@glidersuzuki5572 3 жыл бұрын
There are many vim plugins that are useful. One is undotree, then there's vim-better-whitespace, vim-matchup, like that. You can configure these plugins in lua. All vim options have lua alternative.
@jakewies
@jakewies 3 жыл бұрын
Great point!
@DebajyotiDutta
@DebajyotiDutta 3 жыл бұрын
hi Jake, can you help me out .. I was able to install the Telescope plugin following you article but the moment I am introducing its configuration using the 'lua require('')" statement, I am getting error while sourcing the init.vim file... Error detected while processing C:\Users\ddutta8\AppData\Local vim\init.vim: line 93: E5108: Error executing lua [string ":lua"]:1: loop or previous error loading module 'iamdebajyoti' stack traceback: [C]: in function 'require' [string ":lua"]:1: in main chunk
@Jagddis
@Jagddis 2 жыл бұрын
I got the same
@Jagddis
@Jagddis 2 жыл бұрын
try this brew install luajit
@NostraDavid2
@NostraDavid2 2 жыл бұрын
Does nvim not come with luajit?
@ggtt2570
@ggtt2570 3 жыл бұрын
Hey jake, I love this series a lot. I checked out your very detailed article on this, but it was still fairly difficult to follow for me. I've only been able to configure telescope. I am so glad you're making these videos cause it really helps me out. Could you do LSPs next?
@jakewies
@jakewies 3 жыл бұрын
Yup LSPs are on the roadmap! Glad you are enjoying :D
@ggtt2570
@ggtt2570 3 жыл бұрын
@@jakewies Thank you, just fyi, I sorta got clangd working with lua snip, but it the intellisense only clicks in when I toggle the autocomplete menu and then goes off again once I start making changes. Do you know what might be causing this? For reference, I've pretty much directly copied your config from the article. I can't find any resources and the documentation is exceptionally non comprehensive for a novice like myself.
@girirajrdx7277
@girirajrdx7277 2 жыл бұрын
It followed this…..but when try to use telescope…it says it is not a editor comand
@wijaksanapanji
@wijaksanapanji 3 жыл бұрын
letsgoooooo!!!!!
@boole_cat
@boole_cat 2 жыл бұрын
I suffered for almost 2 weeks, it didn’t work, your tutorial helped
@freemti62
@freemti62 Жыл бұрын
well now I'm all confused, I was hoping for a guide to help me with my lua based nvim setup and plugins, but I stopped watching went you used vim-plug instead
@larrysaul3795
@larrysaul3795 2 жыл бұрын
what would happen, if i have both init.lua and init.vim under ~/.config/nvim ? which one would work.
@NostraDavid2
@NostraDavid2 2 жыл бұрын
Could be it tries to run both. If so, no clue which order it would go in.
Up And Running With Neovim + LSP
34:47
Jake Wiesler
Рет қаралды 46 М.
lazy.nvim explained
14:17
TJ DeVries
Рет қаралды 30 М.
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.
0 to LSP : Neovim RC From Scratch
30:47
ThePrimeagen
Рет қаралды 1,5 МЛН
One Neovim Plugin, 10x Quality of Life.
8:36
DevOps Toolbox
Рет қаралды 78 М.
Neovim - Your First 15 Minutes
16:45
Jake Wiesler
Рет қаралды 38 М.
How to Do 90% of What Plugins Do (With Just Vim)
1:14:03
thoughtbot
Рет қаралды 915 М.
Manage Your Dotfiles Like A Superhero
25:39
Jake Wiesler
Рет қаралды 17 М.
Neovim Lazy Lua IDE - my simple but powerful setup for 2024
29:13
Turn VIM into a full featured IDE with only one command
11:55
Dreams of Code
Рет қаралды 723 М.
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН