LikeOS
Donate
Web browser

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:

  1. o opens a page: type an address or some search words, then press Enter. t does the same in a new tab.
  2. 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.
  3. j / k scroll down and up, H / L go back and forward, r reloads.
  4. d closes the tab and u brings it back. gt and gT (or J / K) switch tabs.
  5. Esc always returns to normal mode. If keys stop doing what you expect, press it. F1 or :help opens the built-in help, and :binds lists 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.

KeyAction
Esc or Ctrl+[Go back to normal mode from any other mode. This is the mode luakit starts in.
iEnter 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.
giFocus 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+zEnter 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:

KeyAction
Tab / Shift+TabOpen the completion menu and step through commands, history and bookmarks. Ctrl+j / Ctrl+k also move, and Esc restores what you typed.
Up / DownStep through earlier commands.
Ctrl+w / Ctrl+uDelete the previous word / the whole line.
Ctrl+a / Ctrl+eJump to the start / end of the line.
Ctrl+EnterExpand :open example to :open www.example.com and open it. This also works for :tabopen and :winopen.
Many normal-mode keys take a count typed before them: 5j scrolls five steps, 3gt goes to tab 3, and 50% jumps to the middle of the page.

Navigation, scrolling & zoom

KeyAction
j / kScroll down / up one step (also Down / Up, Ctrl+e / Ctrl+y).
h / lScroll left / right (also Left / Right, or Shift+mouse wheel).
Ctrl+d / Ctrl+uScroll down / up half a page.
Ctrl+f / Ctrl+bScroll down / up a full page (also Space / Shift+Space, Page Down / Page Up; Backspace scrolls up).
gg / GGo 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 / gUGo one level up in the address path / go to the site's root.
Ctrl+a / Ctrl+xIncrease / decrease the last number in the address (page=4 → page=5).
EnterFollow 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 / zoZoom in / out (also + / -, or Ctrl+mouse wheel).
zz or =Reset the zoom. With a count, set the zoom to that percentage: 150zz = 150 %.
F11Toggle full screen.

Opening pages, searching & history

KeyAction
oOpen an address or search in the current tab (fills in :open ).
tOpen in a new tab (:tabopen ).
wOpen in a new window (:winopen ).
O / T / WSame as o / t / w, but the command line starts with the current address, so you can edit it.
H / LGo 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 / RReload / reload without using the cache.
Ctrl+cStop loading.
gh / gHOpen 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.

Press Tab after o to choose from your history and bookmarks.

Tabs & windows

KeyAction
gt / gTNext / previous tab (also J / K, Ctrl+Tab / Ctrl+Shift+Tab, Ctrl+Page Down / Ctrl+Page Up).
NgtGo to tab number N.
Alt+1 … Alt+9, Alt+0Jump to tabs 1 to 9, and to tab 10.
g0 / g$Go to the first / last tab.
Ctrl+tOpen a new, empty tab.
d or Ctrl+wClose the current tab. 3d closes three tabs.
uReopen the last closed tab, with its history. Closed tabs are kept in the session, so this also works after a restart.
:undolistMenu 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).
gyDuplicate the current tab, with its history.
Ctrl+click or middle-click a linkOpen the link in a background tab.
:tabdetachMove the current tab into a new window.
:tabmenuMenu of all open tabs. Enter switches to one and Delete closes it.
:tabhistoryMenu of the back/forward history of this tab.
:tabdo commandRun 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.

KeyAction
fHint everything clickable (links, buttons, fields) and click the one you choose. A text field gets focus and insert mode.
FHint 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.

KeyAction
;oOpen the link in the current tab.
;tOpen the link in a new tab and switch to it.
;bOpen the link in a background tab.
;wOpen the link in a new window.
;O / ;T / ;WPut the link into a :open / :tabopen / :winopen command line so you can edit it first.
;yCopy (yank) the link address to the primary selection.
;YCopy an element's description (title or alt text) to the primary selection.
;i / ;IOpen an image itself in this tab / in a new tab.
;x / ;XOpen 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.

KeyAction
yCopy the current page address to the primary selection.
YCopy the current page address to the clipboard.
pp / pt / pwOpen the address(es) in the primary selection in this tab / new tabs / a new window.
PP / PT / PWOpen 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.
;yCopy 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.
There is no single-key p or P. The paste keys are always two letters. In a web form (insert mode) the usual Ctrl+v works.

Search in page

KeyAction
/Search forward. Type the text and press Enter.
?Search backward.
n / NNext / previous match.
Ctrl+j / Ctrl+k(while typing the search) Jump to the next / previous match.
:nohlsearch (:noh)Remove the match highlighting.
After a search, press Enter to follow the link that contains the match. Searching for a link's text and pressing Enter is a quick way to click it.

Bookmarks, quickmarks, history & downloads

Bookmarks are kept in a database and managed from a page in the browser.

KeyAction
BBookmark the current page. This opens the bookmark manager with a form already filled in, where you can add tags.
gb / gBOpen the bookmark manager (luakit://bookmarks/) in this tab / a new tab.
:bookmarksOpen 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.

KeyAction
MxSave the current page as quickmark x (a letter or digit), for example Mn.
goxOpen quickmark x in this tab.
gnxOpen quickmark x in a new tab.
gwxOpen quickmark x in a new window.
:qmark x address, address…Set a quickmark by hand. Several addresses open together.
:qmarksList the quickmarks. Enter / t / w open one, e edits it, d deletes it.
:qmarkedit x / :delqmarks xEdit / delete a quickmark. :delqmarks! deletes all of them.

History and downloads

KeyAction
:history [words]Open the searchable history page (luakit://history/) in a new tab, already filtered if you give words.
gd / gDOpen 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+DPut :download and the current address on the command line.
Alt+EnterDownload the link that contains the selected text.
A finished download opened from the downloads page is passed to xdg-open, which picks the matching LikeOS application.

Useful commands & internal pages

KeyAction
:adblock, ga / gAOpen 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, :inspectOpen 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.
:printPrint the page.
:save [file]Save the page as shown, as an .mhtml file.
:dump [file]Save the page's HTML.
:priv-tabopen addressOpen a private tab: it is not written to history, and links opened from it stay private.
:clear-dataMenu to delete cookies, caches, local storage and similar data, per site or for all sites.
:set setting valueChange a setting, for example :set window.home_page https://example.org. Tab completes setting names.
:seton domain setting valueChange a setting for one site only.
:settingsOpen 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, ZZSave the session (all open tabs) and quit. The tabs come back the next time luakit starts.
ZQQuit without saving the session.
:writeSave the session now, without quitting.
:restart, Ctrl+Shift+RRestart luakit and reload its configuration. Your tabs are kept.
F1, :help / :bindsBuilt-in help (luakit://help/) / list of every key binding and command (luakit://binds/).
:logluakit's own message log (luakit://log/).
:js code / :lua codeRun 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.

If luakit crashes or the machine goes down, it restores your tabs on the next start from a recovery session. This session is saved about 30 seconds after you browse.

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.

With the RAM launcher, changes reach the disk only when luakit exits. A hard reset or power loss loses anything changed since the last time you closed luakit, including new bookmarks and cookies. Quit with :wq or ZZ before switching off.
To run luakit from the disk instead, start it once with LUAKIT_RAM=0 luakit, or make it permanent for your account with touch ~/.config/luakit/use-disk.
To change the LikeOS defaults for your account, copy /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.
Does a site misbehave? Start X with LIKEOS_WEB_CONSOLE=1 startx. Every page's JavaScript console messages are then printed in the terminal you started X from.