Using gVIM as your novel manager

I’ve been back and forth on this topic before, but last week I finally had an epiphany. It came to me in a flash that what I needed was really a manager for my novel, not something to write it with, a framework not an engine. And that’s when I realized I had that framework already in front of me.

In part I owe a lot to a time when I abused the heck out of vim/gvim as an IDE for software (or at least ebuild) development. And in part, this epiphany was thanks to the whole GTD phenomenon, in particular that no matter what the tool, its the methodology that matters, not the instrument of implementation.

Which is how I came to realize that what I needed to write wasn’t a particular tool with whiz bang features. What I needed was some organization, and a tool to help me maintain that. Enter my gvim solution. I won’t be able to go over the nuances of using (g)vim in this post – too long and involved a topic. If you need that kind of information, I recommend starting with firing up vim and typing :help .

OK, the secret here was a selection of plugins and a few tweaks to my vimrc. Now, I started with a clean .vimrc for this, just so I could be sure I wasn’t getting conflicts along the way with previously used plugins (like ctags, etc.).

To start with, I installed vimoutliner. This nifty little plugin will take a file and highlight/outline it based on tabbing, including folds and depth numbers. Goes without say that this means you could edit the file in any kind of editor, then load it in vim to be able to see the final effect (handy if you jump platforms a lot).

Next up, spell checking. Used to be you had to install a separate plugin and app for this, but with vim 7.x spellchecking is built in. Just type

:set spell

in your vim session (or add it, sans the colon, to your .vimrc) and voila, you have spellchecking enabled. :help spell is your friend for the keystrokes for adding, ignoring, and finding misspelled words.

Ah, now for the big one. There is a handy plugin for vim called project. Reading the documentation you can see where its originally intended for folks writing code – but what is a writing project but a collection of notes and chapters? Not so disimilar from a collection of header and source files, for example. The documentation for project is all right, but I would recommend paying attention to the bits about calling an “in” file – my experience was that a lot of my personalizations from my .vimrc were lost when project loaded, so duping/pointing at my vimrc helped reset some of those things. I’d also recommend a bit of tomfoolery be added to your vimrc as such:

" Create directories/files on the fly
au BufNewFile * :exe ': !mkdir -p ' . escape(fnamemodify(bufname('%'),':p:h'),'#% \\')

That way when you create a new entry in your project menu, you don’t have to worry about breaking out to mkdir or such – this newfile trigger will do that for you :). I haven’t worked out a way to get word counts as I’m typing, but for now this handy function will do:

" Word count!
map <F5> :!wc -w %; sleep 3 <Enter><Enter>

Finally, and this was just for my own sake, I grabbed the highlight_current_line.vim plugin from scripts.vim.org – nifty way to highlight the line your on (comes in handy when your mood has you using a nice, dark colorscheme in gvim 🙂

Now I can’t abandon you without giving a sample of what works for me, so here is my current .vimrc and .vimprojects . I would recommend that you use project in gvim if you can – the gui comes in handy in this case.

OK, so now we have the toolset. What was the methodology? If you take a peek at that sample .vimprojects (and by “sample” I mean mine as of this posting), you’ll see I broke out my current project into three general areas. First are the chapters (each a subdirectory under novel/), each with  a collection of scenes. I can post the handjam perl and shell scripts I used to convert a ywriter export to this format if you want, but suffice it to say it was an automated process.

Next you have the notes area. I started with text files, then I realized that what I really needed were mini-outlines (hey, if I can get it for free, I’m all about the nice color coding effect. Don’t get me started on the evils of compiz, though – that’s not free in any sense.).

The third area was a copy of my outline to date. Now one of the nice things about *vim, that I find myself missing in other programs no matter how nice they are, is split windows. See, with *vim it is trivial to load my project in the narrow left pane it defaults to, my current scene in the upper right pane, and my outline in the bottom right pane.

And just that simply, I have all the features I need. The only thing I appear to be missing right now, that slightly crucial thing, is, ah, motivation to kick me in the butt back to writing instead of blogging/xboxing/mowing the grass 🙂

One thought on “Using gVIM as your novel manager”

Comments are closed.