Welcome to a Vim plugin double feature: Goyo.vim and limelight.vim!
Goyo.vim creates a distraction-free writing environment within Vim.
Activating Goyo.vim hides the status bar and gutter and replaces them with an empty margin around the editing area, making it easier to focus on your work. As someone who has written novels in Vim, I can think of few features I would have valued more. I’m using it while writing this blog post and I already enjoy it!
When it comes to writing novels, blog posts, and other non-code documents, this can prove rather useful. Programmers try to avoid writing code that wraps across lines for many technical and aesthetic reasons, going so far as to enforce maximum line lengths via linters. Having a wider screen proves helpful if it means seeing the entire line of code at once (especially when working in the Kingdom of Nouns). Prose, conversely, demands multiline paragraphs. The wider the window, the harder it becomes to parse the prose. Newspapers use narrow, multi-column layouts for this exact reason. I routinely split my Vim view into two vertical windows solely to make them narrower. Goyo.vim offers a much better way to handle this.
Using Goyo.vim couldn’t be simpler. In command mode, enter:
:Goyo
To exit:
:Goyo!
Want to change the size of the writing area?
" Set the width
:Goyo 180
" Set the height
:Goyo x50
" Set both at once
:Goyo 180x50
You can also set your own default dimensions per the docs.
If you want to activate Goyo.vim right out of the gate, Vim supports running commands upon opening a file: $ vim [filename] +[command]
. That would translate to:
$ vim blogpost.markdown +Goyo
I incorporated this into the Ruby Rake command I use to draft these blog posts.
A companion plugin to Goyo.vim, limelight.vim dims every paragraph of the current document except for your active one, providing another way to increase focus while writing.
I almost always have two vertical windows open side-by-side in Vim. Even as I write this, I have the previous post in this series open opposite this one. Having all that text dimmed makes it easier to write this paragraph. Thank goodness.
To enable:
:Limelight
To disable:
:Limelight!
I did have to configure a couple things:
" Since the color scheme wasn't auto-detected
let g:limelight_conceal_ctermfg = 'Gray'
" Disable override of hlsearch
let g:limelight_priority = -1
" Integration with Goyo.vim
autocmd! User GoyoEnter Limelight
autocmd! User GoyoLeave Limelight!
Overall, very satisfied with both these plugins. Looking forward to using them more!