Convert Figma logo to code with AI

akhodakivskiy logoVimFx

Vim keyboard shortcuts for Firefox

1,410
174
1,410
7

Top Related Projects

22,991

The hacker's browser.

A Vim-like interface for Firefox, inspired by Vimperator/Pentadactyl.

Map your keys for web surfing, expand your browser with javascript and keyboard.

Vim bindings for Google Chrome.

Vimperator

Quick Overview

VimFx is a Firefox extension that adds Vim-like keyboard shortcuts for browsing and navigation. It aims to provide a more efficient and keyboard-centric browsing experience, allowing users to navigate the web without relying on the mouse.

Pros

  • Enhances browsing efficiency with Vim-inspired keyboard shortcuts
  • Customizable keybindings and settings
  • Lightweight and minimal impact on browser performance
  • Active community and regular updates

Cons

  • Learning curve for users unfamiliar with Vim commands
  • Limited compatibility with some websites and web applications
  • Not available for other browsers (Chrome, Safari, etc.)
  • May conflict with other Firefox extensions or native shortcuts

Getting Started

  1. Install the VimFx extension from the Firefox Add-ons store.
  2. After installation, VimFx is enabled by default.
  3. Press ? to open the help dialog and see available commands.
  4. Customize settings by visiting about:addons and clicking on VimFx preferences.

Basic usage:

  • Use f to enter "hint mode" and navigate links
  • Use j and k to scroll down and up
  • Use gg to go to the top of the page, G to go to the bottom
  • Use H and L to navigate back and forward in history

For more advanced configuration, you can create a ~/.config/vimfx/config.js file to customize keybindings and settings.

Competitor Comparisons

22,991

The hacker's browser.

Pros of Vimium

  • More extensive feature set, including custom search engines and link hints
  • Supports multiple browsers (Chrome, Firefox, Edge)
  • Larger and more active community, resulting in frequent updates and improvements

Cons of Vimium

  • Can be more resource-intensive due to its broader feature set
  • May have a steeper learning curve for new users
  • Some features might conflict with built-in browser functionalities

Code Comparison

VimFx:

export function enterMode(mode) {
  currentMode = mode;
  updateStatusLine();
}

Vimium:

enterMode: (mode) ->
  @setMode(mode)
  @HUD.show("-- #{mode.toUpperCase()} --", 1000)

Both projects use similar approaches for entering different modes, but Vimium includes an additional step to display the mode change to the user through a heads-up display (HUD).

Summary

Vimium offers a more comprehensive set of features and broader browser support, making it suitable for power users who want extensive customization. However, this comes at the cost of potentially higher resource usage and a steeper learning curve. VimFx, while more lightweight, may be preferable for users who prioritize simplicity and performance.

A Vim-like interface for Firefox, inspired by Vimperator/Pentadactyl.

Pros of Tridactyl

  • More comprehensive Vim-like functionality, including ex commands
  • Actively maintained and regularly updated
  • Supports custom themes and user-defined commands

Cons of Tridactyl

  • Steeper learning curve due to more complex features
  • May feel overwhelming for users seeking a simpler Vim-like experience
  • Requires more system permissions to function fully

Code Comparison

VimFx:

vimfx.set('custom.mode.normal.j', 'scrollDown')
vimfx.set('custom.mode.normal.k', 'scrollUp')
vimfx.set('custom.mode.normal.gg', 'scrollToTop')

Tridactyl:

bind j scrollline 5
bind k scrollline -5
bind gg scrollto 0
bind G scrollto 100
set smoothscroll true

The code snippets show how both extensions allow for custom key bindings, but Tridactyl offers more granular control over scrolling behavior and additional settings like smooth scrolling.

Map your keys for web surfing, expand your browser with javascript and keyboard.

Pros of Surfingkeys

  • Cross-browser compatibility (Chrome, Firefox, Safari)
  • More extensive feature set, including visual mode and omnibar
  • Active development and regular updates

Cons of Surfingkeys

  • Steeper learning curve due to more complex configuration
  • Potentially heavier resource usage with additional features

Code Comparison

VimFx (JavaScript):

vimfx.set('custom.mode.normal.j', 'scrollDown')
vimfx.set('custom.mode.normal.k', 'scrollUp')

Surfingkeys (JavaScript):

mapkey('j', 'Scroll down', 'Normal.scroll("down")')
mapkey('k', 'Scroll up', 'Normal.scroll("up")')
api.map('J', 'd')
api.map('K', 'u')

Summary

VimFx is a lightweight, Firefox-specific extension that provides Vim-like keyboard shortcuts for browsing. It's simple to use and configure but limited to Firefox.

Surfingkeys offers a more comprehensive set of features across multiple browsers, including Chrome and Safari. It provides advanced functionality like visual mode and an omnibar, but may require more setup and resources.

Both extensions aim to enhance browsing efficiency through keyboard shortcuts, with Surfingkeys offering more flexibility and features at the cost of increased complexity.

