| 1 | " retlet .vimperatorrc |
|---|
| 2 | " for Vimperator hg head |
|---|
| 3 | |
|---|
| 4 | " prefs |
|---|
| 5 | " ====================================================================== |
|---|
| 6 | " ページのアクセスキーを無効化 |
|---|
| 7 | set! ui.key.generalAccessKey=0 |
|---|
| 8 | |
|---|
| 9 | " Awesomebarの補完対象にBookmarkletを含める |
|---|
| 10 | set! browser.urlbar.filter.javascript=false |
|---|
| 11 | |
|---|
| 12 | " ポップアップ許可数を拡張 cf.http://la.ma.la/blog/diary_200611171115.htm |
|---|
| 13 | set! dom.popup_maximum=9999 |
|---|
| 14 | |
|---|
| 15 | " Gmail/LDR/Fastladder/OpenFL/はてブでは新規タブをバックグラウンドで開く |
|---|
| 16 | autocmd LocationChange ^(?!https?://(mail\\.google\\.com/(mail|a)/|(reader\\.livedoor\\.com|fastladder\\.com|0\\.0\\.0\\.0\:3000)/reader/|b\\.hatena\\.ne\\.jp/(?!entry/http|articles|guide))) :set! browser.tabs.loadDivertedInBackground=false |
|---|
| 17 | autocmd LocationChange ^https?://(mail\\.google\\.com/(mail|a)/|(reader\\.livedoor\\.com|fastladder\\.com|0\\.0\\.0\\.0\:3000)/reader/|b\\.hatena\\.ne\\.jp/(?!entry/http|articles|guide)) :set! browser.tabs.loadDivertedInBackground=true |
|---|
| 18 | |
|---|
| 19 | " Tumblr DashboardでAutoPagerizeのBASE_REMAIN_HEIGHTを変更 |
|---|
| 20 | autocmd VimperatorEnter .* :autocmd GMInjectedScript "www\\.tumblr\\.com/dashboard" :js liberator.eval("ap.remainHeight = 5000", plugins.gmperator.currentSandbox.window.AutoPagerize.addFilter) |
|---|
| 21 | |
|---|
| 22 | " options |
|---|
| 23 | " ====================================================================== |
|---|
| 24 | set defsearch=g |
|---|
| 25 | |
|---|
| 26 | " ex mode でインクリメント補完 |
|---|
| 27 | set wildoptions=auto |
|---|
| 28 | |
|---|
| 29 | " :[tab]open の補完対象と順番 |
|---|
| 30 | set complete=tsl |
|---|
| 31 | |
|---|
| 32 | " ブラウザタイトルの変更 |
|---|
| 33 | set titlestring=*g* |
|---|
| 34 | |
|---|
| 35 | " GUI Options |
|---|
| 36 | set go=rb |
|---|
| 37 | |
|---|
| 38 | " タブを非表示 |
|---|
| 39 | set showtabline=0 |
|---|
| 40 | |
|---|
| 41 | " リンクのURIをコマンドラインに表示 |
|---|
| 42 | set showstatuslinks=2 |
|---|
| 43 | |
|---|
| 44 | " ページロード時にテキストボックスにフォーカスするのを防ぐ |
|---|
| 45 | set focuscontent |
|---|
| 46 | |
|---|
| 47 | " Beep設定 |
|---|
| 48 | set visualbell |
|---|
| 49 | hi Bell display: none; |
|---|
| 50 | |
|---|
| 51 | " mappings |
|---|
| 52 | " ====================================================================== |
|---|
| 53 | " undo一覧から開く |
|---|
| 54 | noremap U :undo<Space> |
|---|
| 55 | |
|---|
| 56 | " C-r でブラウザ再起動 |
|---|
| 57 | noremap <C-r> :restart<CR> |
|---|
| 58 | |
|---|
| 59 | " 上のディレクトリに移動 |
|---|
| 60 | noremap <BS> gu |
|---|
| 61 | noremap <C-BS> gU |
|---|
| 62 | |
|---|
| 63 | " j/k でのスクロール幅を1行から3行に変更 |
|---|
| 64 | noremap j 3j |
|---|
| 65 | noremap k 3k |
|---|
| 66 | noremap <C-j> 3j |
|---|
| 67 | noremap <C-k> 3k |
|---|
| 68 | |
|---|
| 69 | " J/K をC-d/u互換に |
|---|
| 70 | noremap J <C-d> |
|---|
| 71 | noremap K <C-u> |
|---|
| 72 | |
|---|
| 73 | " タブ移動 |
|---|
| 74 | noremap h <C-p> |
|---|
| 75 | noremap l <C-n> |
|---|
| 76 | |
|---|
| 77 | " タブ順序変更 |
|---|
| 78 | noremap <C-h> :tabmove! -1<CR> |
|---|
| 79 | noremap <C-l> :tabmove! +1<CR> |
|---|
| 80 | |
|---|
| 81 | " buffer |
|---|
| 82 | noremap . b |
|---|
| 83 | |
|---|
| 84 | " 未分類のブックマークに追加/削除 |
|---|
| 85 | noremap ,a A |
|---|
| 86 | |
|---|
| 87 | " ! でページのCSSをon/off |
|---|
| 88 | noremap ! :set invum<CR> |
|---|
| 89 | |
|---|
| 90 | " ex modeでC-jを無効化 |
|---|
| 91 | cnoremap <C-j> <Nop> |
|---|
| 92 | |
|---|
| 93 | " plugins |
|---|
| 94 | " ====================================================================== |
|---|
| 95 | let g:plugin_loader_roots = "~/Sites/vimperator-plugins/trunk/ ~/Sites/git/vimperator-plugins/ ~/Sites/git/281167/" |
|---|
| 96 | let g:plugin_loader_plugins = "_libly,appendAnchor,auto_reload,copy,direct_bookmark,feedSomeKeys_2,gmperator,hatenaStar,hint-tombloo,ldrize_cooperation,localkeymode,maine_coon,migemo-find,migemo_completion,multi_requester,nicontroller,no-reading,pino,pixiv_tools,proxy,sbmcommentsviewer,tombloo,twitter,walk-input,youtubeamp,opener" |
|---|
| 97 | |
|---|
| 98 | " no-reading.js |
|---|
| 99 | let g:no_reading_do_echo = 1 |
|---|
| 100 | |
|---|
| 101 | " appendAnchor.js |
|---|
| 102 | let g:auto_append_anchor = "true" |
|---|
| 103 | |
|---|
| 104 | " sbmcommentsviewer.js |
|---|
| 105 | let g:def_sbm_format = "timestamp,id,tagsAndComment" |
|---|
| 106 | let g:def_sbms = "hdl" |
|---|
| 107 | map b :viewSBMComments<CR> |
|---|
| 108 | |
|---|
| 109 | " direct_bookmark.js |
|---|
| 110 | let g:direct_sbm_use_services_by_tag = "h" |
|---|
| 111 | let g:direct_sbm_use_services_by_post = "h" |
|---|
| 112 | let g:direct_sbm_is_normalize = "false" |
|---|
| 113 | let g:direct_sbm_is_use_migemo = "true" |
|---|
| 114 | noremap B :bentry<CR> |
|---|
| 115 | noremap a :sbm<CR> |
|---|
| 116 | noremap A :sbm<Space> |
|---|
| 117 | "noremap ,a :btags<CR> |
|---|
| 118 | autocmd VimperatorEnter .* :btags |
|---|
| 119 | |
|---|
| 120 | " hatenabookmark.js |
|---|
| 121 | js <<EOM |
|---|
| 122 | liberator.globalVariables.hBookmark_shortcuts = { |
|---|
| 123 | hintsAdd : ' ', |
|---|
| 124 | hintsComment : ' ', |
|---|
| 125 | add : ['C'], |
|---|
| 126 | comment : ['c'], |
|---|
| 127 | }; |
|---|
| 128 | if (typeof hBookmark != 'undefined') liberator.loadScript('chrome://hatenabookmark/content/vimperator/plugin/hatenabookmark.js', {__proto__: this}); |
|---|
| 129 | EOM |
|---|
| 130 | noremap s :hbtab<Space> |
|---|
| 131 | noremap S :hbtab<Space> |
|---|
| 132 | " ldrize_cooperation.js |
|---|
| 133 | let g:ldrc_captureMappings = "['j','k','p','o','?']" |
|---|
| 134 | "let g:ldrc_intelligence_bind = "true" |
|---|
| 135 | "let g:ldrc_skip = "0" |
|---|
| 136 | noremap Q :toggleldrc<CR> |
|---|
| 137 | |
|---|
| 138 | " multi_requester.js |
|---|
| 139 | noremap ,t :twitter<Space> |
|---|
| 140 | noremap ,T :twitter!<Space> |
|---|
| 141 | noremap ,@ :twitter!@<CR> |
|---|
| 142 | noremap ,mt :mr<Space>twitter-search-pcod-no-jp<Space> |
|---|
| 143 | noremap ,mT :mr<Space>twitter-search-pcod-no-jp<Space>["retlet"]<CR> |
|---|
| 144 | noremap ,mf :mr<Space>favotter-new<Space> |
|---|
| 145 | noremap ,mF :mr<Space>favotter-new<Space>["retlet"]<CR> |
|---|
| 146 | |
|---|
| 147 | " encodingSwitcher.js |
|---|
| 148 | noremap ,es :set encoding=Shift_JIS<CR> |
|---|
| 149 | noremap ,ec :set encoding=EUC-JP<CR> |
|---|
| 150 | noremap ,eu :set encoding=UTF-8<CR> |
|---|
| 151 | noremap ,ei :set encodeing=ISO-2022-JP<CR> |
|---|
| 152 | |
|---|
| 153 | " copy.js |
|---|
| 154 | noremap ,c :copy<Space> |
|---|
| 155 | js <<EOM |
|---|
| 156 | liberator.globalVariables.copy_templates = [ |
|---|
| 157 | { label: 'titleAndURL', value: '%TITLE% %URL%' }, |
|---|
| 158 | { label: 'title', value: '%TITLE%' }, |
|---|
| 159 | { label: 'url', value: '%URL%' }, |
|---|
| 160 | { label: 'markdown', value: '[%TITLE%](%URL% "%TITLE%")' }, |
|---|
| 161 | { label: 'markdownsel', value: '[%SEL%](%URL% "%TITLE%")' }, |
|---|
| 162 | { label: 'htmlblockquote', value: '<blockquote cite="%URL%" title="%TITLE%">%HTMLSEL%</blockquote>' } |
|---|
| 163 | ]; |
|---|
| 164 | EOM |
|---|
| 165 | |
|---|
| 166 | " localkeymode.js |
|---|
| 167 | let g:localkeymode_enable = "true" |
|---|
| 168 | js <<EOM |
|---|
| 169 | liberator.globalVariables.localKeyMappings=[ |
|---|
| 170 | [/^http:\/\/www\.nicovideo\.jp\/watch/, [ |
|---|
| 171 | ['p', ':nicopause'], |
|---|
| 172 | ['m', ':nicomute'], |
|---|
| 173 | ['v', ':nicommentvisible'], |
|---|
| 174 | ['s', ':nicoseek! +10'], |
|---|
| 175 | ['S', ':nicoseek! -10'], |
|---|
| 176 | ['z', ':nicosize'], |
|---|
| 177 | //['c', ':nicomment ', true], |
|---|
| 178 | //['C', ':nicommand ', true], |
|---|
| 179 | ]], |
|---|
| 180 | [/^http:\/\/www\.youtube\.com\/watch/, [ |
|---|
| 181 | ['p', ':ytpause'], |
|---|
| 182 | ['m', ':ytmute'], |
|---|
| 183 | ['z', ':ytsize'], |
|---|
| 184 | ['s', ':ytseek! +10'], |
|---|
| 185 | ['S', ':ytseek! -10'], |
|---|
| 186 | ]], |
|---|
| 187 | ]; |
|---|
| 188 | EOM |
|---|
| 189 | |
|---|
| 190 | " feedSomeKeys_2.js |
|---|
| 191 | autocmd LocationChange .* :fmapc |
|---|
| 192 | " Gmail |
|---|
| 193 | autocmd LocationChange ^https?://mail\\.google\\.com/(mail|a)/ :fmap! c / j k n p o u e x s r a # [ ] z ? gi gs gt gd ga gc |
|---|
| 194 | " Tumblr (use: tombloo.xpi, dashboard+tombloo.user.js, reblogcommand.user.js, playontumblr.user.js) |
|---|
| 195 | autocmd LocationChange ^http://.*\\.tumblr\\.com/ :fmap! i,tj e,tk n,h |
|---|
| 196 | " favotter (use: twitfavcommandminibuffer.user.js) |
|---|
| 197 | autocmd LocationChange ^http://favotter\\.matope\\.com/ :fmap! f,F |
|---|
| 198 | " LDR/Fastladder/OpenFL (use: tombloo.xpi, ldr+tombloo.user.js, ldr_relative_rate.user.js) |
|---|
| 199 | autocmd LocationChange ^http://(reader\\.livedoor\\.com|fastladder\\.com|0\\.0\\.0\\.0\:3000)/reader/ :fmap! j k s a p v c z Z b,i B,b i,Tj e r < > o,vj J,<Space> K,<S-Space> q w g u T |
|---|
| 200 | " iview |
|---|
| 201 | autocmd LocationChange ^chrome://iviewfx/content/iview\\.html :fmap! j k s a z o i,tj p |
|---|
| 202 | " はてブ |
|---|
| 203 | autocmd LocationChange ^http://b\\.hatena\\.ne\\.jp/(?!entry|articles|guide) :fmap! j k o,oj e a,b |
|---|
| 204 | |
|---|
| 205 | " javascripts |
|---|
| 206 | " ====================================================================== |
|---|
| 207 | " 読込に失敗した画像を再読込 |
|---|
| 208 | " cf.http://d.hatena.ne.jp/caisui/20090502/1241256689 |
|---|
| 209 | "js <<EOM |
|---|
| 210 | "(function(){ |
|---|
| 211 | " var obj={ |
|---|
| 212 | " reload:function(){ |
|---|
| 213 | " obj.core.call(this,content.window); |
|---|
| 214 | " },core:function(aWindow){ |
|---|
| 215 | " var w=aWindow; |
|---|
| 216 | " for(var i=0,j=w.frames.length;i<j;++i){ |
|---|
| 217 | " arguments.callee.call(this,w.frames[i]); |
|---|
| 218 | " } |
|---|
| 219 | " var cnt=0,req,img,list=w.document.images; |
|---|
| 220 | " for(var i=0,j=list.length;i<j;++i){ |
|---|
| 221 | " img=list[i]; |
|---|
| 222 | " if(img instanceof Ci.nsIImageLoadingContent && img.currentURI){ |
|---|
| 223 | " req = img.getRequest(Ci.nsIImageLoadingContent.CURRENT_REQUEST); |
|---|
| 224 | " if(req && !(req.imageStatus & req.STATUS_LOAD_COMPLETE)){ |
|---|
| 225 | " img.forceReload(); |
|---|
| 226 | " ++cnt; |
|---|
| 227 | " } |
|---|
| 228 | " } |
|---|
| 229 | " } |
|---|
| 230 | " liberator.echo("reload image:"+cnt); |
|---|
| 231 | " } |
|---|
| 232 | " } |
|---|
| 233 | " commands.addUserCommand(["reloadimage"],"reload images",obj.reload,true); |
|---|
| 234 | "})(); |
|---|
| 235 | "EOM |
|---|
| 236 | |
|---|
| 237 | " ステータスバーにfeedボタンを表示 |
|---|
| 238 | js <<EOM |
|---|
| 239 | (function(){ |
|---|
| 240 | var feedPanel = document.createElement('statusbarpanel'); |
|---|
| 241 | var feedButton = document.getElementById('feed-button'); |
|---|
| 242 | feedPanel.setAttribute('id','feed-panel-clone'); |
|---|
| 243 | feedPanel.appendChild(feedButton.cloneNode(true)); |
|---|
| 244 | feedButton.parentNode.removeChild(feedButton); |
|---|
| 245 | document.getElementById('status-bar').insertBefore(feedPanel,document.getElementById('security-button')); |
|---|
| 246 | })(); |
|---|
| 247 | EOM |
|---|
| 248 | |
|---|
| 249 | " feedSomeKeys_2.jsとlocalkeymode.jsの相性問題対応パッチ |
|---|
| 250 | " cf.http://vimperator.g.hatena.ne.jp/nokturnalmortum/20081220/1229773089 |
|---|
| 251 | js <<EOM |
|---|
| 252 | autocommands.add( |
|---|
| 253 | 'VimperatorEnter', |
|---|
| 254 | /.*/, |
|---|
| 255 | function () { |
|---|
| 256 | let (orig = plugins.LocalKeyMode.loadKeyMap) { |
|---|
| 257 | plugins.LocalKeyMode.loadKeyMap = function () { |
|---|
| 258 | if (!liberator.plugins.feedKey || liberator.plugins.feedKey.origMap.length <= 0) |
|---|
| 259 | orig.call(plugins.LocalKeyMode); |
|---|
| 260 | }; |
|---|
| 261 | } |
|---|
| 262 | } |
|---|
| 263 | ); |
|---|
| 264 | EOM |
|---|
| 265 | |
|---|
| 266 | " yourfilehost cookie削除 |
|---|
| 267 | " cf.http://anond.hatelabo.jp/20100108213648 |
|---|
| 268 | js <<EOM |
|---|
| 269 | commands.addUserCommand( |
|---|
| 270 | ['removeCookieOfYourfile'], |
|---|
| 271 | 'removeCookieOfYourfile', |
|---|
| 272 | function() { |
|---|
| 273 | liberator.execute('cookiemanager remove yourfilehostdatabase.com/'); |
|---|
| 274 | liberator.execute('cookiemanager remove yourfilehost.com/'); |
|---|
| 275 | liberator.execute('cookiemanager remove yourlifehost.jp/'); |
|---|
| 276 | } |
|---|
| 277 | ); |
|---|
| 278 | EOM |
|---|
| 279 | |
|---|
| 280 | " qmarks |
|---|
| 281 | " ====================================================================== |
|---|
| 282 | qmark g https://mail.google.com/ |
|---|
| 283 | qmark c https://www.google.com/calendar/ |
|---|
| 284 | qmark p pp |
|---|
| 285 | qmark l al |
|---|
| 286 | qmark f af |
|---|
| 287 | qmark t at |
|---|
| 288 | qmark r recss |
|---|
| 289 | |
|---|
| 290 | " colorscheeme |
|---|
| 291 | " ====================================================================== |
|---|
| 292 | colorscheme vimplight |
|---|
| 293 | style -name statusbar chrome://* <<EOM |
|---|
| 294 | #status-bar statusbarpanel { padding: 0 1px !important; } |
|---|
| 295 | statusbarpanel > * { margin: 0 !important; padding: 0 !important; } |
|---|
| 296 | EOM |
|---|
| 297 | |
|---|
| 298 | style -name commandline-ime chrome://* #liberator-commandline-command input { ime-mode: inactive; } |
|---|
| 299 | |
|---|
| 300 | |
|---|
| 301 | " vim: set ft=vimperator: |
|---|