From 865d89c1f89cd121eb05fef72453019335799130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Fri, 12 Jan 2024 01:00:52 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(browser):=20add=20new=20bindin?= =?UTF-8?q?gs=20to=20surfing-keys=20conf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/browser/surfing-keys/surfingkeys.js | 48 ++++++++++++++++----- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/.config/browser/surfing-keys/surfingkeys.js b/.config/browser/surfing-keys/surfingkeys.js index 2797f24a..33bdec6b 100644 --- a/.config/browser/surfing-keys/surfingkeys.js +++ b/.config/browser/surfing-keys/surfingkeys.js @@ -24,13 +24,6 @@ const { vunmap, } = api; -// an example to create a new mapping `ctrl-y` -api.mapkey("", "Show me the money", function () { - Front.showPopup( - "a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).", - ); -}); - // toggle fullscreen, mainly because of YouTube mapkey("F", "Fullscreen", function () { if (window.fullScreen) { @@ -40,11 +33,44 @@ mapkey("F", "Fullscreen", function () { } }); -// an example to replace `T` with `gt`, click `Default mappings` to see how `T` works. -api.map("gt", "T"); +// Copy URL +map("yu", "ya"); -// an example to remove mapkey `Ctrl-i` -api.unmap(""); +// Buffers/Tabs +map("b", "T"); + +// History Back/Forward +map("H", "S"); +map("L", "D"); + +// Next/Prev Page +map("K", "[["); +map("J", "]]"); + +// Scroll Page Down/Up +mapkey("", "Scroll down", () => { + Normal.scroll("pageDown"); +}); +mapkey("", "Scroll up", () => { + Normal.scroll("pageUp"); +}); + +// --- Tabs --- +// Tab Delete/Undo +mapkey("d", "#3Close current tab", () => { + RUNTIME("closeTab"); +}); +mapkey("u", "#3Restore closed tab", () => { + RUNTIME("openLast"); +}); + +// Move Tab Left/Right w/ one press +map(">", ">>"); +map("<", "<<"); + +// Tab Next/Prev +map("", "R"); +map("", "E"); // set theme Hints.style(