man.vim 442 Bytes
Newer Older
Murukesh Mohanan's avatar
Murukesh Mohanan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
setlocal nolist 
setlocal readonly
setlocal buftype=nofile
setlocal bufhidden=hide
setlocal noswapfile
setlocal nomodifiable

function! PrepManPager()
	setlocal modifiable
	if !empty ($MAN_PN)
		silent %! col -b
		file $MAN_PN
	endif
	setlocal nomodified
	setlocal nomodifiable
endfunction

autocmd BufEnter $MAN_PN call PrepManPager()
nnoremap q :q!<CR>
20 21
nnoremap <Space> <PageDown>
map <expr> <CR> winnr('$') == 1 ? ':vs<CR><C-]>' : '<C-]>'