HiPhish / info.vim

Browse info files from Vim (mirror)
https://gitlab.com/HiPhish/info.vim
MIT License
40 stars 6 forks source link

Additional optional mapping #9

Open nkh opened 1 year ago

nkh commented 1 year ago

I added these mappings:

nmap gg K

"use fzf for the menu nmap gm :call fzf#vim#buffer_lines('* ', 0)

There's probably a much better way to find the nodes names than just searching for "* "

HiPhish commented 1 year ago

The b:info variable contains all known information about the current node, including the menu. See :h b:info['Menu'].

nkh commented 1 year ago
Note  The menu is built lazily, it will not exists until executing a menu-related command.

Doesn't the above mean it's empty when I need the info? or is there some silent menu-related command which could be called before filling the fzf buffer?

I must admit that I'm not a fan of vimscript. On the other hand I'm so found of info.vim that I've decided to write some info files for my project (although I want to generate them from some markdown I already have).

HiPhish commented 1 year ago

Doesn't the above mean it's empty when I need the info?

I don't think this is accurate anymore. At least when I open the Bash manual and execute echo b:info the entry is there.

I must admit that I'm not a fan of vimscript.

This plugin predates Lua in Neovim. Honestly, it's very much a hackjob that leverages the standalone info binary to render the text and uses regular expressions to parse the result. Very brittle. I would love to rewrite it from scratch in Lua to parse the Info files directly. Vim script is fine for configuration (and I prefer it over Lua), but when it comes to plugins Lua is king.

The upcoming Neovim 0.10 will have lpeg included, so it might be viable to write a proper parser.

On the other hand I'm so found of info.vim that I've decided to write some info files for my project (although I want to generate them from some markdown I already have).

Info files are generated from Texinfo files. It might not be the nicest markup language, but it's not bad either. For any manual which warrants the complexity of the Info format I would never use Markdown in the first place.