5 Tips to Make Vim Better for Writing

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
if i had to choose i would say that vim is probably my favorite application on linux it's the one that i spend a lot of my time in and that's probably always been the case but for the last couple weeks it's been even more true because about two weeks ago i decided i was going to move all of my writing from libreoffice into them now for those of you who don't know my main job my daily gig is that i edit a historical magazine i used to be mostly a writer and now i spend most of my days editing other people's junk that means that most of my time is actually spent in google docs but for those brief times that i can go through and do my own writing or whatever i want to be in them like i said i used to use libreoffice but i really liked them and i wanted to just see if i could use them as my actual text editor now out of the box vim is not the most friendly to actual writing like it does really well as a code editor like out of the box there's not a lot you have to do enable syntax and you you're pretty much ready to go now obviously you can make it a lot better but out of the box it's a much better code editor than it is at editing a 10 000 word document it just is now there are several things you can do and what i wanted to do today was share with you several tips that i've learned over the last two weeks that is that has made them better for writing so that's what we're going to do let's go ahead and jump in here we are in just a regular boilerplate document it's lowering some stuff don't worry about the words it doesn't matter and ignore the underlying stuff i'll talk about that in a few minutes the first tip i have for you is that one of the biggest things i have a problem with is that i get distracted very easily i get i like shiny things and if i get distracted by something shiny or interesting my intention is diverted it's just the nature of the way i work so something that would help me with that when i'm writing is a distraction free writing environment and well it's better to have a third party tool that will actually like close off your browser so that you can't go to youtube or facebook or whatever when you're in a writing tool you want it to be as distraction free as possible now there's not a ton in them that's going to distract you it's not like libreoffice where there's tons of buttons all over the place but it can it can get more distraction free than this and that's where goyo and limelight come in so if you have goyo and limelight installed they're plugins you can enter goyo mode with a key binding and look this is goio now it doesn't look exactly like this unless you also have limelight installed so goyo just takes all the text and puts it in the center so this would be your distraction free mode now what limelight does and you can and you can see it right on screen is that it highlights the paragraph or line that the cursor is on so if i move to the next line it highlights the next line if i go to the next line it highlights the next line and all the lines that aren't that don't have the cursor in them are kind of shaded in the background so that your focus is only on the place where your cursor is and that's really helpful because it just kind of focuses your attention on wherever you're working that's go you in limelight those are probably my two favorite them plugins honestly they're the ones that i've been using the most lately for this at least and it's just made my writing at least a little bit more enjoyable and allowed me to focus just a little bit more i still get distracted by youtube it doesn't help with that unfortunately so let's go ahead and move on to the next one so the next one is that i highly encourage you if you're going to do this to write everything in markdown because if you write things in markdown it allows you to add text effects to your writing so for example you can do things like this if you do hashtag headline that's a h2 tag so it would allow you to add things like chapter markers if you're writing a novel or something or whatever i mean you go through and do that you can also go through and do bold so that'd be star star bold star star or asterix i guess is what you say and then italics is one asterix and then italic and then another asterisk i can't say that word that word is just beyond me i can't say it anyways that'd be bold in a talk you can also do things like lists so that'd be just one star and then it would allow you to do another one so list and then list and then list you can also add images if you wanted to now obviously it's not going to show an image in the terminal but you could add a add a of an image here if you wanted to you could also add links there that's possible there's just a ton of stuff you can do with markdown that you wouldn't be able to do if you weren't going to use the markdown now by default them does have some markdown highlighting it's not perfect so what i did is went through and installed a markdown syntax plug-in called them dash markdown so you can go through and install that i'll leave a link to that in the video description along with the other the other plugins that i've talked about and that will go through and make sure that all of your markdown has highlighting that then by default doesn't always catch then markdown also goes through as you saw above is it goes through and adds that extra star whenever you're in a list mode so it just will continue to do that until you exit it will also go through and translate your stuff all automatically to both so once you once i leave this or i guess in this case it's italics which is funny uh i would if you leave this it will not show the stars right it will not show the asterisks and same thing for the italics and bold obviously both of those do the exact same thing that's really cool so that's your documents don't get messy they don't have just a ton of asterisks and all that stuff just piling up on top of each other it just appears bold or italics so that is markdown i highly recommend you do that it will also allow you to use tools like pandoc to translate those this text into another format and it makes it easier for other formats to realize kind of what you're doing so that you can have chapter markers or whatever you need to do markdown helps a lot with that so i haven't actually got into that yet i haven't started using pandaq i've just been uploading the markdown stuff to where i need to upload it to but i plan on doing some more research into pandoc and also latex i don't think i'm going to need latex i think that's just more of a scientific tool than what i need but i could be wrong i don't actually know anything about it so markdown is probably the thing i've been spending most of my time refamiliarizing myself with because i learned down in college and believe it or not i've been out of college now for 11 years so so it's been a long time since i learned markdowns so i've had to go through and try to re-familiarize myself with it that's why i keep messing up the two stars sl versus one star thing and i know i keep calling them stars i know that's not what they're called i can't say the other word it's just beyond me anyways so that is the second tip the third one is something that i found i really need now i know there are ways to go through and set it up so that you can navigate this as a paragraph so that i could go through and go down instead of when i go down to the next thing it doesn't it goes down to the next line which because technically these are just two lines instead of 20 lines which is what they look like right these are just two lines of vin that's how them treats them so i know that there are ways where i can treat this as six lines and then use the vim keys to just go down i know there's even built-in bindings for that stuff i just haven't learned them yet but sometimes you need to go to the next sentence or the previous sentence now obviously you can go forward and backwards you can go forward and back letters those things everybody's familiar with who uses vim but if you're going to be writing sentences a lot you need to be able to jump through sentences really quick so if you use the parentheses you can go forward in backward sentence so this the close parenthesis goes forward in time or is forward in your document by sentences so i'm here here i am jumping between sentences forward the open parenthesis goes backwards and that has proven really really useful once i decide to go through and learn what it is that i need to you to do in order to go down actual lines instead of vim lines uh maybe this won't be as useful but for now when i have a whole paragraph of text which is actually just a line in them going through and using the parentheses to jump back and forth between sentences is much easier than using the vim keys to go letter by letter you know what i mean so that is the next one on the list is that you should turn spell checking on and you should learn how to use it so in order to turn spell checking on you need to go into your vim rc or or if you're using nvm you need to go into your init.them so we're going to go into my enven folder we're going to vim into init.vim and then i'm going to go into the general section and what you need to do in order to turn spell check on is this line right here so you need to set space spell space spell lang equals en understory us now you can go through and change what language that is if you speak a different language but for me i'm speaking american so so that's the one that i need if you i believe them supports pretty much any language that the linux system does but i could be wrong about that i i'm completely naive when it comes to other languages other than spanish so i know you could go through and do spanish i know there's italian i know there's french so there's obviously a lot of languages that you can use uh but anyways you just turn that on and then you you reload your vmrc file or you're in that vm in my case it's space s in order to reload the the configuration file and then when you're back here in your document and you've loaded up your document again you'll have to reload any documents you had to open had open but you'll see that there's a whole bunch of words here that are underlined that's not normal that just means that these lines aren't in the english dictionary so i'm pretty sure they're latin words obviously but that just means that they're not in the english dictionary so if you have a misspelling let's just choose a word here at random and you want to correct it let's just say you want to correct it so if we hit z equals then we'll go through and give us a list of what it thinks that word should be and if you wanted to change it you just hit the number that you want to replace it with and hit enter and it will replace that word with the word that you selected if it's not in the list that they give you just hit enter and go through and retype the word you can move back and forth between misspellings so let's say you're all done writing your document and you want to go through and do a final spell check and you have several misspelled words in order to go back and forth between misspelled words you use bracket s s so bracket s so that's gonna be open bracket s goes backwards as you can see i'm going backwards between misspelled words now this doesn't look like much because every word here is misspelled but if you had like just a few misspelled words it actually jumped forward faster or backwards faster in your document now in order to go the other direction you need to use the other bracket and then s so that's that goes backwards and forwards between misspelled words and then if you want to again if you wanted to change that word if you wanted to see the suggestions for that particular word z equals will give you the suggestions that them has for you you can then select the one that is correct if it's there and hit enter and it will replace it so that is spell checking and honestly it's it's not the best spell checker in the world but it's way better than nothing so it's not going to catch everything i highly recommend you go through and actually proofread your stuff but i mean that's basic simple writing stuff so i mean i assume you're going to do that anyways so don't assume that it's perfect but it still is going to catch the obvious stuff which is better than nothing now one last thing on this let's just say you have a word that you happen to know is correct like you know it's spelled right but them thinks that it's not so let's just say for i mean just for example let's just say that this word here is spelled correctly but it says it's not spelled correctly you can go through and add this to your dictionary using z g and it will add that to your dictionary so that it knows now not to add that to your misspelled words and that's also really helpful because a lot of times you write words that aren't in the english dictionary or in this dictionary at least and you need to add those things specifically things like names so that's really helpful so that is spelling okay so the last one is equally important for me now a lot of times back when i was freelancing i had to know the exact word count of the document that i was doing not only did i need to submit a certain amount of words because i got paid by the word but also because i wanted to keep track of how close i was to my whatever my writing goal was and the thing about vim is that it does have built in word count ability so you can go through and hit g control g and down here at the bottom if you can see this it'll actually tell you how many words there are in your document so in this case there's 1713. but that's a pain in the butt right you don't want to have to go through and do g control g all the time now you can go through and rebind that to it so it's just a letter if you want to or if you use something like airline you can go through and eventually screen key will get out of here right it'll actually step here longer now because i press the key there it goes anyways down here at the bottom you'll see i actually have the word count now let me just look at the camera make sure that you can actually see this yeah you should be able to see this down here at the bottom underneath my face you'll see it says it has 1713 words now that's not something that happens by default it doesn't happen my magic you have to go through and actually set that up so if we go to a different tag here where we had oh that's the wrong one here there we go that's the right tag when you use as many workspaces as i do sometimes you get lost it's just the nature of the of the beast anyway so what you want to do if you want word count in your airline bar you can go through and add these two lines here which i will also include in the video description so basically what this does is it enables the word count and then it also tells them what documents it should display word count for because when you're doing a coding document or you're writing a shell script or something you don't need a word count so that's just superfluous information information so you don't want that to happen so you just want to go through and do it for certain uh certain types of files so in this case it does help markdown org mode i guess is what that is text ascii dot text mail and i added vim wiki because vimwiki will actually is kind of stupid if you have vim wiki installed i love vimwiki it's great but it controls every markdown document you ever do it just does by default i don't know if there's a way to turn that off i haven't actually looked into it but if you just have a regular markdown document it assumes you want to use vim wiki in order to edit it it's a pain yes sometimes because it handles things weird and it's not exact markdown so it doesn't work well sometimes it's weird anyways uh because of that i had to use add vimwiki to this list in order for the word count to actually show up in my actual markdown documents again weird but it's just something that i had to do so then then i just went through and saved this reloaded the init.vim and then it went through and added the word count to my airline status bar at the bottom now if you know how to configure airline you can go through and move that wherever you want it's also or should at least be possible for you to do this if you don't use airline i'm just not sure how you'd go about doing it so but it should be possible if you're interested in doing that or you can just use the g control g thing that i showed you earlier so that is how to get word counts so there's another tip for you but it doesn't work for me i've been trying to get it to work and i don't know why it doesn't work maybe it doesn't work in enven maybe it doesn't work because of i have a conflicting key binding somewhere i don't know but supposedly you can go through and move up and down through pages using page up and page down it does not work for me and i'm not sure why but if you have a ton of text like say 50 000 words or something you have this page after page and page of text you can go through and do like 10 page down and it should go through and jump 10 pages down like i said it does not work for me i've been trying for a while to get it to work i don't know why it doesn't work i've looked it up a little bit i haven't spent a lot of time on it but it supposedly that's works like i said maybe it just doesn't work in end them some things don't it's just the nature of having two different programs that are basically the same but not exactly the same so that is the last tip i have for you now as i said at the beginning of this the the video i'm just getting started on this journey there's going to be many more tips like this that i'm going to learn over the next few months as i dedicate myself to to spending more and more time in them and actually using it as a writing tool i'm sure there's a lot more things like there there's that one thing that i really want to do is go through and make it so that when i use the them keys instead of going down like whole lines it'll actually treat a paragraph like those are separate lines i know there's keybinding to do it i just don't remember it it's just the nature of them there's so many key bindings there's no way i'm going to remember all of them but that one's definitely going to be useful because i deal with paragraphs all the time obviously and being able to just navigate through them you know in actual lines instead of jumping between paragraphs with the vim keys is going to be much better so that's something that's got i'm going to have to learn there's several other things that i want to do there's a plug-in called them pencil that i've installed i haven't played around much with it yet it has a lot to do with them with warping and stuff like that i didn't go through warping i actually probably should go through and make a whole video on them pencil but that's something that's really important because you by default you're just going to have them wrapping your text or not wrapping your text at all it's just going to go off into one infinite line with with wrapping and set up i can actually show you this real quick you'll want this line right here in order to have wrapping turned on now there's a there's two different types of wrapping called soft wrap and hard wrap i'm not sure what the difference is quite honestly to be honest with you uh this is just what i looked up and this just seems to work for me uh and that's one of those things that vim pencil seems to take care of the difference between hard wrapping and soft wrapping uh it's just something else that i'm gonna have to learn there are also other plugins that i'm playing around with things like vim language tool that supposedly checks for grammar supposedly that's really good and i told you about the the markdown the other thing i i would highly recommend you do is install a plugin called them last place now this plug-in will basically do what it says in on the tin it will go through and remember the last place in the document you were at at the last save so let's say you're doing a a a bit big edit or you're writing a lot of stuff and you save it and you close them for whatever reason the next time you open it up your cursor will be in the same spot otherwise it'll be at the top and that would really suck if you're in the middle of a document and not necessarily at the end and you just have to go back through and find your place so use vim last place it'll remember your position now you can go through and do that with them script if you wanted to i know that's possible but i just prefer to use the plugin it's just the easy way way out so those are my tips that i know right now and like i said there's gonna be more because i'm gonna i'm gonna be diving into this quite a lot so so that is it for this video if you have comments about what we were talking about today you can leave those in the comments section below you can follow me on twitter at the linuxcast you can support me on patreon at patreon.comcast before i go i'd like to take a moment to thank my current patrons city devon chris east coast web dentures fun to patrick primus marcus magel and jackson tools steve a mitchell arts center amateus merritt camp joshua j dog the bbc's rock peter and crucible thanks everybody for watching i'll see you next time [Music] you
Info
Channel: The Linux Cast
Views: 6,539
Rating: undefined out of 5
Keywords: linux, open source, apps, vim, use vim for writing, novel writing, use vim to write a novel, use vim to write prose, nvim, neovim
Id: GOCVCn5tlmo
Channel Id: undefined
Length: 21min 22sec (1282 seconds)
Published: Sat Dec 18 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.