Vim for Writers
vim is a very powerful modal text editor with a large system of plugins. You may have heard of the infamous vim vs. emacs wars that have existed from the time of usenet and persist till today. vim does have a learning curve but it is very worthwhile to learn because your fingers never leave the keyboard as you are writing and editing. ViM = Vi Improved; it is a superset of the original vi editor.
Here is a must-see video that makes vim folding look utterly simple.
Also see this plugin: vim-outliner
There are several ViM plugin managers. One of them is: vundle, a vim bundle manager that lets you EASILY install other vim plugins/bundles.
Markdown is a very simple mark-up language that encourages writers to focus on their content rather than on presentation. It can handle bolding, italics, bullet lists, section headings, hypertext links, etc. and you can use utilities like pandoc to transform your markdown text to many, many different formats, including:
- add the spacebar mapping to your .vimrc:
nnoremap <Space> za
Check out the beauty of vim-colors-solarized that "is a sixteen color palette (eight monotones, eight accent colors) designed for use with terminal and gui applications. It has several unique properties. I designed this colorscheme with both precise CIELAB lightness relationships and a refined set of hues based on fixed color wheel relationships. It has been tested extensively in real world use on color calibrated displays (as well as uncalibrated/intentionally miscalibrated displays) and in a variety of lighting conditions." (ethanschoonover.com)
Notes for Planning
See the vim script called nvim to build piles of random little notes during novel planning.
Vim can be more or less as powerful as you want it. It's really worth the time spent learning how to jump around ( using '(' and ')' to jump to the start of the previous / next sentence in particular).
- You can get help on just about any vim feature by entering the command ':help SOMETHING', e.g. ':help spell'
- This might be useful: Vim Commands Cheat Sheet
- 'set autowriteall' - autosave your current document whenever you change away from the current buffer. You can just do 'set autowrite', which will save in *most* situations (the main exemption being quitting).
- There is also a vim plugin: https://github.com/907th/vim-auto-save. It apparently turns on auto save and saves every time a buffer is modified.
- 'set spell spelllang=en_gb' - enable (in this case British) spell checking - see the help page for details of the commands to jump to mistakes and pick / learn corrections.
- See some more documentation on the built-in support for spell checking (as of vim 7).
- it supports a personal word list (very useful for fantasy authors ;-) )
- some useful keys for spellchecking:
- ]s - forward to misspelled/rare/wrong cap word
- [s - backwards ]
- S - only stop at misspellings
- [S - in other direction
- zG - accept spelling for this session
- zg - accept spelling and add to personal dictionary
- zW - treat as misspelling for this session
- zw - treat as misspelling and add to personal dictionary
- z= - show spelling suggestions
- :spellr - repeat last spell replacement for all words in window
WriteRoom / DarkRoom simulator
There apparently are many writeroom/darkroom vim plugins and configurations for "distraction free writing". Of the three I tried, I think I like this plugin (vimroom) the best. For installation using vundle, see https://github.com/mikewest/vimroom (Bundle 'mikewest/vimroom'). A rival noted that on Windows, VimTweak yields transparent gvim windows.
- the vim wikia gives some very good options for managing wordcount (simplest is g then Ctrl-g).
The vim wiki plugin is surprisingly powerful. I've noticed quite a few people advocating the use of the zim desktop wiki tool (but, of course, it isn't edited in vim, even though there is a vim zim syntax support); I regularly use Mediawiki instances (and once played with tiddlywiki). The vim wiki plugin looks interesting; and, since I now use the vundle plugin manager, I may give it a try.
Some reviews I've seen for vim wiki:
- one guy uses it along with encryption and distribution through Mercurial
- another uses it for time tracking
- holy cow! vim wiki apparently has a really nifty ASCII table editing mode--might be useful for tracking characters...
Related Articles of Interest
- an article of a guy who wants to devise a ruby gem for handling novel writing/formatting tasks (okay, not really a vim resource; but something that looked interesting to those of us writing text files)
- blog article about writing novels in a text editor vs. a WYSIWYG word processor; some interesting comments, including a reference to flashbake, a set of scripts designed to make it easier for writers to use version control software
- writing in vim -- this author shares his vimrc and some of his plugins; the thing of interest here is his use of a set thesaurus command. I found this intriguing and found this nifty thesaurus plugin for vim that looks very useful and usable.
- Nine great plugins mentioned in this blog article, including:
Marks are bookmarks within a Vim document. You can set a mark by pressing m followed by another letter that designates the mark. To jump to a mark, enter ' followed by the mark's letter.
The great weakness of marks is that they are invisible. This limits the number you can use to however many you can remember, and you can easily accidentally overwrite an existing mark by creating another with the same name.
Showmarks allows you to toggle the visibility of marks off and on – and that tiny functionality is enough to increase the usefulness of marks several times over.
- Vim Signature
vim-signature is a plugin to place, toggle and display marks. Apart from the above, you can also
- Navigate forward/backward by position/alphabetical order
- Displaying multiple marks (upto 2, limited by the signs feature)
- Placing custom signs !@#$%^&*() as visual markers
Vim-abolish is so elegant that you wonder why no one thought of it before, but it's hard to describe. It has aspects of a word processor's spell checker or autocorrect, but might best be described as a configurable search and replace tool. What makes Vim-abolish so powerful is that it allows you not only to search and replace one word or spelling for another, but also to include all instances of a word. Upper case, lower case, noun and adverb, past and present tense, participles – all can be added to the search and replaced with a few dozen characters.
Admittedly, you might take a while to learn how to think in the terms necessary to set up a Vim-abolish command, and learning how to construct a command may take some time too. However, once you understand how Vim-abolish works, you will probably find it an invaluable proofreading tool.
- Rachel Aaron advises tracking ones reading progress in this excellent blog article (on how to increase ones writing productivity).
- One user uses ViM together with git (flashbake), vimroom, onlinethesaurus, vim-abolish, vim-repeat and vim-outline. Vimroom does not always work as well, and there's little support for it, but it's still usable with a bit of tinkering. Of all the plugins vim-outline is the most useful. She recommends it to everyone planning to use vim. It allows you to easily structure your text, and makes for easy folding/expanding.
- vim-repeat looks interesting for better repetition with: .
- Seth Brown wrote: The Text Triumvirate (zsh, vim and tmux) -- in this article, Seth mentions vim-powerline, a python-powered status line plugin. The author of that plugin then points to vim-airline as a lighter-weight but still featureful status line plugin.
- one redditor has plans to write a book on Vim for Writers; there are some interesting chapter titles in this reddit.
- Here is a nifty Google tech talk by vim creator Bram Moolenaar with useful tips for productive vim; and a blog post about how to use vim and ack for notetaking.
Question: What's a good way to 'highlight' bits of text that you know you need to fact-check/add to/etc. so that it's easily seen upon a reread? I've just changed the text color in programs I've used previously...but how to best do that in vim?
One answer: I first thought about using vim tags -- I have never used them before, but I've heard of them and it sounds like they do some things that might be useful.
- Then I ran across the qfn (quickfixnotes) plugin. The qfn helpfile makes it sound like it is a step in the right direction:
In Vim the quickfix commands are used more generally to find a list of positions in files. For example, |:vimgrep| finds pattern matches. You can use the positions in a script with the |getqflist()| function. Thus you can do a lot more than the edit/compile/fix cycle!
- But this vim-notebook plugin sounds much more straightforward and easy-to-use right off the bat:
This plugin has been created to annotate and aggregate key aspects, such as source code, documentation, notes etc, relative to tasks to be done. Annotations with referenced resources are stored into text files called notebooks under the folder $HOME/.notebook.
A typical usage scenario is:
- create a new notebook called issue_missing_refresh_of referenced_line
- open the text file containing key information
- select text of interest
- annotate selecting proper category and description
- repeat annotation for other interesting text
- open the notebook to have an overview of interesting information
- go to an entry of interest
- jump to the referenced text file
- repeat the exploration with other entries
Traditionally, I've just made my notes directly in the text, marking it with NOTES ;-)
This year, though, writing in Markdown, I might take the HTML commenting approach (as suggested in this pandoc google group). On the other hand, the vim-notebook plugin sounds pretty cool--being able to annotate things in a separate file and yet jump to them at will... neat!
Why use ViM?
Question: Is there a portable OFFLINE text editor that could be run from a USB drive? If so, would such a thing be safe for use on public computers or able to be secured? It doesn't need to be anything fancy.
Why should you give this modal ASCII editor a try?
- think of it as an extension to touch typing (your fingers never need to reach for a mouse)
- the vi input model is extremely efficient
- because of these seven reasons (well, the last is a bit facetious, but the other six are spot on: it's mature and people who learn it generally swear by it, it's free and has a vibrant community, it's customizable and extensible, it works over ssh connections, its configuration is extremely portable, and it is very thoroughly documented)
- "If you are someone who writes text or code for a number of hours every day, learning Vim would be a gamechanger for you. "