Skip to content
/ vim-rfc Public
forked from mhinz/vim-rfc

📓 Query RFC database and download RFCs from within Vim.

License

Notifications You must be signed in to change notification settings

hmpop/vim-rfc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vim-rfc allows querying the RFC database and opening any RFC/STD document in Vim.

vim-rfc in action

Installation

Use your favorite plugin manager.

Using vim-plug:

Plug 'mhinz/vim-rfc'

Restart Vim and :PlugInstall, then have a look at the docs: :h rfc.

Dependencies

This plugin requires Ruby support compiled into Vim: :echo has('ruby')

Additionaly, nokogiri is used as XML parser:

$ gem install nokogiri

Usage

List documents:

:RFC [regexp]

Rebuild cache and list documents:

:RFC! [regexp]

A new window with all matches will be shown. Use <cr> to open an entry or q to quit. If there is only a single match, it gets opened right away.

Examples: :RFC, :RFC 100, :RFC http/2, :RFC ipv4 addresses.

Within a RFC document, if you are on a line from the table of contents, <c-]>/<cr> will jump to the referenced section. On a string like STD 10 or RFC 1234 (which should also be highlighted), it opens the referenced document instead. Use <c-o> to jump back.

Configuration

There are no options, but you can change the default colors used in the window opened by :RFC. See :h rfc-colors.

Internals

If you use this plugin for the first time it downloads an index file from the internet. To parse that XML file a SAX parser, nokogiri, is used which is a event-driven XML parser written in C.

The parse tree is saved in a Ruby hash and written to a cachefile in YAML format. The file is located in ~/.vim-rfc.yml.

If you issue a query, the cachefile will be used for the lookup. The resulting hash will be provided back to the Vim environment.

At the end the index file will be removed, since it's not needed anymore.

If you use the plugin for the second time, the cachefile will be used right away and downloading the 8 MiB index will be omitted.

Author and Feedback

If you like my plugins, please star them on Github. It's a great way of getting feedback. Same goes for issues reports or feature requests.

About

📓 Query RFC database and download RFCs from within Vim.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 71.0%
  • Ruby 29.0%