Use Vim as Info Page Browser

In this post, I set up vim as a manual page viewer, using ManPageView plugin. It turned out that the same plugin can be used to view info pages as well. All one needs to to is to add ".i" suffix to the command that you are seeking help on. For example, ":Man sed.i" will show the info page for sed. With this information, we can set up vim as info page browser, just add these lines in ~/.bashrc:

vinfo() {
/usr/bin/vim -c "Man $@.i" -c 'silent! only' -c 'nmap q :q<cr>'
}
alias info='vinfo'

Now open a terminal, type info whatever will show the info page of whatever you are seeking help on, if it exists, with nice syntax highlighting and easy to use key bindings. One caveat is that you would get an blank page if the info page does not exist, instead of getting the top level info directory as with the real info command. However, real info command doesn't have syntax highlighting and familiar key-bindings, so I stick with vim.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account associated with the e-mail address you provide, it will be used to display your avatar.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <div> <h1><h2><h3><sub><sup><b><i><u><font><img>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Lines and paragraphs break automatically.

More information about formatting options

To prevent automated spam submissions leave this field empty.
Nice place