Skip to content

Instantly share code, notes, and snippets.

@petitviolet
Created June 30, 2014 09:26
Show Gist options
  • Save petitviolet/16c5b4523dab7af6a2ec to your computer and use it in GitHub Desktop.
Save petitviolet/16c5b4523dab7af6a2ec to your computer and use it in GitHub Desktop.
Youtube search from vimperator
(function() {
liberator.modules.commands.addUserCommand(
["youtube"],
"search from youtube",
function(args){
if (args.length === 0) {
liberator.echo('input a query!');
return false;
}
// make "and" query
var query = args.join("+");
var youtubeUrl = 'https://www.youtube.com/results?search_query='
// open in a new tab
liberator.open(youtubeUrl + query, liberator.NEW_TAB);
return false;
},
{},
true
);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment