Powerful Text Snippets - Emacs YASnippet - Straightforward Emacs

  Рет қаралды 15,210

Jake B

2 жыл бұрын

In this video I discuss YASnippet, a powerful package for Emacs that brings "abbreviations" - essentially pieces of text that will expand into other, larger pieces of text. I promise, after trying them out it's hard to go back!
github.com/joaotavora/yasnippet
Table of Contents:
0:00 Introduction
0:30 Demo
1:13 Installing YASnippet
1:55 Your first snippet
4:25 A complex snippet
7:08 Review
8:08 Conclusion

Пікірлер: 61
@akayysworld
@akayysworld 2 жыл бұрын
One of the best emacs channels I've ever seen, simple, well edited, and to the point.
@JakeBox0
@JakeBox0 2 жыл бұрын
Thank you very much for the kind comment, I really appreciate that.
@haidermirza3674
@haidermirza3674 2 жыл бұрын
literally is
@GospodinStanoje
@GospodinStanoje 2 жыл бұрын
This is definitely best Emacs channel by far. I've watched almost all of them, but every Emacs video is 1 hour+ long, and it's a live commentary usually. And you cannot see many of the things they are typing. On the other hand your videos are short, neat, have a point and you tell us at the beginning what is it that we are going to learn and you show us how it's done. All of that while providing amazing fonts, colors, etc. I was able to see everything you type without any problem. Maybe the only 'advice', or suggestion would be, that you could tell which keys you are pressing when doing basic stuff. I tend to forget, for example, how to open new window to the right, or just to be completely noob-friendly. Or just turn on the screen-key, that would be awesome. Anyway, even if you keep it this way, it's truly amazing. Great work! Greetings from Serbia. :)
@JakeBox0
@JakeBox0 2 жыл бұрын
Thank you so much for that comment, I really appreciate it. I will 100% take that into consideration and find a good way to do it. I've been apprehensive about putting my keys on screen because my Emacs bindings are custom and likely would not work for you. But we shall see! Thanks again so much. Hello to Serbia from the USA!
@mikepartin571
@mikepartin571 Ай бұрын
Not sure YASnippet gives much to my particular workflow (of course that's just me), but I did want to leave a note of appreciation for the video, it was a good explanation of the package and very informative. I agree with the other commenters on the video style being quite preferable to the majority of emacs related content I've seen. Excellent work, and I look forward to more.
@mikepartin571
@mikepartin571 Ай бұрын
I decided to revisit and just give YASnippet a try. I have to admit it when it's true, I was wrong. Thanks for the intro to the tool.
@realMenta
@realMenta Жыл бұрын
The best emacs channel. Thank you, loving your channel. I'm really glad that I found it.
@JakeBox0
@JakeBox0 Жыл бұрын
Thanks very much. Glad I can help. Let me know if you have any video suggestions.
@abdel-dz
@abdel-dz 2 жыл бұрын
Thank you for the video, I had my snippets written directry to my config file, but I found this extension more flexible, thank you for the tutorial 🙏
@JakeBox0
@JakeBox0 2 жыл бұрын
You are very welcome, thanks for the comment. I'm very glad the video helped, YASnippet is great.
@NdxtremePro
@NdxtremePro 2 жыл бұрын
First, great explanation! Second, YASnippet looks awesome! I could absolutely see someone defining functions by doing this, so they always remember how many options it takes, this is literally better than IDEs. The only downside are there is no automated way to do that for all functions at one time. You could prepackage an SDK with snippets related to it, and get a better experience that something like Dash on OSX.
@caayo5085
@caayo5085 2 жыл бұрын
This is awesome! Been using emacs a lot more for my programming/math courses and these videos have been great! Thank you for making these!
@JakeBox0
@JakeBox0 2 жыл бұрын
Thanks! Glad to hear it helped. Thanks for the nice comment. Happy to take video requests on topics that might help you more.
@caayo5085
@caayo5085 2 жыл бұрын
@@JakeBox0 I don't know if really experiment or dive deep into org-agenda or note taking itself but I've begun to apply a lot of my coursework and notations into both org-agenda and org-mode and (for me) seeing how others use them allows me to make modifications to keep up my work.
@JakeBox0
@JakeBox0 2 жыл бұрын
@@caayo5085 Interesting, thanks for sharing. I've been thinking about doing a "workflow" video though have been hesitant. Maybe I'll get on that. Thanks.
@fetchmasters
@fetchmasters Жыл бұрын
Very nice! Got it up and running in minutes and already using it.
@fabianyanez4105
@fabianyanez4105 2 жыл бұрын
Wow. This is so helpful, I love it and will use this alot!!! Keep making videos 🙃
@neelanshsharma8150
@neelanshsharma8150 Жыл бұрын
appreciate your hard work. Thanks for making this.
@shanknbake
@shanknbake 2 жыл бұрын
Appreciate your videos. Keep them coming!
@JakeBox0
@JakeBox0 2 жыл бұрын
Thank you very much.
@davidgood840
@davidgood840 2 жыл бұрын
Simple and useful. Thanks!
@JakeBox0
@JakeBox0 2 жыл бұрын
Thanks. You're welcome.
@ChristianTietze
@ChristianTietze 2 жыл бұрын
Up next, abbrev-mode please, then a comparison in your workflows 💪
@AndreKhan716
@AndreKhan716 8 ай бұрын
Awesome! Thank you.
@sweetshit4931
@sweetshit4931 Жыл бұрын
This is a great video. This made me config 40 minutes so far.
@Dus3826
@Dus3826 2 жыл бұрын
I really enjoy your short introductions :) when it's within a src block - does it mean I can execute all kind of logic for the snippet ? Like do a python source block and then take the 2 input things, sort them, and paste them ..?
@JakeBox0
@JakeBox0 2 жыл бұрын
Thanks, I try to be brief. I'm not sure I know exactly what you mean, I'll try though - if you have a snippet with a SRC block with code in it, you could run it after it's expanded. You can also include Elisp code inside Snippets, see here: joaotavora.github.io/yasnippet/snippet-development.html#org9804f4c
@heiwiper1601
@heiwiper1601 2 жыл бұрын
Thanks for the video, may I know which theme are you using ?
@JakeBox0
@JakeBox0 2 жыл бұрын
You're welcome. That would be doom-molokai from the doom-themes package.
@larrasket
@larrasket 2 жыл бұрын
Very nice, thanks. Which theme & font are used in this video? Also, how do manage to center in the view in 7:11?😅
@JakeBox0
@JakeBox0 2 жыл бұрын
Theme: I think doom-molokai. One of the doom-themes. Font: Roboto Mono (I think!) Center view: writeroom-mode (using visual-fill-column).
@BobIrving2
@BobIrving2 29 күн бұрын
Just found your channel after watching your keynote at EmacsConf. Loving it! As a noob, I especially like the straightforward part. Question about your Dropbox implementation -- how did you set that up? And do you save all your files right into Dropbox and work on them from there? I'm getting a ThinkPad for emacs use and want to be to access the same files as on my desktop. Thanks again!
@JakeBox0
@JakeBox0 27 күн бұрын
Oh, great! Glad you like it! The Dropbox is pretty simple. I just keep all of my Emacs related stuff in Dropbox. I then make a symlink from an Emacs configuration folder to my home directory. There are apps that help you do this, I use one called Mackup but I believe there are others. It has worked well for me, you just need to symlink once and then any change you make on one device will propagate to the other thanks to Dropbox. Let me know if you have any more questions.
@BobIrving2
@BobIrving2 26 күн бұрын
@@JakeBox0 Thanks for the reply. I've never heard of symlink, but it sounds like that could be my ticket. I'll look for a Linux app that can do that. Would it also work with GDrive? And would that also make the folder accessible on multiple devices, which is what I really want?
@JakeBox0
@JakeBox0 26 күн бұрын
@@BobIrving2 Symlinks can be created with the `ln` command. Google Drive I imagine would work the same, unsure how it looks locally but for my drive I can just cd in to the directory.
@hassantelly
@hassantelly 2 жыл бұрын
very nice and to the point! (I came from reddit, just saying)
@JakeBox0
@JakeBox0 2 жыл бұрын
Thank you! Glad to have you here on KZbin.
@killertigergaming6762
@killertigergaming6762 Жыл бұрын
I want to use yasnippet but I can't figure out how to get completions with corfu sadly
@zenec_
@zenec_ 2 жыл бұрын
Thx god you exist ^^
@JakeBox0
@JakeBox0 2 жыл бұрын
:)
@richardfrangie3518
@richardfrangie3518 2 жыл бұрын
How do I use yasnippet and company together? Company interferes with yasnippet, for example, I'm going to write function and company take it, not the yaspinet template. Another question, is there any template repository? Thanks
@JakeBox0
@JakeBox0 2 жыл бұрын
I think that’s just an issue with the key you are using. Try using a prefix like < or something that company won’t find a match for.
@PaulEmsley
@PaulEmsley Жыл бұрын
Thanks.
@purgatoriprytania5382
@purgatoriprytania5382 Жыл бұрын
How do you get back to editing the fillable snippet fields once the snippet decides that it's 'closed out'? This is my biggest frustration with Yasnippet when using it for longer documents: sometimes-especially if you have fields inside tables, say-it will exit you out of snippet mode and there's no way (that I can discover) to get back. It also seems to mess up undo/redo information.
@JakeBox0
@JakeBox0 Жыл бұрын
I think you can navigate with TAB and S-TAB. joaotavora.github.io/yasnippet/snippet-development.html#org41a4ac7
@purgatoriprytania5382
@purgatoriprytania5382 Жыл бұрын
@@JakeBox0 Cheers. Yep, you can, but once Yas decides that to abort, TAB and S-TAB no longer allow you to navigate between fields, and there's no way to reactivate Yas, except by invoking 'undo,' which doens't always work either.
@BlackberryBoy
@BlackberryBoy 2 жыл бұрын
Hey, very nice videos. 🙂
@JakeBox0
@JakeBox0 2 жыл бұрын
Thanks for the nice comment.
@aaparky7039
@aaparky7039 Жыл бұрын
you beautiful wonderful beastie! Thank you!
@diegonayalazo
@diegonayalazo 2 жыл бұрын
thanks
@Achy1les
@Achy1les 2 жыл бұрын
Outstanding video. But, the black Emacs frame color, although it is a default color for geeks, programmers and the like, does not help much when teaching any subject. For that, there are specialized studies about Pedagogic colours, coloours and teaching. et. al. So, IMHO, please do not use it in your tutorials and also remember to increase the font size, since there are short-sighted people who would love to learn more from your expertise. Thx a lot for sharing your knowledge... I have subscribed
@JakeBox0
@JakeBox0 2 жыл бұрын
Thanks for the comment (and all the others! :). I agree mostly, I try my best to choose colors/sizes that work, and receive feedback when they don't. Re the dark color, I made a video with a white background and that received negative feedback as well, so I guess there's no making everybody happy. I'll keep that in mind though, you're right about contrast. I will try to remember to use themes Prot's modus-themes, which strive for high contrast and accessibility.
@Achy1les
@Achy1les 2 жыл бұрын
@@JakeBox0 "I made a video with a white background and that received negative feedback as well..." Normally this kind of comment comes from geeks and programmers who are fascinated with black colour thinking that this is the hacking world colour, but have never studied or have a formal systematic training in a University to be a teacher. Not everyone who knows a lot in any field is apt to be a true teacher. A true teacher or educator, generally speaking, knows, at least, the basic concepts of the art of teaching... For me, one of the best Emacs series, from the creator of Doom-emacs - whom I think is a very good teacher - prefers to use light colours and bigger fonts to make his tutos. I remember that in one of his videos he explains why... Anyways, thx for answering...
@killertigergaming6762
@killertigergaming6762 Жыл бұрын
@@Achy1les how about no light hurts my eyes and looks worse
@quebecisaac8596
@quebecisaac8596 2 жыл бұрын
Is there a link to the org file in the video?
@JakeBox0
@JakeBox0 2 жыл бұрын
No, sorry, I can add it soon.
@user-yn6ii7ys3u
@user-yn6ii7ys3u 2 жыл бұрын
*n i c e*
@JakeBox0
@JakeBox0 2 жыл бұрын
Thank you! Good to see you here again.
@alexei3366
@alexei3366 2 жыл бұрын
Why you use YaSnippet to generate text? I use keyboard macros for this.
@JakeBox0
@JakeBox0 2 жыл бұрын
I like the customization, organization, and automatically evaluated Elisp. To each their own! Also, why fill up my keyboard with tons of bindings when I can have a simple keycode?
ХОТЯ БЫ КИНОДА 2 - официальный фильм
1:35:34
ХОТЯ БЫ В КИНО
Рет қаралды 2,1 МЛН
КАХА и Джин 2
00:36
К-Media
Рет қаралды 3,7 МЛН
Can You Draw The PERFECT Circle?
00:57
Stokes Twins
Рет қаралды 88 МЛН
La final estuvo difícil
00:34
Juan De Dios Pantoja
Рет қаралды 26 МЛН
Wow AirPods
0:17
ARGEN
Рет қаралды 1,2 МЛН
Very Best And Good Price Smart Phone
0:42
SDC Editing Zone 9K
Рет қаралды 217 М.
Introducing GPT-4o
26:13
OpenAI
Рет қаралды 4,4 МЛН