Switching back to Firefox from Nyxt and maintaining the emacs style workflow and keybinding theme.
About
I love Emacs, but it’s definitely not a viable alternative to modern browsers like firefox. The desire to have an ’emacs-like’ browser lead me to use Nyxt.
But… Despite nyxt being an awesome piece of software, it’s unpolished and comes with its issues, not to mention that many websites that use cloudflare basically refuse to work with nyxt.
So for now I’ve settled on using Firefox, but with Emacs-like keybindings by utilizing vimiun
Here’s how!
Step I: about:config
First visit about:config
.
To change the modifier key to alt & use emacs keybindings when editing text set:
ui.key.accelKey
to18
ui.key.chromeAccess
to0
devtools.editor.keymap
toemacs
Step II: gtk-key-theme
Now, adjust .config/gtk-3.0/settings.ini
, make sure you’ve added
gtk-key-theme-name = Emacs
It should look something like this:
[Settings]
.....
gtk-key-theme-name = Emacs
Step III: Vimium
Install vimium.
Go on Vimium’s Options page to, by clicking the addon, feel free to use & adjust the following configuration to your liking.
unmapAll # use emacs-style bindings only
map <c-n> scrollDown
map <c-p> scrollUp
map <c-b> goBack
map <c-f> goForward
map <c-x>. scrollToTop
map <c-x>, scrollToBottom
map <c-V> scrollFullPageUp
map <c-v> scrollFullPageDown
map <c-x><c-r> reload
map <c-x>k removeTab
map <c-c><c-u> copyCurrentUrl
map <c-c><c-l> LinkHints.activateModeToCopyLinkUrl
map <c-c><c-o> openCopiedUrlInCurrentTab
map <c-c><c-O> openCopiedUrlInNewTab
map <c-c><c-i> enterInsertMode
map <c-x><c-f> LinkHints.activateMode
map <c-x><c-F> LinkHints.activateModeToOpenInNewForegroundTab
map <c-x><a-f> LinkHints.activateModeWithQueue
map <c-x>f LinkHints.activateModeToOpenInNewTab
map <c-x><c-d> Vomnibar.activate
map <c-x><c-D> Vomnibar.activateInNewTab
map <c-x>b Vomnibar.activateTabSelection
map <c-x><c-b> Vomnibar.activateBookmarks
map <c-x><c-B> Vomnibar.activateBookmarksInNewTab
map <c-@> Marks.activateCreateMode
map <c-x><c-@> Marks.activateGotoMode
map <c-s> enterFindMode
map <c-S> performFind
map <c-r> performBackwardsFind
map <c-R> performBackwardsFind
map <c-c>b previousTab
map <c-c>f nextTab
map <c-x>4 duplicateTab
map <c-g><c-r> restoreTab
map <c-x>5 moveTabToNewWindow
map <c-g><c-p> togglePinTab
map <a-B> moveTabLeft
map <a-F> moveTabRight
map <c-h> showHelp
You can find a complete vimium configuration that I’m using in my dotfiles repo
Final thoughts
With the above settings you will also get emacs keybindings when editing text, something that it was not the case with Nyxt (or at least the way I had it configured).
The only inconvenience is that I couldn’t find a way to remap M-w
to
copy. Other than that it’s a really nice experience that’s easy to
reproduce between multiple machines.
Related content
- Raamdev vimium emacs configuration
- emacs-keybinding addon, I do not recommend using this addon, but it has a useful troubleshooting guide & a nice inspiration