| 1 | noremap h <C-p> |
|---|
| 2 | noremap l <C-n> |
|---|
| 3 | noremap J <PageDown> |
|---|
| 4 | noremap K <PageUp> |
|---|
| 5 | noremap j 5j |
|---|
| 6 | noremap k 5k |
|---|
| 7 | |
|---|
| 8 | " pass through |
|---|
| 9 | noremap <C-q> <C-v> |
|---|
| 10 | |
|---|
| 11 | noremap . d |
|---|
| 12 | noremap { <S-Tab><C-Enter> |
|---|
| 13 | noremap } <Tab><C-Enter> |
|---|
| 14 | |
|---|
| 15 | noremap z <PageDown> |
|---|
| 16 | noremap x <PageUp> |
|---|
| 17 | |
|---|
| 18 | " commands |
|---|
| 19 | noremap gl :qmarks<CR> |
|---|
| 20 | noremap a :dialog addbookmark<CR> |
|---|
| 21 | noremap <Left> :tabmove! -1<CR> |
|---|
| 22 | noremap <Right> :tabmove! +1<CR> |
|---|
| 23 | noremap ,a :dialog addons<CR> |
|---|
| 24 | noremap ,d :dialog downloads<CR> |
|---|
| 25 | noremap ,c :dialog console<CR> |
|---|
| 26 | noremap ,g :set go+=m<CR> |
|---|
| 27 | noremap ,G :set go-=m<CR> |
|---|
| 28 | noremap ,t :twitter<Space> |
|---|
| 29 | noremap ,h :hatebu<CR> |
|---|
| 30 | noremap ,2 :dialog foxage2ch<CR> |
|---|
| 31 | |
|---|
| 32 | " moreqmarks.js |
|---|
| 33 | noremap gv :stacklist<CR> |
|---|
| 34 | noremap gz :queuelist<CR> |
|---|
| 35 | |
|---|
| 36 | " incuri.js |
|---|
| 37 | noremap [j :decuri<CR> |
|---|
| 38 | noremap ]j :incuri<CR> |
|---|
| 39 | |
|---|
| 40 | " Paste |
|---|
| 41 | cmap <C-v> <S-Insert> |
|---|
| 42 | imap <C-v> <S-Insert> |
|---|
| 43 | |
|---|
| 44 | set guioptions=m |
|---|
| 45 | |
|---|
| 46 | set focuscontent |
|---|
| 47 | |
|---|
| 48 | set complete=slh |
|---|
| 49 | "set wildoptions=auto |
|---|
| 50 | |
|---|
| 51 | " ]] |
|---|
| 52 | set nextpattern=次.*,→,\bnext,>>,» |
|---|
| 53 | " [[ |
|---|
| 54 | set previouspattern=前.*,←,\bprev,<<,« |
|---|
| 55 | |
|---|
| 56 | set verbose=9 |
|---|
| 57 | |
|---|
| 58 | javascript <<EOM |
|---|
| 59 | liberator.commands.add(["hatebu"], "Hatena Bookmark", function() { |
|---|
| 60 | var url = 'http://b.hatena.ne.jp/entry/'+liberator.buffer.URL; |
|---|
| 61 | getBrowser().addTab(url, null, null, null); |
|---|
| 62 | }); |
|---|
| 63 | // add dialogs |
|---|
| 64 | [ |
|---|
| 65 | ['bbs2chreader', 'bbs2chreader', 'chrome://bbs2chreader/content/bbsmenu/page.xul', 'resizable,width=200,height=700'], |
|---|
| 66 | ['scrapbook', 'ScrapBook', 'chrome://scrapbook/content/scrapbook.xul', 'resizable,width=300,height=700'], |
|---|
| 67 | ['foxage2ch', 'Foxage2ch', 'chrome://foxage2ch/content/foxage2ch.xul'], |
|---|
| 68 | ['livehttpheaders', 'Live HTTP Headers', 'chrome://livehttpheaders/content/LiveHTTPHeaders.xul'], |
|---|
| 69 | ].forEach(function([name, description, uri, args]) liberator.config.dialogs.push([name, description, function() openDialog(uri, "_blank", args)])); |
|---|
| 70 | |
|---|
| 71 | // SessionManager |
|---|
| 72 | liberator.commands.add(["saves[ession]"], "Save Session", function() gSessionManager.saveWindow()); |
|---|
| 73 | |
|---|
| 74 | // proxy.js |
|---|
| 75 | liberator.globalVariables.proxy_settings = [ |
|---|
| 76 | { |
|---|
| 77 | conf_name: 'disable', |
|---|
| 78 | conf_usage: 'direct connection', |
|---|
| 79 | settings: [ |
|---|
| 80 | { |
|---|
| 81 | label: 'type', |
|---|
| 82 | param: 0 |
|---|
| 83 | } |
|---|
| 84 | ] |
|---|
| 85 | }, |
|---|
| 86 | { |
|---|
| 87 | conf_name: 'forwarding', |
|---|
| 88 | conf_usage: 'use port forwarding', |
|---|
| 89 | settings: [ |
|---|
| 90 | { |
|---|
| 91 | label: 'type', |
|---|
| 92 | param: 1 |
|---|
| 93 | }, |
|---|
| 94 | { |
|---|
| 95 | label: 'http', |
|---|
| 96 | param: 'localhost' |
|---|
| 97 | }, |
|---|
| 98 | { |
|---|
| 99 | label: 'http_port', |
|---|
| 100 | param: 8080 |
|---|
| 101 | } |
|---|
| 102 | ] |
|---|
| 103 | } |
|---|
| 104 | ]; |
|---|
| 105 | |
|---|
| 106 | liberator.commands.addUserCommand(["gmcommand", "gmcmd"], "Run Greasemonkey Command", |
|---|
| 107 | var commander = GM_BrowserUI.getCommander(getBrowser().selectedTab.linkedBrowser.contentWindow); |
|---|
| 108 | function(value) { |
|---|
| 109 | for (var i = 0; i < commander.menuItems.length; i++) { |
|---|
| 110 | var menuItem = commander.menuItems[i]; |
|---|
| 111 | if (menuItem.getAttribute("label") == value) { |
|---|
| 112 | menuItem._commandFunc(); |
|---|
| 113 | return; |
|---|
| 114 | } |
|---|
| 115 | } |
|---|
| 116 | liberator.echoerr(value+" is not defined userscript command."); |
|---|
| 117 | }, |
|---|
| 118 | { |
|---|
| 119 | completer: function(filter) { |
|---|
| 120 | var completions = []; |
|---|
| 121 | var exp = new RegExp(".*" + filter + ".*"); |
|---|
| 122 | for (var i = 0; i < commander.menuItems.length; i++) { |
|---|
| 123 | var label = commander.menuItems[i].getAttribute("label"); |
|---|
| 124 | if (!filter || exp.test(label)) { |
|---|
| 125 | completions.push([label, label]); |
|---|
| 126 | } |
|---|
| 127 | } |
|---|
| 128 | return [0, completions]; |
|---|
| 129 | } |
|---|
| 130 | }); |
|---|
| 131 | EOM |
|---|
| 132 | |
|---|
| 133 | echo ".vimperatorrc is loaded" |
|---|
| 134 | " vim: set ft=javascript sw=4 ts=4 et: |
|---|