Skip to content

Instantly share code, notes, and snippets.

@kaosf
Created January 22, 2016 10:33
Show Gist options
  • Select an option

  • Save kaosf/caee5c098989504ef41f to your computer and use it in GitHub Desktop.

Select an option

Save kaosf/caee5c098989504ef41f to your computer and use it in GitHub Desktop.
るりま(Ruby リファレンスマニュアル)を最新に更新するvimperator用コマンド

https://gist.github.com/long-long-float/c542e5232dfd297ab724 のforkみたいなものです.FirefoxのVimperatorのための設定です.

  1. vimperatorrcをあなたの~/.vimperatorrcにコピペして下さい
  2. るりまのページに行きます
  3. うわっ,古いって思ったら :rurimaupdate すると最新の(ではなくJavaScriptコード内のVERSION)るりまになります

rurima じゃなくて rurema に変えたりとかは各自お好みでお願いします.

var VERSION = "2.3.0";
if(content.location.hostname === "docs.ruby-lang.org") {
var p = content.location.pathname;
var v = p.match(/^\/ja\/([\d\.]+)\//);
if(v && v[1] !== VERSION) {
content.location.pathname = p.replace(v[1], VERSION);
}
}
:command! rurimaupdate :js (function(){var VERSION="2.3.0";if("docs.ruby-lang.org"===content.location.hostname){var p=content.location.pathname,v=p.match(/^\/ja\/([\d\.]+)\//);v&&v[1]!==VERSION&&(content.location.pathname=p.replace(v[1],VERSION))};})();

ghost commented Jan 22, 2016

Copy link
Copy Markdown

Most of the limits below affect both GitHub and the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment