VS Code Extensions for Writing

4 minute read

When I wrote my first book, I either used MacVim on my MacBook Pro or Textastic and WorkingCopy on my iPad Pro. At the time, I was traveling a lot and that iPad Pro + Smart Keyboard were a perfect fit on small airplane tables.

The situation is different for my current book. Thanks to the pandemic, I’m not traveling at all. This means I get to use The Big Screen and The Good Keyboard and sit in The Comfy Chair while writing the entirety of the book. Since I quit my job to focus on the book, this combination has served me well: four new chapters are done!

Aside from staying in one place for a while, another big change with this book is that I’ve switched from MacVim to VS Code. I still love MacVim (and am using it to write this post), but having a separate environment dedicated to writing the book is proving useful for reducing distractions. I’ve taken that separation so far as to set up a Mac Mini for the purpose.

In all my years as a vi(m) user, I’ve always just used the vanilla version, with no plugins, addons, or extensions of any sort. When I started to use VS Code I expected my usage to be the same: just the basic program. Thankfully for me (and the book), that’s not the case. Instead, I’ve slowly acquired a small handful of extensions that have been invaluable in the process of writing this book. Here they are:

Word Count

Yes, the basic one that Microsoft provides as an example of how to make extensions for VS Code. At an average of 450 words per page, I can get a sense of how long a chapter is without needing to do a build of the book.

Selection Word Count

This helps me get rid of (or prove?) that “dammit, I didn’t do anything today” feeling. A quick selection of all the stuff I wrote in that session helps set my mind at ease and show that, yes, however slow it may feel, I am making progress.

Section Word Count Targets

I love this one. As I work on the outline for the book (which is written in markdown), I add (Target: NNN) at the end of each section header. The NNN is an estimate for how many words long I think that section will be. Not only does this help me keep track of progress, I also can get a workable estimate for the final size of the chapter.

Yeah, there’s a lot of counting going on with my writing. Whatever it takes to help me feel productive, right?

TODO Highlight

This is another one I rely on heavily. At Prag, we have two sets of special tags that are critical: <author></author> and <ed></ed>. These are notes from author to editor and back again, and they allow this partnership to work well asynchronously. I also use <author> tags for myself to mark things that I want to get back to. This also communicates to my editor that I’ve noticed something needs a change so they don’t need to comment on it.

TODO Highlight is highly configurable, so I’ve set it to mark TODO, XXX, and TBD in light blue, all <author> tags in green, and all <ed> tags in red. Aside from highlighting the items in the text itself, appropriately coloured dots appear in the scrollbar. It all adds up to making it a breeze to see what outstanding tasks and conversations remain in a work-in-progress.

Auto Close Tag

I’m actually very good at closing all my tags on my own, thankyouverymuch. Despite that, I found myself in a situation where I was writing a lot of <author> tags, so I installed this to save myself some keystrokes. Most of the time, it remains useful. Once in a while, it gets in the way. Overall, the balance still tips toward useful, so I keep it around.

Batch Replacer

My personal writing style is Commonwealth English, but Prag’s is American English. I have a file that’s nothing but an ever-growing list of things like this:

replace "analogue"
with "analog"

replace "apologise"
with "apologize"

replace "authorisation"
with "authorization"

Once in a while, I run Batch Replacer to tidy things. It’s a bit of a heavy hammer for the job, but it works.

See? Only a small handful, but it’s all I need to be productive when writing this book. It’s possible more will join the list as I work my way through the writing and publication process—maybe something for diffs, but I have Kaleidoscope, so maybe not—but it’s not likely to be more than one or two. My decades with vi(m) have shown me that for my work style, less is usually more.

Note: I’m not looking for recommendations for new extensions to add to the list. Please don’t provide them unless I specifically ask (which I have not).