Rethinking Neovim as a Tool For Writers

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
In 2019, researchers found that perceived clutter in the workspace can lead to 30% decrease in cognitive resources and focus compared to uncluttered environments. Participants in the cluttered environment also reported increased stress and anxiety further hindering their performance. When people take notes, whether in a notebook or digital devices, the environment must be conducive to welcoming their thoughts and ideas. Otherwise, there's friction leading to the degradation of the input they intended to record. This is true for all types of writers. No takers and even authors. Yes, there are authors who create entire words in VIM. Check out the amazing talk linked about to learn more. If Neovin is the best tech editor in the world, how about transforming it into the perfect writing environment? That's exactly what I'm going to do in this video. I've already shared my note-taking system in Obsidian if you're interested in that. The link is up above here. But for now, let's focus on making Neovin a heaven for writers. Since everything I write, be that notes, blog posts, newsletters are all in markdown. Heck, even the author from VIMCon was using markdown for his book. I needed a good way to quickly preview my syntax. This is not crucial, but definitely helps with these rare markdown objects that require rendering in a browser. I also made sure the LSPs configured to parse markdown, which helps me understand the structure while writing it without even previewing. So I added markdown preview.nvim to lazy and let it take care of the rest. Once ready, the markdown preview command pops my browser with the markdown parse ready to go. This is beautiful and so elegant, but it's not only about the presentation. This thing can parse tables, flow charts, tasks, it can even scroll with you as you move along. This doesn't only make markdown easier to use for any writing purpose, but also completely eliminates the sub-par visuals inside the editor. When compared to something like org mode in Emax or Neovin, I made an entire video about Neovin if you want to catch that. Since writing requires focus, not only nice visuals, two of my most important plugins used to be Koyo running alongside limelight. These make sure only a single area is highlighted at a time, while ensuring all surrounding destruction is removed. Sadly, both plugins are unmaintained now, and with the progression towards Lua, Neovin are beloved for created a new super duo. The first half of it is called Twilight. Twilight focuses your eyes on the task at hand, or in this case, the block of code or text paragraph. It'll illuminate the surrounding text around the cursor and make sure your eyes don't work over time to find the center. Remember my take on friction and how friction contributes to degradation of quality and fatigue over time? This is a perfect example. Twilight's other half is Zen mode, and these two work in tandem for a perfect writing experience. Zen mode will even switch Twilight's own by default, so you don't have to care about it. Zen mode eliminates every single destruction on the screen, rulers, bars, icons, everything that is in the pure text being edited is hidden. And with Twilight focusing on the written text, they both alleviate every possible strain on the eyes. If you look closely, Zen mode even goes to the length of hiding my Timax bar, as a plug-in. So when I fire it up, both the Timax status bar and Lueline are both out of sight. Isn't this beautiful? It feels like we've got a nice focus environment for writing books, doesn't it? Well, not quite. So far we've been dealing with the high level settings of the editor, which is important, but it's time to dive into the character level and fix the way the text is presented. It may not seem so, but the text wrapping, as it is, is not ready yet. Vim presents text, assuming most of it is code. And that's how it's parsed and displayed. Vim pencil does that beautifully. It supports both soft and hardline wrapping. It can handle and exclude file types. It's aware of concealing. If that's relevant to your New York users, pencil can also help you with spell check and become a one-stop shop of toggling Vim into a writing pad. My command for starting it is Zen mode, with Twilight set by default, and then pencil together. This creates the setup that invites my creative side to start producing ideas and turning them into words. Another beautiful change introduced by pencil is the cursor wrap, where the text is wrapped around the center cursor, which is also responsive to the top and bottom of the document. Compared to chasing the text with your eyes, this is another refreshing change I didn't even know I wanted. Put simply, pencil lets you rest your eyes and fingers, while taking the very little friction left with our setup to zero. Check out its docs for the extensive configuration options. It also features some very interesting talks and blog posts promoting the language and philosophy of text editing in VI. Highly recommended. Okay, visual mode is on, and the editor looks great. But what about the actual thing here? I mean, for code we've got the LSP to fix issues, and let me know when I made a mistake. But what about free text? After all, I'm writing another here. So the good old set spell is actually pretty damn good. When it's turned on, you'll see spell errors on their line. Move to the next spell mistake or previous with opening or closing bracket. With S respectively. And okay, so we have mistakes found, but how about fixing them? Well, Z and equal sign will pop up a list with the options the language system thinks are relevant, sorted by the most probable to the list. You can pick an option to accept the fix, but given this order, you can do something slightly smarter. If you hit one Z equal, this tells the editor to automatically pick the first result on the list and apply it as a fix. This can also be done as a mapping for ease of running through mistakes and fixing them. Here's my setup, which I don't use all that often anymore. Maybe I'm greatest spelling, which I'm not, but here's what it's doing. There's an insert mode mapping here that pops the mode back to normal, moves to the previous result, which if you're not standing on the very first character of the word, brings you there, and then picks the first result from a spelling fix table and moves on. Keep in mind that lots of mistakes are not going to be fixed correctly, even if you're using the list, because the editor just doesn't know terms like DevOps or abbreviation of JavaScript to JS, for example. So in many cases, you may want to give it a hand by hitting ZG. I remember this is good, which then adds the word to the table of accepted spellings, or the opposite ZW, which in my mind, I remember that as wrong, and this would remove the word from the table and would basically tell them that it's not spelled correctly. With a few good mappings here and a few cycles of training the editor with the relevant spelling words, this feature can be a breeze to work with and a great little helper. The nice thing about it is that it's completely native and doesn't require anything installed. Last, but definitely not least, as you probably all know, you can't really end a setup video, surely not around Neovim, without a hint of AI sprinkled on top. I'll leave a link up here for a more in-depth video I made about all the AI coding assistants for Neovim, but here I want to focus on a particular one that works just as well with three language. This would be OpenAI's chat GPT, which I've integrated using chat GPT and VIM plugin. The link to the plugin is in the description, and like I mentioned earlier, you can watch the full video to learn about all its features. Once authenticated, I can use the chat GPT command. For text purposes, I'm going to use two features of it. The first of which is grammar correction. This works best on visually selected range of text and fixes the language for me. I used to have a dedicated plugin for grammar correction and better use of the English language, but with AI, this seems pointless. Another useful feature of it is summarizing the text. Generally speaking, LLMs are great with taking bits of written text and making it longer or shorter, or in this case, just grabbing the essence and making something more concise. I've been using both features a lot on my blog posts and newsletter issues, just because they're so easy to use and are already given to me by the plugin. Now, show me a notebook that can do that. Now that the environment is suited for writing of all kinds, it's time to build a system around it. Otherwise, no level of productive environment can help you find and note you to classier, let alone suggest it when you research something. This is why I created my second brain in Obsidian. And in the video right here, I show how to integrate it with new VIM for the perfect experience so that you can combine the methods in this video with a system for life. And by the way, if you're interested in more information around that, please drop a comment below. I do try to read and follow up on all of them. Thank you for watching.
Info
Channel: DevOps Toolbox
Views: 13,670
Rating: undefined out of 5
Keywords:
Id: oLpGahrsSGQ
Channel Id: undefined
Length: 8min 48sec (528 seconds)
Published: Fri Feb 02 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.