Viewing info documentation with vim

documentationinfovim

I'm trying to use the ManPageView addon to view info documentation within vim.

Although I find ManPageView very useful for, well, viewing manpages, its info-reading functionality doesn't seem to work at all. But then I almost never read info documentation, mostly because it doesn't seem worth taking the time to learn the info interface. So I may be doing it wrong.

Anyhow: running :Man info.i as suggested by the ManPageView documentation gives me

info: No menu item `(info)Top' in node `(dir)Top'.
info: No menu item `(info)Top' in node `(dir)Top'.
info: No menu item `(info)Top' in node `(dir)Top'.
***warning*** sorry, no manpage exists for <(info)Top>

I see some success if I delete the following lines, which start at line 345 in the file autoload/manpageview.vim:

" special exception for info {{{3
if a:viamap == 0 && ext == "i"
 let s:manpageview_pfx_i = "(".manpagetopic.")"
 let manpagetopic        = "Top"
" call Decho("top-level info: manpagetopic<".manpagetopic.">")
endif

Deleting those lines will allow :Man info.i to work, but I still can't follow links in the displayed page.

It works by calling info on the command line and capturing the output, so perhaps it's just that info's CLI has changed? Specifically, $ info info Advanced will bring up the topic "Advanced" within the "info" node. I dug around in the addon's source code for a while but didn't find any obvious way to direct it to pass the node as an extra argument instead of doing what it seems to be supposed to do, which is to wrap the node name in parentheses and prefix it to the topic, passing the combination as a single command-line argument to info.

I've not tried to use this addon to view info documentation before. I'm running an updated ubuntu 10.10, using the vim-gnome package.

I've filed some semblance of a bug report at what seems to be the recommended location

Have others had success using this addon to view info documentation? I feel like I'm lost in the mists that eternally shroud the outer reaches of Obscurity.

note: Whilst composing this message, I've discovered the info addon, which seems to work acceptably, at least at first glance.

Best Answer

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.

Related Question