root/dotfiles/vimperator/retlet-vimperatorrc

Revision 31816, 8.2 kB (checked in by retlet, 3 months ago)

ちょこちょこプラグイン入れた

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