Commit d157bb07 authored by Murukesh Mohanan's avatar Murukesh Mohanan

shift manpager stuff to plugin

parent 93d888be
syntax match BACKHIDE '.\b' conceal contained
syntax match BOLD '\(.\)\b\1' contains=BACKHIDE
syntax match Underlined '_\b.' contains=BACKHIDE
highlight link BOLD Constant
if exists("b:did_man")
finish
endif
let b:did_man = 1
setlocal nolist
setlocal readonly
setlocal buftype=nofile
setlocal bufhidden=hide
setlocal noswapfile
setlocal nomodifiable
setlocal nowrap
setlocal conceallevel=3
setlocal iskeyword+=,_
setlocal concealcursor=nvic
if !exists("*s:MMan")
function! s:MMan()
let l:word = substitute(expand('<cword>'), '.\b', '', 'g')
if winnr('$') == 1
vsplit
endif
exec 'Man' l:word
endfunction
function s:PrepManPager()
setlocal modifiable
if !empty ($MAN_PN)
"silent %! col -b -x
%s/.\b//g
file $MAN_PN
endif
setlocal nomodified
setlocal nomodifiable
endfunction
endif
"autocmd BufEnter $MAN_PN call PrepManPager()
nnoremap <buffer> q :q!<CR>
nnoremap <buffer> <Space> <PageDown>
nnoremap <buffer> <CR> :call <SID>MMan()<CR>
nnoremap <buffer> <c-]> :call <SID>MMan()<CR>
......@@ -95,6 +95,7 @@ nnoremap <Up> gk
"execute pathogen#infect()
call plug#begin('~/.vim/plugged')
Plug 'murukeshm/vim-manpager'
Plug 'vim-scripts/diffchar.vim'
Plug 'scrooloose/nerdtree'
......@@ -169,9 +170,7 @@ let g:ycm_collect_identifiers_from_tags_files = 1
let g:ycm_seed_identifiers_with_syntax = 1
let g:ycm_python_binary_path = '/usr/bin/python3'
if !empty($MAN_PN)
autocmd StdinReadPost * set ft=man | file $MAN_PN
elseif @% == "" && getcwd() == "/tmp"
if empty($MAN_PN) && @% == "" && getcwd() == "/tmp"
" From http://vi.stackexchange.com/questions/239/
" with exception for reading manpages
try
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment