On 09/03/12 21:41, Phil Dobbin wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 09/03/2012 19:33, sc wrote:
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
It doesn't work on my OS X box (I haven't checked it yet in Fedora or
Debian). The gremlins are still present & there's no syntax
highlighting in the man pages.
Cheers,
Phil...
It assumes that you are using a Vim version compiled with +syntax and
+quickfix, which usually means a Normal version or better (check near
the top of the output of the :version command). In addition, in order to
see syntax highlighting you have to enable it, by means of one (any one)
of the following lines in your vimrc:
syntax on
or
source $VIMRUNTIME/vimrc_example.vim
or
runtime vimrc_example.vim
Best regards,
Tony.
--
The goal of Computer Science is to build something that will last at
least until we've finished building it.
--
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