root/dotfiles/vimperator/otsune-vimperatorrc

Revision 34508, 6.7 kB (checked in by otsune, 7 months ago)

update

Line 
1" otsune .vimperatorrc
2"2.1 (created: 2009/05/21 13:13:06)
3
4echo "loading..."
5" Mappings
6" minimum css
7noremap ! :set usermode<CR>
8
9" set mark-a, jump mark-a
10noremap _ ma
11noremap } `a
12
13"
14noremap j 5j
15noremap k 5k
16noremap J <C-d>
17noremap K <C-u>
18
19" select next/previous tab
20"noremap <Right> gt
21"noremap <Left> gT
22noremap <C-l> gt
23noremap <C-h> gT
24noremap <C-w>l gt
25noremap <C-w>h gT
26
27" move current tab left/right
28map <S-Right> :tablast<CR>
29map <S-Left> :tabfirst<CR>
30map <C-L> :tabmove! +1<CR>
31map <C-H> :tabmove! -1<CR>
32
33" ex mode
34cmap <C-d> <Tab>
35"cmap <Down> <Tab>
36"cmap <Up> <S-Tab>
37cmap <C-n> <Tab>
38cmap <C-p> <S-Tab>
39
40"
41let mapleader=','
42map <A-b> :set guioptions+=B<CR>
43""map <Leader>b :set guioptions+=B<CR>
44map <A-B> :set guioptions-=B<CR>
45""map <Leader>B :set guioptions-=B<CR>
46"noremap <Leader>t :mb tumblr.reblog<CR>
47noremap <Leader>b :bentry<CR>
48"noremap <Leader>p :pukka<CR>
49noremap <Leader>t :tombloo Quote<CR>
50noremap <Leader>m :tabmove 1<CR>
51noremap <Leader>l :toggleldrizecooperation<CR>
52noremap <Leader>g :mb location | web-gyotaku | open
53noremap <Leader>a :mb location | web-archive | open
54noremap <Leader>s :mb pinned-or-current-link | share-twitter-on-tumblr
55
56" http://vimperator.g.hatena.ne.jp/saitamanodoruji/20090613/1244854256
57"map <Leader>z :js var u=liberator.modules.buffer.URL.replace(/http:\/\/(.*)\.2ch\.net\/test\/read\.cgi\/(.*)\/(\d{4})(\d{1})(\d{5})\/\d{0,4}[n-]{0,2}/, "http://mimizun.com/search/perl/dattohtml.pl?http://mimizun.com/log/2ch/$2/$1.2ch.net/$2/kako/$3/$3$4/$3$4$5.dat");liberator.open(u)<CR>
58
59" Unhidden and hidden the menubar and the toolbar
60"map <A-Up> :set guioptions+=mT<CR>
61"map <A-Down> :set guioptions-=mT<CR>
62
63"javascript <<EOM
64"  toggle_element = function (name){
65"    document.getElementById(name).collapsed ^= 1;
66"  }
67"EOM
68
69" ;A
70javascript <<EOM
71hints.addMode( 'A', 'copy URL and description',
72  function (element) util.copyToClipboard('<a href="' + element.href + '">' + element.textContent + '</a>', true),
73  function () '//a[@href]'
74);
75EOM
76
77" Options
78"highlight Bell display:none
79set guioptions+=B
80"set titlestring=Vimperator
81"set verbose=9
82"set history=1000
83"set complete=slS
84"set wildoptions=auto
85"set suggestengines=google
86"set newtab=all
87"set focuscontent
88"set hintstyle+=font-size:15px;
89"]]
90"set nextpattern+=次(の)?ページ,→\b,下一頁,Следующая,다음
91"[[
92"set previouspattern+=prev, 前(の)?ページ,\b←
93"
94set editor=/Applications/MacVim/mvim\ -f
95
96js <<EOM
97liberator.globalVariables.plugin_loader_roots = "/Users/otsune/proj/coderepos/lang/javascript/vimperator-plugins/";
98liberator.globalVariables.plugin_loader_plugins = [
99  'appendAnchor.js',
100  'copy.js',
101  'direct_bookmark.js',
102  'googlesuggest.js',
103  'highlight.js',
104  'inspector.js',
105  'ldrize_cooperation.js',
106  'mouseinspect.js',
107  'multi_requester.js',
108  'nicovideo_comment.js',
109  'pathtraq.js',
110  'pluginManager.js',
111  'proxy.js',
112  'pukka.js',
113  'tombloo.js',
114  'xpathBlink.js',
115];
116EOM
117
118" nextlink.js
119let g:nextlink_followlink = "true"
120
121" sbm
122"let g:direct_sbm_use_services_by_tag = "d"
123"let g:direct_sbm_use_services_by_post = "d"
124
125" pukka plugin variable
126let g:pukka_normalizelink = "true"
127
128" ime_control.js
129"let g:ex_ime_mode = "disabled"
130"let g:ex_ime_mode = "inactive"
131"let g:textarea_ime_mode = "inactive"
132
133" ldr_cooperation.js
134let g:ldrc_captureMappings = "['t', 'T', 'h', 'l', 'j', 'k', 'p', 'o', '?']"
135"let g:ldrc_hints = "true"
136let g:ldrc_intelligence_bind = "true"
137
138" feedSomekey_2
139autocmd LocationChange .* :fmapc
140autocmd LocationChange 'ogame\.jp' :fmap <Left> <Right> <Up> <Down>
141"autocmd LocationChange 'mail\.google\.com/mail' :fmap -depth 4 c / j k n p o u e x s r a # [ ] z ? gi gs gt gd ga gc
142"autocmd LocationChange .* :js modes.passAllKeys = /^https?:\/\/mail\.google\.com/.test(buffer.URL)
143"autocmd LocationChange .* :js modes.passAllKeys = /^https?:\/\/fastladder\.com/.test(buffer.URL)
144
145" copy.js
146javascript <<EOM
147liberator.globalVariables.copy_templates = [
148   { label: 'H::D(Image2)', value: 'Hatena::ImageMax 650px',
149  custom: function() { let [, width, height] = buffer.title.match(/\(PNG\s\S+, \s([0-9]+)x([0-9]+)\spx\)/); const MAX_W = 650; let maxWidth = width > MAX_W ? ":w" + MAX_W : ""; return '[' + buffer.URL + ':image' + maxWidth + ']'; }
150   },
151   { label: 'titleAndURL',    value: '%TITLE% %URL%' },
152   { label: 'title',          value: '%TITLE%' },
153   { label: 'hatena',         value: '[%URL%:title=%TITLE%]' },
154   { label: 'hatenacite',     value: '>%URL%:title=%TITLE%>\n%SEL%\n<<' },
155   { label: 'markdown',       value: '[%SEL%](%URL% "%TITLE%")' },
156   { label: 'htmlblockquote', value: '<blockquote cite="%URL%" title="%TITLE%">%HTMLSEL%</blockquote>' },
157   { label: 'amazon',   value: 'copy asamashi code from Amazon', custom: function(){return 'http://amazon.jp/o/ASIN/'+ content.document.getElementById('ASIN').value + '/otsune-22/ref=nosim';} },
158   { label: 'tinyurl',        value: 'Get Tiny URL',
159    custom: function(){ return util.httpGet('http://tinyurl.com/api-create.php?url=' + encodeURIComponent(buffer.URL)).responseText; }
160   },
161];
162EOM
163
164" Add Mapping `C-c' copy or stop loading
165javascript <<EOF
166mappings.addUserMap([modes.NORMAL,modes.VISUAL],['<C-c>'], 'Copy selected text or stop loading',
167        function(){
168                var sel = window.content.window.getSelection().toString();
169                if (sel){
170                        copyToClipboard(sel,true);
171                } else {
172                        BrowserStop();
173                        echo('Stopped loading !');
174                }
175        }
176);
177EOF
178
179" Show feed-button to statusbar
180javascript <<EOM
181(function () {
182var feedPanel = document.createElement('statusbarpanel');
183var feedButton = document.getElementById('feed-button');
184    feedPanel.setAttribute('id','feed-panel-clone');
185    feedPanel.appendChild(feedButton.cloneNode(true));
186    feedButton.parentNode.removeChild(feedButton);
187    document.getElementById('status-bar')
188        .insertBefore(feedPanel,document.getElementById('security-button'));
189})();
190EOM
191
192" http://vimperator.g.hatena.ne.jp/blue_ring/20090403/1238762521
193" inspect mode hint
194js <<EOM
195hints.addMode('i', 'inspectThis', function(elem){ inspectDOMNode(elem) }, function() '//*');
196commands.addUserCommand(['setInspectionXPath', 'six'], 'Set a XPath in the Hints Mode of Inspection', function(args){
197  hints.addMode('i', 'inspectThis', function(elem){ inspectDOMNode(elem) }, function() args.string);
198}, {}, true);
199EOM
200
201" hatena bookmark xul
202javascript if (typeof hBookmark != 'undefined') liberator.loadScript('chrome://hatenabookmark/content/vimperator/plugin/hatenabookmark.js', {__proto__: this});
203
204" disable accesskey
205"set! ui.key.generalAccessKey=-1
206set! ui.key.contentAccess=0
207" open bookmarks in background
208set! browser.tabs.loadBookmarksInBackground=true
209
210" Abbreviations
211
212source! /Users/otsune/.vimperatorrc.local
213
214" colorscheme sweets
215echo "done"
216" vim: ft=vimperator sw=2 sts=2
Note: See TracBrowser for help on using the browser.