# Writing a book in VS Code: setup, extensions and limits

> A code editor is a surprisingly good manuscript tool: plain files, real version control, no autosave surprises. The setup, the extensions, and where it stops.

Canonical: https://buk.press/blog/writing-a-book-in-vs-code

3 September 2026 · 4 min read

VS Code is a genuinely good place to write a book, because a manuscript is plain text and VS Code is very good at plain text: Git history, search across chapters, no proprietary format, no cloud dependency. What it will not do is produce the book: its Markdown preview is a web page, and printing a web page gives you a document, not a typeset volume.

The idea sounds wrong for about a day. Then you notice that a book is a folder of text files, that you want to know what changed since Tuesday, that you want to search 90,000 words in 40 milliseconds, and that you would rather not find out in 2031 that your writing app's format is no longer readable.

Novelists have been quietly doing this for years. Here is the setup that works, and, more usefully, the point at which the editor hands off.

## Why a code editor suits a manuscript

- **The files are yours.** Markdown on your disk. No account, no export step, no format to be locked out of.
- **Real version history.** Git gives you every draft, a diff of what changed in a scene, and the ability to write a risky rewrite on a branch and throw it away without ceremony.
- **Search that scales.** Find every use of a character's name across the whole book, with a regex if you need one, instantly.
- **One file per chapter.** The file tree is your outline, and reordering chapters is renaming files.
- **It is fast and it is quiet.** No sync spinner, no toolbar, and it works on a plane.

The honest counterpoint: VS Code has no idea it is holding a book. No word-count goal, no manuscript view, no corkboard. If those are what keep you writing, a tool built for writers is the better answer and this post is not for you.

## Making it feel like a writing app

Out of the box it is set up for code, which is the wrong shape for prose: full-width lines, no wrapping, a cursor that jumps by word boundaries you did not intend. Four settings fix most of it. Put them in a workspace `.vscode/settings.json` so they apply to the book and not to your other work:

```
<code>{
  "[markdown]": {
    "editor.wordWrap": "bounded",
    "editor.wordWrapColumn": 80,
    "editor.lineNumbers": "off",
    "editor.quickSuggestions": false,
    "editor.renderWhitespace": "none",
    "editor.fontFamily": "Georgia, serif",
    "editor.fontSize": 16,
    "editor.lineHeight": 1.7
  },
  "files.autoSave": "afterDelay",
  "editor.minimap.enabled": false
}</code>
```

Then **Zen Mode** (`Ctrl/Cmd+K Z`) for the actual writing, which hides everything but the text. Two more worth knowing: the built-in Markdown preview is `Ctrl/Cmd+K V`, and `Ctrl/Cmd+Shift+F` searches the whole folder.

Extensions, kept to the four that earn their place: a spell checker (Code Spell Checker, with a project dictionary for your invented names), a prose linter if you want one (write-good or Vale; Vale is the serious option and takes an afternoon to configure), Markdown All in One for list continuation and table formatting, and a word-count extension for the status bar.

## Structuring the folder

Number the chapter files. It is the whole trick, and it is what makes the folder sort into reading order and concatenate correctly:

```
<code>book/
  manuscript/
    00-front-matter.md
    01-the-problem-with-mornings.md
    02-subtraction.md
    03-what-to-keep.md
    99-back-matter.md
  images/
  notes/
    characters.md
    timeline.md
  .gitignore</code>
```

Leave gaps in the numbering if you like inserting chapters, or use `010`, `020`, `030` so you never have to renumber. The `notes/` folder stays out of the book but inside the repository, which is one of the quieter benefits of this setup: research and manuscript are versioned together.

