aboutsummaryrefslogtreecommitdiffstats
path: root/google-results.js
blob: 14161c7c58afb262a3630e5396d1686d1a317a46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
* ==VimperatorPlugin==
* @name google-results.js
* @description provides quick access to google results
* @author whatsthebeef (whiskeytangobravo@gmail.com, http://www.whatsthebeef.org)
* @version 0.1
* @minversion 2.0pre
* ==/VimperatorPlugin==
*
* LICENSE
* Creative Commons
*
* USAGE
* :gr [index]
* index - the index of the result you would like to access
* 
* EXAMPLE
* keys can be mapped like so
* nmap ,1 :gr<Space>0<CR> 
* nmap ,2 :gr<Space>1<CR> 
* etc...
* the you only need to press ,1 to access first result...
*
* HISTORY
* 2012/02/27 ver. 0.1 - initial written.
*
*/

(function() {

commands.addUserCommand(["gr"],
    "Google Results",
    function (args) {
        window.content.document.querySelectorAll("div > ol > li > div > h3 > a")[args].click();
    });
})();