Vim Motions Cheat Sheet
Vimium - The Hacker's Browser
Vimium is a browser extension that provides keyboard-based navigation and control of the web in the spirit of the Vim editor.
Installation instructions:
Install via the Chrome web store or the Firefox Addons site.
To install from source, see here.
Vimium's Options page can be reached via a link on the help dialog (type ?
) or via the button next to Vimium on the extension pages of Chrome (chrome://extensions
) or Firefox (about:addons
).
Keyboard Bindings
Modifier keys are specified as <c-x>
, <m-x>
, and <a-x>
for ctrl+x, meta+x, and alt+x respectively. For shift+x and ctrl-shift-x, just type X
and <c-X>
. See the next section for how to customize these bindings.
Once you have Vimium installed, you can see this list of key bindings at any time by typing ?
.
Navigating the current page:
Key | Action |
---|---|
? | Show the help dialog for a list of keys |
h | Scroll left |
j | Scroll down |
k | Scroll up |
l | Scroll right |
gg | Scroll to top of the page |
G | Scroll to bottom of the page |
d | Scroll down half a page |
u | Scroll up half a page |
f | Open a link in the current tab |
F | Open a link in a new tab |
r | Reload |
gs | View source |
i | Enter insert mode |
yy | Copy the current URL to the clipboard |
yf | Copy a link URL to the clipboard |
gf | Cycle forward to the next frame |
gF | Focus the main/top frame |
Navigating to new pages:
Key | Action |
---|---|
o | Open URL, bookmark, or history entry |
O | Open URL, bookmark, history entry in a new tab |
b | Open bookmark |
B | Open bookmark in a new tab |
Using find:
Key | Action |
---|---|
/ | Enter find mode -- type your search query and hit Enter to search, or Esc to cancel |
n | Cycle forward to the next find match |
N | Cycle backward to the previous find match |
For advanced usage, see regular expressions on the wiki.
Navigating your history:
Key | Action |
---|---|
H | Go back in history |
L | Go forward in history |
Manipulating tabs:
Key | Action |
---|---|
J, gT | Go one tab left |
K, gt | Go one tab right |
g0 | Go to the first tab. Use ng0 to go to n-th tab |
g$ | Go to the last tab |
^ | Visit the previously-visited tab |
t | Create tab |
yt | Duplicate current tab |
x | Close current tab |
X | Restore closed tab (i.e., unwind the 'x' command) |
T | Search through your open tabs |
W | Move current tab to new window |
<a-p> | Pin/unpin current tab |
Using marks:
Key | Action |
---|---|
ma, mA | Set local mark "a" (global mark "A") |
a, A | Jump to local mark "a" (global mark "A") |
`` | Jump back to the position before the previous jump (before the previous gg, G, n, N, /, or `a) |
Additional advanced browsing commands:
Key | Action |
---|---|
]] , [[ | Follow the link labeled next or > (previous or < ) - useful for browsing paginated sites |
<a-f> | Open multiple links in a new tab |
gi | Focus the first (or n-th) text input box on the page. Use "tab" to cycle through options. |
gu | Go up one level in the URL hierarchy |
gU | Go up to root of the URL hierarchy |
ge | Edit the current URL |
gE | Edit the current URL and open in a new tab |
zH | Scroll all the way left |
zL | Scroll all the way right |
v | Enter visual mode; use p/P to paste-and-go, use y to yank |
V | Enter visual line mode |
Vimium supports command repetition so, for example, hitting 5t
will open 5 tabs in rapid succession.
There are some advanced commands which aren't documented here; refer to the help dialog (type ?
) for a full list.
Custom Key Mappings
You may remap or unmap any of the default key bindings in the "Custom key mappings" on the options page.