mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
feat(surfingkeys): Add more search aliases
This commit is contained in:
parent
e5fb48289f
commit
11cba49807
1 changed files with 67 additions and 15 deletions
|
|
@ -22,7 +22,6 @@ api.unmap('<ctrl-i>');
|
||||||
// Settings
|
// Settings
|
||||||
settings.language = "zh-CN";
|
settings.language = "zh-CN";
|
||||||
settings.showModeStatus = false;
|
settings.showModeStatus = false;
|
||||||
// Keymap, reference https://github.com/texiwustion/colemak_config_for_surfingkeys/tree/main
|
|
||||||
// #region Helper
|
// #region Helper
|
||||||
const {
|
const {
|
||||||
aceVimMap,
|
aceVimMap,
|
||||||
|
|
@ -45,6 +44,7 @@ const {
|
||||||
Visual,
|
Visual,
|
||||||
RUNTIME,
|
RUNTIME,
|
||||||
} = api;
|
} = api;
|
||||||
|
// Keymap, reference https://github.com/texiwustion/colemak_config_for_surfingkeys/tree/main
|
||||||
const forward = {
|
const forward = {
|
||||||
add: function (key) {
|
add: function (key) {
|
||||||
// 转发即将被 unmap 的键
|
// 转发即将被 unmap 的键
|
||||||
|
|
@ -155,8 +155,8 @@ const _addSearchAlias = function (
|
||||||
alias,
|
alias,
|
||||||
name,
|
name,
|
||||||
searchUrl,
|
searchUrl,
|
||||||
searchPrefix = "s",
|
|
||||||
acUrl = "https://duckduckgo.com/ac/?q=",
|
acUrl = "https://duckduckgo.com/ac/?q=",
|
||||||
|
searchPrefix = "s",
|
||||||
parseResponse = parseSearchResponse,
|
parseResponse = parseSearchResponse,
|
||||||
) {
|
) {
|
||||||
api.addSearchAlias(
|
api.addSearchAlias(
|
||||||
|
|
@ -241,26 +241,42 @@ vForwardFactory.pull(vMapLists);
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
// #region Search Alias
|
// #region Search Alias
|
||||||
api.unmap("os"); // StackOverflow
|
removeSearchAlias("s"); // StackOverflow
|
||||||
api.vunmap("ss");
|
removeSearchAlias("d"); // DuckDuckGo
|
||||||
api.unmap("ob"); // Baidu
|
removeSearchAlias("g"); // Google
|
||||||
api.vunmap("sb");
|
removeSearchAlias("b"); // Baidu
|
||||||
api.unmap("og"); // Google
|
removeSearchAlias("w"); // Bing
|
||||||
api.vunmap("sg");
|
removeSearchAlias("y"); // YouTube
|
||||||
api.unmap("od"); // DuckDuckGo
|
|
||||||
api.vunmap("sd");
|
|
||||||
api.unmap("ow"); // Bing
|
|
||||||
api.vunmap("sw");
|
|
||||||
|
|
||||||
/// Common
|
/// Common
|
||||||
_addSearchAlias("dd", "DuckDuckGo", "https://duckduckgo.com/?q=");
|
_addSearchAlias("dd", "DuckDuckGo", "https://duckduckgo.com/?q=");
|
||||||
_addSearchAlias("gg", "Google", "https://www.google.com/search?q=");
|
_addSearchAlias("gg", "Google", "https://www.google.com/search?q=");
|
||||||
_addSearchAlias("bd", "Baidu", "https://www.baidu.com/s?wd=");
|
_addSearchAlias("bd", "Baidu", "https://www.baidu.com/s?wd=");
|
||||||
_addSearchAlias("bi", "Bing", "https://www.bing.com/search?q=");
|
_addSearchAlias("bi", "Bing", "https://www.bing.com/search?q=");
|
||||||
|
_addSearchAlias(
|
||||||
|
"wk",
|
||||||
|
"Wikipedia",
|
||||||
|
"https://en.wikipedia.org/w/index.php?title=Special:Search&search=",
|
||||||
|
);
|
||||||
|
_addSearchAlias("re", "Reddit", "https://www.reddit.com/search?q=");
|
||||||
|
_addSearchAlias("st", "Steam", "https://store.steampowered.com/search/?term=");
|
||||||
|
_addSearchAlias(
|
||||||
|
"ud",
|
||||||
|
"UrbanDictionary",
|
||||||
|
"https://www.urbandictionary.com/define.php?term=",
|
||||||
|
);
|
||||||
|
_addSearchAlias("tw", "X", "https://twitter.com/search?q=");
|
||||||
|
_addSearchAlias("de", "Thesaurus", "https://www.onelook.com/?w=");
|
||||||
|
_addSearchAlias(
|
||||||
|
"ww",
|
||||||
|
"WantWords",
|
||||||
|
"https://www.shenyandayi.com/wantWordsResult?lang=zh&query=",
|
||||||
|
);
|
||||||
/// AI Search
|
/// AI Search
|
||||||
_addSearchAlias("fe", "Felo", "https://felo.ai/search?q=");
|
_addSearchAlias("fe", "Felo", "https://felo.ai/search?q=");
|
||||||
_addSearchAlias("pp", "Perplexity", "https://www.perplexity.ai/?q=");
|
_addSearchAlias("pp", "Perplexity", "https://www.perplexity.ai/?q=");
|
||||||
_addSearchAlias("cg", "ChatGPT", "https://chat.openai.com/?q=");
|
_addSearchAlias("cg", "ChatGPT", "https://chat.openai.com/?q=");
|
||||||
|
_addSearchAlias("mc", "Metacritic", "https://www.metacritic.com/search/");
|
||||||
/// EECS Related
|
/// EECS Related
|
||||||
_addSearchAlias(
|
_addSearchAlias(
|
||||||
"gh",
|
"gh",
|
||||||
|
|
@ -268,14 +284,42 @@ _addSearchAlias(
|
||||||
"https://github.com/search?type=repositories&q=",
|
"https://github.com/search?type=repositories&q=",
|
||||||
);
|
);
|
||||||
_addSearchAlias("so", "StackOverflow", "https://stackoverflow.com/search?q=");
|
_addSearchAlias("so", "StackOverflow", "https://stackoverflow.com/search?q=");
|
||||||
|
_addSearchAlias("se", "StackExchange", "https://stackexchange.com/search?q=");
|
||||||
_addSearchAlias(
|
_addSearchAlias(
|
||||||
"aw",
|
"aw",
|
||||||
"ArchWiki",
|
"ArchWiki",
|
||||||
"https://wiki.archlinux.org/index.php?search=",
|
"https://wiki.archlinux.org/index.php?search=",
|
||||||
);
|
);
|
||||||
/// Software
|
_addSearchAlias("wa", "WolframAlpha", "https://www.wolframalpha.com/input/?i=");
|
||||||
|
_addSearchAlias("eb", "ebay", "https://www.ebay.co.uk/sch/i.html?kw=");
|
||||||
|
// Programming language packages
|
||||||
|
_addSearchAlias("py", "pypi", "https://pypi.org/search/?q=");
|
||||||
|
_addSearchAlias("ng", "NuGet", "https://www.nuget.org/packages?q=");
|
||||||
|
_addSearchAlias("np", "npm", "https://www.npmjs.com/search?q=");
|
||||||
|
// Package Manager Search
|
||||||
|
_addSearchAlias("wg", "winget", "https://winget.ragerworks.com/search/all/");
|
||||||
_addSearchAlias("sc", "Scoop", "https://scoop.sh/#/apps?q=");
|
_addSearchAlias("sc", "Scoop", "https://scoop.sh/#/apps?q=");
|
||||||
_addSearchAlias("br", "Brew", "https://duckduckgo.com/?q=!brew ");
|
_addSearchAlias("br", "HomeBrew", "https://duckduckgo.com/?q=!brew ");
|
||||||
|
_addSearchAlias("au", "AUR", "https://aur.archlinux.org/packages?K=");
|
||||||
|
_addSearchAlias("pa", "Pacman", "https://archlinux.org/packages/?q=");
|
||||||
|
_addSearchAlias("ap", "APT", "https://packages.ubuntu.com/search?keywords=");
|
||||||
|
_addSearchAlias(
|
||||||
|
"a2",
|
||||||
|
"AlternativeTo",
|
||||||
|
"https://alternativeto.net/browse/search/?q=",
|
||||||
|
);
|
||||||
|
_addSearchAlias(
|
||||||
|
"cr",
|
||||||
|
"Chrome Web Store",
|
||||||
|
"https://chrome.google.com/webstore/search/",
|
||||||
|
);
|
||||||
|
/// Video
|
||||||
|
_addSearchAlias(
|
||||||
|
"yt",
|
||||||
|
"YouTube",
|
||||||
|
"https://www.youtube.com/results?search_query=",
|
||||||
|
);
|
||||||
|
_addSearchAlias("bl", "Bilibili", "https://search.bilibili.com/all?keyword=");
|
||||||
|
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
|
|
@ -310,7 +354,11 @@ api.mapkey("as", "Start/Stop Generating", chatgptStartStop, {
|
||||||
//}, { domain: /chatgpt.com/ });
|
//}, { domain: /chatgpt.com/ });
|
||||||
// perplexity.ai
|
// perplexity.ai
|
||||||
api.unmap("<Ctrl-i>", /perplexity.ai/); // allows to use perplexity web keybindings
|
api.unmap("<Ctrl-i>", /perplexity.ai/); // allows to use perplexity web keybindings
|
||||||
api.map();
|
api.mapkey("aB", "Add Perplexity Bookmark", function () {
|
||||||
|
// button.border:nth-child(2)
|
||||||
|
var btn = document.querySelector("button.border:nth-child(2)");
|
||||||
|
btn.click();
|
||||||
|
});
|
||||||
|
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
|
|
@ -426,3 +474,7 @@ addVimMapKey(
|
||||||
);
|
);
|
||||||
|
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
|
// #region Hints
|
||||||
|
Hints.setNumeric();
|
||||||
|
// #endregion
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue