Vimium – A browser extension that provides Vim-style keyboard controls
vimium.github.io
vimium.github.io
I'm quite proud of the little test I wrote to figure out which DOM APIs could be used to detect the visibility of different kinds of elements, in order that we could display link hints correctly: https://github.com/philc/vimium/blob/master/test_harnesses/v...
Not sure I'll have much time to work on OSS in the foreseeable future, but it would certainly be nice to work together again.
I built the custom search engines feature (which I ironically don't use much anymore).
Related: last week I published a very similar extension, but for Google Sheets. https://github.com/philc/sheetkeys
Do you have any plans for a Google Docs extension as well? Or do you mostly get by with Vimium there?
I think it's fair to say that between Vimium and a windows manager on OSX I've cut my mouse actions by 90%.
Your work has had a profoundly positive impact on my life and I'm very grateful.
You can see the rest of my ergonomic aids here: https://twitter.com/mbuckbee/status/1463598464252665866
- Kinesis Freestyle split keyboard tented and then tented even more with slanted yoga blocks
- 4K monitor/tv to show multiple screens to reduce alt-tabbing
- Magic trackpad mounted on a cellphone stand on the left of my keyboard (I'm right handed). This lets me use my non-dominant hand and requires less arm movement.
(I am about to use it to press the "reply" button to submit this comment. It's fantastic.)
I tried saving tabs for reference material, but I prefer something simpler. I shutdown my PC at the end of the day. I have a dump.txt where every link that might get needed tomorrow gets pasted.
You seem to have mastered pure focus which is an amazing, coveted trait, but we don't all have it.
It's less aggression and more disbelief/shock because I don't understand how it would be possible to use a browser with more than 15 tabs open.
Folks who successfully have huge numbers of tabs and who really love that, in my experience, are treating their tabs like a different kind of bookmark, or they just have a ton of bookmarks. They'll usually use a categorization feature of some kind in order to organize their tabs just like someone organizes a library. Whether you're using tabs, bookmarks, written notes, whatever, all these systems in general are just some form of active tracking.
If you're not actively organizing and tracking though, why not free yourself and merely close your tabs aggressively? It's pretty easy, just uncheck the "Re-open tabs on startup" or the equivalent in your browser settings, then just click the "close" button on your window with all your hundreds of tabs. Let them go, and free yourself of worrying about them!
Besides, if you REALLY need them, you've always got your browser history anyway ;)
And Trello card is an action item which will eventually get to the "DONE" column, will be decomposed into actionable items or will be deleted/archived during the next review event.
I also don’t have to close them to return later or curate them — more time and thinking saved. Sidebery unloads tabs in collapsed groups so even though I have a few hundred open across two Firefox windows, probably less than 20 are consuming RAM and other resources.
I don’t really use bookmarks. I don’t think they solve any problem very well. Both tabs and notes/documents with links in are better.
I keep my tabs low and there's no way I'd find anything with that many tabs open but thought I'd call out the feature given the context of this discussion.
Has that been your experience as well?
I'm sorry you lost your tabs but congratulations nonetheless.
https://stackoverflow.com/questions/11828270/how-do-i-exit-v...
It takes more time to bookmark a link, than it is to open it in a new tab. The positioning of the tab is an indication of approx. when that tab had been opened, and the other tabs near it is likely similar in subject matter, or is related somehow.
It acts as a queue to be processed as well.
And for a lot of browsers, the auto-preloading means you can have the tab "saved" and you can view it, even if it took long time to load. It's a form of "offline" viewing.
If bookmarks can achieve _all_ of the above, without having the need for the user to do anything extra, it would actually replace tabs. But so far, i've not seen anyone switch.
Add in tree style tabs and you get this relationship on steroids - new tabs are automatically a child of the source tab, and you can expand/collapse the tree.
I have to shut down everything at the end of the day and start from a clean reboot the next or I get overwhelmed. I think it's sort of my way of unloading work stuff from my brain at the end of the day and loading up again at the beginning of the next.
Main reason for keeping tags are they are a constant reminder of topics to look into. Kinda like postits on your monitor. If I put them away using bookmarks I often forget about them and neder get to them. I have folders with hundreds of links I wanted to look a year back and still haven't.
I do clean out tabs occasionally when I am done with a topic but I mostly only bookmark when having to shutdown the system.
My approach is to bookmark things and then if I feel like it's time to read up on something or just a good time to work on the reading backlog, I'll just pick whatever seems suitable at a first glance.
No, why would it be? It's sort of my curated list of things to check out when I have a free moment, just like HN is. HN curates the Internet for potentially interesting things for hackers, and I further curate from that (and other sources) for things that interest me, and have them as open tabs. It's no more "stressful" than knowing the fact that there are thousands of interesting HN links on here. They're just options of potential things to look at, not tasks to get through.
I use bookmarks as a more persistent thing, for things I know will be of interest to me long term. Some of these tabs might go into my bookmarks, but many others are interesting enough to look at/read through once, but not worth adding a bookmark for.
The grouping of tabs into trees also helps with keeping them (pretty much self-)organized. Vimium's "search open tabs" shortcut is also very useful, if I need a specific tab right now.
Links rot. If I see something on the interwebs that I want to store or remember, I usually copy the pertinent information somewhere else. Be that Anki, or org-mode, or somewhere else. I leave the tab open until I get the free time to go back and copy the information somewhere.
Looking at my open-longest tabs, it seems I've got some Magento documentation open from last summer. I should go clean that up. )) If these were bookmarks, I would absolutely _never_ get around to filing the information away in a useful place.
Finally found Link Hints, which does only the link opening part, but better (IMO), and with normal keyboard shortcuts. Now I'm constantly using it.
https://addons.mozilla.org/en-US/firefox/addon/key-jump-keyb...
0: https://handsfreecoding.org/2017/11/22/extensions-now-availa...
Offtopic:
The section "Declaration for Applicable Regions" from ReadMe, this is the first time I've come across it.
Should it be read as a disclaimer or an opinion?
Edit: no, but tridactyl is: https://github.com/tridactyl/tridactyl
https://github.com/rvaiya/warpd https://github.com/rvaiya/keyd
Why in the world are those links side by side?
Also, I think the other mentioned alternatives look quite similar to that regard.
Maybe I'll switch away some time in the future, but for now the flawless vim-UX, its customizability and my many scripts and custom bindings I've written for it keep my locked in the qutebrowser garden, haha!
I think honestly most of the work in getting such an API merged would be political since most of the people who approved it are no longer at Mozilla.
If anyone wants to pick it up I would be delighted to help.
Tried it before, long long time ago, but found it to complex. But now after using Vimium for a while Qutebrowser actually seems very intuitive and not hard at all.
Although I must admit for a longer while I've been ignoring sites that are annoying or unusable without a blocker and it made my day much calmer. I stopped even clicking links on most "news" sites that are just borderline clickbaits.
Just for potential readers who might not be aware: qutebrowser ships with its own inbuild adblocker though, so you're entirely left adrift in the ad-trashpile that is the Web today. Qutebrowser isn't my daily driver (mainly because I found it a pain to configure), but from my limited experience, the adblocking works pretty well.
so you're *not* entirely left adrift
Here are some of my headaches that force me to use Chrome/Firefox anyway sometimes, if anyone has answers to these I am very interested to hear them.
* Can't save passwords / autofill (for accounts I don't particularly care about)
* UI scaling in Windows (for high-res screens) is bad. The web page contents do not scale automatically.
* Does not resolve Teams "secure links" (workaround is to right click teams links instead and copy them, then paste in qutebrowser)
* Twitter videos don't work
* On linux (somehow this works on windows), "accept all cookies" sometimes does not get rid of that prompt. Stack overflow is an example where this happens. Another example is redhat where the prompt does not load for a while [0]
* Clicking something that spawns a box where text can be inserted does not bring me into insert mode. Example [1] (the searchglass). This causes me to close the tab by mistake sometimes by typing 'd'.
[0]: https://access.redhat.com/documentation/en-us/red_hat_enterp... [1]: https://www.atlassian.com/software/jira/templates/web-design...
I empathise with the author wanting to make a buck but it's hard to reconcile the approach he took with the level of trust granted to this extension.
But I agree, there is so much trust with extensions like this it isn't even about intent.
Vimium disables the browser's backward-forward cache (by listening to the "unload" event), causing navigation to be much slower.
There is also no way for a website owner to warn a Vimium user of conflicting keybindings. I run a website which implements Vim keybindings and several of my users complain that it doesn't work. I have to remind them to disable Vimium. This issue has been open on their GitHub for more than 4 years with no end in sight.
I've observed the effects on both Firefox and Chrome and it's like day and night.
On chrome you can even test it using Devtools > Application> backward forward cache
No, not really. Not unless it specifies certain `web_accessible_resources` which you try to load - but that's a bit of a hack, needs to be done on an extension-by-extension basis, and won't even work for all extensions.
Plus in the case of your parent, their website implements vim keybindings, so basically all of them are going to conflict with this extension, and it's going to be pretty useless if they detect that situation and react by changing all of them to something non-standard.
The initial way we checked for it was looking for document.body.matches('*[_vimium-has-onclick-listener]') but apparently that stopped working in 2018. We then used a variation of this code: https://github.com/hackape/Detect-Vimium/blob/master/detect-... which seems to work still.
Or Vimium users could RTFM.
Apparently VimFX still runs via some hacks on modern Firefox versions? The last release was even in 2022. Maybe I should give it a try again.
IMO the scrolling in Tridactyl is better than native as it can work even when the page has put focus somewhere daft (like a pop-up).
Tridactyl's huge jumps are annoying to me, as is Vimium's excess smoothness. In Vim, I hit j once to scroll one line, same as <down>.
You can change that easily with `:bind j scrollline 1` and `:bind k scrollline 1` :)
The default bind was a conscious choice to break with tradition with Vimperator because everyone I knew rebound j/k to scroll further.
I'm glad you got VimFx working though!
* The extension has a genuine need for the permissions
* It’s an old extension at this point, with known maintainers with names and faces
* I really, really want the features
Neither Vimium nor SurfingKeys don't hold a candle to KeySnail because back in the days add-ons worked you could control the browser's chrome as well as a bunch of other non-HTML elements.
Today, you cannot even use browser extensions to close a browser window if the page didn't load in it.
These tools were intended for "power users", who could establish for themselves if the piece of code they want to use is doing something malicious or not. Also being an easy way to extend the browser without a need to recompile it and a need to understand a huge project with a ton of infrastructure... flushed down the drain.
This reminds me about how Alan Key said in one of his interviews that if a motorcycle was invented today, it would've been outlawed right away due to safety concerns.
Curious to discuss if there is a way to trust these extensions without establishing ourselves that the code is not harmful.
Of course you need to do some due diligence, but it isn't anywhere near as taxing as you seem to think.
Security is worthless if it prevents you from doing useful things. Given a choice between a chance of security breach and not being able to do the useful thing at all, in the circumstances like using a Web browser, I'd definitely choose to have the useful thing w/o security.
And assessing risk of freely available open source software is still difficult, you either rely on all the authors being standup citizens, or on the bulk of the reviewers to be truthful and knowledgeable.
The occasional website having its own keybinds never stops being annoying, but it's easy to disable the extension per site
Maybe there's something to be learned by browser designers. It's not just the fact it's on the home row and muscle memory for Vim users. The default speed for down/up arrow scrolling and lack of smoothing is just not the same.
Page Up/Down?
It does not compare directly with the old vimperator addon but it works great for regular browser navigation.
The only occasional glitch I saw was in UI for adding site exceptions.
I've used Vimium on Chrome. Every few years I get excited, install it, feel 10x more productive, and then a few days later uninstall it.
As I recall, it doesn't work on the New Tab page. It doesn't work if the address bar is in focus. I believe you have to wait for the page to fully load before you can use it.
Most annoyingly, a lot of websites have custom keyboard shortcuts, so you have to blacklist them in the Vimium config. Eg Gmail, Miro. Then you need to remember you can't use Vimium on them.
None of this is their fault in any way, of course. But it does make Vimium a bit annoying to use for me anyway.
No, you just need to enter insert mode. Hit `i`, then all the keyboard shortcuts for the site work. Exit insert mode with escape or ctrl+[.
Thanks for this, this changes everything. Namely, I can re-enable most commands that I've globally disabled. Who woulda thought the path to enlightenment would be to simply RTFM.
As someone else replied, insert mode.
In the editor speed matters: speed is a bottleneck. For example, if AI comes in writes a paragraph based on the function title, "bubble_sort_array", that's great, because now I've sliced 2 minutes off the 3 minutes that would ordinarily take.
But in the browser, time is cheap; in fact, that's largely why I used the browser, to luxuriate in the time it takes to, say, read an article, or write a long comment. I'm there to take it slow, to escape the tyranny of efficiency. So when I'm there to relax, shaving 4 seconds off a 10 minute reading time is irrelevant.
So I use shortcuts in my editor, but not my browser.
For address bar being focussed, a tab will take you to to the page content.
The one thing I find most annoying (which isn't vimium's fault) is the lack of j/k scrolling on pdfs.
Unfortunately, the extension cannot always overpower site's key-bindings, and that's where it sucks.
However, there's one exception to that rule: every now and then I need to work with a VNC in the browser, and in that specific case Surfingkeys takes over and makes it unusable. Well... it's annoying, but, really all it takes is clicking the extension's icon next to the address bar, and then clicking it again once I'm done with the VNC.
And yes, not having access to browser's chrome (that the address bar and new tab etc.) is a disadvantage that's due to how browsers currently work is impossible to work around.
Extensions do offer a kind of substitute, but it can never be 100% (i.e. Surfingkeys have a way to input new URL or edit current URL w/o interacting with the address bar, or a way to select a tab w/o interacting with browser's chrome, but if you happen on a page like settings or something similar, the extension cannot work there).
// privacy.resistFingerprinting breaks alt keybindings
api.map('<Ctrl-.>', '<Alt-s>');
api.unmap('<Alt-s>');
SurfingKeys remembers disabled websites so it can be a time-saver.Overall I don't want to come across as critical of of something that just needs a little effort to use, more of just setting expectations.
Normally this would be less of an issue but for me, I ran into this problem while on my rowing machine, and I didn't want to stop to fiddle with keybindings.
I seem to remember in Windows 7, there was some sort of voice assistant, that could similarly put a label on every visible clickable element. That was for voice command, but would be great for keyboard navigation, too.
there is multiple easy-motions or variant implementation in the major editors
Vimium has a lot of other great functions, but I don’t use them often enough to remember them, maybe I should.
However, I have to exclude it for a lot of webapps and websites where keybindings are used to trigger different events, which is sometimes annoying if you don’t know or forget about it.
I can't use the web without vimium.
Back then the browser extensions for Vim key bindings kept breaking now and then, and that’s a big part of the reason why I stopped using these extensions. Probably the situation is a lot more stable today.
Another part of the reason that I stopped using these plugins I think is also because I do a lot of my browsing these days on my phone. And aside from that even when I am on the computer, I don’t really miss the feature in my browser. Maybe also because I use a laptop most of the time, and the trackpad of the Apple laptops are nice to use.
Anyway, I still use Vim key bindings where it matters the most to me and that is in my editor where I write code and other text.
One thing that I came to think of that maybe someone can answer. What happens if you try to run one of those Vim-in-the-browser sites, while at the same time you have Vim-style keyboard controls for the browser itself? For example this one: https://www.vimonlineeditor.com/
Unfortunately, there's been a pretty clear shift in the web away from the interoperability that extensions like this need. I'm increasingly seeing elements that aren't detectable as clickable, or which do something different when you click via extension vs with the mouse.
Firefox has compounded the problem by making tabs not apply your extension's changes in a tab until a document has loaded there.
I used to be able to do most of what I needed from the keyboard and just occasionally supplement with the trackpad, but I finally relented a few years ago and got a mouse.
[1] Was using tridactyl but decided to come back and give vimium another try after seeing this.
I know the authors are in the comments so let me say: thank you!
But, after some thought, I realise that allowing such extension simply requires trusting a third party app access to so much of my personal information. They (understandably) need the ability to read every page I browse. Vimium-FF even requires clipboard access.
I do believe the authors have the best intentions. But the amount of trust I need to have in order for a third party app to have so much access to some of my most confidential information (online banking, emails etc.) is very very high.
For example, saving the current page in a local file can be as easy as: tri.excmds.exclaim_quiet ('echo "' + document.location.href + '"' > $HOME/notes')
Sky is the limit given that you can interface with any page with JS and then pipe and process the output with any system utility or system context.
A simple example for demonstration would be copying the contents of the body tag, piping them to a readability[3] util and have the output saved to a local vault.
Or have a video played with mpv with a press of a button since you can invoke any of these functions be it custom or built-in targeting any element the same way you would follow a link by hinting.
Here are a few other, pretty interesting use cases as seen in examplar custom user configurations taken from their github wiki[4]
alias playAllVideos js tri.native.run("mpv --really-quiet --ontop --keepaspect-window --profile=protocol.http " + Array.from(document.querySelectorAll("a, iframe, video")).reduce((s, e) => {let r=(/^https?:\/\/((www.)?youtu((\.be\/)|(be\.com\/((embed\/)|(watch\?v=))))[^ ]+)|(.+\.webm)$/);let l="";if(e.tagName=="IFRAME")l=e.src.match(r);else if(e.tagName=="A")l=e.href.match(r)||e.innerText.match(r);else if(e.tagName=="VIDEO")l=[e.currentSrc?e.currentSrc:e.src];console.log(l);return s+(l && l.length > 0 && s.indexOf(l[0])<0?"'"+l[0]+"' ":"")},""))
alias gitclone jsb -p tri.native.run("git clone --depth=1 '" + JS_ARG + "' /home/me/prog/" + JS_ARG.split("/").slice(-1))
alias rsssave jsb -p tri.native.run('cat >> ~/.config/newsboat/urls', JS_ARG + "\n")
alias openGithubNotifications composite js Array.from(document.querySelectorAll("li.list-group-item > span:nth-child(1) > a:nth-child(2)")).map(e => e.href) | jsb -p JS_ARG.forEach(url => tri.excmds.tabopen(url))
Edit: I assume native messaging has security implications you should probably consider if the browser is running directly with your system without any means of isolation like sandboxing with bubblewrap or better running under a virtual environment.
[1] https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Web... [2] https://github.com/tridactyl/native_messenger [3] https://github.com/cixtor/readability [4] https://github.com/tridactyl/tridactyl/wiki/
Otherwise a malicious website targeting Tridactyl users who use the native messenger could gain shell access when you triggered your command on them.
Here's my Surfingkeys configuration as an ex-Vimium user:
api.map('F', 'gf');
api.Hints.setCharacters("asdgqwertzxcvb");
It makes open in new tab behave like Vimium and f work like a toggle.Hope this helps someone looking for a better option migrating from Vimium.
Maybe one day, I'll be to master this extension for all things, but it's hard for me naturally remember to use it.
PS: I'm a moderate level user of Vim and use it for adhoc things.
I use Qutebrowser and it's fantastic, I even wrote some userscripts for it which are probably easier to build than web extensions.
Currently I use Vim Vixen[0]. It's still nowhere near as feature-full as Vimperator was, but nothing can be nowadays. My only real complaint about it is how link hints don't let you complete with the link text like Vimperator could - it's the one thing that as far as I can tell, no replacement supports even though it's a whole lot better.
[0] https://addons.mozilla.org/en-US/firefox/addon/vim-vixen/
Vim Vixen unfortunately has been unmaintained since May [1]. If anyone knows ueokande personally, could they let him know that I would be happy to help get some releases out? I sent an email yesterday but I am not optimistic as it seems like quite a few people have tried over the last few months.
Edit: btw the hintfiltermode Tridactyl calls "vimperator-reflow" is what Vimperator actually did
Same with vim-keys in any text input field.