Blog Page 1 of 1 (4 posts) :: archive :: feeds

A thought on writing novels

As I’m now starting to get more serious about writing novels, I recently made a list of the next few books I want to write after the one I’m working on, and I ran into an unexpected side effect: knowing what the next few items in the queue are has somehow made writing a novel feel far more doable. It’s now a task that has an ending, rather than being something with no end in sight.

Sidenote: I’m not sure how much I’ll talk here about the novel in progress, at least not until I finish a full draft, but I do plan to talk about tools and process. (For example, I’ll write more about this later, but I’m using Vim with a Git repo and a post-commit hook that generates a print-ready proof PDF of the full book via TeX whenever I commit.)

Neovim 0.1.0

Neovim 0.1.0 was released yesterday. I’ve been using an earlier version for a month or two now and all things told, I’m happy with it. My old .vimrc worked fine (though with 0.1.0 the .vimrc has been moved to ~/.config/nvim/init.vim, which will take a bit of getting used to), and everything I’ve needed to use has worked. Vim-plug is nice for managing plugins. I haven’t switched from Syntastic to Neomake yet, but that’s on my todo list for the near future.

Vim-fu

Vim has a steep learning curve, but it’s worth it. Here’s a cheat sheet of sorts showing some of the more useful commands (I put it together for a presentation at work):

There’s still a lot more to Vim, of course. And by a lot I mean a huge, massive mountain of things. Our goal here was to introduce some of the basics of Vim and provide a foundation for learning more. :help is your friend.

Vim search and replace on funky characters

Occasionally I run across weird characters in Vim that show up as numbers in angle brackets — <95> or <97>, for example. They’re just curly quotes and em-dashes and such, but they’re encoded oddly, and there’s no way easy to do a search and replace on them.

Except that there is.

  1. Yank the character. (That’s Vim talk for copying to the clipboard.)
  2. Start typing your search-and-replace command — :%s/
  3. Hit Ctrl-R followed by " (double quotes) to paste the character.
  4. Finish out the rest of the search-and-replace and hit Enter — :%s/<97>/--/g

Voila. (There might be a way to fix these characters with iconv or some other encoding app, but I haven’t been able to get it to work other than this way.)