root/dotfiles/vimperator/hogelog-vimperatorrc @ 24711

Revision 24711, 3.5 kB (checked in by hogelog, 6 years ago)
  • 細々とした変更
  • Greasemonkeyのコマンドを実行するコマンド:gmcommandを実装
Line 
1noremap h <C-p>
2noremap l <C-n>
3noremap J <PageDown>
4noremap K <PageUp>
5noremap j 5j
6noremap k 5k
7
8" pass through
9noremap <C-q> <C-v>
10
11noremap . d
12noremap { <S-Tab><C-Enter>
13noremap } <Tab><C-Enter>
14
15noremap z <PageDown>
16noremap x <PageUp>
17
18" commands
19noremap gl      :qmarks<CR>
20noremap a       :dialog addbookmark<CR>
21noremap <Left>  :tabmove! -1<CR>
22noremap <Right> :tabmove! +1<CR>
23noremap ,a      :dialog addons<CR>
24noremap ,d      :dialog downloads<CR>
25noremap ,c      :dialog console<CR>
26noremap ,g      :set go+=m<CR>
27noremap ,G      :set go-=m<CR>
28noremap ,t      :twitter<Space>
29noremap ,h      :hatebu<CR>
30noremap ,2      :dialog foxage2ch<CR>
31
32" moreqmarks.js
33noremap gv      :stacklist<CR>
34noremap gz      :queuelist<CR>
35
36" incuri.js
37noremap [j :decuri<CR>
38noremap ]j :incuri<CR>
39
40" Paste
41cmap <C-v> <S-Insert>
42imap <C-v> <S-Insert>
43
44set guioptions=m
45
46set focuscontent
47
48set complete=slh
49"set wildoptions=auto
50
51" ]]
52set nextpattern=次.*,→,\bnext,>>,»
53" [[
54set previouspattern=前.*,←,\bprev,<<,«
55
56set verbose=9
57
58javascript <<EOM
59liberator.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
72liberator.commands.add(["saves[ession]"], "Save Session", function() gSessionManager.saveWindow());
73
74// proxy.js
75liberator.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
106liberator.commands.addUserCommand(["gmcommand", "gmcmd"], "Run Greasemonkey Command",
107var commander = GM_BrowserUI.getCommander(getBrowser().selectedTab.linkedBrowser.contentWindow);
108function(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});
131EOM
132
133echo ".vimperatorrc is loaded"
134" vim: set ft=javascript sw=4 ts=4 et:
Note: See TracBrowser for help on using the browser.