1560 words, ~ 7 mins to read

Writing Novels and Non-Fiction with Visual Studio Code

You’re probably thinking, whoa, hold on there, what?

Screenshot of writing editor - VS code

Screenshot shows a chapter from Soldier

Dec 2024 Update: This update comes nearly four years after the first draft. I have now published a total of 16 full novels with this system (> 1M words!).

TL;DR

I used Microsoft’s Visual Studio Code to write novels. A rather nerdy endeavor for an author of ancient history, and it turned out to be the best thing I ever did. My writing process is probably 30-40% faster than my previous methods, more pleasurable, and I’ve reduced final pre-production effort by 70-80% compared to what I did previously.

Introduction

Many writers (fiction, not computer programming) probably haven’t even heard of Visual Studio Code. Is it a graphics program? Is it studio software? Those who have might wonder how a programming editor can possibly be good for writing books.

Well, someone had to go there, and I did. Brave and the bold. Or maybe just stupid. In hindsight, it was not stupid at all. All my novels have now either been revised, or written entirely, using the approach described below, with Microsoft’s free Visual Studio Code programming editor.

Before anyone questions my sanity, here is my journey with writing tools:

  1. First, I tried Microsoft Word.
  2. Then, I went to OneNote so I could better organize the manuscript before packaging it for publishing.
  3. Then, I tried Scrivener — briefly — an established tool for novelists with customized features for writing.
  4. After that, I dabbled with Ulysses — an excellent software for Mac and iPad, customized for writing needs. I wrote significant parts of The Wrath of God with Ulysses.
  5. I also briefly flirted with Bear and IA Writer, both great tools for Markdown-centric writing.
  6. And then I returned to Microsoft Word because I found myself restricted by certain aspects of Ulysses.

But each time, I felt constrained by something or the other:

  • Difficulties in managing chapters, writing speed, moving things around, navigating, creating beta versions or box sets, and wasting time on formatting too early in the process.
  • Inability to easily get robust metrics (I’m a bit of a numbers guy), keep track of development history.
  • Lack of content portability (getting tied into proprietary formats).

Each of these ultimately impacted productivity because writing and publishing a book is not just about “writing.” There’s a lot that goes into preparing a book for Amazon or elsewhere.

A Typical Writing Process

  1. Writing.
  2. Polishing the work (grammar, pacing, rewrites, reviews, etc.).
  3. Understanding the writing metrics to smooth out rough edges (unbalanced POVs, excessively long chapters, etc.).
  4. Getting it beta read with multiple people, revising.
  5. Sending it for proofreading or querying.
  6. Exporting to publishable formats (Word, ePub, mobi, PDF, etc.).
  7. Publishing.

Now, consider the effort and complexity when manuscripts are 80–100,000 words, split into 50+ chapters. And multiple such books. It gets a bit hairy. I also found it really hard to update my backmatter and book lists of each book after I released a new one. It was also challenging to bring all books to the same look-and-feel if I wanted to revise. Could I separate content from format?

So, I finally thought, could an old guy (alright, I’m not that old) think of using some of these fancy programming editors that come with a lot of useful features? I’m a tinkerer by nature and enjoy exploring new things.

And that’s how I jumped into using Visual Studio Code for writing my manuscript. Here’s what attracted me to it.

My Process

