Distraction Free Writing with Vim

05 September 2012

I recently configured Vim to switch to a special writing mode upon opening Markdown files. It helps me to keep the focus while writing avoiding distractions. I first saw this concept in iA Writer and immediately fell in love with it. However, my muscle memory was too tied with Vim and I didn't want to switch to a different editing environment solely for this purpose. Hence, I tried to make Vim to behave in a similar manner.

Check this screencast to see it in action:

For anyone interested, these are the steps I took to setup it. Please note that I tried this with MacVim on OS X Lion. It may not work as expected in other versions or other OSs.

You can find the customized versions of all needed files in this Git repo.

Update: I extracted the distraction free mode settings into its own plugin and allowed it to be toggled from the F4 key (now it won't be forced upon opening Markdown files). Check the repo in GitHub for updated settings.