| 1 | " otsune .vimperatorrc |
|---|
| 2 | "2.1 (created: 2009/05/21 13:13:06) |
|---|
| 3 | |
|---|
| 4 | echo "loading..." |
|---|
| 5 | " Mappings |
|---|
| 6 | " minimum css |
|---|
| 7 | noremap ! :set usermode<CR> |
|---|
| 8 | |
|---|
| 9 | " set mark-a, jump mark-a |
|---|
| 10 | noremap _ ma |
|---|
| 11 | noremap } `a |
|---|
| 12 | |
|---|
| 13 | " |
|---|
| 14 | noremap j 5j |
|---|
| 15 | noremap k 5k |
|---|
| 16 | noremap J <C-d> |
|---|
| 17 | noremap K <C-u> |
|---|
| 18 | |
|---|
| 19 | " select next/previous tab |
|---|
| 20 | "noremap <Right> gt |
|---|
| 21 | "noremap <Left> gT |
|---|
| 22 | noremap <C-l> gt |
|---|
| 23 | noremap <C-h> gT |
|---|
| 24 | noremap <C-w>l gt |
|---|
| 25 | noremap <C-w>h gT |
|---|
| 26 | |
|---|
| 27 | " move current tab left/right |
|---|
| 28 | map <S-Right> :tablast<CR> |
|---|
| 29 | map <S-Left> :tabfirst<CR> |
|---|
| 30 | map <C-L> :tabmove! +1<CR> |
|---|
| 31 | map <C-H> :tabmove! -1<CR> |
|---|
| 32 | |
|---|
| 33 | " ex mode |
|---|
| 34 | cmap <C-d> <Tab> |
|---|
| 35 | "cmap <Down> <Tab> |
|---|
| 36 | "cmap <Up> <S-Tab> |
|---|
| 37 | cmap <C-n> <Tab> |
|---|
| 38 | cmap <C-p> <S-Tab> |
|---|
| 39 | |
|---|
| 40 | " |
|---|
| 41 | let mapleader=',' |
|---|
| 42 | map <A-b> :set guioptions+=B<CR> |
|---|
| 43 | ""map <Leader>b :set guioptions+=B<CR> |
|---|
| 44 | map <A-B> :set guioptions-=B<CR> |
|---|
| 45 | ""map <Leader>B :set guioptions-=B<CR> |
|---|
| 46 | "noremap <Leader>t :mb tumblr.reblog<CR> |
|---|
| 47 | noremap <Leader>b :bentry<CR> |
|---|
| 48 | "noremap <Leader>p :pukka<CR> |
|---|
| 49 | noremap <Leader>t :tombloo Quote<CR> |
|---|
| 50 | noremap <Leader>m :tabmove 1<CR> |
|---|
| 51 | noremap <Leader>l :toggleldrizecooperation<CR> |
|---|
| 52 | noremap <Leader>g :mb location | web-gyotaku | open |
|---|
| 53 | noremap <Leader>a :mb location | web-archive | open |
|---|
| 54 | noremap <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 |
|---|
| 70 | javascript <<EOM |
|---|
| 71 | hints.addMode( 'A', 'copy URL and description', |
|---|
| 72 | function (element) util.copyToClipboard('<a href="' + element.href + '">' + element.textContent + '</a>', true), |
|---|
| 73 | function () '//a[@href]' |
|---|
| 74 | ); |
|---|
| 75 | EOM |
|---|
| 76 | |
|---|
| 77 | " Options |
|---|
| 78 | "highlight Bell display:none |
|---|
| 79 | set 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 | " |
|---|
| 94 | set editor=/Applications/MacVim/mvim\ -f |
|---|
| 95 | |
|---|
| 96 | js <<EOM |
|---|
| 97 | liberator.globalVariables.plugin_loader_roots = "/Users/otsune/proj/coderepos/lang/javascript/vimperator-plugins/"; |
|---|
| 98 | liberator.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 | ]; |
|---|
| 116 | EOM |
|---|
| 117 | |
|---|
| 118 | " nextlink.js |
|---|
| 119 | let 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 |
|---|
| 126 | let 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 |
|---|
| 134 | let g:ldrc_captureMappings = "['t', 'T', 'h', 'l', 'j', 'k', 'p', 'o', '?']" |
|---|
| 135 | "let g:ldrc_hints = "true" |
|---|
| 136 | let g:ldrc_intelligence_bind = "true" |
|---|
| 137 | |
|---|
| 138 | " feedSomekey_2 |
|---|
| 139 | autocmd LocationChange .* :fmapc |
|---|
| 140 | autocmd 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 |
|---|
| 146 | javascript <<EOM |
|---|
| 147 | liberator.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 | ]; |
|---|
| 162 | EOM |
|---|
| 163 | |
|---|
| 164 | " Add Mapping `C-c' copy or stop loading |
|---|
| 165 | javascript <<EOF |
|---|
| 166 | mappings.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 | ); |
|---|
| 177 | EOF |
|---|
| 178 | |
|---|
| 179 | " Show feed-button to statusbar |
|---|
| 180 | javascript <<EOM |
|---|
| 181 | (function () { |
|---|
| 182 | var feedPanel = document.createElement('statusbarpanel'); |
|---|
| 183 | var 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 | })(); |
|---|
| 190 | EOM |
|---|
| 191 | |
|---|
| 192 | " http://vimperator.g.hatena.ne.jp/blue_ring/20090403/1238762521 |
|---|
| 193 | " inspect mode hint |
|---|
| 194 | js <<EOM |
|---|
| 195 | hints.addMode('i', 'inspectThis', function(elem){ inspectDOMNode(elem) }, function() '//*'); |
|---|
| 196 | commands.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); |
|---|
| 199 | EOM |
|---|
| 200 | |
|---|
| 201 | " hatena bookmark xul |
|---|
| 202 | javascript 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 |
|---|
| 206 | set! ui.key.contentAccess=0 |
|---|
| 207 | " open bookmarks in background |
|---|
| 208 | set! browser.tabs.loadBookmarksInBackground=true |
|---|
| 209 | |
|---|
| 210 | " Abbreviations |
|---|
| 211 | |
|---|
| 212 | source! /Users/otsune/.vimperatorrc.local |
|---|
| 213 | |
|---|
| 214 | " colorscheme sweets |
|---|
| 215 | echo "done" |
|---|
| 216 | " vim: ft=vimperator sw=2 sts=2 |
|---|