One convention worth adopting from the start: **one sentence per line**. It looks strange for about an hour and then it is obviously right. Git diffs become sentence-level instead of paragraph-level, and moving a sentence is moving a line. Markdown joins consecutive lines into a paragraph, so the output is unaffected. (Unless you are writing verse, where you want the opposite; [line breaks in Markdown](https://buk.press/blog/markdown-line-breaks) covers that case.)

## Git, without the ceremony

You need about five commands, and none of the branching model arguments apply to a book with one author:

```
<code>git init
git add -A && git commit -m "Chapter 3 draft"
git log --oneline              # every draft, in order
git diff                       # what changed since the last commit
git checkout -- chapter-03.md  # undo today entirely</code>
```

Commit at the end of each writing session with a message describing the session. A year in, `git log` is a writing diary you did not have to keep. Push to a private repository and you have an offsite backup with full history, which is more than any word processor's autosave gives you.

Add `--word-diff` to `git diff` for prose. Line-level diffs on text are hard to read; word-level diffs show you the sentence you actually changed.

## Where the editor stops

At the point where you need a book rather than a manuscript. VS Code's Markdown preview is a web page in a panel. It is styled for reading code documentation, it has no page size, no margins, no page numbers, and printing it gives you exactly what printing a web page gives you. That is not a shortcoming; it was never trying to typeset anything.

So the last step happens elsewhere, and there are two routes. If you enjoy toolchains, [Pandoc](https://buk.press/blog/pandoc-for-books) plus a LaTeX engine will typeset the folder from the command line and you can wire it to a VS Code task. If you would rather choose typefaces by looking at them, combine the chapters into one file and design it in something built for pages:

```
<code># Numbered files concatenate in reading order
cat manuscript/*.md > book.md</code>
```

That single file is the handoff. [Combining Markdown files](https://buk.press/blog/combine-markdown-files) goes into the details worth getting right: heading levels, image paths, the blank line between files. From there bukpress takes it: typefaces, margins, paper and covers set once, a hard page break on a line of `---`, and the same file exporting both [a PDF](https://buk.press/markdown-to-pdf) and [an EPUB](https://buk.press/markdown-to-epub).

The division holds up well in practice. The editor is where the words happen and where the history lives; the production step is a separate thing you do at the end, and neither tool has to pretend to be the other. [The sample book](https://buk.press/sample-book) is what the second half looks like: eight pages from one Markdown file, exported once.

**About this article.** Written by the team that builds bukpress, which turns Markdown into print-ready PDF and EPUB books. Spotted something wrong or out of date? Write to [support@buk.press](mailto:support@buk.press).

## Read next

Tools 30 August 2026 · 5 min read

## [Obsidian to PDF: getting a book out of your vault](https://buk.press/blog/obsidian-to-pdf)

Obsidian's Export to PDF prints the note the way your current theme draws it on screen, which is why the result looks like a screenshot of an app rather than a book. To get a real book you have to decide first whether you are exporting one note or assembling a manuscript. They are different problems with different fixes.

[Read it](https://buk.press/blog/obsidian-to-pdf)

How-to 30 August 2026 · 4 min read

## [How to combine Markdown files into one book](https://buk.press/blog/combine-markdown-files)

Keep chapters as separate files while you write, named so they sort in book order, then concatenate them into one manuscript with a page-break marker between each file. Do this as a last step, not as a working habit: the combined file is what you typeset; the per-chapter files stay the thing you edit.

[Read it](https://buk.press/blog/combine-markdown-files)

Tools 30 August 2026 · 5 min read

## [Pandoc Markdown to PDF: the commands, and where it stops](https://buk.press/blog/pandoc-for-books)

To convert Markdown to PDF with Pandoc, install Pandoc and a PDF engine (a LaTeX distribution such as TeX Live or MiKTeX, or an alternative like Typst or WeasyPrint), then run pandoc input.md -o output.pdf. Add --pdf-engine=xelatex to use your own fonts, -V geometry:margin=2.5cm for margins and --toc for a contents page. Pandoc is the best tool for documents with citations, cross-references or mathematics, and for books built by a script; it stops being pragmatic when the requirements are visual, because every visual change means LaTeX or a template.

[Read it](https://buk.press/blog/pandoc-for-books)

## Write it in Markdown. Ship a book.

bukpress turns the file you are already writing into a typeset PDF and EPUB: your type, your covers, no watermark, ever.

[Get Lifetime, $27 once](https://app.buk.press/signup)
