summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2017-10-29 00:14:43 -0400
committerJesse Luehrs <doy@tozt.net>2017-10-29 02:01:52 -0400
commit88be99a05bc0143f62ef471ac2f6a5bd68d2f70c (patch)
tree294be4f3eece13ef7f7032af7e1b49789d9cb7c5
parent5b650317822743efb0185ccee8c77f982a28b3e7 (diff)
downloadconf-88be99a05bc0143f62ef471ac2f6a5bd68d2f70c.tar.gz
conf-88be99a05bc0143f62ef471ac2f6a5bd68d2f70c.zip
clean up the help overrides stuff a bit
-rw-r--r--vim/ftplugin/perl.vim5
-rw-r--r--vim/ftplugin/python.vim12
-rw-r--r--vim/ftplugin/ruby.vim6
-rw-r--r--vimrc8
4 files changed, 12 insertions, 19 deletions
diff --git a/vim/ftplugin/perl.vim b/vim/ftplugin/perl.vim
index 8fb8575..6edc9fb 100644
--- a/vim/ftplugin/perl.vim
+++ b/vim/ftplugin/perl.vim
@@ -2,10 +2,7 @@ let b:ale_linters = { 'perl': ['perlcritic'] }
" look up words in perldoc rather than man for K
function! s:perldoc(word)
- let l:perldoc_pager = $PERLDOC_PAGER
- let $PERLDOC_PAGER = 'cat'
- exe 'silent read! perldoc -f "' . a:word . '" 2>/dev/null || perldoc "' . a:word . '"'
- let $PERLDOC_PAGER = l:perldoc_pager
+ exe 'silent read! perldoc -o PlainText -f "' . a:word . '" 2>/dev/null || perldoc -o PlainText "' . a:word . '"'
setlocal ft=man
endfunction
nnoremap <buffer> <silent>K :call Help(0, [':'], '<SID>perldoc')<CR>
diff --git a/vim/ftplugin/python.vim b/vim/ftplugin/python.vim
index 6973956..b317797 100644
--- a/vim/ftplugin/python.vim
+++ b/vim/ftplugin/python.vim
@@ -1,9 +1,13 @@
" look up words in pydoc rather than man for K
function! s:pydoc(word)
- let l:pydoc_pager = $MANPAGER
+ let l:pydoc_manpager = $MANPAGER
+ let l:pydoc_pager = $PAGER
let $MANPAGER = 'cat'
+ let $PAGER = 'cat'
exe 'silent read! pydoc "' . a:word . '" 2>/dev/null'
- let $MANPAGER = l:pydoc_pager
+ let $MANPAGER = l:pydoc_manpager
+ let $PAGER = l:pydoc_pager
+ setlocal ft=man
endfunction
-nnoremap <buffer> <silent>K :call Help(0, [':'], '<SID>pydoc')<CR>
-vnoremap <buffer> <silent>K :call Help(1, [':'], '<SID>pydoc')<CR>
+nnoremap <buffer> <silent>K :call Help(0, ['.'], '<SID>pydoc')<CR>
+vnoremap <buffer> <silent>K :call Help(1, ['.'], '<SID>pydoc')<CR>
diff --git a/vim/ftplugin/ruby.vim b/vim/ftplugin/ruby.vim
index a7c536d..e030a3d 100644
--- a/vim/ftplugin/ruby.vim
+++ b/vim/ftplugin/ruby.vim
@@ -18,7 +18,7 @@ endif
" look up words in ri rather than man for K
function! s:ri(word)
- exe 'silent read! ri --no-pager "' . a:word . '" 2>/dev/null'
+ exe 'silent read! ri -T -f rdoc "' . a:word . '" 2>/dev/null'
endfunction
-nnoremap <buffer> <silent>K :call Help(0, [':'], '<SID>ri')<CR>
-vnoremap <buffer> <silent>K :call Help(1, [':'], '<SID>ri')<CR>
+nnoremap <buffer> <silent>K :call Help(0, [':', '.'], '<SID>ri')<CR>
+vnoremap <buffer> <silent>K :call Help(1, [':', '.'], '<SID>ri')<CR>
diff --git a/vimrc b/vimrc
index c123daa..743f314 100644
--- a/vimrc
+++ b/vimrc
@@ -437,14 +437,6 @@ function! Help(visual, iskeyword, command)
exe &helpheight . 'new'
set modifiable
exe 'call ' . a:command . '("' . l:word . '")'
- try
- silent %s/\%x1b\[\d\+m//g
- catch /.*/
- endtry
- try
- silent %s/.\%x08//g
- catch /.*/
- endtry
normal! ggdd
set buftype=nofile
set nobuflisted