Configuration
onon needs no configuration. When you want different defaults or keys, write them in Lua, in a config.lua holding only what you change. :config (Settings… or Cmd-, on macOS) opens the file in your text editor, creating it if there is none. :reload-config applies your edits without restarting.
onon.options.dual_page = trueonon.options.fit_mode = "width"onon.theme.font = { family = "Iosevka", size = 15 }
onon.bind("<C-d>", onon.next_page)onon.bind("<C-u>", onon.prev_page)The example configuration lists every option and default binding, generated from the same registry the app uses.
Where it lives
Section titled “Where it lives”onon loads the first of these that exists:
| Platform | Location |
|---|---|
| Any | The path given with --config |
| Linux | ~/.config/onon/config.lua |
| Linux | $XDG_CONFIG_HOME/onon/config.lua |
| Linux | Each $XDG_CONFIG_DIRS/onon/config.lua |
| Linux | /etc/xdg/onon/config.lua |
| macOS | ~/Library/Application Support/onon/config.lua |
| macOS | ~/.config/onon/config.lua |
| Windows | %APPDATA%\onon\config.lua |
--no-config starts from the built-in defaults, ignoring every file.
Options
Section titled “Options”Options are fields of onon.options, or onon.o for short:
onon.o.scroll_off = 8onon.o.smooth_scroll_dampening = 0.3At runtime, :set inspects and changes them: :set scroll_step? shows a value, :set dual_page! toggles a boolean, and :set scroll_step=80 sets one. The reference lists every option with its type and default.
Key and mouse bindings
Section titled “Key and mouse bindings”onon.bind takes a key or sequence and an action, or a Lua function:
onon.bind("H", onon.prev_page)onon.bind("gg", onon.first_page)onon.bind("<C-o>", onon.jump_backward)onon.bind("r", function() onon.rotation(onon.rotation() + 90) end)
onon.bind_mouse("middle_down", onon.pan)onon.bind_mouse("<C-wheel-up>", onon.zoom_in)Keys in angle brackets use the names in the reference: <CR>, <Esc>, <Space>, <PgDn>, <F1>, <C-a> for Control, <A-x> for Alt, <D-s> for Cmd on macOS and <S-Tab> for Shift. onon.unbind and onon.unbind_mouse remove a binding. Sequences that start with a digit, ' or " are taken by counts and marks.
:keybinds edits bindings inside onon. Bindings changed there are kept in the session database and applied before config.lua, so where the two disagree, config.lua wins.
Commands
Section titled “Commands”: opens the command prompt. Tab completes commands, options and paths:
:page iv go to the page labelled iv:search \Cmoss search, matching case:fit width:open chapter2.pdf:theme birch:w save annotationsStatus bar
Section titled “Status bar”The status bar is two templates, left and right:
onon.o.status_bar_left = "{message}"onon.o.status_bar_right = "{document} {label}/{total} {zoom}"onon.o.status_bar_visible = false -- hide itThe placeholders include {page}, {label}, {total}, {zoom}, {search} and {modified}. The reference has the full list. How the bar looks comes from the theme.
Session data
Section titled “Session data”Each document’s place, marks and zoom, recent files, prompt history, the chosen theme and keybindings changed in onon are kept in session.sqlite:
| Platform | Directory |
|---|---|
| Linux | $XDG_DATA_HOME/onon or ~/.local/share/onon |
| macOS | ~/Library/Application Support/onon |
| Windows | %APPDATA%\onon |
Set onon.o.session_database = false to keep nothing.