Created
October 7, 2015 15:10
-
-
Save jtrim/ffdd4a6eb257b9fab786 to your computer and use it in GitHub Desktop.
This file contains 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
Plugin 'junegunn/goyo.vim' | |
" =================== | |
" Goyo | |
" =================== | |
function! s:goyo_enter() | |
setlocal wrap linebreak nolist | |
set virtualedit= | |
setlocal display+=lastline | |
noremap <buffer> <silent> k gk | |
noremap <buffer> <silent> j gj | |
noremap <buffer> <silent> 0 g0 | |
noremap <buffer> <silent> $ g$ | |
if exists('$TMUX') | |
silent !tmux set status off | |
endif | |
endfunction | |
function! s:goyo_leave() | |
setlocal nowrap | |
set virtualedit=all | |
silent! nunmap <buffer> k | |
silent! nunmap <buffer> j | |
silent! nunmap <buffer> 0 | |
silent! nunmap <buffer> $ | |
if exists('$TMUX') | |
silent !tmux set status on | |
endif | |
endfunction | |
autocmd User GoyoEnter nested call <SID>goyo_enter() | |
autocmd User GoyoLeave nested call <SID>goyo_leave() | |
let g:goyo_width=110 | |
nmap <Leader>z :Goyo<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment