TakeTuesday E03: Introduction to LuaSnip

  Рет қаралды 56,051

TJ DeVries

TJ DeVries

Күн бұрын

Пікірлер: 199
@jankapko9338
@jankapko9338 3 жыл бұрын
"then i found LuaSnips and my life did a whole three sixty" lmaooo
@teej_dv
@teej_dv 3 жыл бұрын
I was hoping someone would catch this haha
@thaddaeusmarkle1665
@thaddaeusmarkle1665 3 жыл бұрын
180 degree turns are for noobs. BeginBot goes all the way.
@eduardoaranda4379
@eduardoaranda4379 3 жыл бұрын
This is another level of intro 😄
@teej_dv
@teej_dv 3 жыл бұрын
haha thanks! Trying to raise the bar each time.
@gomezhyuuga
@gomezhyuuga 2 жыл бұрын
Can't express how much I loved the intro!
@teej_dv
@teej_dv 2 жыл бұрын
Wow! That's so generous and kind of you :) thanks so much! I will keep on trying to make people laugh and learn at the same time!
@luislindgren5615
@luislindgren5615 3 жыл бұрын
What a masterpiece hahaha Learned a lot and laughed hard, 11/10!
@teej_dv
@teej_dv 3 жыл бұрын
Dang, 11/10. Idk how I can keep trying to top that haha! So happy you liked it :)
@dim-2d
@dim-2d 3 жыл бұрын
Bruh, the intro is another level! Excellent video! Keep up the great work, it’s much appreciated!
@elyezer
@elyezer 3 жыл бұрын
The bar was set very high in this one! Looking forward to to the upcoming ones. Great vid as always! Thank you for the great content.
@teej_dv
@teej_dv 3 жыл бұрын
Uh oh, now the pressure is on!
@elyezer
@elyezer 3 жыл бұрын
@@teej_dv no pressure :D
@nguyenthanh1479
@nguyenthanh1479 2 жыл бұрын
With first 2'30 mins for the intro. Gave me the motivation to watch for the rest of video without skipping any minutes. Keep doing. Good job TJ :)
@cattohappy9263
@cattohappy9263 3 жыл бұрын
Holy cow, I love that I've found your YT channel. Looking forward for the new episode.
@teej_dv
@teej_dv 3 жыл бұрын
Welcome :) looking forward to making it!
@luiscarloscorderopena7030
@luiscarloscorderopena7030 3 жыл бұрын
intro is god level
@zilizhang3555
@zilizhang3555 2 жыл бұрын
Holy moly truly appreciate the humour and mostly importantly the knowledge
@goosechaser
@goosechaser Жыл бұрын
Had no idea you posted this but found it from the LuaSnips documentation. Great video hahaha
@kylewoock
@kylewoock 2 жыл бұрын
This is the best neovim / programming video I have ever seen.
@robertjmccabe
@robertjmccabe 2 жыл бұрын
Thanks!
@mohityadav21
@mohityadav21 3 жыл бұрын
The intro is awesome. Also, nice transitions.
@teej_dv
@teej_dv 3 жыл бұрын
Awesome! We're trying hard to get better each video!
@nitinmax1000
@nitinmax1000 3 жыл бұрын
Super cool intro Teej! Loved alot and as usual awesome neovim content.
@ertugrulsrt5761
@ertugrulsrt5761 Жыл бұрын
breaking change: to set snippets you need to use add_snippets ls.add_snippets('all', { ls.parser.parse_snippet("expand", "als;dfjasldkflasdfj"), }) ls.add_snippets('lua', { ls.parser.parse_snippet('lf', 'local $1 = function($2) $0 end') })
@ellisonleao
@ellisonleao 3 жыл бұрын
my day just got a lot better after watching this video
@teej_dv
@teej_dv 3 жыл бұрын
@craigdanielmaceacher
@craigdanielmaceacher 3 жыл бұрын
Finally taking the dive into setting up luasnip with cmp, the options and config is a bit overwhelming for novice Lua people like myself (long time Vim user though). I'm not a programmer by trade (I'm a tech writer) so someone talking it through like this really helps. One criticism in otherwise great video: the first few characters of the line (check @7:17) are cutoff for some reason.
@teej_dv
@teej_dv 2 жыл бұрын
Thanks! I'll keep that in mind for next time
@davidsicilia5316
@davidsicilia5316 Жыл бұрын
Thanks for this video, these are so much better than reading through docs
@mrjson3039
@mrjson3039 Ай бұрын
Just came back to watch this amazing intro.
@adgai
@adgai 3 жыл бұрын
Worth the one month waited. Especially the intro. And sorry for the pestering you on Twitch 😂
@teej_dv
@teej_dv 3 жыл бұрын
Haha, it motivated me to keep working on it!
@willernst
@willernst 3 жыл бұрын
Oh, man! I don't know if the editing or the grooming is more impressive. I guess I can just say "Amazing cuts!"
@teej_dv
@teej_dv 3 жыл бұрын
ahahahahaha yes, i love it!
@bl_nkspac_9650
@bl_nkspac_9650 3 жыл бұрын
Underrated comment.
@julian-fricker
@julian-fricker 3 жыл бұрын
So much thumbnail, so much hype.
@astrophilo2000
@astrophilo2000 Жыл бұрын
that intro is CRAZY !!! love it
@TG-ll6kf
@TG-ll6kf 2 жыл бұрын
It took a whopping 30 seconds for this vid to get my like.. Keep up the great content!!
@saikoushikmacha7379
@saikoushikmacha7379 3 жыл бұрын
Love the video have been waiting for this from the first episode of this series. Waiting for the next episode hope it comes too soon.
@Acorn10
@Acorn10 2 жыл бұрын
Awesome Billy Mayes impersonation. I'm sold! Placing my order now
@TheFalloo92
@TheFalloo92 3 жыл бұрын
Strong @ThePrimeagen vibes. Love the energy, love the luasnip.
@teej_dv
@teej_dv 3 жыл бұрын
He's the reason I got started with streaming
@gunnarleber7856
@gunnarleber7856 2 жыл бұрын
You lost me at $0 for the last argument. Say whaaaaat??? Great work by the way, keep on rocking!
@narwashius1176
@narwashius1176 3 жыл бұрын
Saw thumbnail.... hit that like button !! If my Tuesdays were like this, I hope to contribute nvim sooner.
@teej_dv
@teej_dv 3 жыл бұрын
haha, I hope you liked it even more after watching!
@benjaminpapin4312
@benjaminpapin4312 3 жыл бұрын
holly shit this video cracks me up, well done for the content and the energy, keep it up !!
@teej_dv
@teej_dv 3 жыл бұрын
Awesome! Makes me so happy to hear that I'm making people laugh!
@yttos7358
@yttos7358 2 жыл бұрын
Yooo this was exactly what I was looking for!😁 I just started porting all of my `.vim` files to `.lua` and `hrsh7th/cmp` was on that list. Liked and Subbed👍 Can't wait to see the next installment
@CodeSmell
@CodeSmell 3 жыл бұрын
🤣 I needed this. At 1.75 speed, the intro is a pretty bangin' rap!
@teej_dv
@teej_dv 3 жыл бұрын
ahaha, I hadn't tried that myself but now I'll need to go back
@dadinhoschannel4003
@dadinhoschannel4003 2 жыл бұрын
Duuuude! Where is the video two?!! hahah Awesome work, man. keep at it. Best regards
@teej_dv
@teej_dv 2 жыл бұрын
Filming is almost complete. Editing time now :)
@KronosaurusRex
@KronosaurusRex 3 жыл бұрын
Okay, so you were right. I really had to watch this intro. Honestly I can’t even imagine what will you give us next. Btw, hoy do you show the CR and the tabulations? I’m intrigued. And nice video!
@teej_dv
@teej_dv 3 жыл бұрын
Ha! I'm happy you liked it so much! You're looking for ":help listchars"
@KronosaurusRex
@KronosaurusRex 3 жыл бұрын
@@teej_dv huge thanks!
@lamprospitsillou6325
@lamprospitsillou6325 3 жыл бұрын
What a thumbnail ! Can't wait
@teej_dv
@teej_dv 3 жыл бұрын
ITS HAPPENING!!!
@Oswee
@Oswee 3 жыл бұрын
You both made my day! :D Superb job! :)
@orbital1337
@orbital1337 3 жыл бұрын
Interesting, I had basically zero clue of how to properly use snippets (I never really used them in any editor) but this got me to try out some things with LuaSnip. The fruit of my labor today is a snippet for Lua development that automatically generates the LuaDoc string for a function. Basically, it uses treesitter to get the parameters of the next function after the cursor and then uses a dynamic node to create a comment like "-- @param p {}" for every every parameter p of the function. Surprisingly this is less than 20 lines of Lua code plus another 10 lines or so for the snippet itself. Neat, and should be easy to generalize to my other main languages!
@teej_dv
@teej_dv 2 жыл бұрын
Talking about awesome code and NOT SHARING A LINK?!?!?!?! :)
@orbital1337
@orbital1337 2 жыл бұрын
@@teej_dv Unless I'm going crazy here, I responded to this comment earlier with a link and I think KZbin automatically deleted it. Or maybe its like flagged for review or something? I don't know how KZbin does things around links these days... This is what I wrote (roughly): I actually just expanded the snippet a bit more - it now also detects whether the function contains a return statement and if so, adds a "-- @return" comment, too. In fact, it checks whether there is a return statement which is not just "return" (i.e. it returns something non-nil), so we don't have false positives for functions that use early returns as control flow. It's on my github at t-troebst/config.nvim/lua/user/snippets/lua.lua (please chill KZbin.. :P). I also had some fun with C++ which is my main language. I wrote some snippets that generate the special member functions (constructor, move assignment, etc.) automatically. They use treesitter to check whether the snippet is being inside of a class or not. If we're inside of a class, we get the name of the class via treesitter and generate the appropriate inline declaration / definition. Otherwise, we use the different syntax to define stuff outside of classes. In that case the use has to enter the name of the class but the templates are still correctly stripped via lua patterns / regex. The code for this stuff is also in the repo (in the snippets/cpp.lua file).
@teej_dv
@teej_dv 2 жыл бұрын
KZbin comments are actually so bad :'( this comment will probably disappear as well
@orbital1337
@orbital1337 2 жыл бұрын
@@teej_dv Yeah like they don't even have the decency to give you an error saying "you can't post links" - they just silently remove the comment after the fact... Anyway, very nice video - it's been fun to toy around with this stuff. :P
@bhaveshverma8629
@bhaveshverma8629 3 жыл бұрын
Super super video. Thank you so much to learn.
@teej_dv
@teej_dv 3 жыл бұрын
Glad you liked it
@zeocamo
@zeocamo 3 жыл бұрын
this was so cool, i when back in time to watch it again
@dr.akalanka6591
@dr.akalanka6591 2 жыл бұрын
That font is awesome!
@ryanleemartin7758
@ryanleemartin7758 2 жыл бұрын
"co-workers giggling behind my back as I slowly type boilerplate" lmao. dead
@DaviAreias
@DaviAreias Жыл бұрын
wasnt expecting a github link to be this fun lol
@geekstakulus
@geekstakulus 2 жыл бұрын
Nice one, TJ!
@MarkHegreberg
@MarkHegreberg 3 жыл бұрын
more OS projects need unhinged commercials with the ghost of a dead promo guy
@mikloscsepella2743
@mikloscsepella2743 3 жыл бұрын
amazing! i mean your content is another level. i just wish you would teach me to use all of my plugins like that. thank you
@teej_dv
@teej_dv 3 жыл бұрын
Slowly but surely I'm working on it!
@jessedarko
@jessedarko 3 жыл бұрын
Amazing work TJ
@teej_dv
@teej_dv 3 жыл бұрын
Thanks Jesse :) was really happy with this one!
@Jorres-qx1lu
@Jorres-qx1lu 3 жыл бұрын
Patentless technology lmao!!! Great work TJ!
@teej_dv
@teej_dv 2 жыл бұрын
So happy someone caught that line. Was really pleased with myself with that one haha
@drewad0
@drewad0 Жыл бұрын
I smashed that like button as hard as that guy hit that mattress
@voidmice1669
@voidmice1669 3 жыл бұрын
I died laughing at the intro and then I died a second time when you bleeped out VS C***. LMAO
@teej_dv
@teej_dv 2 жыл бұрын
we don't curse here, so no saying VS C***
@AntonKastritskiy
@AntonKastritskiy 3 жыл бұрын
These intros are getting out of hand! Nice job 👍
@teej_dv
@teej_dv 3 жыл бұрын
doin my best :)
@hemarkable
@hemarkable 3 жыл бұрын
TJ, I just moved over to doom emacs. If you'd keep posting videos like this, I might have to consider moving back to neovim. 😂
@teej_dv
@teej_dv 3 жыл бұрын
/me *scrambles furiously to put out new content*
@felgenh399
@felgenh399 3 жыл бұрын
Gotta love the intro
@_jdfx
@_jdfx 3 жыл бұрын
tacos AND this? amazing, thanks TJ 😄
@RoxCodes
@RoxCodes 3 жыл бұрын
Absolutely legendary
@teej_dv
@teej_dv 3 жыл бұрын
Excellent cameo
@olalekanadekanmbi3771
@olalekanadekanmbi3771 2 жыл бұрын
that looks so powerful
@vivemexicoofertas
@vivemexicoofertas Жыл бұрын
Loved it!
@alexwall7204
@alexwall7204 2 жыл бұрын
Really helpful video, thank you!
@marcelfahle
@marcelfahle 3 жыл бұрын
omg dude 😃 content is amazing too, thanks 🙂
@marcelfahle
@marcelfahle 3 жыл бұрын
autotune ftw
@Max-bh8tg
@Max-bh8tg 3 жыл бұрын
Love the intro
@teej_dv
@teej_dv 2 жыл бұрын
Thank you, thank you :)
@prankobano9076
@prankobano9076 Жыл бұрын
Great content!
@gharbimohamed8302
@gharbimohamed8302 3 жыл бұрын
Best intro ever 🤣🤣
@TheGogiu
@TheGogiu Жыл бұрын
Give at this guy an oscar please!!!
@blovio
@blovio 2 жыл бұрын
Anyone else having trouble with luasnip recognizing snippets (timestamp 13:28 and 14:37) I found this after reading the docs: ls.add_snippets("all", { ls.parser.parse_snippet("expand", "-- this is what was expanded!"), ls.parser.parse_snippet("lf", "local $1 = function($2) $0 end"), }) Not sure if i'm implementing it wrong or if they changed the method names in a recent commit... but the ls.add_snippets() is what worked to recognize my snippets.
@kevinjahns2746
@kevinjahns2746 2 жыл бұрын
This is awesome
@hackerzol
@hackerzol Жыл бұрын
Why make a whole keymap for s when you can do :so and you don't have to make a keymap and its the same number of keystrokes?
@n0kodoko143
@n0kodoko143 3 жыл бұрын
YES!
@inzaghinaji1800
@inzaghinaji1800 Жыл бұрын
thanks man that was great ^^
@lesmpt
@lesmpt 3 жыл бұрын
Can't remember that I have ever commented on a yt video. But this is hilarious.
@teej_dv
@teej_dv 3 жыл бұрын
Wow! That's high praise! Thanks
@JusticeHunter
@JusticeHunter 2 жыл бұрын
This is amazing.
@AndreaSchiavini
@AndreaSchiavini 2 жыл бұрын
Hey this is great content! I'm loving it :) May I ask what's the colorscheme used here? It doesn't look like the gruvbuddy I see in your dots. Keep up the great work TJ!
@teej_dv
@teej_dv 2 жыл бұрын
Should be gruvbuddy (the picture on gruvbuddy readme is probably just out of date haha)
@dreimade
@dreimade 3 жыл бұрын
Hey TJ, beautiful vid! I can't seem to get my snippet file to source. Is there a guide somewhere on this? Not sure where you required it or how it's imported into luasnip...
@teej_dv
@teej_dv 2 жыл бұрын
Hmm, just make sure it's somewhere like `plugin/mysnippets.lua` or something like that.
@BennyPowers
@BennyPowers 3 жыл бұрын
Loving this. Do neogit and vgit next!
@teej_dv
@teej_dv 2 жыл бұрын
neogit is on the list to explore!
@davidklsn
@davidklsn 3 жыл бұрын
Amazing! Thanks for this!
@teej_dv
@teej_dv 2 жыл бұрын
Glad to help :)
@viraatchandra8498
@viraatchandra8498 2 жыл бұрын
get this man a million subs
@wyfyj
@wyfyj 2 жыл бұрын
omg that intro
@sabyabhoi8841
@sabyabhoi8841 3 жыл бұрын
LMFAO bruh how much effort do you put in your videos? Keep up the good work!
@teej_dv
@teej_dv 3 жыл бұрын
Well there's a reason we're only on episode 3.... LUL
@ninjarogue
@ninjarogue 2 жыл бұрын
Thank you!!!
@sanskarsharma9494
@sanskarsharma9494 2 жыл бұрын
super cool and helpful :]
@robertjmccabe
@robertjmccabe 2 жыл бұрын
Suggestion for a future take Tuesday: in my journey to update my workflow to neovim with modern Lua plugins I am having a rough time getting used to the nvim-tree plugin. I used nerdtree for years and got really used to it 😞. Some of my annoyances: the file explorer window doesn’t resize to fit the file name width. Also, It isn’t easy to easily get a file explorer pane for the current file (it only allows a single nvim-tree pane per window) - I’m used to just doing something like :e % to get a file explorer in the directory of interest. I know these seem like little things but it is throwing off my workflow big time.
@robertjmccabe
@robertjmccabe 2 жыл бұрын
Nevermind. I went back to the native netrw file explorer. nvim-tree was too weird for me.
@MegaMario0007
@MegaMario0007 2 жыл бұрын
Stupid question but what do you use for split navigation now then? Could only find etc. in your dots
@teej_dv
@teej_dv 2 жыл бұрын
I'm not sure what you mean. I navigate splits w/ control + hjkl
@tokiomutex4148
@tokiomutex4148 3 жыл бұрын
Great intro
@teej_dv
@teej_dv 3 жыл бұрын
Thanks sir palpatine
@jrmoulton
@jrmoulton 3 жыл бұрын
I love this
@teej_dv
@teej_dv 3 жыл бұрын
Thanks! I had so much fun making it!
@RictorScale
@RictorScale 2 жыл бұрын
LOL you are the man TJ
@paologonzales4361
@paologonzales4361 3 жыл бұрын
ahckk finally
@kartik4792
@kartik4792 3 жыл бұрын
We need more youtubers like @TJ DeVries and @ThePrimeagen.
@teej_dv
@teej_dv 3 жыл бұрын
Thanks
@nonefvnfvnjnjnjevjenjvonej3384
@nonefvnfvnjnjnjevjenjvonej3384 2 жыл бұрын
Hahaha. This was such a good video
@nyxkrage
@nyxkrage 3 жыл бұрын
very cool
@frydac
@frydac 3 жыл бұрын
damn I made a bunch of luasnip snippets without the extras.. I made my own rep() function after a significant time figuring out how to do this.. I can't believe I missed the extras in the docs (assuming it's there, it is right? EDIT: yes extras is metioned, but fmt() is undocumented for as far as I can see) Also without the fmt() it is not really very readable and quite a bit of punctuation.. and of course I didn't think of creating something like that myself :) And I assume it would be a considerable effort. hopefully vid 2 and 3 will be posted soon Currently using both luasnip and ultisnips as I have to port a bunch of snippets still (which use a fair bit of python I want to get rid of and replace by lua only, it will be glorious!) Thanks for this!
@teej_dv
@teej_dv 2 жыл бұрын
but you learned more things, so that's good :) Working on 2, but it's still a bit away.
@jereziah
@jereziah 3 жыл бұрын
Not even mad.
@teej_dv
@teej_dv 3 жыл бұрын
BUT WAIT THERES MORE
@zwiebec78
@zwiebec78 2 жыл бұрын
#amazing
@sonicCat
@sonicCat 2 жыл бұрын
What colorscheme is it?
@null_bite
@null_bite 3 жыл бұрын
Lmaoo, perfection 👌
@Tondz1
@Tondz1 2 жыл бұрын
Intro reminds me of Better Call Sual
@shubhampawar7921
@shubhampawar7921 3 жыл бұрын
Does LuaSnip support friendly-snippets?
@teej_dv
@teej_dv 3 жыл бұрын
github.com/L3MON4D3/LuaSnip#add-snippets Yup!
@eyesight2073
@eyesight2073 2 жыл бұрын
1:48 🤣🤣🤣
@cam545
@cam545 3 жыл бұрын
damnit TJ
@teej_dv
@teej_dv 3 жыл бұрын
wait a second... that's not your line
@BrazenNL
@BrazenNL 2 жыл бұрын
So, your life turned around 360º, huh? You must like ballet. 😄
@yourdadsbestfriend7101
@yourdadsbestfriend7101 2 жыл бұрын
so when is the next video?
@teej_dv
@teej_dv 2 жыл бұрын
haha, great queestion. I'm not sure right now. Still working on the script and what not. Can't give any good timelines at this point. Sorry about that
@swastikacharyya
@swastikacharyya 3 жыл бұрын
Teej it's official , you are going shoot ad for my new video , with beginbot 🤣🤣
@teej_dv
@teej_dv 3 жыл бұрын
haha, maybe I found a new career... ;)
TakeTuesday E04: LuaSnips - Advanced Configuration
27:56
TJ DeVries
Рет қаралды 32 М.
TakeTuesday E01: nvim-cmp
30:42
TJ DeVries
Рет қаралды 65 М.
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
Being An Efficient Developer | Prime Reacts
22:56
ThePrimeTime
Рет қаралды 161 М.
Everything You Need To Start Writing Lua
28:15
TJ DeVries
Рет қаралды 62 М.
Treesitter Basics and Installation
13:50
TJ DeVries
Рет қаралды 27 М.
AI Risks No One is Talking About
14:09
TJ DeVries
Рет қаралды 57 М.
lazy.nvim explained
14:17
TJ DeVries
Рет қаралды 33 М.
Automatically Execute *Anything* in Nvim
11:03
TJ DeVries
Рет қаралды 78 М.
I tried 10 code editors
10:28
Fireship
Рет қаралды 3,2 МЛН
Vim Tips I Wish I Knew Earlier
23:00
Sebastian Daschner
Рет қаралды 89 М.