| 1 | " retlet .vimperatorrc |
|---|
| 2 | " for Vimperator 2.0 |
|---|
| 3 | |
|---|
| 4 | " prefs |
|---|
| 5 | " ====================================================================== |
|---|
| 6 | " caretのサイズ |
|---|
| 7 | "set! ui.caretWidth=10 |
|---|
| 8 | |
|---|
| 9 | " undo保持数 |
|---|
| 10 | set! browser.sessionstore.max_tabs_undo=30 |
|---|
| 11 | |
|---|
| 12 | " タブの閉じるボタン非表示 |
|---|
| 13 | set! browser.tabs.closeButtons=2 |
|---|
| 14 | |
|---|
| 15 | " ページのアクセスキーを無効化 |
|---|
| 16 | set! ui.key.generalAccessKey=0 |
|---|
| 17 | |
|---|
| 18 | " Awesomebarの補完対象にBookmarkletを含める&件数を変更 |
|---|
| 19 | set! browser.urlbar.filter.javascript=false |
|---|
| 20 | set! browser.urlbar.maxRichResults=20 |
|---|
| 21 | |
|---|
| 22 | " ポップアップ許可数を拡張 cf.http://la.ma.la/blog/diary_200611171115.htm |
|---|
| 23 | set! dom.popup_maximum=9999 |
|---|
| 24 | |
|---|
| 25 | " Gmail/LDR/Fastladder/OpenFL/はてブでは新規タブをバックグラウンドで開く |
|---|
| 26 | autocmd LocationChange (?!https?://(mail\.google\.com\/(mail|a)\/|(reader\.livedoor\.com|fastladder\.com|0\.0\.0\.0\:3000)/reader/|b\.hatena\.ne\.jp/retlet)) :set! browser.tabs.loadDivertedInBackground=false |
|---|
| 27 | autocmd LocationChange https?://(mail\.google\.com\/(mail|a)\/|(reader\.livedoor\.com|fastladder\.com|0\.0\.0\.0\:3000)/reader/|b\.hatena\.ne\.jp/retlet) :set! browser.tabs.loadDivertedInBackground=true |
|---|
| 28 | |
|---|
| 29 | " options |
|---|
| 30 | " ====================================================================== |
|---|
| 31 | set nopreload |
|---|
| 32 | |
|---|
| 33 | " ex mode でインクリメント補完 |
|---|
| 34 | set wildoptions=auto |
|---|
| 35 | |
|---|
| 36 | " :[tab]open の補完対象と順番 |
|---|
| 37 | set complete=sl |
|---|
| 38 | |
|---|
| 39 | " ブラウザタイトルの変更 |
|---|
| 40 | set titlestring=*g* |
|---|
| 41 | |
|---|
| 42 | " スクロールバーとタブ番号を表示 |
|---|
| 43 | set go=rbn |
|---|
| 44 | |
|---|
| 45 | " 開いているページがひとつだけならタブを非表示にする |
|---|
| 46 | set showtabline=1 |
|---|
| 47 | |
|---|
| 48 | " リンクのURIをコマンドラインに表示 |
|---|
| 49 | set showstatuslinks=2 |
|---|
| 50 | |
|---|
| 51 | " 新規ウィンドウの処理 |
|---|
| 52 | set popups=2 |
|---|
| 53 | |
|---|
| 54 | " ページロード時にテキストボックスにフォーカスするのを防ぐ |
|---|
| 55 | set focuscontent |
|---|
| 56 | |
|---|
| 57 | " Beep設定 |
|---|
| 58 | set visualbell |
|---|
| 59 | hi Bell opacity: .5; |
|---|
| 60 | |
|---|
| 61 | " mappings |
|---|
| 62 | " ====================================================================== |
|---|
| 63 | " OSのキーバインドを再現 |
|---|
| 64 | map <M-c> <C-v><M-c> |
|---|
| 65 | imap <C-f> <Right> |
|---|
| 66 | imap <C-b> <Left> |
|---|
| 67 | imap <C-p> <Up> |
|---|
| 68 | imap <C-n> <Down> |
|---|
| 69 | imap <M-a> <C-v><M-a> |
|---|
| 70 | imap <M-z> <C-v><M-z> |
|---|
| 71 | imap <M-x> <C-v><M-x> |
|---|
| 72 | imap <M-c> <C-v><M-c> |
|---|
| 73 | imap <M-v> <C-v><M-v> |
|---|
| 74 | cmap <C-f> <Right> |
|---|
| 75 | cmap <C-b> <Left> |
|---|
| 76 | cmap <C-p> <Up> |
|---|
| 77 | cmap <C-n> <Down> |
|---|
| 78 | cmap <M-a> <C-v><M-a> |
|---|
| 79 | cmap <M-z> <C-v><M-z> |
|---|
| 80 | cmap <M-x> <C-v><M-x> |
|---|
| 81 | cmap <M-c> <C-v><M-c> |
|---|
| 82 | cmap <M-v> <C-v><M-v> |
|---|
| 83 | |
|---|
| 84 | " undo一覧から開く |
|---|
| 85 | map U :undo<Space> |
|---|
| 86 | |
|---|
| 87 | " C-r でブラウザ再起動 |
|---|
| 88 | map <C-r> :restart<CR> |
|---|
| 89 | |
|---|
| 90 | " 上のディレクトリに移動 |
|---|
| 91 | map <BS> gu |
|---|
| 92 | map <C-BS> gU |
|---|
| 93 | |
|---|
| 94 | " j/k でのスクロール幅を1行から3行に変更 |
|---|
| 95 | noremap j 3j |
|---|
| 96 | noremap k 3k |
|---|
| 97 | |
|---|
| 98 | " J/K をC-d/u互換に |
|---|
| 99 | map J <C-d> |
|---|
| 100 | map K <C-u> |
|---|
| 101 | |
|---|
| 102 | " タブ移動 |
|---|
| 103 | map h <C-p> |
|---|
| 104 | map l <C-n> |
|---|
| 105 | map <C-k> <C-p> |
|---|
| 106 | map <C-j> <C-n> |
|---|
| 107 | |
|---|
| 108 | " タブ順序変更 |
|---|
| 109 | map <C-h> :tabmove! -1<CR> |
|---|
| 110 | map <C-l> :tabmove! +1<CR> |
|---|
| 111 | |
|---|
| 112 | " buffer |
|---|
| 113 | map . :buffer<Space> |
|---|
| 114 | |
|---|
| 115 | " C-a で未分類のブックマークに追加/削除 |
|---|
| 116 | noremap <C-a> A |
|---|
| 117 | |
|---|
| 118 | " URL中の数字を++/-- |
|---|
| 119 | noremap ++ <C-a> |
|---|
| 120 | noremap -- <C-x> |
|---|
| 121 | |
|---|
| 122 | " ! でページのCSSをon/off |
|---|
| 123 | map ! :set invum<CR> |
|---|
| 124 | |
|---|
| 125 | " ex modeでC-jを無効化 |
|---|
| 126 | cmap <C-j> <Nop> |
|---|
| 127 | |
|---|
| 128 | " plugins |
|---|
| 129 | " ====================================================================== |
|---|
| 130 | " ime_controller.js |
|---|
| 131 | let g:ex_ime_mode = "inactive" |
|---|
| 132 | let g:textarea_ime_mode = "inactive" |
|---|
| 133 | |
|---|
| 134 | " encodingSwitcher.js |
|---|
| 135 | map es :set fileencoding=Shift_JIS<CR> |
|---|
| 136 | map ec :set fileencoding=EUC-JP<CR> |
|---|
| 137 | |
|---|
| 138 | " google-search.js |
|---|
| 139 | map gs :gsearch!<Space> |
|---|
| 140 | |
|---|
| 141 | " migemo_hint.js |
|---|
| 142 | set hintmatching=custom |
|---|
| 143 | |
|---|
| 144 | " sbmcommentsviewer.js |
|---|
| 145 | let g:def_sbm_format = "timestamp,id,tagsAndComment" |
|---|
| 146 | let g:def_sbms = "hdl" |
|---|
| 147 | map bb :viewSBMComments<CR> |
|---|
| 148 | |
|---|
| 149 | " hatena-bookmark-search.js |
|---|
| 150 | "map bs :tabbs<Space> |
|---|
| 151 | "map bS :tabbs!<Space> |
|---|
| 152 | "map ,b :bs -reload<CR> |
|---|
| 153 | |
|---|
| 154 | " direct_bookmark.js |
|---|
| 155 | let g:direct_sbm_use_services_by_tag = "h" |
|---|
| 156 | let g:direct_sbm_use_services_by_post = "h" |
|---|
| 157 | let g:direct_sbm_is_normalize = "false" |
|---|
| 158 | let g:direct_sbm_is_use_migemo = "true" |
|---|
| 159 | map B :bentry<CR> |
|---|
| 160 | map a :sbm<CR> |
|---|
| 161 | map A :sbm<Space> |
|---|
| 162 | map ,a :btags<CR> |
|---|
| 163 | |
|---|
| 164 | " ldrize_cooperation.js |
|---|
| 165 | let g:ldrc_captureMappings = "['j','k','p','o','?']" |
|---|
| 166 | let g:ldrc_intelligence_bind = "true" |
|---|
| 167 | let g:ldrc_skip = "0" |
|---|
| 168 | map Q :toggleldrc<CR> |
|---|
| 169 | |
|---|
| 170 | " multi_requester.js |
|---|
| 171 | map ,t :twitter<Space> |
|---|
| 172 | map ,T :twitter!<Space> |
|---|
| 173 | map ,@ :twitter!@<CR> |
|---|
| 174 | map ,mt :mr<Space>twitter-search-pcod-no-jp<Space> |
|---|
| 175 | map ,mT :mr<Space>twitter-search-pcod-no-jp<Space>["retlet"]<CR> |
|---|
| 176 | map ,mf :mr<Space>favotter-new<Space> |
|---|
| 177 | map ,mF :mr<Space>favotter-new<Space>["retlet"]<CR> |
|---|
| 178 | |
|---|
| 179 | " copy.js |
|---|
| 180 | map cp :copy<Space> |
|---|
| 181 | js <<EOM |
|---|
| 182 | liberator.globalVariables.copy_templates = [ |
|---|
| 183 | { label: 'titleAndURL', value: '%TITLE% %URL%' }, |
|---|
| 184 | { label: 'title', value: '%TITLE%' }, |
|---|
| 185 | { label: 'url', value: '%URL%' }, |
|---|
| 186 | { label: 'markdown', value: '[%TITLE%](%URL% "%TITLE%")' }, |
|---|
| 187 | { label: 'markdownsel', value: '[%SEL%](%URL% "%TITLE%")' }, |
|---|
| 188 | { label: 'htmlblockquote', value: '<blockquote cite="%URL%" title="%TITLE%">%HTMLSEL%</blockquote>' } |
|---|
| 189 | ]; |
|---|
| 190 | EOM |
|---|
| 191 | |
|---|
| 192 | " localkeymode.js |
|---|
| 193 | let g:localkeymode_enable = "true" |
|---|
| 194 | js <<EOM |
|---|
| 195 | liberator.globalVariables.localKeyMappings=[ |
|---|
| 196 | [/^http:\/\/www\.nicovideo\.jp\/watch/, [ |
|---|
| 197 | ['p', ':nicopause'], |
|---|
| 198 | ['m', ':nicomute'], |
|---|
| 199 | ['v', ':nicommentvisible'], |
|---|
| 200 | ['s', ':nicoseek! +10'], |
|---|
| 201 | ['S', ':nicoseek! -10'], |
|---|
| 202 | ['z', ':nicosize'], |
|---|
| 203 | ['c', ':nicomment ', true], |
|---|
| 204 | ['C', ':nicommand ', true], |
|---|
| 205 | ]], |
|---|
| 206 | [/^http:\/\/reader\.livedoor\.com\/reader/, [ |
|---|
| 207 | ['f', function () hints.show("t")], |
|---|
| 208 | ]], |
|---|
| 209 | [/^/, [ |
|---|
| 210 | ['f', function () hints.show("o")], |
|---|
| 211 | ]], |
|---|
| 212 | ]; |
|---|
| 213 | EOM |
|---|
| 214 | |
|---|
| 215 | " feedSomeKeys_2.js |
|---|
| 216 | autocmd LocationChange .* :fmapc |
|---|
| 217 | " Tumblr (要dashboard+tombloo.user.js, ReblogCommand.user.js) |
|---|
| 218 | autocmd LocationChange ^http://.*\.tumblr\.com/ :fmap i,tj |
|---|
| 219 | autocmd LocationChange ^http://.*\.tumblr\.com/ :fmap e,tj |
|---|
| 220 | " favotter (要Twit Fav command Minibuffer) |
|---|
| 221 | autocmd LocationChange ^http://favotter\.matope\.com/ :fmap f,F |
|---|
| 222 | " Gmail |
|---|
| 223 | autocmd LocationChange ^https?://mail\.google\.com/(mail|a)/ :fmap -d 4 c / j k n p o u e x s r a # [ ] z ? gi gs gt gd ga gc |
|---|
| 224 | " LDR/Fastladder/OpenFL |
|---|
| 225 | 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,ie r < > o,vj J,<Space> K,<S-Space> q w g u T |
|---|
| 226 | " Fastladder Reblog用 (要tombloo.xpi/ldr+tombloo.user.js) |
|---|
| 227 | autocmd LocationChange ^http://fastladder\.com/reader/ :fmap i,Tj |
|---|
| 228 | autocmd LocationChange ^http://fastladder\.com/reader/ :fmap e,Tj |
|---|
| 229 | " iview |
|---|
| 230 | autocmd LocationChange ^chrome://iviewfx/content/iview.html :fmap j k s a z o i,tj p |
|---|
| 231 | " はてブ |
|---|
| 232 | autocmd LocationChange ^http://b\.hatena\.ne\.jp/retlet :fmap j k o e b |
|---|
| 233 | |
|---|
| 234 | " javascripts |
|---|
| 235 | " ====================================================================== |
|---|
| 236 | " はてなブックマークツールバー連携 |
|---|
| 237 | " cf.http://subtech.g.hatena.ne.jp/secondlife/20090402/1238655382 |
|---|
| 238 | js <<EOF |
|---|
| 239 | liberator.globalVariables.hBookmark_shortcuts = { |
|---|
| 240 | hintsAdd : 'c', |
|---|
| 241 | hintsComment : 'C', |
|---|
| 242 | add : ['bc'], |
|---|
| 243 | comment : ['C'], |
|---|
| 244 | }; |
|---|
| 245 | if (typeof hBookmark != 'undefined') liberator.loadScript('chrome://hatenabookmark/content/vimperator/plugin/hatenabookmark.js', {__proto__: this}); |
|---|
| 246 | EOF |
|---|
| 247 | map bs :hbtab<Space> |
|---|
| 248 | |
|---|
| 249 | " ステータスバーにfeedボタンを表示 |
|---|
| 250 | js <<EOM |
|---|
| 251 | (function(){ |
|---|
| 252 | var feedPanel = document.createElement('statusbarpanel'); |
|---|
| 253 | var feedButton = document.getElementById('feed-button'); |
|---|
| 254 | feedPanel.setAttribute('id','feed-panel-clone'); |
|---|
| 255 | feedPanel.appendChild(feedButton.cloneNode(true)); |
|---|
| 256 | feedButton.parentNode.removeChild(feedButton); |
|---|
| 257 | document.getElementById('status-bar').insertBefore(feedPanel,document.getElementById('security-button')); |
|---|
| 258 | })(); |
|---|
| 259 | EOM |
|---|
| 260 | |
|---|
| 261 | " feedSomeKeys_2.jsとlocalkeymode.jsの相性問題対応パッチ |
|---|
| 262 | " cf.http://vimperator.g.hatena.ne.jp/nokturnalmortum/20081220/1229773089 |
|---|
| 263 | js <<EOM |
|---|
| 264 | autocommands.add( |
|---|
| 265 | 'VimperatorEnter', |
|---|
| 266 | /.*/, |
|---|
| 267 | function () { |
|---|
| 268 | let (orig = plugins.LocalKeyMode.loadKeyMap) { |
|---|
| 269 | plugins.LocalKeyMode.loadKeyMap = function () { |
|---|
| 270 | if (!liberator.plugins.feedKey || liberator.plugins.feedKey.origMap.length <= 0) |
|---|
| 271 | orig.call(plugins.LocalKeyMode); |
|---|
| 272 | }; |
|---|
| 273 | } |
|---|
| 274 | } |
|---|
| 275 | ); |
|---|
| 276 | EOM |
|---|
| 277 | |
|---|
| 278 | " qmarks |
|---|
| 279 | " ====================================================================== |
|---|
| 280 | qmark g https://mail.google.com/ |
|---|
| 281 | qmark c https://www.google.com/calendar/ |
|---|
| 282 | qmark p pp |
|---|
| 283 | qmark l al |
|---|
| 284 | qmark f af |
|---|
| 285 | |
|---|
| 286 | " colorscheeme |
|---|
| 287 | " ====================================================================== |
|---|
| 288 | colorscheme sweets |
|---|
| 289 | style -name tab-style-fix chrome://* <<EOM |
|---|
| 290 | .tab-text-shadow, |
|---|
| 291 | .tabs-newtab-button { |
|---|
| 292 | display: none !important; |
|---|
| 293 | } |
|---|
| 294 | EOM |
|---|
| 295 | |
|---|
| 296 | " vim: set ft=vimperator: |
|---|