# Configuration Currently keybindings and a user stylesheet can be configured. The configuration format for chawan is toml. Chawan will look for a config file in the ~/.config/chawan/ directory called `config.toml`. For an example see the default configuration in the res/ folder. A list of configurable options follows. ## General General options must be placed in a section called `[general]`. Following is a list of general options:
**Name****Value****Function**
double-width-ambiguousbooleanAssume the terminal displays characters in the East Asian Ambiguous category as double width
## Stylesheets User stylesheets must be placed in a section called `[css]`. There are two ways to import user stylesheets: 1. Include a user stylesheet using the format `include = 'path-to-user.css'`. To include multiple stylesheets, use `include = ['first-stylesheet.css, second-stylesheet.css']`. Relative paths are interpreted as relative to the config directory. 2. Place your stylesheet directly in your configuration file using `inline = """your-style"""`. ## Keybindings Keybindings must be placed in these sections: * for page browsing: `[page]` * for line editing: `[line]` 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-[`). Modifiers can be escaped with the `\` sign. (Note: it is **highly recommended** to use single quotes here; escaping can get quite ugly with double quotes.) ```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. ### Normal mode actions
**Name****Function**
`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
`CURSOR_LEFT`Move cursor to the previous cell
`CURSOR_RIGHT`Move cursor to the next cell
`CURSOR_LEFT`Move cursor to the previous cell
`CURSOR_LINEBEGIN`Move cursor to the first cell of the line
`CURSOR_LINEEND`Move cursor to the last cell of the line
`CURSOR_NEXT_WORD`Move cursor to the beginning of the next word
`CURSOR_PREV_WORD`Move cursor to the end of the previous word
`CURSOR_NEXT_LINK`Move cursor to the beginning of the next clickable element
`CURSOR_PREV_LINK`Move cursor to the beginning of the previous clickable element
`PAGE_DOWN`Move screen down by one page
`PAGE_UP`Move screen up by one page
`PAGE_LEFT`Move screen to the left by one page
`PAGE_RIGHT`Move screen to the right by one page
`HALF_PAGE_DOWN`Move screen down by half a page
`HALF_PAGE_UP`Move screen up by half a page
`SCROLL_DOWN`Move screen down by one line
`SCROLL_UP`Move screen up by one line
`SCROLL_LEFT`Move screen to the left by one line
`SCROLL_RIGHT`Move screen to the right by one line
`CLICK`Click element currently under cursor
`CHANGE_LOCATION`Go to URL
`RELOAD`Reload page
`RESHAPE`Reshape buffer (=render page anew)
`REDRAW`Redraw buffer (=redraw screen)
`TOGGLE_SOURCE`Source view
`CURSOR_FIRST_LINE`Move cursor to the first line of the buffer
`CURSOR_LAST_LINE`Move cursor to the last line of the buffer
`CURSOR_TOP`Move cursor to the first line of the page
`CURSOR_MIDDLE`Move cursor to the middle of the page
`CURSOR_BOTTOM`Move cursor to the last line of the page
`CENTER_LINE`Center screen around line
`LINE_INFO`Display information about line
### Line-editing actions
**Name****Function**
`NULL`Do nothing
`SUBMIT`Submit line
`CANCEL`Cancel operation
`BACKSPACE`Delete character before cursor
`DELETE`Delete character after cursor
`CLEAR`Clear text before cursor
`KILL`Clear text after cursor
`KILL_WORD`Delete previous word
`BACK`Move cursor back by one character
`FORWARD`Move cursor forward by one character
`PREV_WORD`Move cursor to the previous word by one character
`NEXT_WORD`Move cursor to the previous word by one character
`BEGIN`Move cursor to the previous word by one character
`END`Move cursor to the previous word by one character
`ESC`Ignore keybindings for next character
## Network Network options must be placed in a section called `[network]`. Chawan can use two separate back-ends to fetch remote resources (i.e. websites, css, etc.) The default back-end is the nim standard library's HTTP client. As an alternative, curl is supported as well, by invoking an existing curl binary on your system. Following is a list of network options:
**Name****Value****Function**
use-curlbooleanEnable curl support
curl-binarystringPath to the curl binary (only used if use-curl is set to true)
To enable curl support, you must * set `use-curl` to true * and set `curl-binary` to the path of your curl binary.