On Tue, 13 Mar 2012, Phil Dobbin wrote:

On 13/03/2012 10:52, Thor Andreassen wrote:
On Fri, Mar 09, 2012 at 07:05:58PM +0000, Phil Dobbin wrote:
Hi, all.

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

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

Not exactly what you asked for, but here is how I do it. In my .vimrc I've got:

source $VIMRUNTIME/ftplugin/man.vim

Slightly better:

run ftplugin/man.vim

(:run[time] is like :source except it searches the paths in 'runtimepath')


which makes the Man command available. In my shell startup file I define a function that will open the man page in vim, something like this:

manvim() { vim -c "Man $1" -c 'silent! only'; }

Hi, Thor.

This is getting curiouser & curiouser; that won't work for me either.

I've appended the first line into my ~/.vimrc & the second to my ~/.bashrc (this on Linux).

You could also combine the lot:

manvim () { vim -c 'run ftplugin/man.vim' -c "Man $1" -c 'sil! only' ; }

This worked fine for me under Linux (OpenSUSE) as-is.

For OS X, (where I don't have a .vimrc on the machine on which I tested), it also took turning on syntax highlighting:

manvim () {
        vim -c 'syn on' \
                -c 'run ftplugin/man.vim' \
                -c "Man $1" \
                -c 'sil! only'
}

If that doesn't work, please expand upon how it "won't work".

--
Best,
Ben

--
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