On Fri, Mar 09, 2012 at 07:05:58PM +0000, Phil Dobbin wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1

> Hi, all.

> I quite often send various man pages & the like to Vim like so:

> `$ man foo | ul -i | vim -`

> which works great but it tends to bring with it some non-ASCII, control
> & null (ASCII0) characters with it. When doing this on OS X I've been
> sending the file to BBEdit which has a Zaps Gremlins command which rids
> me of the offending characters so then I can use :harcopy in MacVim to
> save the resultant file as a PDF.

> Is there anyway I can zap these gremlins from inside Vim & therefore
> negate the BBEdit part of the workflow? It'll also free me up to do it
> on my Linux boxes too.

you can put the following in your ~/.bashrc:

function vman() { man "$@" 2>&1 | col -bx | iconv -c | vim -c 'set ft=man nomod 
nolist' -c 'call Hideme()' -; }

(all one line)

where Hideme() is defined in your .vimrc as

function! Hideme()
    setlocal noswapfile
    setlocal buftype=nofile
    setlocal bufhidden=hide
endfunction

i use it a lot and never see any gremlins, with the added benefit of
syntax highlighting on the man page

sc

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to