Wikia

Vim Tips Wiki

Changes: See man pages by gview

Edit

Back to page

(Move categories to tip template)
(Change <tt> to <code>, perhaps also minor tweak.)
 
Line 4: Line 4:
 
|previous=1336
 
|previous=1336
 
|next=1341
 
|next=1341
|created=September 22, 2006
+
|created=2006
 
|complexity=basic
 
|complexity=basic
 
|author=gosman
 
|author=gosman
Line 12: Line 12:
 
|category2=
 
|category2=
 
}}
 
}}
First, source the script <tt>man.vim</tt> in your vimrc like below, then you can use <tt>:Man</tt> command.
+
First, source the script <code>man.vim</code> in your vimrc like below, then you can use <code>:Man</code> command.
   
 
<pre>
 
<pre>
Line 18: Line 18:
 
</pre>
 
</pre>
   
Then, create a bash script <tt>gman</tt> like below:
+
Then, create a bash script <code>gman</code> like below:
   
 
<pre>
 
<pre>

Latest revision as of 06:21, July 13, 2012

Tip 1338 Printable Monobook Previous Next

created 2006 · complexity basic · author gosman · version n/a


First, source the script man.vim in your vimrc like below, then you can use :Man command.

source /usr/share/vim/vim70/ftplugin/man.vim

Then, create a bash script gman like below:

#!/bin/bash
#gman use gview to see the man pages
#usage: gman name
#example: gman ls
gview -c \"Man $1\" -c only

Now you can see man pages by gman, and you can use scrollbar to browse the manual.

CommentsEdit

I am fond of the following bash function which has a similar effect to this tip.

function man() {
  /usr/bin/man $* | col -b | /usr/bin/vim -R -c 'set ft=man nomod nolist' -
}

Can also do with an alias for the csh shells.


See VimTip167.


Around Wikia's network

Random Wiki