| 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/はてブでは新規タブをバックグラウンドで開く |
|---|
| 16 | autocmd LocationChange '^(?!https?://(mail\.google\.com/(mail|a)/|(reader\.livedoor|fastladder)\.com/reader/|b\.hatena\.ne\.jp/(?!(entry|articles|guide))))' :set! browser.tabs.loadDivertedInBackground=false |
|---|
| 17 | autocmd LocationChange '^https?://(mail\.google\.com/(mail|a)/|(reader\.livedoor|fastladder)\.com/reader/|b\.hatena\.ne\.jp/(?!(entry|articles|guide)))' :set! browser.tabs.loadDivertedInBackground=true |
|---|
| 18 | |
|---|
| 19 | " options |
|---|
| 20 | " ====================================================================== |
|---|
| 21 | " /,? 検索結果をハイライト |
|---|
| 22 | set hlsearch |
|---|
| 23 | |
|---|
| 24 | " ex mode でインクリメント補完 |
|---|
| 25 | set wildoptions=auto |
|---|
| 26 | |
|---|
| 27 | " :[tab]open の補完対象と順番 |
|---|
| 28 | set complete=tsl |
|---|
| 29 | |
|---|
| 30 | " ブラウザタイトルの変更 |
|---|
| 31 | set titlestring=*g* |
|---|
| 32 | |
|---|
| 33 | " GUI Options |
|---|
| 34 | set go=rb |
|---|
| 35 | |
|---|
| 36 | " タブを非表示 |
|---|
| 37 | set showtabline=0 |
|---|
| 38 | |
|---|
| 39 | " リンクのURIをコマンドラインに表示 |
|---|
| 40 | set showstatuslinks=2 |
|---|
| 41 | |
|---|
| 42 | " ページロード時にテキストボックスにフォーカスするのを防ぐ |
|---|
| 43 | set focuscontent |
|---|
| 44 | |
|---|
| 45 | " Beep設定 |
|---|
| 46 | set visualbell |
|---|
| 47 | hi Bell display: none; |
|---|
| 48 | |
|---|
| 49 | " mappings |
|---|
| 50 | " ====================================================================== |
|---|
| 51 | " undo一覧から開く |
|---|
| 52 | noremap U :undo<Space> |
|---|
| 53 | |
|---|
| 54 | " C-r でブラウザ再起動 |
|---|
| 55 | noremap <C-r> :restart<CR> |
|---|
| 56 | |
|---|
| 57 | " 上のディレクトリに移動 |
|---|
| 58 | noremap <BS> gu |
|---|
| 59 | noremap <C-BS> gU |
|---|
| 60 | |
|---|
| 61 | " j/k でのスクロール幅を1行から3行に変更 |
|---|
| 62 | noremap j 3j |
|---|
| 63 | noremap k 3k |
|---|
| 64 | noremap <C-j> 3j |
|---|
| 65 | noremap <C-k> 3k |
|---|
| 66 | |
|---|
| 67 | " J/K をC-d/u互換に |
|---|
| 68 | noremap J <C-d> |
|---|
| 69 | noremap K <C-u> |
|---|
| 70 | |
|---|
| 71 | " タブ移動 |
|---|
| 72 | noremap h <C-p> |
|---|
| 73 | noremap l <C-n> |
|---|
| 74 | |
|---|
| 75 | " タブ順序変更 |
|---|
| 76 | noremap <C-h> :tabmove! -1<CR> |
|---|
| 77 | noremap <C-l> :tabmove! +1<CR> |
|---|
| 78 | |
|---|
| 79 | " buffer |
|---|
| 80 | noremap . b |
|---|
| 81 | |
|---|
| 82 | " 未分類のブックマークに追加/削除 |
|---|
| 83 | noremap ,a A |
|---|
| 84 | |
|---|
| 85 | " ! でページのCSSをon/off |
|---|
| 86 | noremap ! :set invum<CR> |
|---|
| 87 | |
|---|
| 88 | " ページのエンコーディングを変更 |
|---|
| 89 | noremap ,es :set encoding=Shift_JIS<CR> |
|---|
| 90 | noremap ,ec :set encoding=EUC-JP<CR> |
|---|
| 91 | noremap ,eu :set encoding=UTF-8<CR> |
|---|
| 92 | noremap ,ei :set encodeing=ISO-2022-JP<CR> |
|---|
| 93 | |
|---|
| 94 | " ex modeでC-jを無効化 |
|---|
| 95 | cnoremap <C-j> <Nop> |
|---|
| 96 | |
|---|
| 97 | " command |
|---|
| 98 | " ====================================================================== |
|---|
| 99 | " autocmd VimperatorEnter .* <args> を lazy コマンドとして登録 |
|---|
| 100 | command! -nargs=+ lazy autocmd VimperatorEnter .* <args> |
|---|
| 101 | |
|---|
| 102 | " plugins |
|---|
| 103 | " ====================================================================== |
|---|
| 104 | let g:plugin_loader_roots = "~/Sites/vimperator-plugins/trunk/ ~/.vimperator/load/ ~/Sites/git/littlefolk/" |
|---|
| 105 | let g:plugin_loader_plugins = "_libly,char-hints-mod2,account_switcher,appendAnchor,auto_reload,copy,direct_bookmark,feedSomeKeys_3,gmperator,hatenaStar,hint-tombloo,ldrize_cooperation,maine_coon,migemo_completion,multi_requester,no-reading,pino,pixiv_tools,proxy,sbmcommentsviewer,tombloo,twitter,walk-input,stella,opener,heuristic-search,bitly,x-hint" |
|---|
| 106 | |
|---|
| 107 | " no-reading.js |
|---|
| 108 | let g:no_reading_on_statusline = 1 |
|---|
| 109 | |
|---|
| 110 | " appendAnchor.js |
|---|
| 111 | let g:auto_append_anchor = "true" |
|---|
| 112 | let g:auto_append_anchor_once = "true" |
|---|
| 113 | |
|---|
| 114 | " sbmcommentsviewer.js |
|---|
| 115 | let g:def_sbm_format = "timestamp,id,tagsAndComment" |
|---|
| 116 | let g:def_sbms = "hdl" |
|---|
| 117 | noremap b :echo ":viewSBMComments"<CR>:viewSBMComments<CR> |
|---|
| 118 | |
|---|
| 119 | " direct_bookmark.js |
|---|
| 120 | let g:direct_sbm_use_services_by_tag = "h" |
|---|
| 121 | let g:direct_sbm_use_services_by_post = "h" |
|---|
| 122 | let g:direct_sbm_is_normalize = "false" |
|---|
| 123 | let g:direct_sbm_is_use_migemo = "true" |
|---|
| 124 | noremap B :bentry<CR> |
|---|
| 125 | noremap a :sbm<CR>:echo ":sbm"<CR> |
|---|
| 126 | noremap A :sbm<Space> |
|---|
| 127 | lazy :btags |
|---|
| 128 | |
|---|
| 129 | " hatenabookmark.js |
|---|
| 130 | noremap s :hbtab<Space> |
|---|
| 131 | noremap S :hbtab<Space> |
|---|
| 132 | js <<EOM |
|---|
| 133 | liberator.globalVariables.hBookmark_shortcuts = { |
|---|
| 134 | hintsAdd : 'A', |
|---|
| 135 | hintsComment : ' ', |
|---|
| 136 | add : ['C'], |
|---|
| 137 | comment : ['c'], |
|---|
| 138 | }; |
|---|
| 139 | if (typeof hBookmark != 'undefined') liberator.loadScript('chrome://hatenabookmark/content/vimperator/plugin/hatenabookmark.js', {__proto__: this}); |
|---|
| 140 | EOM |
|---|
| 141 | |
|---|
| 142 | " ldrize_cooperation.js |
|---|
| 143 | let g:ldrc_captureMappings = "['j','k','p','o','?']" |
|---|
| 144 | "let g:ldrc_intelligence_bind = "true" |
|---|
| 145 | "let g:ldrc_skip = "0" |
|---|
| 146 | noremap Q :toggleldrc<CR> |
|---|
| 147 | |
|---|
| 148 | " heuristic-search.js |
|---|
| 149 | noremap ` :hsearch<Space> |
|---|
| 150 | |
|---|
| 151 | " multi_requester.js |
|---|
| 152 | noremap ,t :twitter<Space> |
|---|
| 153 | noremap ,T :twitter!<Space> |
|---|
| 154 | noremap ,@ :twitter!@<CR> |
|---|
| 155 | noremap ,mt :mr<Space>twitter-search-pcod-no-jp<Space> |
|---|
| 156 | noremap ,mT :mr<Space>twitter-search-pcod-no-jp<Space>["retlet"]<CR> |
|---|
| 157 | noremap ,mf :mr<Space>favotter-new<Space> |
|---|
| 158 | noremap ,mF :mr<Space>favotter-new<Space>["retlet"]<CR> |
|---|
| 159 | |
|---|
| 160 | " copy.js |
|---|
| 161 | noremap ,c :copy<Space> |
|---|
| 162 | js <<EOM |
|---|
| 163 | liberator.globalVariables.copy_templates = [ |
|---|
| 164 | { label: 'titleAndURL', value: '%TITLE% %URL%' }, |
|---|
| 165 | { label: 'title', value: '%TITLE%' }, |
|---|
| 166 | { label: 'url', value: '%URL%' }, |
|---|
| 167 | { label: 'markdown', value: '[%TITLE%](%URL% "%TITLE%")' }, |
|---|
| 168 | { label: 'markdownsel', value: '[%SEL%](%URL% "%TITLE%")' }, |
|---|
| 169 | { label: 'htmlblockquote', value: '<blockquote cite="%URL%" title="%TITLE%">%HTMLSEL%</blockquote>' } |
|---|
| 170 | ]; |
|---|
| 171 | EOM |
|---|
| 172 | |
|---|
| 173 | " x-hint.js |
|---|
| 174 | nnoremap -urls='^http://www\.tumblr\.com/(dashboard|tumblelog|show)' f :xh t //*[@class="quote_source"]//a[not(@class="tumblr_blog")]|//*[@class="caption"]//a[not(@class="tumblr_blog")]<CR> |
|---|
| 175 | |
|---|
| 176 | " feedSomeKeys_3.js |
|---|
| 177 | " Gmail |
|---|
| 178 | lazy fmaps -u='^https?://mail\.google\.com/(mail|a)/' c / j k n p o u e x s r a # [ ] z ? gi gs gt gd ga gc |
|---|
| 179 | " Tumblr (use: tombloo.xpi, dashboard+tombloo.user.js, reblogcommand.user.js, playontumblr.user.js) |
|---|
| 180 | lazy fmaps -u='^http://[^\./]*\.tumblr\.com/' i,tj e,tk n,h |
|---|
| 181 | " favotter (use: twitfavcommandminibuffer.user.js) |
|---|
| 182 | lazy fmaps -u='^http://favotter\.matope\.com/' e,F |
|---|
| 183 | " LDR/Fastladder (use: tombloo.xpi, ldr+tombloo.user.js, ldr_relative_rate.user.js) |
|---|
| 184 | lazy fmaps -u='^http://(reader\.livedoor|fastladder)\.com/reader/' j k s a p v c z Z b,i B,b e r < > o,vj J,<Space> K,<S-Space> q w g u |
|---|
| 185 | lazy fmaps -u='^http://(reader\.livedoor|fastladder)\.com/reader/' -events=vkeypress i,Tj T |
|---|
| 186 | " iview |
|---|
| 187 | lazy fmaps -u='^chrome://iviewfx/content/iview\.html' j k s a z o i,tj p |
|---|
| 188 | " はてブ |
|---|
| 189 | lazy fmaps -u='^http://b\.hatena\.ne\.jp/(?!(entry|articles|guide))' j k o,oj e a,b |
|---|
| 190 | "nnoremap -urls='^http://b\.hatena\.ne\.jp/(?!(entry|articles|guide))' a :xh A //h3[contains(concat(" ",normalize-space(@class)," "), " entry current-element ")]/a[1]<CR> |
|---|
| 191 | |
|---|
| 192 | " js |
|---|
| 193 | " ====================================================================== |
|---|
| 194 | " ステータスバーにfeedボタンを表示 |
|---|
| 195 | js <<EOM |
|---|
| 196 | (function(){ |
|---|
| 197 | var feedPanel = document.createElement('statusbarpanel'); |
|---|
| 198 | var feedButton = document.getElementById('feed-button'); |
|---|
| 199 | feedPanel.setAttribute('id','feed-panel-clone'); |
|---|
| 200 | feedPanel.appendChild(feedButton.cloneNode(true)); |
|---|
| 201 | feedButton.parentNode.removeChild(feedButton); |
|---|
| 202 | document.getElementById('status-bar').insertBefore(feedPanel,document.getElementById('security-button')); |
|---|
| 203 | })(); |
|---|
| 204 | EOM |
|---|
| 205 | |
|---|
| 206 | " yourfilehost cookie削除 |
|---|
| 207 | " cf.http://anond.hatelabo.jp/20100108213648 |
|---|
| 208 | js <<EOM |
|---|
| 209 | commands.addUserCommand( |
|---|
| 210 | ['removeCookieOfYourfile'], |
|---|
| 211 | 'removeCookieOfYourfile', |
|---|
| 212 | function() { |
|---|
| 213 | liberator.execute('cookiemanager remove yourfilehostdatabase.com/'); |
|---|
| 214 | liberator.execute('cookiemanager remove yourfilehost.com/'); |
|---|
| 215 | liberator.execute('cookiemanager remove yourlifehost.jp/'); |
|---|
| 216 | } |
|---|
| 217 | ); |
|---|
| 218 | EOM |
|---|
| 219 | |
|---|
| 220 | " Tumblr DashboardでAutoPagerizeのBASE_REMAIN_HEIGHTを変更 |
|---|
| 221 | lazy autocmd GMInjectedScript '^http://www\.tumblr\.com/dashboard' :js liberator.eval("ap.remainHeight = 5000", plugins.gmperator.currentSandbox.window.AutoPagerize.addFilter) |
|---|
| 222 | |
|---|
| 223 | " LocalMappings |
|---|
| 224 | " cf.http://vimperator.g.hatena.ne.jp/nokturnalmortum/20100128/1264675483 |
|---|
| 225 | js <<EOM |
|---|
| 226 | function addLocalMappings(buffer, maps) { |
|---|
| 227 | maps.forEach( |
|---|
| 228 | function (map) { |
|---|
| 229 | let [cmd, action, extra] = map; |
|---|
| 230 | let actionFunc = action; |
|---|
| 231 | extra || (extra = {}); |
|---|
| 232 | |
|---|
| 233 | if (typeof action == "string") { |
|---|
| 234 | if (action.charAt(0) == ':') |
|---|
| 235 | actionFunc = extra.open ? function () commandline.open("", action, modes.EX) |
|---|
| 236 | : function () liberator.execute(action); |
|---|
| 237 | else |
|---|
| 238 | actionFunc = function () events.feedkeys(action, extra.noremap, true); |
|---|
| 239 | } |
|---|
| 240 | extra.matchingUrls = buffer; |
|---|
| 241 | mappings.addUserMap( |
|---|
| 242 | [modes.NORMAL], |
|---|
| 243 | [cmd], |
|---|
| 244 | "Local mapping for " + buffer, |
|---|
| 245 | actionFunc, |
|---|
| 246 | extra |
|---|
| 247 | ); |
|---|
| 248 | } |
|---|
| 249 | ); |
|---|
| 250 | } |
|---|
| 251 | |
|---|
| 252 | addLocalMappings( |
|---|
| 253 | /^(http:\/\/(es|www).nicovideo.jp\/watch|http:\/\/(jp|www)\.youtube\.com\/watch)/, |
|---|
| 254 | [ |
|---|
| 255 | ['p', ':stplay', ], |
|---|
| 256 | ['m', ':stmute', ], |
|---|
| 257 | ['c', ':stcomment', ], |
|---|
| 258 | ['zz', ':stlarge', ], |
|---|
| 259 | ['r', ':strepeat', ], |
|---|
| 260 | ['+', ':stvolume! 10', ], |
|---|
| 261 | ['-', ':stvolume! -10', ], |
|---|
| 262 | ['S', ':stseek! -10', ], |
|---|
| 263 | ['s', ':stseek! 10', ], |
|---|
| 264 | ] |
|---|
| 265 | ); |
|---|
| 266 | EOM |
|---|
| 267 | |
|---|
| 268 | " qmarks |
|---|
| 269 | " ====================================================================== |
|---|
| 270 | qmark g https://mail.google.com/ |
|---|
| 271 | qmark c https://www.google.com/calendar/ |
|---|
| 272 | qmark p pp |
|---|
| 273 | qmark l al |
|---|
| 274 | qmark f af |
|---|
| 275 | qmark t at |
|---|
| 276 | qmark r recss |
|---|
| 277 | |
|---|
| 278 | " highlight/style |
|---|
| 279 | " ====================================================================== |
|---|
| 280 | color vimplight |
|---|
| 281 | style -name maine_coon * #liberator_maine_coon { -moz-appearance: none !important; } |
|---|
| 282 | |
|---|
| 283 | " [tab]open等で長いタイトルがURIに被るらないように |
|---|
| 284 | hi CompResult widht: 45%; overflow: hidden; max-width; 60%; |
|---|
| 285 | |
|---|
| 286 | " ステータスバーのアイコンの間隔を揃える |
|---|
| 287 | style -name statusbar chrome://* <<EOM |
|---|
| 288 | #status-bar > statusbarpanel { padding: 0 1px !important; } |
|---|
| 289 | statusbarpanel > * { margin: 0 !important; padding: 0 !important; } |
|---|
| 290 | EOM |
|---|
| 291 | |
|---|
| 292 | " ex mode時IMEをOFF |
|---|
| 293 | style -name commandline-ime chrome://* #liberator-commandline-command input { ime-mode: inactive; } |
|---|
| 294 | |
|---|
| 295 | " vim: set ft=vimperator: |
|---|