Vim Org Mode: Can This Really Add Emacs Org Mode To Vim

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
one of the things that people say is great about emacs is aug mode which is a really powerful mode for note taking document structuring as well as a bunch of other things as well but what if i said that there was a way to replicate this behavior inside of vim and this plugin has been a work in progress for a very very long time and is nowhere near complete but it still has a lot of features and this plugin is called vim org mode now there are a couple of different plugins that try to do this but the one we're going to be looking at today is vim org mode so let's actually go and have a look at how this works so to actually open up an org file what we have to do is name the file anything.org so it could be text.org test.org notes.org anything.org now i don't know if it works the same way in emacs that you have to name the file in this specific way but the way it works inside of vim is by naming it like this now if you're planning to just use this for note taking it's going to work in a fairly similar fashion to something like vim wiki now obviously vim wiki is going to be a much more complete experience but if you want an org mode like experience inside of vim this is basically as close as you're going to get so let's actually go and test this out and see what it can do now obviously this is a blank file so there's going to be nothing in it but let's add some headings to it so a single level heading is done with a single asterisk a double level heading is done with two asterisks and then a triple level heading is done with three asterisks now depending on your theme it may go and highlight all of the asterisks it may not mine doesn't seem to do so but it is actually treating them as the correct level so if i go and leave insert mode now as you can see it went and actually closed those folds so one of the big things about working with org mode is it heavily heavily uses folds to really compress the size of the document so if you haven't used folds before in vm we can go and open this up with z o for open so z o that opens that up z c we'll go and close it so z o z c i'll go and open up screen key just so it's a bit easier for you guys to see so open that back up and let's actually add a another heading at the same level as this one here so obviously we can just write out the extra asterisks we need and go and create a new heading like that but there might be an easier way to do this so what we can do instead is we actually have two key bindings we can work with we can do backslash hn and that will create a new heading below at the same level or we can do backslash h capital n that will create a new heading above now there is another one but this one i don't know how it works and it seems to break the document fairly frequently so backslash hh as you can see that deleted everything it's supposed to go and actually create a new heading below but it seems to just delete the entire document so i wouldn't recommend touching that one feel free to use hn and h capital m though so another thing that is useful about org mode is being able to really easily insert dates so dates aren't actually being used properly in this but i'll get a bit more into that a bit later for now let's actually go insert a new date so if i do local leader a that will then prompt us to enter a date now by default it's going to try to insert whatever today's date is but we can actually go and modify that so let's just say we want to set it to like 2019-07 dash i know zero nine and leave the day entry open and i think it's gonna try to autofill that day for us as you can see it then goes and works out whatever that day was so if instead we wanted to go and use today's date we can just do backslash sa or local leader sa and then just press enter and use whatever it's going to try to autofill for us so in this case that is 2020 08 10 and that is a monday so let's just get rid of these dates because we don't actually need them so those dates were something called an active date so the way that we go and insert an inactive date is by doing backslash s i so i for inactive a for active so as with the one before we can just press enter and insert today's date or we can actually go and modify this so i'm just going to press enter now and as you see this has gone inserted and inactive date now if you actually have the vim calendar plug-in you can do local leader pa and local leader pi to actually go and insert dates from your calendar now i haven't actually got that plugin installed so i can't actually do that and you can also modify a date with control a and control x if you have the speed dating plugin but i don't have that one installed either so let's say that you have your headings and then you realize that something is at the wrong level so let's say that this heading down here at the third level we actually wanted this to be at the second level now obviously we can just go and modify this but that's not potentially the easiest way to do it so what we can do instead is we can actually go and promote this heading by doing left angle bracket left angle bracket and that will then go and promote it to the same level as the one above it or we can go and demote it by doing right angle bracket right angle bracket now on some parts of the document this might behave really weirdly so for level one headings i've noticed that sometimes weird things might happen so if i go and demote this one as you can see it goes and closes all of the folds for some reason i don't know why it does that it does actually go and work but for some reason it messed with my folds now we can also go and promote this and this does another weird thing as well so if we promote this left angle racket left angle bracket it went and copied a part of the document for some reason i don't know why it does that with level one headings it might be a problem with the way the tree is structured but i have noticed that it does occasionally do weird things like that now we can also go and promote everything inside of a tree so if i do right angle bracket ar that demotes everything if i do left angle bracket ar that promotes everything so left angle bracket ar that will then bring it up to the same level as these headings that are at heading level one and its child is going to be at heading level two so instead of using z o and z c we can also go and cycle through the visibility levels of the folds as well so if i just press tab right now what it's going to do is go and hide everything that is a child of this bit right here so it's gonna hide this and it's gonna hide this okay so if i press tab again what it's going to show is we have a fold that was hidden inside of this and if i press it now as you can see this goes and shows everything and obviously we can also go in the opposite direction by doing shift tab so shift tab will show us we have one thing hidden in this and if i shift tab again what that does is goes and hides everything okay so let's say you have a really big document with a bunch of related sections and now obviously you could go and manually search for each of these different headings yourself but for some things that might be a little bit annoying obviously if they aren't the exact same text like i have right now it will be a little bit harder than it otherwise would be so let's say that you instead wanted to add some sort of method to easily jump to that heading well we can do that with something called a tag so if i do backslash st what that does is lets us add a tag to a heading so let's add the tag i don't know uh doc so off to the right here as you can see there is this little thing off to the side so let's actually scroll down the document and do backslash ft and then search for the tag doc now what that's going to do is let us cycle between every single heading that has been tagged with the tag doc so let's go and add that to a second one so this one right here so backslash st and backslash st and add the tag doc i don't know why it didn't work the first time and let's do backslash ft now and what that's going to let us do is jump directly to the headings that have been tagged in that way so this is just an easier way to move around the document than having to obviously you know manually search for everything because sometimes you might actually not know exactly what that heading was now you could always do another thing like add in your own sort of tagging system we have like dash this is doc and then like dash this is dock as well but this is a way that's built into org mode that you could actually use instead now this wouldn't be a very good system for taking notes if it didn't have a way to do lists so if we do dash and then put square brackets and put a space then that is basically going to be a checkbox list we can do a plain list by just not including the checkbox we can also do it with a plus so we can do just a list there or we can do plus with the checkbox and that will work like that now in the documentation also says that we can do a list like this but that doesn't work because this is going to be a heading there's no way to distinguish this and this so i don't know why it shows that this is a list it's not i don't know why it's included in the docs it is just a heading to do it like this now we can also do numbered lists so these are going to just be unordered lists but we can do a numbered list by doing one dot and then put square brackets for a checkbox list or we can do one dot without the checkbox and just have a numbered list now it also shows that we can do one without the dot but that obviously doesn't work because there's no way to distinguish this from regular text so i don't know why that is listed either so if you want to change the status of a text box that can just be done with local leader cc now sometimes when you lose focus of the document it stops working for some reason i did the exact same thing just then and it worked i don't know what the deal is with that it could just be a general vim problem it could be a problem with the plug-in i'm not entirely sure but sometimes it might just go and run the regular binding without the local leader key so just keep that in mind now one thing you can also do along with this is if you go up to a heading and you add in square brackets and then you either put in a slash or a percent sign uh percent sign wherever that is on my keyboard what this is going to do is actually keep track of how much of the list you've actually completed so right now it doesn't show anything but let's go and do backslash cc and as you can see it now says i've done zero percent of the list so from this point on as i actually go and update the list it's going to update this number so backslash cc 50 done to go down to this one backslash cc 100 done and obviously you can do this in any order and if you add new list items so let's add in this one and backslash cc now as you can see it went updated to 66 because this time there is three items in the list rather than being two items and if you want to actually go and create a new list item rather than just copying one basically if you just press enter on any of the lines that has a list on it what it's going to do is continue that same sort of list so in this case it created a new list item that was plus with a checkbox on it but if i go and create it from this point right here what that's going to do is create a plain list using a dash and if we do it from this point it's going to do a plain list using a plus so obviously we can have this percentage of the work we've done of a checklist but let's say there isn't an explicit checklist and we just want to say that something needs to be in the to do state well if we go and select a heading what we can do is a local leader ct and that adds the word to do to it so that means this is in the to do state and if we do backslash ct again or locally leader ct that will then cycle it to the done state and then local leader ct again and that will cycle it back to the regular state so local leader ct will cycle you through the to do states now this percentage thing right here is supposed to work with to do states as well but i haven't noticed it actually working so if i just go and add the percentage sign here that should go and update this number right here it should say you're at x percentage of the entire list but it doesn't seem to be working right now i don't know why that's not working once again the documentation says this should be working but there's a couple of things throughout the documentation that aren't entirely clear and i'll get to that in just a moment one such item is with global agendas so a global agenda is basically going to look at a specific file or a specific folder and then take all of the dates and then stick it into a special buffer that says okay this is everything you need to do for this week or this is all of the to do's that you have set right now but the global agenda doesn't work so if i do backslash c a c-a-a i have now frozen vim there's nothing i can do at this point my vin buffet is now frozen i can leave this for 5 minutes 10 minutes 20 minutes it's still going to be frozen because it doesn't actually work so let's actually go and actually i can't quit out of this so let's just go quit my terminal and open that again so let's go back into test.org and if i do the same thing for global to do's so backslash c a t i don't know why it's frozen if it couldn't find the file it would say hey the file doesn't exist so it's clearly looking for a file and even though the file is there it's just freezing and it's not because the file is massive either i have a single file there so for whatever reason this doesn't seem to be working and it will freeze vim every single time i don't know why it does that it's just really annoying to deal with though however we don't have all hope lost we can still do local to do's so if i go back into org mode and i do backslash c a capital t as you can see that will then show us all the to-do's in our current file and luckily it also works for the weekly agenda as well so if i do backslash c a capital a as you can see it shows all the dates in the current week now when i said the inactive dates didn't actually work i didn't realize they actually worked in a local file so if i just go and add one now so backslash s i and just add a date here so this one here is inactive this one is active if i do backslash c a at capital a now we need to make sure we save the file first it doesn't go and save that when we try to open up that new buffer so backslash c a capital a as you can see it only shows the active date it doesn't show the inactive date so this is by no means everything this plugin can do but this is we start to get into a bit of a weird situation so let's have a look at the help page for org mode so if i just go to that page and then i search for not yet implemented now if you're doing documentation for anything please don't write naughty implemented in any of your documentation because it's going to get really confusing and in this it's in the documentation 43 times so there's a bunch of different bindings and a bunch of different features that are labeled with not yet implemented so it's really hard to go and actually read this documentation and work out what this can actually do so if you just go and cycle through this you'll see things like tables and all your implemented footnotes not your implemented internal links not implemented handling links not yet implemented and a bunch of other stuff as well which are in the regular version of org mode but for some reason they decided to include it in the documentation for vim org mode even though it doesn't actually work now i don't know why anyone would want to do that and if you're writing documentation for any application out there please don't do that or i will probably submit an issue about it because that shouldn't be in your documentation if it's not yet implemented don't bother listing it because if it's listed it will confuse someone and i spent way too much time not realizing that a lot of this stuff wasn't implemented yet when if it just wasn't in the documentation i wouldn't even be thinking about it so i haven't used org mode myself but i imagine it's going to be fairly similar to the experience of using say vim emulation in visual studio code it's better than having nothing at all but if you really want that proper experience you're going to have to use emacs to use org mode and if you want to have those proper vim key support you're going to have to use vim if you want a good note-taking system inside of vim i would highly highly suggest using vimwiki you don't have to go and use org mode just because you're using org mode inside of emacs if you want good note taking in vim vimwiki is the way to go but if you do want this feature subset and you want this weird documentation i guess vim org mode might be fine to use as i said i wouldn't really recommend this unless you're some really weird person who wants to use vim as your text editor but you still are really attached to using org mode i imagine there are better ways to get this experience like using the vim keys through like doom emacs or something like that inside of emacs that's probably going to be better than whatever you're getting here but if you do want to use this then it is available for you to use so i think that is pretty much everything for me but before i go i would like to thank my supporters so a special thank you to joao kim kobini on craig nathan andrew montezar joseph peter d wrote tony donald john mikel spaghettis and silva if you want to go watch my podcast where it's just all rambling nonsense that is available on the tech over t youtube channel and the library channel for the video version and also anywhere you listen to audio podcasts for the audio version also remember to go check out this channel on library bit to bit shoot and a bunch of other platforms as well and if you want to support the channel without paying any extra money to me then use my amazon affiliate links and i get a bit of kickback from just anything else from just anything you purchase out there so you can purchase i don't know uh some twinings australian afternoon tea or you could purchase a phone and i get a bit of a kickback for that so i think that is pretty much everything for me and i'm out [Music] [Applause] [Music] you
Info
Channel: Brodie Robertson
Views: 25,559
Rating: undefined out of 5
Keywords: brodie robertson, brodie robertson linux, vim, emacs, vim org mode, vim org mode tutorial, emacs org mode, emacs org mode tutorial, emacs vs vim, vim vs emacs, vim org mode plugin, vim plugin org mode, brodie robertson vim, brodie robertson vim plugins, linux, vim plugins, vim plugin, vim tutorial, vim emacs, emacs vim, best vim plugins, best vim plugins 2020, arch linux, org mode, org mode vim, org mode vim plugin, org mode in vim, neovim, neovim plugin, neovim org mode
Id: lQ0wOGEB9co
Channel Id: undefined
Length: 18min 48sec (1128 seconds)
Published: Tue Aug 18 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.