Write in VS Code using Markdown -> Produce Docx through [the PublishQuickly script](https://publishquickly.com) in seconds -> Minor tweaks to the Docx -> Ready for proofreading and final release

Here are ten things that made this really valuable for me:

The Ten Features of Visual Studio Code I Use for Writing My Novels

  1. Fast Writing and Powerful Extensions — The autocomplete feature enabled by the All Autocomplete extension can enhance writing speed and reduce writing errors. There are also extensions to help with Markdown writing, live preview, and many, many others.
  2. Beautiful dark themes — (Pitch Black or Dracula) which are easy on the eyes, and the ability to customize themes and fonts. I’ve since tried other beautiful themes — my current favorite is Horizon. It’s wonderful.
  3. Excellent Markdown editor with CSS customization and live preview that scrolls in sync with the editor. The outline view is a superb navigation feature that lets you jump to sub-sections (particularly helpful for non-fiction, academic, or computer-related writing).
  4. A Zen Mode that keeps the focus only on the editor.
  5. Ability to see chapter word counts, spell check, fast search, global search, and search-replace.
  6. Integrated version control — I can save versions of my chapters as many times as I want and go back to any version I want.
  7. Works on files on the folder, which means I can open these files from any editor, including simple notepads, wherever and whenever, and continue to work. For example, on iPad, I use GoCoEdit. It’s this ability to work on simple text files that also makes it perfect for scripting against it.
  8. Split editor — Open multiple versions, the same chapter in two places, reference files, to-dos — whatever you want. In fact, the split can be more than two — if you have a large monitor, you can have 3 vertical splits with each having a horizontal split, or a 2 x 2 grid.
  9. Line number and right-side mini-view that’s great for navigating large chapters and going back and forth.
  10. VIM mode support — Most people won’t know about this outside coders, but this is a fantastic writing emulation that lets you write and navigate text files really fast using just keyboard strokes. It takes a little getting used to, but once you get a hang of it, it’s amazing! I cannot stress this enough — Vim has truly powered writing for me. In terms of writing speed, the combination of Autocomplete and Vim keystrokes is the single biggest driver of productivity.

I bet I haven’t even explored many other tips and techniques, but I will update findings as I go.

Disadvantages

Working with an editor made for programming comes with some disadvantages, some that might be deal-breakers if you are not willing to make changes. Here are three that come to mind. None of these proved to be deal-breakers for me.

  1. Not designed by default for writing. Unlike Scrivener, Bear, or Ulysses, there are no built-in presets or features that are specific for writers (like exporting to multiple formats, separate note-taking, chapter organization, etc.). But personally, I ended up not using those features much, and their value diminished.
  2. No mobile support — There is no Visual Studio Code for iPad, Android, or iOS. You’ll need to find some other Markdown text editor (I use iaWriter on my iPad) that can connect to your Cloud account to edit the files. Perhaps this will come someday. I’ve heard of VS Code in the Cloud, but I prefer to work on files on my computer. Having said that, GitHub allows you to edit the files on the fly directly in the browser, and there’s now even VS Code for the web! Since the files are simple text files, it’s easy to modify them anywhere.
  3. No in-built document formatter — e.g., bold, italics, etc. You write in text, but you can use Markdown to get most of those features. Markdown is really simple! (Some of the themes in VS Code, like Horizon, do a pretty good job of coloring the text based on the formatting — like bold and italics, and it’s good enough). See the Screenshot below.
Coloring and Themes in VS Code for Writing in Markdown

How I Organize My Work in Visual Studio Code

Nothing complicated at all, really.

The critical thing about my setup is I write using Markdown. This is a simple text format, really easy to learn, and you can then transform the text into many other outputs, including Word and ePub.

My setup is very simple:

manuscripts/
the.last.pharaoh.regent.md
the.last.pharaoh.queen.md
the.last.pharaoh.empress.md
...
resources/
tlp.map.png
tlp.cover.png
...

Using with Grammarly

Just copy the specific text section into Grammarly, make the fixes, and paste it back. You can also just paste the entire text as-is in Microsoft Word, use the Grammarly plug-in to fix everything, and then paste it back!

The idea is that you do 90% of your book writing on VS and then do the final formatting in whatever tool you want. You have to do that with pretty much any writing tool anyway; none of them get you to 100% readiness right away.

What Next?

If you want to follow my method, here are three things you need:

  1. Learn Markdown in 10 minutes.
  2. Go grab MS Visual Studio Code for free.
  3. (Optional) Any tool to convert the Markdown to Word (for example). I use a custom script that does a whole lot more.

I hope that helps, give it a try!

All the books on my homepage have been written with the above techniques.

About Jay Penner

Jay Penner's highly-rated books regularly feature Amazon's category bestseller lists. Try his Spartacus, Cleopatra, Whispers of Atlantis or Dark Shadows books. Reach out to him or subscribe to his popular newsletter.

learn more →