Created
January 6, 2014 19:05
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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