Vim bindings for Google Chrome.

Pros of chromium-vim

  • More extensive customization options for key mappings and settings
  • Supports a wider range of Vim-like commands and features
  • Active development with frequent updates and bug fixes

Cons of chromium-vim

  • Steeper learning curve due to more complex configuration
  • May have a higher performance impact on browser speed
  • Limited to Chromium-based browsers, reducing cross-browser compatibility

Code Comparison

VimFx (JavaScript):

vimfx.set('custom.mode.normal.j', 'scrollDown')
vimfx.set('custom.mode.normal.k', 'scrollUp')
vimfx.set('custom.mode.normal.gg', 'scrollToTop')

chromium-vim (JavaScript):

map('j', 'scrollDown')
map('k', 'scrollUp')
map('gg', 'scrollToTop')
imap('<C-[>', '<Esc>')
set('smoothscroll', true)

Both extensions allow for custom key mappings, but chromium-vim offers more granular control and additional settings. VimFx's configuration is simpler, while chromium-vim provides more advanced options for power users. The code examples demonstrate the difference in syntax and complexity between the two projects.

Vimperator

Pros of Vimperator

  • More comprehensive Vim-like experience with a command-line interface
  • Extensive customization options through .vimperatorrc file
  • Broader range of commands and features for power users

Cons of Vimperator

  • Heavier and potentially more resource-intensive
  • Steeper learning curve for new users
  • Less frequently updated, potentially leading to compatibility issues

Code Comparison

VimFx:

export const commands = {
  'scroll_left': scrollLeft,
  'scroll_right': scrollRight,
  'scroll_up': scrollUp,
  'scroll_down': scrollDown,
};

Vimperator:

commands.add(["scrolll[eft]", "sl"], "Scroll left",
    function (args) { buffer.scrollByHorizontalAmount(-args.count); });
commands.add(["scrollr[ight]", "sr"], "Scroll right",
    function (args) { buffer.scrollByHorizontalAmount(args.count); });

The code snippets show different approaches to implementing scrolling commands. VimFx uses a more concise, modern JavaScript syntax with an object literal for command definitions. Vimperator employs a more verbose method, adding commands individually with separate function definitions.

VimFx's approach is more maintainable and easier to read at a glance, while Vimperator's method allows for more detailed command descriptions and custom argument handling.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

VimFx – Vim keyboard shortcuts for Firefox

Note: VimFx is a legacy extension for Firefox 115+, requiring the LegacyFox shim (see below).


VimFx is a Firefox extension which adds short, Vim-style keyboard shortcuts for browsing and navigation, for a near mouseless experience.

  • Doesn’t change your browser in any way. Everything can be disabled.
  • Easy for beginners, powerful for advanced users. Not just for Vim fanatics.
  • Modeled after Vimium for Chrome.

New to VimFx? Check out Questions & Answers!
Power user? Make a config file!
In either case, have look at the the documentation and the wiki.

VimFx is made by these awesome people.

Installation Instructions

Before installing VimFx, make sure LegacyFox is installed. On Linux, you can issue the commands below; on other operating systems, you can copy the files from the LegacyFox repository into your Firefox installation directory.

git clone https://git.gir.st/LegacyFox.git 
cd LegacyFox
sudo make install  # set DESTDIR= for custom install location

Why VimFx was created

Even before Vimium there was Vimperator for Firefox. In my opinion, Vimperator has too many features and aggressively changes the default Firefox appearance and behavior. Vimium is exactly what I need in terms of added functionality, but for Chrome. That’s why I decided to develop a similar extension for Firefox.

 VimFx will be nice to your browser and to your habits. Promise.

– Anton Khodakivskiy, VimFx’s original author.

Key Features

VimFx has concise shortcuts for most commonly performed actions. Many simply invoke standard Firefox features. That is preferred over re-implementing similar functionality.

Press f to mark links, text inputs and buttons on the page. Then either type the hint or the text of a marked element to click it. This command has many variations, for example to copy links or open them in new tabs.

Search with / and cycle between matches with n and N.

Open a new tab with t, close it with x. Reopen it again with X. Switch between tabs with J and K, or some of the several other tab commands.

Scrolling left/down/up/right: h, j, k, l.
Top/Bottom: gg, G.
Page up/down: space, shift-space.
Half a page: d, u.

Use Caret mode to copy text without using the mouse.

There are of course many more shortcuts! Press ? to see them all, and then / to search among them. Click on a command or open VimFx’s options page in the Add-ons Manager to customize the default shortcuts.

You can temporarily disable VimFx by using Ignore mode. Press i to enter it, and shift-escape to exit. Use the blacklist to automatically enter Ignore mode on specific sites.

There’s also an article on ghacks.net which is a good introduction.

Alternatives

If you’re looking for a WebExtension replacement for VimFx, check out these extensions: