| 1 | " Vimperator 1.2pre |
|---|
| 2 | |
|---|
| 3 | set visualbell |
|---|
| 4 | set verbose=9 |
|---|
| 5 | " set wildoptions=auto |
|---|
| 6 | " set complete=sfl |
|---|
| 7 | set complete=sbfh |
|---|
| 8 | set defsearch=g |
|---|
| 9 | set suggestengines=w,g |
|---|
| 10 | set nextpattern+=next,次(の)?ページ,\b次.*,→\b,\b,下一頁 |
|---|
| 11 | set previouspattern+=prev,前(の)?ページ,\b前.*,\b← |
|---|
| 12 | |
|---|
| 13 | noremap j 5j |
|---|
| 14 | noremap k 5k |
|---|
| 15 | |
|---|
| 16 | " コマンドライン、テキストエリア内では<C-v>で貼り付け |
|---|
| 17 | cnoremap <C-v> <S-Insert> |
|---|
| 18 | inoremap <C-v> <S-Insert> |
|---|
| 19 | |
|---|
| 20 | noremap I <C-q> |
|---|
| 21 | |
|---|
| 22 | map <Left> <C-p> |
|---|
| 23 | map <Right> <C-n> |
|---|
| 24 | map <S-Left> :tabmove! -1<CR> |
|---|
| 25 | map <S-Right> :tabmove! +1<CR> |
|---|
| 26 | |
|---|
| 27 | " autoIgnoreKey.js |
|---|
| 28 | " javascript <<EOM |
|---|
| 29 | " liberator.globalVariables.autoignorekey_pages = uneval([ |
|---|
| 30 | " /^http:\/\/reader\.livedoor\.com\/reader/, |
|---|
| 31 | " /^https?:\/\/www\.rememberthemilk\.com\// |
|---|
| 32 | " ]); |
|---|
| 33 | " EOM |
|---|
| 34 | |
|---|
| 35 | " gmail_biff.js |
|---|
| 36 | let g:gmbf_check_intervals = "300" |
|---|
| 37 | " stylechanger.js |
|---|
| 38 | let g:styles = "vimperator,tab,bookmarkstoolbar" |
|---|
| 39 | " copy.js |
|---|
| 40 | js <<EOF |
|---|
| 41 | liberator.globalVariables.copy_templates = [ |
|---|
| 42 | { label: 'hatenaAnchor', value: '[%URL%:title=%TITLE%]' }, |
|---|
| 43 | { label: 'hatenaQuote', value: '>%URL%:title=%TITLE%>\n%SEL%\n<<' }, |
|---|
| 44 | { label: 'getASIN', value: 'get ASIN Code from amazon', custom: function() content.document.getElementById('ASIN').value }, |
|---|
| 45 | { label: 'titleAndURL', value: '%TITLE%\n%URL%' }, |
|---|
| 46 | { label: 'title', value: '%TITLE%', map: ',y' }, |
|---|
| 47 | { label: 'anchor', value: '<a href="%URL%">%TITLE%</a>' }, |
|---|
| 48 | { label: 'selanchor', value: '<a href="%URL%" title="%TITLE%">%SEL%</a>' }, |
|---|
| 49 | { label: 'htmlblockquote', value: '<blockquote cite="%URL%" title="%TITLE%">%HTMLSEL%</blockquote>' } |
|---|
| 50 | ]; |
|---|
| 51 | EOF |
|---|
| 52 | |
|---|
| 53 | " Autocommans |
|---|
| 54 | " feedSomeKeys.js |
|---|
| 55 | autocmd LocationChange .* :fmapc |
|---|
| 56 | js <<EOF |
|---|
| 57 | liberator.autocommands.add('LocationChange', "^https?://mail\\.google\\.com\\/(mail|a)\\/",[ |
|---|
| 58 | 'js liberator.plugins.feedKey.setup(', |
|---|
| 59 | '"c / y j k n p o u e x s r a # [ ] z ? gi gs gt gd ga gc".split(/ +/).map(function(i) [i, "4"+i])', |
|---|
| 60 | ');'].join('')); |
|---|
| 61 | liberator.autocommands.add('LocationChange', "^http://reader\\.livedoor\\.com\\/reader\\/", |
|---|
| 62 | 'js liberator.plugins.feedKey.setup("j k s a p v c <Space> <S-Space> z Z < > b i".split(/ +/));'); |
|---|
| 63 | liberator.autocommands.add('GMActiveScript', "\nldrize\\.user\\.js$", |
|---|
| 64 | 'js if(plugins.gmperator.currentSandbox.LDRize.getSiteinfo()) liberator.plugins.feedKey.setup([["J","j"],["K","k"],"p","l","v","o","i","s"]);'); |
|---|
| 65 | EOF |
|---|
| 66 | |
|---|
| 67 | |
|---|
| 68 | " Add Mapping <C-c> copy or stop loading |
|---|
| 69 | javascript <<EOF |
|---|
| 70 | mappings.addUserMap([modes.NORMAL,modes.VISUAL],['<C-c>'], 'Copy selected text or stop loading', |
|---|
| 71 | function(){ |
|---|
| 72 | var sel = window.content.window.getSelection().toString(); |
|---|
| 73 | if (sel){ |
|---|
| 74 | copyToClipboard(sel,true); |
|---|
| 75 | } else { |
|---|
| 76 | BrowserStop(); |
|---|
| 77 | echo('Stopped loading !'); |
|---|
| 78 | } |
|---|
| 79 | } |
|---|
| 80 | ); |
|---|
| 81 | EOF |
|---|
| 82 | |
|---|
| 83 | " Show feed-button to statusbar |
|---|
| 84 | javascript <<EOF |
|---|
| 85 | (function(){ |
|---|
| 86 | var feedPanel = document.createElement('statusbarpanel'); |
|---|
| 87 | var feedButton = document.getElementById('feed-button'); |
|---|
| 88 | feedPanel.setAttribute('id','feed-panel-clone'); |
|---|
| 89 | feedPanel.appendChild(feedButton.parentNode.removeChild(feedButton)); |
|---|
| 90 | document.getElementById('status-bar').insertBefore(feedPanel,document.getElementById('security-button')); |
|---|
| 91 | })(); |
|---|
| 92 | EOF |
|---|
| 93 | |
|---|
| 94 | javascript <<EOF |
|---|
| 95 | (function(){ |
|---|
| 96 | var tabs = getBrowser().mTabs; |
|---|
| 97 | for (var i=0; i<tabs.length; i++){ |
|---|
| 98 | ['width','maxwidth','minwidth','flex'].forEach(function(attr)tabs[i].removeAttribute(attr)); |
|---|
| 99 | } |
|---|
| 100 | document.getElementById('content').addEventListener('TabOpen',function(e){ |
|---|
| 101 | var t = e.originalTarget; |
|---|
| 102 | ['width','maxwidth','minwidth','flex'].forEach(function(attr)t.removeAttribute(attr)); |
|---|
| 103 | },false); |
|---|
| 104 | })(); |
|---|
| 105 | EOF |
|---|
| 106 | |
|---|
| 107 | echo ".vimperatorrc sourced" |
|---|
| 108 | " vim:sw=2 ts=2 sts=0 et filetype=vimperator: |
|---|