diff options
author | Jesse Luehrs <doy@tozt.net> | 2009-12-16 01:54:56 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2009-12-16 01:54:56 -0600 |
commit | cd6447b827ec2e30d5a3a94e5c7e700c3819086d (patch) | |
tree | c1ed5f082369b240b1829633f4855fcf2d68ffba | |
parent | 7e8fb301acc266b480ed90adb678909ed347a22c (diff) | |
download | conf-cd6447b827ec2e30d5a3a94e5c7e700c3819086d.tar.gz conf-cd6447b827ec2e30d5a3a94e5c7e700c3819086d.zip |
always filter backspaces and escape chars in the help window
-rw-r--r-- | vim/ftplugin/perl.vim | 6 | ||||
-rw-r--r-- | vimrc | 12 |
2 files changed, 10 insertions, 8 deletions
diff --git a/vim/ftplugin/perl.vim b/vim/ftplugin/perl.vim index bce3faa..0f6e968 100644 --- a/vim/ftplugin/perl.vim +++ b/vim/ftplugin/perl.vim @@ -7,12 +7,6 @@ function! s:perldoc(word) let perldoc_pager = $PERLDOC_PAGER let $PERLDOC_PAGER = 'cat' exe 'silent read! perldoc -f "' . a:word . '" 2>/dev/null || perldoc "' . a:word . '"' - try - silent %s/\%x1b\[\d\+m//g - silent %s/.\%x08//g - catch /.*/ - endtry - normal ggdd let $PERLDOC_PAGER = perldoc_pager set ft=man endfunction @@ -462,13 +462,21 @@ function Help(visual, iskeyword, command) exe &helpheight . 'new' set modifiable exe 'call ' . a:command . '("' . word . '")' + try + silent %s/\%x1b\[\d\+m//g + catch /.*/ + endtry + try + silent %s/.\%x08//g + catch /.*/ + endtry + normal ggdd set bt=nofile set nobuflisted set nomodifiable endfunction function s:man(word) - exe 'silent read! man -P"col -b" ' . a:word - normal ggdd + exe 'silent read! man -Pcat ' . a:word set ft=man endfunction nmap <silent>K :call Help(0, [], '<SID>man')<CR> |