# [[Text expansion in Obsidian with Espanso]]
## The video
Related:: ""
Related:: "[[Espanso]]"
<iframe width="560" height="315" src="https://www.youtube.com/embed/zoeQ5yNoXsY" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
## Timestamps
[00:00](https://www.youtube.com/watch?v=zoeQ5yNoXsY&t=0s) Intro
[00:41](https://www.youtube.com/watch?v=zoeQ5yNoXsY&t=41s) What is Espanso?
[02:12](https://www.youtube.com/watch?v=zoeQ5yNoXsY&t=132s) Downloading and setting up Espanso
[04:09](https://www.youtube.com/watch?v=zoeQ5yNoXsY&t=249s) 1. Basic match [05:02](https://www.youtube.com/watch?v=zoeQ5yNoXsY&t=302s) My social links
[06:33](https://www.youtube.com/watch?v=zoeQ5yNoXsY&t=393s) Affiliate links [08:04](https://www.youtube.com/watch?v=zoeQ5yNoXsY&t=484s) Obsidian-specific shortcuts
[10:22](https://www.youtube.com/watch?v=zoeQ5yNoXsY&t=622s) Canned responses
[11:34](https://www.youtube.com/watch?v=zoeQ5yNoXsY&t=694s) 2. Extensions [12:51](https://www.youtube.com/watch?v=zoeQ5yNoXsY&t=771s) 3. Forms
[13:13](https://www.youtube.com/watch?v=zoeQ5yNoXsY&t=793s) 4. Regex triggers
[16:17](https://www.youtube.com/watch?v=zoeQ5yNoXsY&t=977s) Text expansion in Obsidian
## Transcript
- Like many of us, I do a lot of typing in my daily life. I work remotely, so I actually type to my colleagues more than I talk to them. I've lived in a few countries so I maintain many relationships with friends and family that I've left behind primarily through text or chat messages. And as you may have noticed in some of my videos I've learned to use a lot of shortcuts and tricks to make all of that typing a little less tedious. In this video, I'm gonna talk to you about the open source app that I use to go beyond just shortcuts and actually expand texts that I find myself typing out frequently in Obsidian and elsewhere. That app is called Espanso. Espanso is a text expansion app that has a lot going for it. This isn't sponsored and I don't even have an affiliate link for it. The developer doesn't know I exist. I just really love this app after having tried many other apps. It is a free open source app that you can download right now, it supports Linux, windows and MacOS. And the thing that I love most about it is that all of the configuration for it and all the settings are held in plain text files, which means that it fits right into my workflows because I already use Git and GitHub in some cases where I need remote repositories to track everything, including my Obsidian notes. I like to be able to version control them and it also acts as kind of a layer of backup in case I need to revert some changes, if that doesn't mean anything to you. Suffice it to say that all of the settings that are done in this app are just stored in like a text file that you can edit and you can send that text file to somebody else, for example, and then they have all of your expansion shortcuts and triggers and all of that. So it's just a really clean way of being able to move something between systems maybe. I use a few laptops and a few operating systems so it's really cool that they all work off of the same configuration. First, you'll need to follow the download instructions for your operating system. There are a few different options so I'm just going to leave a link here and then you can come back when you're done downloading it. My primary operating system is macOS so I just had to do brew tap Espanso slash Espanso and then I did brew install Espanso on the terminal. After that, on the terminal you'll just have to do Espanso path, and that's just gonna show you where on your machine the Espanso configuration files are held. So in my case it's saying that it's in the default directory for MacOS. Now I could just go to this Folder path in Finder and then pretty much use any text editor to open it up but I'm gonna open it in my IDE of choice, which is VS code. So this is what that directory looks like. There are going to be two folders, config and match, config is where you'll have some of the configuration and settings that will apply to everything. So if you click on that, there are some default options that you can feel free to toggle on or off or enable. I didn't really change any of these but maybe you will want to. So just as an example, you can do all sorts of things like have a toggle key to enable and disable Espanso but I don't really use that. And then here in the match Folder is where you're going to have all of the files and the actual expansion shortcuts that you want to set up this gitignore file is something that I set up. It's because there are some things that I don't want to be pushing to the remote repository in particular. I do have one private configuration file that I don't really need to be publishing. However, this does mean that I am pushing this to my remote repository on GitHub if you use that. So I'm going to leave a link in the description or you can click up there and you can copy a lot of my shortcuts. In Espanso terminology, a match is a pair of two things a trigger and unexpected output. Espanso has a few types of matches. The first is a basic one that just consists of a trigger and a replacement. So for example, you could type something like yday and then you could have Espanso replace that with yesterday. The trigger is usually a combination of keystrokes. It could be a word or it could be really anything that you want it to be. When you install Espanso you're only going to have this base.yml file and you can really put everything in here. However, I just wanted to break it up into multiple files because I have a lot of these things defined and so I just thought it would be a little less unwieldy to be able to categorize them in some way. You don't have to though. So let me show you what some of my stuff looks like. For example, in the NVDH one this is all of my contact details basically. So you know I have one for my name. So for each one of these I'm setting a trigger and a replacement phrase, for the trigger. I like to use the semicolon. That's just so that maybe I want to type NVDH in some other context and it's not going to be replaced. But having the semicolon is a trigger for Espanso to know that it should replace this whole phrase including the semicolon with my name. So if I opened up Obsidian, this is how that looks. But this will work in any app really just that I have Obsidian handy. So I just typed in Semicolon NVDH and the whole thing was replaced by Espanso with my full name. I have a bunch of other ones like I do me.e which is going to be replaced by my email or me.gh which is replaced by my GitHub link and so on. These are all of the things that I might conceivably want to tell people about. That way I don't have to remember links and I don't have to bookmark them and I also don't have to type them up. I just have to create my own way of remembering these things easily. So in this case it's always semicolon me dot and then whatever social media network I want to link for example like Twitter or what I'm using now is macedon. The basic type of match is actually what I use the most. So let me show you a few more of those now. So one of these yaml files is just for affiliate links because I have a lot of products that I use a lot and I'm such a big fan of that. I have gotten affiliate links so that when I share them with you usually you get some sort of benefit and I also get some benefit or commission. So just to keep track of all of them, I do have them here. That way when somebody asks me like, oh what was that awesome app that you used to automatically tag things using AI, well that's Napkin. So I would then like if it's an Obsidian or Discord or whatever, I could just type the semicolon and then aff, short for affiliate, dot Napkin and that is replaced with my actual Napkin affiliate link. I also have some emojis. These are the ones that I use quite a bit. So I've got for example, flags. These are countries whose flags that I use a lot for one reason or another. Yes, I know that in most apps you can just like click an emoji icon or something, but this is just a way that I can use in any app so I don't even have to worry about, you know how to get to that menu in every app. This is the one I showed you earlier with all of my contact details. So in the videos section here, I'm just putting the link to a video for Anuppuccin because people are always asking me what theme of Obsidian I use. Right now it's Anuppuccin and I'm not really changing much from it. Sometimes I change like the colors or something but for the most part it's Anuppuccin. I also have some Obsidian specific stuff. So first of all, I type the word Obsidian a lot so now I just have to type, you know semicolon obs and that's like you know formatted and that's capitalized and everything for me. I use it for links. This is the link to the Obsidian community page which has like the link to Discord and the community forum and stuff like that 'cause people ask me where to go and I refer them to Obsidian when I don't know the answer. So I've also got some very particular things here. These are things that are specific to my use case. So I don't know if it's really going to be useful for you but at the very least I'm showing you how you could kind of customize it as well. So in this case I have one for frontmatter for items in particular, yes I could put this in Obsidian but I think in this particular case I was doing a search and replace I believe, and I was doing it within my ID and not within Obsidian. So I wanted to be able to do it from other apps. This is like specific markdown format for an image that I use a lot in Obsidian because it's the logo of my team. Now this matches for leaflet. This is like, I never remember all of this so I just have an Espanso match that automatically puts in leaflet. So let me show you what that looks like in Obsidian when I use it I just have to type, you know the semicolon and then leaf and it has a map already. Then I could just choose the image that I want to use Obsidian leaflet with and then change some of these. But at least the basic format is already there and I don't have to mess around with it or remember it. There are some things here specifically for Pathfinder stat block usage. Oh, I also use timestamp actually sometimes when I'm doing a dev vlog or basically when I'm trying to figure out something and I wanna track how I'm learning I just use bullet points and then I use semicolon ts to put in the timestamp and it'll say oh I tried this but it didn't work, here's why. And then a link, you know, to some Stack overflow page that I found that explains why what I tried didn't work. So I use timestamp a lot for that. I also have one that's just for replies. So this is like when I'm writing an email or answering comments on YouTube or elsewhere and these are the things that I say a lot. I find this really useful because there are some things like hi there or my name or some things like that. But I also have like a section here just for different ways to say thank you. There's like thanks for watching or I really appreciate it or I'm happy you like my videos, they all start with a semicolon ty dot and then I can say, you know support or thank you so much or sweet or whatever. I also have you're welcome. Same thing for that I have some for sorry and the thing that's really been helping me is this section which is the no section. I find it difficult to say no and I find it even more difficult to say no when I have to think about it and phrase it and like I don't wanna be mean but sometimes I do have to say no rather than get into the cycle where I don't wanna say no so I don't answer at all, which is you know, even ruder. I actually have just started writing down the different ways or different reasons that I would say no. The second type of match is extensions which is a catch-all term for a bunch of different things. They can be dates or they can be something that's already on your clipboard. So you could copy something and then have Espanso do something with that copied text. Once you type a phrase, you could have a bunch of choices and then have Espanso choose between them. You could randomize, what Espanso is going to come up with based on certain criteria or you can even run a script. Espanso can do a lot more than I'm actually using it for. So I'm just gonna show you what I do use it for. One of the most common matches that I actually use is this date one. So it still has a trigger but you'll see something different in the value for the replace parameter there are these squiggly brackets which is going to be taking the value of my date. I am setting the date format here. I use this a lot in Obsidian. So if I go back to that, I just type semicolon date and it brings in today's date because it's June the sixth. I also do something for Obsidian where I do today instead. And it's the same thing it's today's date except it's in brackets. That's something that's very Obsidian specific. A third type of match that Espanso supports is form. So you can actually write out like a full letter or something and then maybe you can have a variable for the name or you know, just certain things like that within the text of the form that you can change. Espanso can do that. I don't actually use that though so I'm gonna skip right over that. And a fourth type of Espanso match is regex triggers. Regex is regular expressions, which is just a fancy way of describing the pattern of something when you don't know exactly what's going to be there. Let me show you what that means. One of the things that I have to say no to a lot is sponsorships. I don't have anything against sponsorships I've had them before. However, I'm really picky about what I talk about in general. I have a whole ethics statement to talk about my stance on this, but I feel very strongly about authenticity which means that I say no to seriously like 99.999% of people who have products that may or may not be awesome but I'm just not really quite ready to endorse. So I do have a specific match for it and you'll see that instead of the trigger. And then replace format, I have regex and replace. What this means is that whatever I type here is going to be the product name and that is going to be replaced here where I have product in these curly braces. So let me show you what that looks like. For example, let's pretend that this is in an email or a comment. I would just type the semicolon, no spawns and then I would type in the product name. So let's just say your product here and now what happened is that whatever I typed within those parentheses which is in this case, "your product here" was replaced within the body of the text. So now it says, however I don't believe your product here is a good fit for my audience. And then there's a little bit of an explanation. I have another similar one where I talk about tools. This is specifically for like PKM tools 'cause there's so many PKM apps and I get a lot of them reaching out to me. I'm pretty particular now that I have Obsidian. My standards are pretty high for what I'll even look at and I don't have the time to look at something that only meets some of my requirements even if it would be useful for others who have less stringent requirements. So what I would do is I have one for tools and I'll put PKM app which I hope doesn't exist and it's the same thing but it'll say I'm not too familiar with PKM app. And then it says I have a list of requirements that I look for and I am also publishing that list within my notes. And that way people know like, oh this isn't something that she just does for us. This is actually something that she checks everything against, so and then I say these are the things I'm looking for, would you mind letting me know which ones it does and doesn't do? And that way I put it back on them and I don't have to do any of the research. And then they can say like, oh yeah we do all of them, which has never happened. It's more likely that they'll tick some of the boxes and not others. So you might be wondering why am I not doing this in Obsidian? Because there are actually alternatives to using a separate app like Espanso, for starters there are actually already Obsidian plugins for this. I know there's text expander text snippets and jelly snippets. I don't use any of those. I've tried all of them but I don't use them on a daily basis. And the reason that I don't use those plugins is that they're limited in scope to Obsidian only. So if I want to respond to a message on YouTube or on email or Macedon or something, then I'm not going to be able to use Obsidian specific shortcuts in those other apps. Espanso just works on basically anything that you can type on, on your computer and so I find it a lot more useful. Obsidian is good at a lot of things already so I would rather have a separate app that does text expansion really well than try to use text expansion within the limited scope of Obsidian only. Now I have also tried other separate text expansion apps including Text Expander, which I used for years but it's not open source and it's also not free and it also has a UI, so it requires you to get to know that UI and you always have to have that running. I really like the simplicity of just needing to save a text file in Espanso and then all the configuration and all of those matches already work. I also like that I can create my own organization so I could have everything in one huge file and just have like different sections of matches or like you saw, I can have different files entirely and organize them that way. I love that I can push them out to GitHub so that you can see it as well. And maybe you can take some inspiration from how I've set up my stuff. Espanso was created by a developer named Federico just as a passion project. He's not making money off of it, he's not selling it. So if you do like Espanso then maybe you could consider donating to him on this link. Having canned responses helps me answer questions more thoroughly or maybe more politely than I otherwise would have, and in some cases it enables me to say no where I might have said maybe or worse, yes. Text expansion is an essential part of the way that I work and play because it helps me focus on the things that matter by automating the things that don't. And Espanso as a free open source text expansion tool that saves config in plain text files is my current text expansion tool of choice. Now the text expansions that I showed you are for the most part pretty basic but sometimes I need something a little bit more complex. If you'd like to see that, then check out this video where I show you how to use Quick Add in Obsidian to create my own macros. Thanks for watching, agyaman la unay!