From 31117cad22df103f84cfbe97dff08debcde72a66 Mon Sep 17 00:00:00 2001 From: bptato Date: Sun, 5 Dec 2021 19:55:13 +0100 Subject: Change configuration format to toml --- doc/config.md | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'doc/config.md') diff --git a/doc/config.md b/doc/config.md index 14a34608..6b3efd17 100644 --- a/doc/config.md +++ b/doc/config.md @@ -1,6 +1,7 @@ # Configuration -Currently keybindings and a user stylesheet can be configured. +Currently keybindings and a user stylesheet can be configured. The +configuration format for twt is toml. twt will look for a config file in the ~/.config/twt/ directory, so you can just copy the one from res/ there and customize that to your liking. @@ -9,26 +10,31 @@ A list of configurable options follows. ## Stylesheets -To set a user stylesheet, use the format `stylesheet "path-to-user.css"`. +To set a user stylesheet, use the format `stylesheet = "path-to-user.css"`. Relative paths are interpreted as relative to the config directory. -For now, specifying a second stylesheet will override the first one. +Specifying a second stylesheet will override the first one. ## Keybindings -"Normal" (default pager browsing) mode keybindings are configured using the -syntax - nmap +To specify a keybinding, you will first have to specify a mode: -Similarly, "Line-edit" (line editing) mode keybindings are configured -using the syntax +* for page browsing: [page] +* for line editing: [line] - lemap +Keybindings are configured using the syntax + + '' = '' Where `` is a combination of unicode characters with or without modifiers. Modifiers are the prefixes `C-` and `M-`, which add control or escape to the keybinding respectively (essentially making `M-` the same as -`C-[`). +`C-[`). Modifiers can be escaped with the `\` sign. + +```Example: +'C-M-j' = 'CHANGE_LOCATION' # change URL when Control, Escape and j are pressed +'gg' = 'CURSOR_FIRST_LINE' # go to the first line of the page when g is pressed twice +``` `` is a valid normal or line-edit mode action. A detailed description of these follows. @@ -37,7 +43,7 @@ description of these follows.
**Name****Function** -
`NULL`Do nothing +
`NULL`Do nothing (used for disabling default keybindings)
`QUIT`Exit the browser
`CURSOR_UP`Move the cursor to the previous line
`CURSOR_DOWN`Move cursor to the next line @@ -75,7 +81,7 @@ description of these follows.
`LINE_INFO`Display information about line
-### Line-edit mode actions +### Line-editing actions
**Name****Function** -- cgit 1.4.1-2-gfad0