Coder Social home page Coder Social logo

vim-rfc's Introduction

vim-rfc is a plugin for easy querying of the RFC database and loading RFC/STD documents into a Vim buffer.

vim-rfc in action!

If you use any of my plugins, please star them on github. It’s a great way of getting feedback and gives me the kick to put more time into their development. If you encounter any bugs or have feature requests, just open an issue report on Github.

Follow me: Twitter | SO

Installation

If you don’t have a plugin manager, I suggest having a look at vim-plug. Installation is a breeze afterwards:

call plug#begin('~/.vim/bundle')
  Plug 'mhinz/vim-rfc'
  Plug 'vim-scripts/rfc-syntax', { 'for': 'rfc' } " optional syntax highlighting for RFC files
call plug#end()

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

.is really simple.

Query the database: :RFC <regexp>

Rebuild cache and query the database: :RFC! <regexp>

A new window with all matches will be shown. Now you can simply use <cr> to open the entry.

If you don’t want to open anything, hit q.

Tip
Since regular expressions are used, :RFC .* will list all documents. Makes it easy to search.

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.

License

MIT license. Copyright (c) 2015 Marco Hinz.

vim-rfc's People

Contributors

andreaswachowski avatar andrey-starodubtsev avatar mhinz avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.