K Cartlidge

C#/DotNet. Go. Node. Python/Flask. Elixir.

Markdown Creative Writing in Visual Studio


Why on earth would I ever consider writing in Microsoft Visual Studio?

For the general writer

There's probably no convincing reason why you should.

For software developers who use it anyway

If I use it what's the benefit?

How can I improve my workflow?



I tend to write in Markdown with one file per chapter. This provides clear separation, simple and obvious commits in source control, and relatively distraction-free writing as I'm focused purely on the chapter I'm working on.

My current tooling is custom and handles these multiple files by reading a YAML file that specifies the sequence of the chapters and stitching it together on-demand. You can replicate this quite easily with a simple batch file that, when run, joins the chapters into a single long document (you just need to remember to keep the commands in the batch file up to date).


type Introduction.md            >  _book.md
type Hero-enters-the-frame.md   >> _book.md
type Villain-steals-stuff.md    >> _book.md

The use of a single > on the first line is deliberate to ensure you don't continually build up the book with repeated copies appended over and over.

Books and drafts/proofs


Obviously you could do everything in a single project and use source control (tags, branches etc) to identify particular drafts, but the advantage of the above is that regardless of how far down the road you've gone you can still refer to previous drafts without needing to mess around with commits.

In effect you can flip between and compare multiple drafts side-by-side without context switching into source control (and you still get the commit diffs if you need them).


Visual Studio already supports Markdown preview. However the Markdown Editor 2 extention by Mads Kristensen provides a couple of extras that really help.

For theming you can create an md-styles.css file either in your solution folder or in the folder above it. If you do the latter then your solution and all solutions sat alongside it gain the same theming.


	Custom styling for the Markdown 2 Visual Studio extention.
	Place in a folder above the one containing repos.
	MUST be named `md-styles.css` to be picked up.

html, .markdown-body {
	background: #fcfcfc;
	color: #111;
	cursor: default;

.markdown-body {
	padding: 1rem 2rem;
	font-family: 'iA Writer Duospace', verdana, tahoma, arial, sans-serif;
	font-size: 13pt;
	line-height: 135%;

h1, h2, h3, h4, h5, h6 {
	line-height: 130%;
	letter-spacing: -1px;

code {
	background: #ddd;
	padding: 0.1em 0.3em;

a {
	color: #44b;
	text-decoration: none;
	border-bottom-style: solid;
	border-bottom-width: 2px;

li {
	margin-top: 0.4rem;
	margin-bottom: 0.4rem;

@media (prefers-color-scheme: dark) {
	html, .markdown-body {
		background: #222;
		color: #fcfcfc;
	code {
		background: #444;
	a {
		color: #6ec9ff;

I should point out that the colours in the CSS above switch according to the OS choice of light/dark theme. The extention has it's own light/dark setting, but if you use the media selector above then the OS one will always override it so you may as well leave the extention set to automatic.

Other tools

For source control alongside the majority of developers I use Git. For repos at various times I've use Github and Gitlab, plus self-hosted Gitea.

What I'd really recommend regardless of your choice of source control is Git Extentions. It's a great way of handling your source control, viewing commit history and branches, and much more. Having used various other source control UIs (Visual Studio and JetBrains built-in ones, SourceTree, GitKraken, and more) this one has been my standard for years now. But switch the fonts to something like Consolas 12pt for best results!

The result

Familiar editing alongside navigation, previews, theming, organisation, and source control.

Visual Studio has a notable memory overhead (usually around 1,500 MB vs 500 MB for VS Code or 20 MB for NotePad++). But when you're creative writing that memory is usually just sat there unused anyway, so for most machines with at least 8GB of RAM it doesn't matter. And if you're not coding then Visual Studio isn't as bad on battery life as you might expect.

Incidentally, NotePad++ is an excellent writing tool for Markdown apart from its previewing and navigation support - there are things you can do with plugins or functions definitions, but it's a little clunky.