Luakit Web-Browser Cheatsheet
luakit is the web browser of LikeOS: the WebKit engine, driven from the keyboard. These are the keys and commands worth knowing.
Luakit at a glance
luakit is the default web browser on LikeOS. It is built on WebKitGTK and driven from the keyboard: like the vi editor, it has modes, single-key commands in normal mode and a : command line at the bottom of the window. You can still use the mouse for everything. Start it from the window manager menu (Luakit Web Browser) or the desktop icon, or type luakit in a terminal. LikeOS also opens web pages, http/https links, images and PDF files in luakit.
Five things to learn first:
- o opens a page: type an address or some search words, then press Enter. t does the same in a new tab.
- f labels every link and button with a number. Type the number, or part of the link text, to click it. F opens the link in a background tab instead.
- j / k scroll down and up, H / L go back and forward, r reloads.
- d closes the tab and u brings it back. gt and gT (or J / K) switch tabs.
- Esc always returns to normal mode. If keys stop doing what you expect, press it. F1 or
:helpopens the built-in help, and:bindslists every key binding.
Modes
The mode you are in is shown in the bottom-left corner of the window. In normal mode (no label) keys are browser commands. In the other modes they are text, hint labels or commands.
| Key | Action |
|---|---|
| Esc or Ctrl+[ | Go back to normal mode from any other mode. This is the mode luakit starts in. |
| i | Enter insert mode (-- INSERT --). Your keys go to the page, so you can type into forms. Clicking a text field, or choosing one with f or gi, enters insert mode automatically. |
| gi | Focus the first text field on the page and enter insert mode. Use a count to pick another field, for example 2gi. |
| : | Enter command mode. This opens the : command line at the bottom. Enter runs the command and Esc cancels it. |
| f, F, ; | Enter follow (link hint) mode. See Link hints. |
| /, ? | Enter search mode to find text on the page. |
| Ctrl+z | Enter passthrough mode (-- PASS THROUGH --). luakit ignores all its own bindings and sends every key to the page. This is useful for web apps with their own shortcuts. Esc leaves it. Works from normal and insert mode. |
On the command line (command mode), these keys help:
| Key | Action |
|---|---|
| Tab / Shift+Tab | Open the completion menu and step through commands, history and bookmarks. Ctrl+j / Ctrl+k also move, and Esc restores what you typed. |
| Up / Down | Step through earlier commands. |
| Ctrl+w / Ctrl+u | Delete the previous word / the whole line. |
| Ctrl+a / Ctrl+e | Jump to the start / end of the line. |
| Ctrl+Enter | Expand :open example to :open www.example.com and open it. This also works for :tabopen and :winopen. |
Navigation, scrolling & zoom
| Key | Action |
|---|---|
| j / k | Scroll down / up one step (also Down / Up, Ctrl+e / Ctrl+y). |
| h / l | Scroll left / right (also Left / Right, or Shift+mouse wheel). |
| Ctrl+d / Ctrl+u | Scroll down / up half a page. |
| Ctrl+f / Ctrl+b | Scroll down / up a full page (also Space / Shift+Space, Page Down / Page Up; Backspace scrolls up). |
| gg / G | Go to the top / bottom of the page (also Home / End; 0 also goes to the top). |
| N% | Go to N percent of the page, for example 25%. |
| ^ / $ | Scroll to the far left / far right. |
| ]] / [[ | Open the page's "next" / "previous" page, for example the next page of search results. |
| gu / gU | Go one level up in the address path / go to the site's root. |
| Ctrl+a / Ctrl+x | Increase / decrease the last number in the address (page=4 → page=5). |
| Enter | Follow the link that contains the selected text. Ctrl+Enter opens it in a new tab, Shift+Enter in a new window, and Alt+Enter downloads it. |
| zi / zo | Zoom in / out (also + / -, or Ctrl+mouse wheel). |
| zz or = | Reset the zoom. With a count, set the zoom to that percentage: 150zz = 150 %. |
| F11 | Toggle full screen. |
Opening pages, searching & history
| Key | Action |
|---|---|
| o | Open an address or search in the current tab (fills in :open ). |
| t | Open in a new tab (:tabopen ). |
| w | Open in a new window (:winopen ). |
| O / T / W | Same as o / t / w, but the command line starts with the current address, so you can edit it. |
| H / L | Go back / forward in this tab's history (also Ctrl+o / Ctrl+i, and the Back/Forward keys on keyboards that have them). A count goes back several pages: 3H. |
| r / R | Reload / reload without using the cache. |
| Ctrl+c | Stop loading. |
| gh / gH | Open the home page in this tab / in a new tab. |
How :open reads what you type:
A single word that looks like an address (likeos.systemtrap.com) is opened as a web page. On LikeOS a bare host name gets https:// (see LikeOS notes).
A path to an existing local file is opened as file://.
Anything else is a web search with the default engine (Google): o luakit key bindings.
To use another engine, start with its name: o duckduckgo likeos, o wikipedia WebKit, o github luakit, o imdb some film. These engines are built in: duckduckgo, github, google, imdb, wikipedia.
Tabs & windows
| Key | Action |
|---|---|
| gt / gT | Next / previous tab (also J / K, Ctrl+Tab / Ctrl+Shift+Tab, Ctrl+Page Down / Ctrl+Page Up). |
| Ngt | Go to tab number N. |
| Alt+1 … Alt+9, Alt+0 | Jump to tabs 1 to 9, and to tab 10. |
| g0 / g$ | Go to the first / last tab. |
| Ctrl+t | Open a new, empty tab. |
| d or Ctrl+w | Close the current tab. 3d closes three tabs. |
| u | Reopen the last closed tab, with its history. Closed tabs are kept in the session, so this also works after a restart. |
:undolist | Menu of closed tabs. Enter reopens in the current tab, u in a background tab, w in a new window, d forgets the entry. |
| < / > | Move the tab one place left / right (with a count, several places). |
| gy | Duplicate the current tab, with its history. |
| Ctrl+click or middle-click a link | Open the link in a background tab. |
:tabdetach | Move the current tab into a new window. |
:tabmenu | Menu of all open tabs. Enter switches to one and Delete closes it. |
:tabhistory | Menu of the back/forward history of this tab. |
:tabdo command | Run a command in every tab, for example :tabdo reload. |
Link hints (follow mode)
Hint modes label the elements on the page with numbers. Type a label number, or a few letters of the element's text (case does not matter), and luakit acts on the match. Esc cancels.
| Key | Action |
|---|---|
| f | Hint everything clickable (links, buttons, fields) and click the one you choose. A text field gets focus and insert mode. |
| F | Hint links and open the chosen one in a background tab. |
| Tab / Shift+Tab | (in hint mode) Move the focus to the next / previous hint. |
| Enter | (in hint mode) Activate the focused hint. |
| Shift+Enter | (in hint mode) Activate all visible hints at once. |
Extended hints: press ;, then one of these keys. g; does the same, but stays in extended-hint mode until you press Esc.
| Key | Action |
|---|---|
| ;o | Open the link in the current tab. |
| ;t | Open the link in a new tab and switch to it. |
| ;b | Open the link in a background tab. |
| ;w | Open the link in a new window. |
| ;O / ;T / ;W | Put the link into a :open / :tabopen / :winopen command line so you can edit it first. |
| ;y | Copy (yank) the link address to the primary selection. |
| ;Y | Copy an element's description (title or alt text) to the primary selection. |
| ;i / ;I | Open an image itself in this tab / in a new tab. |
| ;x / ;X | Open the link behind a thumbnail image in this tab / in a background tab. |
| ;; | Focus an element (a link, button or form field) without clicking it. |
Yank & paste
X has two places to copy to: the primary selection (whatever you last highlighted, pasted with the middle mouse button) and the clipboard (Ctrl+c / Ctrl+v in other programs). Lower-case keys use the primary selection and upper-case keys use the clipboard.
| Key | Action |
|---|---|
| y | Copy the current page address to the primary selection. |
| Y | Copy the current page address to the clipboard. |
| pp / pt / pw | Open the address(es) in the primary selection in this tab / new tabs / a new window. |
| PP / PT / PW | Open the address(es) in the clipboard in this tab / new tabs / a new window. |
| Middle-click on the page (not on a link) | Open the address in the primary selection in this tab. |
| ;y | Copy a link's address using a hint (see Link hints). |
| Shift+Insert | (on the command line) Paste the primary selection. Ctrl+y puts back the text you last deleted with Ctrl+w or Ctrl+u. |
Search in page
| Key | Action |
|---|---|
| / | Search forward. Type the text and press Enter. |
| ? | Search backward. |
| n / N | Next / previous match. |
| Ctrl+j / Ctrl+k | (while typing the search) Jump to the next / previous match. |
:nohlsearch (:noh) | Remove the match highlighting. |
Bookmarks, quickmarks, history & downloads
Bookmarks are kept in a database and managed from a page in the browser.
| Key | Action |
|---|---|
| B | Bookmark the current page. This opens the bookmark manager with a form already filled in, where you can add tags. |
| gb / gB | Open the bookmark manager (luakit://bookmarks/) in this tab / a new tab. |
:bookmarks | Open the bookmark manager, or switch to its tab if it is already open. |
:bookmark [address tags…] | Bookmark the current page, or a given address with tags. |
Quickmarks are one-letter shortcuts to your favourite sites.
| Key | Action |
|---|---|
| Mx | Save the current page as quickmark x (a letter or digit), for example Mn. |
| gox | Open quickmark x in this tab. |
| gnx | Open quickmark x in a new tab. |
| gwx | Open quickmark x in a new window. |
:qmark x address, address… | Set a quickmark by hand. Several addresses open together. |
:qmarks | List the quickmarks. Enter / t / w open one, e edits it, d deletes it. |
:qmarkedit x / :delqmarks x | Edit / delete a quickmark. :delqmarks! deletes all of them. |
History and downloads
| Key | Action |
|---|---|
:history [words] | Open the searchable history page (luakit://history/) in a new tab, already filtered if you give words. |
| gd / gD | Open the downloads page (luakit://downloads/) in this tab / a new tab. :downloads does the same. |
:download [address] | Download an address, or the current page. |
| Ctrl+Shift+D | Put :download and the current address on the command line. |
| Alt+Enter | Download the link that contains the selected text. |
xdg-open, which picks the matching LikeOS application.Useful commands & internal pages
| Key | Action |
|---|---|
:adblock, ga / gA | Open the ad blocker page (luakit://adblock/). There you can switch blocking on or off and enable or disable each filter list. |
:adblock-enable (:abe) / :adblock-disable (:abd) | Turn ad blocking on / off for every tab. This is useful to check whether the blocker is breaking a site. Blocking is on again after luakit restarts. |
:adblock-reload (:abr) | Reload the filter lists from disk, for example after adding a new list. |
:adblock-list-enable N (:able) / :adblock-list-disable N (:abld) | Enable / disable filter list number N. The adblock page does the same with a click. |
F12, :inspect | Open the WebKit web inspector (developer tools). F12 and :inspect! toggle it. |
Ctrl+Shift+U, :view-source (:vs) | Show the page source in a new tab. |
:print | Print the page. |
:save [file] | Save the page as shown, as an .mhtml file. |
:dump [file] | Save the page's HTML. |
:priv-tabopen address | Open a private tab: it is not written to history, and links opened from it stay private. |
:clear-data | Menu to delete cookies, caches, local storage and similar data, per site or for all sites. |
:set setting value | Change a setting, for example :set window.home_page https://example.org. Tab completes setting names. |
:seton domain setting value | Change a setting for one site only. |
:settings | Open luakit://settings/, where you can view and edit every setting. |
:q / :q! | Close the window / close it even if something objects (for example a running download). |
:wq, ZZ | Save the session (all open tabs) and quit. The tabs come back the next time luakit starts. |
| ZQ | Quit without saving the session. |
:write | Save the session now, without quitting. |
:restart, Ctrl+Shift+R | Restart luakit and reload its configuration. Your tabs are kept. |
F1, :help / :binds | Built-in help (luakit://help/) / list of every key binding and command (luakit://binds/). |
:log | luakit's own message log (luakit://log/). |
:js code / :lua code | Run JavaScript in the page / Lua inside luakit. |
Internal pages you can open with o: luakit://settings/, luakit://help/, luakit://binds/, luakit://history/, luakit://bookmarks/, luakit://downloads/, luakit://adblock/, luakit://log/, and WebKit's own webkit://gpu, which shows how pages are rendered and composited.
LikeOS-specific notes
LikeOS ships luakit with its own settings in /etc/xdg/luakit/userconf.lua and a launcher in /usr/local/bin/luakit. This is what differs from a stock luakit:
Home page and window size. The home page (gh) is https://likeos.systemtrap.com. New windows are sized one step below the screen: 1280×1024 on a 1920-wide screen, 1024×768 on 1280-wide, and 800×600 on smaller screens.
HTTPS by default. A bare host name typed after o (example.org) opens as https://example.org. localhost and numeric IP addresses stay as typed. Type http:// yourself for the rare site that has no HTTPS.
A fresh web process per site. When you go to a different site in the same tab (typed, clicked or opened by a script), luakit opens the page in a new tab in the same place and closes the old one. This keeps memory down and scrolling smooth. As a result, H cannot go back to the previous site: press u to get the old tab back. Reloads, back/forward and form submissions are not affected. You can switch this off in luakit://settings/ (setting webview.fresh_process_per_site). The change is remembered and applies from the next page load.
Media is restricted. Media Source Extensions and Web Audio are off. Most streamed video, which uses Media Source, will not play. Plain video files still play, but only when you click them.
WebGL is on, and every page is drawn by WebKit's accelerated compositor (hardware_acceleration_policy = "always"), with or without a GPU.
Ad blocking with regional lists. 27 filter lists come pre-installed in ~/.local/share/luakit/adblock/ for every new account and for root: EasyList, EasyPrivacy and Peter Lowe's list, plus 24 regional lists (German, French, Italian, Spanish, Portuguese, Dutch, Polish, Czech/Slovak, Hebrew, Arabic, Chinese, Russian, Indian, Bulgarian, Latvian, Hungarian, Romanian, Greek, Nordic, Indonesian, Vietnamese, Korean, Japanese and Turkish). The LikeOS ad blocker understands filter options and indexes rules, so all 27 lists together cost about as much as two. It blocks requests only: element-hiding rules (##) are not supported. To add a list, copy any Adblock Plus .txt file into that folder and run :abr. The lists are snapshots from when the image was built, so you can replace them with newer copies the same way.
The browser profile is kept in RAM. The luakit command runs a launcher that moves luakit's data (cookies, history, bookmarks, session, settings) and cache to a private /ram/<user> directory (mode 0700) for the current boot. The data is copied back to ~/.local/share/luakit each time luakit exits. The cache is not copied back unless you start luakit with LUAKIT_RAM_SAVE_CACHE=1 luakit.
:wq or ZZ before switching off.LUAKIT_RAM=0 luakit, or make it permanent for your account with touch ~/.config/luakit/use-disk./etc/xdg/luakit/userconf.lua to ~/.config/luakit/userconf.lua and edit the copy. luakit loads your file instead of the system one, so start from a copy to keep the other LikeOS settings.LIKEOS_WEB_CONSOLE=1 startx. Every page's JavaScript console messages are then printed in the terminal you started X from.