Vimium Firefox



Vimium is available as a plugin/extension for both Chrome and Firefox. Basically, you install it, and then press f. The little yellow labels pop up on everything you can interact with. If there's anything that 'doesn't work', that is almost always an inaccessible web element rather than a fault with Vimium. Yes, the web is a bit rubbish in places! Oct 08, 2019 Vimium-FF is the Vimium plugin from Chrome, ported to Firefox. It is still in experimental stage as I'm writing this post. The first thing that I noticed that was different is the scrolling which is smoothly animated. This might be a pro or a con depending on your preferences. Moreover, you can go to Vimium's website and get its demo video. You can also use this extension for Firefox, the Firefox extension is called Vimium-FF. The Tridactyl extension is similar to Vimium. However, this extension was created just for Firefox. The Tridactyl extension basically emulates Firefox's Vimperator extension. Unlike Vimium, the keyboard shortcuts can be used at any time, and the default bindings use modifier keys (think Emacs, not Vim). Get for Firefox or Chrome. Original Vimium README. Vimium is a Chrome extension that provides keyboard-based navigation and control of the web in the spirit of the Vim editor. Installation instructions. The Hacker's Browser. Vimium provides keyboard shortcuts for navigation and control in the spirit of Vim. This is a port of the popular Chrome extension to Firefox. Most stuff works, but the port to Firefox remains a work in progress.

  1. Vimium Firefox
  2. Vimium Firefox Free

In this post I'll talk about how I manage Firefox and mimick some of the behaviours/aestheticsI'd come to enjoy from using other browsers over the years.

Note: I'm in no way affiliated with Worldwide. It's a cool project and the site looks great, so figuredI'd use it for a screenshot

Last winter, like many others, my experience with Chrome/Chromium had been a little sour for some time.I decided to make the jump to Firefox. Seeing as the browser was the one component of my system that I'dleft out of my declarative configuration, I thought it'd be a good time to tackle that. The final piece.

Defining a package

The Firefox package in nixpkgs has been broken for platforms.darwin for quite a while. I wasn't about to set out on trying to tackle that, as I simply didn't have the time. So instead, I wrapped up fetching the release .dmg in a simple overlay. Here's what it looks like currently:

Firefox

As you can see, it's a simple derivation that just fetches & unpacks the .dmg, then moves it to an Applications/ directory in the resulting $out. Using this overlay, you can simply add it to your user or system packages list and it'll end up in ~/.nix-profile/Applications/ or ~/Applications/

Tying it in with home-manager

The ever awesome nix-community/home-manager has a really nice module for configuring Firefox. The above overlay can be configured as the package by simply setting programs.firefox.package = Firefox; (if Firefox is the name you bound the overlay to).

But the module lets you do much more than that.

Extensions from rycee's NUR repo

The programs.firefox module has an extensions option

programs.firefox.extensions

List of Firefox add-on packages to install. Note, it is necessary to manually enable these extensions inside Firefox after the first installation.

Type: list of packages

So, if you can produce package derivations whos result represents a Firefox extension, you can add it to this list and they'll be installed. Fortunately rycee has a bunch available in his NUR expressions repo.

Firefox

For anyone unfamilar with the NUR, here's an excerpt from the nix-community/NUR README

The Nix User Repository (NUR) is community-driven meta repository for Nix packages. It provides access to user repositories that contain package descriptions (Nix expressions) and allows you to install packages by referencing them via attributes. In contrast to Nixpkgs, packages are built from source and are not reviewed by any Nixpkgs member.

With this and rycee's firefox-addons packages (automatically generated & updated) we have declarative management of extensions:

Fine grained configuration & mimicking Chrome profiles

Another great feature of the programs.firefox module from home-manager: you can configure user profiles along with any settings available in about:config (stored in userprefs.js).

I was excited to see this, because my experience with Firefox's profile management so far had been lacklustre. I thought I could perhaps cook up something to mimick the profile management of Chrome. There are a few extensions out there for Firefox that offer session management based on profiles, but I really like the simplistic approach of having each instance/window of the browser run under a profile session. I'd gotten used to the pattern of having my work profile open on one workspace, and my personal profile open on another.

Vimium

I've managed to achieve this fairly elegantly, I think. Here's what I've been using:

With this, I'm setting up a bunch of common configuration I'd like to use for any profiles by let'ing defaultSettings. Then, for each profile I'm doing a merge operation with // (for those unfamilar, attributes on the right are merged over matching attributes on the left).

