読者です 読者をやめる 読者になる 読者になる

.vimperatorrc晒し

あまりカスタマイズしてないけど。
今は使ってない機能とかも残ってると思うし、ただコピペしてきただけのところもあるので注意。
ひとつひとつコメントを書こうかなと思ったけど、面倒だったのでやめた。

set titlestring=Firefox
set ignorecase
set complete=Sl
set focuscontent
set visualbell
set activate=homepage,quickmark,tabopen,paste
set hintmatching=custom

colorscheme indigo

map j 5<C-e>
map k 5<C-y>

cmap <C-n> <TAB>
cmap <C-p> <S-TAB>
cmap <C-i> <TAB>
map h <C-p>
map l <C-n>

com! -complete=bookmark -nargs=+ ob :t <args>
com! -complete=history -nargs=+ oh :t <args>

map ,b :ob
map ,h :oh

nnoremap <C-g> g<C-g>

noremap ! :open javascript:(function()%7Bvar%20s=document.createElement('style');s.type='text/css';s.innerHTML=%22*%7Bfont-family:'IPAMonaPGothic'%20!important;font-size:12pt%20!important;%7D%22;document.getElementsByTagName('head')%5B0%5D.appendChild(s);%7D)();<CR>

set history=0

style chrome://* #statusbar-display[type="overLink"] {display: none !important;}

set! ui.key.generalAccessKey=0

set nextpattern=^次(へ|の|ペ)?,^続き,NEXT,(next|more),^(>>*|»)
set previouspattern=^前(へ|の|ペ)?,^戻る,BACK,(prev|previous),^(<<*|«)
let g:nextlink_nositeinfo_act = "f"

let g:hints_for_embedded_mode="e"
noremap ;e :embhint<CR>

let use_hints_ext_hinttags=1
let use_hints_ext_extendedhinttags=1

silent command! -nargs=+ lazy autocmd VimperatorEnter .* <args>
"lazy fmaps -u='www\.google\.co(m|\.jp)/reader' -events=vkeypress j k n p m s v A r S N P X O gh ga gs gt gu u / ? J K
"lazy fmaps -u='fastladder\.com/reader' -events=vkeypress s a r w W c j k z p o v > < f
lazy fmaps -u='reader\.livedoor\.com/reader' -events=vkeypress s a r w W c j k z p o v > < f

silent bmark -title="google" -tags=keyword -keyword=g http://www.google.co.jp/search?q=%s
silent bmark -title="twitter" -tags=keyword -keyword=tw http://twitter.com/%s
silent bmark -title="nico" -tags=keyword -keyword=ni http://www.nicovideo.jp/search/%s
silent bmark -title="nico sm" -tags=keyword -keyword=sm http://www.nicovideo.jp/watch/sm%s
silent bmark -title="nico ranking" -tags=keyword -keyword=nira http://www.nicovideo.jp/ranking
silent bmark -title="cpan" -tags=keyword -keyword=cpan http://metacpan.org/search?q=%s
silent bmark -title="google translate" -tags=keyword -keyword=tr http://translate.google.co.jp/translate_t?q=%s

javascript <<EOM
liberator.globalVariables.copy_templates = [
  { label: 'url',         value: '%URL%', map: 'y' },
  { label: 'titleAndURL', value: '%TITLE% %ENCODEDURL%', map: ',y' },
  { label: 'title',       value: '%TITLE%' },
  { label: 'anchor',      value: '<a href="%ENCODEDURL%">%TITLE%</a>' },
];
EOM

javascript <<EOM
liberator.globalVariables.stella_nico_use_comment=true
function addLocalMappings(buffer, maps) {
  maps.forEach(
    function (map) {
      let [cmd, action, extra] = map;
      let actionFunc = action;
      extra || (extra = {});

      if (typeof action == "string") {
        if (action.charAt(0) == ':')
          actionFunc = extra.open ? function () commandline.open("", action, modes.EX)
                                  : function () liberator.execute(action);
        else
          actionFunc = function () events.feedkeys(action, extra.noremap, true);
      }
      extra.matchingUrls = buffer;
      mappings.addUserMap(
        [modes.NORMAL],
        [cmd],
        "Local mapping for " + buffer,
        actionFunc,
        extra
      );
    }
  );
}

addLocalMappings(
  /^(http:\/\/(es|www).nicovideo.jp\/(watch|playlist\/mylist)|http:\/\/(jp|www)\.youtube\.com\/watch|http:\/\/(www\.)?vimeo\.com\/(channels\/(hd)?#)?\d+)/,
  [
    ['<C-g>', ':pageinfo S',      ],
    ['p',     ':stplay',          ],
    ['m',     ':stmute',          ],
    ['c',     ':stcomment',       ],
    ['zz',    ':stlarge',         ],
    ['s',     ':stseek! 15',      ],
    ['S',     ':stseek! -15',     ],
    ['v',     ':stvolume! 10',    ],
    ['V',     ':stvolume! -10',   ],
    ['e',     ':strelations ',    {open: true}],
    ['E',     ':strelations! ',   {open: true}],
  ]
);
EOM

プラグイン一覧

% ls ~/.vimperator/plugin
_libly.js          hints-yank-paste.js   prevent-pseudo-domain.js
caret-hint.js      migemo-find.js        sbmcommentsviewer.js
copy.js            migemo_completion.js  statusline-toolbar.js
feedSomeKeys_3.js  migemo_hint.js        stella.js
hints-ext.js       nextlink.js

とりあえずfeedSomeKeys_3.jsとstella.jsは必須。migemo系はFirefoxのアドオンのXUL/Migemoと合わせて使う。
prevent-pseudo-domain.jsは:t jquery.jsとしたときにhttp://jquery.jsに飛ばずに検索してくれるもの。


実際、FirefoxってVimperatorだよね。