Vim Style Navigation (with Settings + Enhanced)

Vim-style scrolling + hint(f/F), find(/ n/N), history(H/L), page ops(r t x*), misc(yy p o ?). UserScript-safe fallbacks.

Tendrás que instalar una extensión para tu navegador como Tampermonkey, Greasemonkey o Violentmonkey si quieres utilizar este script.

Necesitarás instalar una extensión como Tampermonkey o Violentmonkey para instalar este script.

Necesitarás instalar una extensión como Tampermonkey o Violentmonkey para instalar este script.

Necesitarás instalar una extensión como Tampermonkey o Userscripts para instalar este script.

Necesitará instalar una extensión como Tampermonkey para instalar este script.

Necesitarás instalar una extensión para administrar scripts de usuario si quieres instalar este script.

(Ya tengo un administrador de scripts de usuario, déjame instalarlo)

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

(Ya tengo un administrador de estilos de usuario, déjame instalarlo)

Autor
bianwenbo
Instalaciones diarias
0
Instalaciones totales
3
Calificaciones
0 0 0
Versión
2.2.0
Creado
31/8/2025
Actualizado
1/9/2025
Tamaño
20,6 KB
Licencia
MIT
Funciona en
Todos los sitios

Vim Style Navigation (with Settings + Enhanced)

A Tampermonkey userscript that brings Vim-style navigation to the web:

  • Scrolling: hjkl, d/u, gg/G
  • Link hints: f / F
  • Find: /, n / N
  • History: H / L
  • Page ops: r, t, x*
  • Misc: yy, p, o, ?

* x can only close tabs that were opened by scripts (browser restriction).


✨ Features

Scrolling

  • h / l — scroll left/right
  • j / k — scroll down/up
  • d / u — page down/up (distance = baseStep + extraPage)
  • gg / G — jump to top/bottom

Link Hint

  • f — open hinted link in current tab
  • F — open hinted link in new tab (uses GM_openInTabwindow.open fallback)

Find

  • / — open lightweight find bar
  • n / N — next / previous match (based on window.find)

History & Page Ops

  • H — back, L — forward
  • r — reload, t — new tab, x — close tab*
  • J/K tab switching is not available in UserScript due to browser permissions.

Misc

  • yy — copy current page URL (clipboard API / GM fallback)
  • p — open URL from clipboard (or prompt fallback)
  • o — open URL or search (prompt)
  • ? — help overlay

Smart input detection: Hotkeys are disabled inside INPUT / TEXTAREA / SELECT / contentEditable / designMode=on.


⚙️ Settings (Tampermonkey Menu)

Open Tampermonkey → this script → Menu Commands to adjust:

  • Base Step (baseStep, default 100)
  • Extra Page (extraPage, default 300)
  • gg Interval (ggIntervalMs, default 600 ms)
  • Native Smooth Scroll (useNativeSmooth, on/off)
  • Ignore Modifier Keys (ignoreWithModifier, on/off)
  • Exclude Sites: add/remove URL prefixes or regex (e.g. /.*\.notion\.site\//)
  • Hint Chars (hintChars), Hint Max Letters (hintMaxLetters)
  • Reset Defaults

🚀 Installation

  1. Install Tampermonkey for your browser.
  2. Add this userscript (paste raw URL or code).
  3. Refresh any page and start using Vim keys.

🛡️ Permissions & Notes

  • Uses GM_openInTab, GM_setClipboard, GM_getValue/GM_setValue, GM_registerMenuCommand.
  • Clipboard read may require HTTPS and user permission; script falls back to prompt when needed.
  • Some sites use custom scroll containers; extreme layouts may reduce hint accuracy.
  • Recommended to exclude heavy editors: Google Docs, Notion, Figma, Gmail, etc.
  • UserScript cannot switch browser tabs programmatically (security limitation).

❓ Troubleshooting

  • Keys don’t work: Check if focus is inside an input/editor; confirm the site isn’t in the exclude list.
  • x doesn’t close: Browsers only allow scripts to close tabs that they opened.
  • Clipboard issues: Grant permission or use the prompt fallback.
  • Conflicts: If a site uses the same keys, enable “Ignore Modifier Keys” or add the site to Exclude.

🗺️ Keymap (Quick Reference)

Category Keys Action
Scroll j / k Down / Up
h / l Left / Right
d / u Page Down / Up (base+extra)
gg / G Top / Bottom
Hint f / F Open link (current / new tab)
Find /, n / N Open find, Next / Prev
History H / L Back / Forward
Page r / t / x Reload / New tab / Close tab*
Misc yy / p / o / ? Copy URL / Open from clipboard / Open or search / Help

📜 License

MIT License © Wenbo Bian