This yields a home profile with some styling (we'll get to that) and DuckDuckGo as the search engine, and a work profile whos only differing setting from the default configuration is an about:blank home page. I haven't taken the time yet to configure it, but it'd be dead simple to implement a different styled/coloured work profile so the browser windows differ in appearance, which would be nice.

To launch these different profiles in the manner I prefer, I have the following skhd bindings:

The firefox binary accepts a -P flag to set the profile. We can pass this using open's --args flag. This really nicely mimicks the behaviour of Chrome I mentioned. All browser data from each profile is kept entirely separate.

Changing appearance with userChrome

And to go along with userprefs.js, the module also has a userChrome option. I only recently decided to take advantage of this. I've been using yabai for a while and have managed to configure my desktop appearance/functionality to closely resemble that of the tiling WMs I'd used on Linux/BSD over the years. I have fond memories of xombrero on OpenBSD, and found myself longing for a somewhat similar appearance. Since I'd configured Alacritty and patched Emacs to drop their title bars to fit nicely with the nature of the environment, I figured it was probably possible with Firefox via userChrome too.

Some readers may have noticed the this line earlier in my profile expression

I decided to break out the CSS for Firefox into its own file, as I knew how unwieldy it'd be. I've managed to conjure up something that hides all the elements I'm not interested in displaying, as I operate the browser mostly with the keyboard (thanks to Vimium).

Here's what it configures:

  • Hides window controls (macOS title bar)

  • Hides all 'clutter' in the nav bar (including all extensions except browserpass)

  • Hide tabs if only one tab is open

  • Minimal appearance with a solarized-light inspired theme

  • Move the hamburger menu to the left of the URL bar

  • Move tabs inline to the right of the URL bar

Here's the full configuration for anyone who may want to use it. I've tried to keep it clean and well commented.

Vimium firefox update

The home-manager module also supports userContent, but I'm yet to play around with that.

Closing words

So with all this, my entire we browsing environment is declarative - just as the rest of my configuration. It's nice being able to set up on a new machine in a matter of minutes and have everything exactly as you like it - even all the intricacies.

This concludes the write-up. If you have any questions, please don't hesitate to comment or reach out to me on Twitter (@calumacrae). Until next time, happy hacking :)

Firefox

Writing efficient user interfaces is the main maxim, here at Vimperator labs. We often follow the Vim way of doing things, but extend its principles when necessary. Towards this end, we’ve created the liberator library for Mozilla based applications, to encapsulate as many of these generic principles as possible, and liberate developers from the tedium of reinventing the wheel.

NOTE: Vimperator will stop functioning with Firefox 57!

Firefox 57 will change its add-on ecosystem to be exclusively based on WebExtensions. While this offers (some) compatibility with extensions written for Chrome and Microsoft Edge, it removes the possibility to do many advanced stuff which Vimperator does. Additionally, it would require a full rewrite of Vimperator, which nobody has volunteered for. Therefore we will stop supporting any Firefox version later than Firefox 56. Head over to our GitHub page for a list of alternatives or a detailed discussion. If you want to have famous last words, you can take a survey here to inspire future add-on authors what you actually liked about Vimperator (update:survey results in CSV).

Currently, these applications are using this library:

Vimperator (for Firefox)

Vimperator, the flagship project from Vimperator labs, creates a Vim-like Firefox.

Vimperator is a Firefox browser extension with strong inspiration from the Vim text editor, with a mind towards faster and more efficient browsing. It has similar key bindings and you could call it a modal web browser, as key bindings differ according to which mode you are in. For example, it has a special Hint mode, where you can follow links easily with the keyboard only. Also most functionality is available as commands, typing :back will go back within the current page history, just like hitting the back button in the toolbar.

Muttator (for Thunderbird)

Muttator is to Thunderbird what Vimperator is to Firefox. Combines the best aspects of Vim and Mutt.

Vimium Firefox

Muttator is a free add-on for the Thunderbird mail client, which makes it look and behave like the Vim text editor. It has similar key bindings and you could call it a modal mail client, as key bindings differ according to which mode you are in. For example, the same keys can select the next message while the message list has focus or can scroll down an existing message when the message preview is selected. It also adds commands for accessing most Thunderbird functionality. E.g., :contact -lastname 'Vimperator' vimperator@mozdev.org will add Vimperator’s mailing list to your address book.

Vimium Firefox Free

Vimium (for Chrome)

Vimium is a Google Chrome extension written by Phil Crosby and Ilya Sukhar which provides keyboard shortcuts for navigation and control in the spirit of the Vim editor. Due to limitations of the Chrome extension mechanism, it is not as powerful as Vimperator but is still considered the best Vimperator-like extension for Chrome.

Vrapper (for Eclipse)

Vrapper is an Eclipse plugin which acts as a wrapper for Eclipse text editors to provide a Vim-like input scheme for moving around and editing text.

Unlike other plugins which embed Vim in Eclipse, Vrapper imitates the behaviour of Vim while still using whatever editor you have opened in the workbench. The goal is to have the comfort and ease which comes with the different modes, complex commands and count/operator/motion combinations which are the key features behind editing with Vim, while preserving the powerful features of the different Eclipse text editors, like code generation and refactoring.

VsVim (for VisualStudio)

VsVim is a Vim Emulation layer for Visual Studio 2010 and above. It integrates the familiar key binding experience of Vim directly into Visual Studio’s editor.

Get involved

For now, we have just focused on these three Mozilla applications because of time constraints. If you want other host applications like Instantbird or Sunbird to make use of our liberator library, feel free to contact us.