I've discovered that the easiest way to view info docs in vim is to just open them. They are just gzipped text with some binary codes added in as markup. This is especially useful to know in cases where it's not practical to install an addon.
The location of the info docs is distro-specific; under ubuntu, and presumably other debian-likes, they are at /usr/share/info/*.info.gz
. They are gzipped, but vim will handle the translation for you if you just open them.
I actually prefer this manner of viewing them to using the info
reader, as it presents the docs as one long file that you can quickly search or page through. Having an addon would still be useful to facilitate following links and such. I actually haven't tried using the info
addon mentioned in the update; I haven't needed to look at an info file since then.
I never ran it manually before, but install-info
looks like what you want (if you guessed it has an info manual, you're right, info install-info
— although there is a man page, too).
Best Answer
To create Info documentation, you first need a texi file.
.texi
- Texinfo is a typesetting syntax used for generating documentation in both on-line and printed form (creating filetypes as dvi, html, pdf, etc., and its own hypertext format, info) with a single source file. It is implemented by a computer program released as free software of the same name, created and made available by the GNU Project from the Free Software Foundation..info
- Info (Generated viamakeinfo
.) This is a specific format which essentially is a plain text version of the original Texinfo syntax in conjunction with a few control characters to separate nodes and provide navigational elements for menus, cross-references, sections, and so on. The Info format can be viewed with theinfo
program.makeinfo
is a utility that converts a Texinfo file into an Info file; it is part of the texinfo package.texinfo-format-region
andtexinfo-format-buffer
are GNU Emacs functions that do the same.Here is a texi sample to use as a template:
Convert that into Info documentation with:
Listing a New Info File
To add a new Info file to your system, write a menu entry for it in the menu in the
dir
file in theinfo
directory (/usr/share/info/
on Ubuntu). Also, move the new Info file itself to theinfo
directory. For example, if you were adding documentation for GDB, you would write the following new entry:The first part of the menu entry is the menu entry name, followed by a colon. The second part is the name of the Info file, in parentheses, followed by a period. The third part is the description.
Conventionally, the name of an Info file has a
.info
extension. Thus, you might list the name of the file like this:However, Info will look for a file with a
.info
extension if it does not find the file under the name given in the menu. This means that you can refer to the filegdb.info
asgdb
, as shown in the first example. This looks better.