Vimfari is a Safari Web Extension that provides Vim-style keyboard shortcuts for navigating and controlling the web. Based on Vimium, with extensive Safari compatibility fixes and optimizations.
Safari (Developer Mode):
- Clone this repository
- Safari → 开发 → Web 扩展 → 允许无符号扩展
- 在 Safari → 设置 → 扩展 中启用 Vimfari
| Key | Action | Key | Action |
|---|---|---|---|
j / k |
Scroll down / up | d / u |
Half page down / up |
h / l |
Scroll left / right | gg / G |
Top / bottom of page |
f |
Open link in current tab | F |
Open link in new tab |
yf |
Copy link URL | yy |
Copy current URL |
o |
Open URL, bookmark, history | O |
...in new tab |
T |
Search open tabs | : |
Execute command |
/ |
Find in page | n / N |
Next / previous match |
H / L |
Back / forward in history | r / R |
Reload / hard reload |
t |
New tab | x / X |
Close / restore tab |
J / K |
Previous / next tab | ^ |
Visit previously-visited tab |
gt / gT |
Next / previous tab | g0 / g$ |
First / last tab |
p / P |
Paste and open / new tab | v / V |
Visual / visual line mode |
i |
Insert mode | ? |
Help dialog |
m / ` |
Create mark / go to mark | gi |
Focus text input |
]] / [[ |
Follow next / previous link | gu / gU |
Up URL level / root |
zi / zo / z0 |
Zoom in / out / reset | << / >> |
Move tab left / right |
Type ? at any time to see all available commands.
Add custom mappings on the Options page (reachable from the help dialog). Syntax:
map <key> <command> [options] # Map a key to a command
unmap <key> # Remove a key mapping
unmapAll # Remove all mappings
Examples:
map <c-d> scrollPageDown
map r reload hard
unmap J
Special keys: <c-*> (ctrl), <a-*> (alt), <m-*> (meta/cmd), <s-*> (shift), <left>, <right>, <up>, <down>, <f1>–<f12>, <space>, <tab>, <enter>, <delete>, <backspace>, <home>, <end>.
- Native tab operations:
NativeBridgeenables Swift-level tab control for commands likex/X/t/J/K - IME-friendly find mode: Chinese/Japanese input works correctly in find mode (
/) - Cross-origin iframe handling: All Vomnibar and HUD popups work reliably in Safari's security model
- Clipboard: Three-tier fallback (
execCommand→navigator.clipboard→ HUD iframe) ensures copy/paste works
| Issue | Details |
|---|---|
Bookmarks (b/B) |
chrome.bookmarks API is unsupported in Safari Web Extensions |
| First-open auto-focus | Safari blocks focus() in cross-origin extension iframes until first user interaction — click once to activate |
Paste permission (p/P) |
One-time system permission dialog for clipboard read access |
See CONTRIBUTING.md. Issues and pull requests are welcome.
MIT. Based on Vimium by Phil Crosby and Ilya Sukhar. Vimfari modifications by Neal Ding. See MIT-LICENSE.txt.