[CLUE-Talk] Viewing man pages with vi or Emacs

John H Swaby polymath at uwyo.edu
Wed Jan 10 00:02:59 MST 2001


Tonight at the meeting I mentioned two handy ways of viewing
man pages using either vi or Emacs.

vi method:

  This certainly works with the "more" pager (you'll have to
  experiment to see if it works with the "less" pager).

  After running, for example,

    man ksh

  press "v"; this will put you into vi-mode.

  Then to get rid of all of those annoying backspace characters,
  press ":" to put yourself into ex-mode and enter

    %s/.^H//g

  where ^H is control-H.  You can obtain this by pressing control-V
  followed by control-H.

  Now this will put you at the bottom of the man page.  To get back
  to the top, enter, of course, 1 G.


Emacs method:

  When in Emacs and you would like to view a man page, press M-x
  and enter

    man

  (M-x stands for Meta-x and on a PC is the left Alt key.  On
  a Sun box it is either of the diamond keys on either side of
  the space bar.  If these don't work, you can invoke the same
  function by pressing the escape key followed by pressing the
  "x" key.)

  Emacs will now prompt you for the man page.  So, for example,
  enter

    ksh

  Here are the commands available in the Emacs man-mode:

    m       Prompt to retrieve a new manpage.
    r       Retrieve reference in SEE ALSO section.
    M-n     Jump to next manpage in circular list.
    M-p     Jump to previous manpage in circular list.
    n       Jump to next manpage section.
    p       Jump to previous manpage section.
    g       Go to a manpage section.
    s       Jumps to the SEE ALSO manpage section.
    q       Deletes the manpage window, bury its buffer.
    k       Deletes the manpage window, kill its buffer.
    ?       Prints this help text.

  With the r command above this gives the man system a bit
  of the hypertext functionality of the GNU Info system.

Enjoy!

EMACS is the

  E xtensible
  M odifiable
  A lgorithmic
  C omputer
  S ystem






More information about the clue-talk mailing list