Skip to content

Instantly share code, notes, and snippets.

@waltonjones
Created January 6, 2014 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save waltonjones/8287903 to your computer and use it in GitHub Desktop.
Save waltonjones/8287903 to your computer and use it in GitHub Desktop.
A few lines in my vimrc for controlling the distraction-free environment Goyo.
" WordProcessor Mode / Goyo
let g:goyo_width=65
let g:wp_mode_is_on = 0
function! ToggleWPMode()
if g:wp_mode_is_on
set formatoptions=tcq
set nowrap nolinebreak expandtab
silent! nunmap <buffer> k
silent! nunmap <buffer> j
silent! nunmap <buffer> 0
silent! nunmap <buffer> $
silent! iunmap <buffer> k
silent! iunmap <buffer> j
silent! iunmap <buffer> 0
silent! iunmap <buffer> $
let g:wp_mode_is_on = 0
else
set formatoptions=ant1
noremap k gk
noremap j gj
noremap 0 g0
noremap $ g$
set wrap linebreak nolist noexpandtab
set formatprg=par
set spell spelllang=en_us
let g:wp_mode_is_on = 1
endif
endfunction
nnoremap <Leader>g :Goyo<CR>:call ToggleWPMode()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment