# Configuration of Chawan Chawan supports configuration of various options like keybindings, user stylesheets, site preferences, etc. The configuration format is very similar to toml, with the following exceptions: * Inline tables may span across multiple lines. * Table arrays can be cleared by setting a variable by the same to the empty array. This allows users to disable default table array rules. Example: ``` omnirule = [] # note: this must be placed at the beginning of the file. [[omnirule]] # this is legal. all default omni-rules are now disabled. ``` Chawan will look for a config file in the $XDG_CONFIG_HOME/chawan/ directory called `config.toml`. (Chawan defaults to ~/.config if the XDG_CONFIG_HOME environment variable is not set.) See the default configuration file in the res/ folder, and bonus configuration files in the bonus/ folder for further examples. **Table of contents** * [Start](#start) * [Search](#search) * [Encoding](#encoding) * [External](#external) * [Network](#network) * [Display](#display) * [Omnirule](#omnirule) * [Siteconf](#siteconf) * [Stylesheets](#stylesheets) * [Keybindings](#keybindings) * [Pager actions](#pager-actions) * [Line-editing actions](#line-editing-actions) * [Appendix](#appendix) * [Regex handling](#regex-handling) * [Match mode](#match-mode) * [Search mode](#search-mode) * [Path handling](#path-handling) * [Word types](#word-types) * [w3m word](#w3m-word) * [vi word](#vi-word) * [Big word](#big-word) ## Start Start-up options are to be placed in the `[start]` section. Following is a list of start-up options:
Name Value Function
visual-home url Page opened when Chawan is called with the -V option (and no other pages are passed as arguments.)
startup-script JavaScript code Script Chawan runs on start-up. Pages will not be loaded until this function exits. (Note however that asynchronous functions like setTimeout do not block loading.)
headless boolean Whether Chawan should always start in headless mode. Automatically enabled when Chawan is called with -r.
console-buffer boolean Whether Chawan should open a console buffer in non-headless mode. Defaults to true.
Warning: this is only useful for debugging. Disabling this option without manually redirecting standard error will result in error messages randomly appearing on your screen.
## Search Search options are to be placed in the `[search]` section. Following is a list of search options:
Name Value Function
wrap boolean When set to true, searchNext/searchPrev wraps around the document.
ignore-case boolean When set to true, document-wide searches are case-insensitive by default.
Note: this can also be overridden inline in the search bar (vim-style), with the escape sequences `\c` (ignore case) and `\C` (strict case). See [search mode](#search-mode) for details.)
## Encoding Encoding options are to be placed in the `[encoding]` section. Following is a list of encoding options:
Name Value Function
document-charset array of charset label strings List of character sets for loading documents.
All listed character sets are enumerated until the document has been decoded without errors. In HTML, meta tags and the BOM may override this with a different charset, so long as the specified charset can decode the document correctly.
display-charset string Character set for keyboard input and displaying documents.
Used in dump mode as well.
(This means that e.g. `cha -I EUC-JP -O UTF-8 a > b` is equivalent to `iconv -f EUC-JP -t UTF-8`.)
## External External options are to be placed in the `[external]` section. Following is a list of external options:
Name Value Function
tmpdir path Directory used to save temporary files.
editor shell command External editor command. %s is substituted for the file name, %d for the line number.
mailcap array of paths Search path for [mailcap](mailcap.md) files.
mime-types array of paths Search path for [mime.types](mime.types.md) files.
cgi-dir array of paths Search path for [local CGI](localcgi.md) scripts.
urimethodmap array of paths Search path for [urimethodmap](urimethodmap.md) files.
w3m-cgi-compat boolean Enable local CGI compatibility with w3m. In short, it redirects `file:///cgi-bin/*` and `file:///$LIB/cgi-bin/*` to `cgi-bin:*`. For further details, see [localcgi.md](localcgi.md).
download-dir string Path to pre-fill for "Save to:" prompts. This is not validated, you can set it to whatever you find useful.
## Input Input options are to be placed in the `[input]` section.
Name Value Function
vi-numeric-prefix boolean Whether vi-style numeric prefixes to commands should be accepted.
When set to true, commands that return a function will be called with the numeric prefix as their first argument.
Note: this only applies for keybindings defined in [page].
use-mouse boolean Whether Chawan is allowed to use the mouse.
Currently, the default behavior imitates that of w3m.
Examples: ``` [input] vi-numeric-prefix = true [page] # Here, the arrow function will be called with the vi numbered prefix if # one was input, and with no argument otherwise. # The numeric prefix can never be zero, so it is safe to test for undefined # using the ternary operator. G = 'n => n ? pager.gotoLine(n) : pager.cursorLastLine()' ``` ## Network Network options are to be placed in the `[network]` section.
Name Value Function
max-redirect number Maximum number of redirections to follow.
prepend-scheme string Prepend this to URLs passed to Chawan without a scheme.
Note that local files (`file:` scheme) will always be checked first; only if this fails, Chawan will retry the request with `prepend-scheme` set as the scheme.
By default, this is set to "https://". Note that the "://" part is mandatory.
prepend-https boolean Deprecated: use prepend-scheme instead.
When set to false, Chawan will act as if prepend-scheme were set to "".
proxy URL Specify a proxy for all network requests Chawan makes. All proxies supported by cURL may be used. Can be overridden by siteconf.
default-headers Table Specify a list of default headers for all HTTP(S) network requests.
## Display Display options are to be placed in the `[display]` section. Following is a list of display options:
Name Value Function
color-mode "monochrome" / "ansi" / "eight-bit" / "true-color" / "auto" Set the color mode. "auto" for automatic detection, "monochrome" for black on white, "ansi" for ansi colors, "eight-bit" for 256-color mode, and "true-color" for true colors.
"8bit" is accepted as a legacy alias of "eight-bit". "24bit" is accepted as a legacy alias of "true-color".
format-mode "auto" / ["bold", "italic", "underline", "reverse", "strike", "overline", "blink"] Specifies output formatting modes. Accepts the string "auto" or an array of specific attributes. An empty array (`[]`) disables formatting completely.
no-format-mode ["bold", "italic", "underline", "reverse", "strike", "overline", "blink"] Disable specified formatting modes.
emulate-overline boolean When set to true and the overline formatting attribute is not enabled, overlines are substituted by underlines on the previous line.
alt-screen "auto" / boolean Enable/disable the alternative screen.
highlight-color color Set the highlight color. Both hex values and CSS color names are accepted.
highlight-marks boolean Enable/disable highlighting of marks.
double-width-ambiguous boolean Assume the terminal displays characters in the East Asian Ambiguous category as double-width characters. Useful when e.g. ○ occupies two cells.
minimum-contrast number Specify the minimum difference between the luminance (Y) of the background and the foreground. -1 disables this function (i.e. allows black letters on black background, etc).
force-clear boolean Force the screen to be completely cleared every time it is redrawn.
set-title boolean Set the terminal emulator's window title to that of the current page.
default-background-color "auto" / color Overrides the assumed background color of the terminal. "auto" leaves background color detection to Chawan.
default-foreground-color "auto" / color Sets the assumed foreground color of the terminal. "auto" leaves foreground color detection to Chawan.
query-da1 bool Enable/disable querying Primary Device Attributes, and with it, all "dynamic" terminal querying.
It is highly recommended not to alter the default value (which is true), or the output will most likely look horrible. (Except, obviously, if your terminal does not support Primary Device Attributes.)
columns, lines, pixels-per-column, pixels-per-line number Fallback values for the number of columns, lines, pixels per column, and pixels per line for the cases where it cannot be determined automatically. (For example, these values are used in dump mode.)
force-columns, force-lines, force-pixels-per-column, force-pixels-per-line boolean Force-set columns, lines, pixels per column, or pixels per line to the fallback values provided above.
## Omnirule The omni-bar (by default opened with C-l) can be used to perform searches using omni-rules. These are to be placed in the table array `[[omnirule]]`. Examples: ``` # Search using DuckDuckGo Lite. (Bound to C-k by default.) [[omnirule]] match = '^ddg:' substitute-url = '(x) => "https://lite.duckduckgo.com/lite/?kp=-1&kd=-1&q=" + encodeURIComponent(x.split(":").slice(1).join(":"))' # Search using Wikipedia, Firefox-style. [[omnirule]] match = '^@wikipedia' substitute-url = '(x) => "https://en.wikipedia.org/wiki/Special:Search?search=" + encodeURIComponent(x.replace(/@wikipedia/, ""))' ``` Omnirule options:
Name Value Function
match regex Regular expression used to match the input string. Note that websites passed as arguments are matched as well.
Note: regexes are handled according to the [match mode](#match-mode) regex handling rules.
substitute-url JavaScript function A JavaScript function Chawan will pass the input string to. If a new string is returned, it will be parsed instead of the old one.
## Siteconf Configuration options can be specified for individual sites. Entries are to be placed in the table array `[[siteconf]]`. Examples: ``` # Enable cookies on the orange website for log-in. [[siteconf]] url = 'https://news\.ycombinator\.com/.*' cookie = true # Redirect npr.org to text.npr.org. [[siteconf]] host = '(www\.)?npr\.org' rewrite-url = ''' (x) => { x.host = "text.npr.org"; const s = x.pathname.split('/'); x.pathname = s.at(s.length > 2 ? -2 : 1); /* No need to return; URL objects are passed by reference. */ } ''' # Allow cookie sharing on *sr.ht domains. [[siteconf]] host = '(.*\.)?sr\.ht' # either 'something.sr.ht' or 'sr.ht' cookie = true # enable cookies share-cookie-jar = 'sr.ht' # use the cookie jar of 'sr.ht' for all matched hosts third-party-cookie = '.*\.sr\.ht' # allow cookies from subdomains ``` Siteconf options:
Name Value Function
url regex Regular expression used to match the URL. Either this or the `host` option must be specified.
Note: regexes are handled according to the [match mode](#match-mode) regex handling rules.
host regex Regular expression used to match the host part of the URL (i.e. domain name/ip address.) Either this or the `url` option must be specified.
Note: regexes are handled according to the [match mode](#match-mode) regex handling rules.
rewrite-url JavaScript function A JavaScript function Chawan will pass the URL to. If a new URL is returned, it will replace the old one.
cookie boolean Whether loading cookies should be allowed for this URL. By default, this is false for all websites.
third-party-cookie array of regexes Domains for which third-party cookies are allowed on this domain. Note: this only works for buffers which share the same cookie jar.
Note: regexes are handled according to the [match mode](#match-mode) regex handling rules.
share-cookie-jar host Cookie jar to use for this domain. Useful for e.g. sharing cookies with subdomains.
referer-from boolean Whether or not we should send a Referer header when opening requests originating from this domain. Simplified example: if you click a link on a.com that refers to b.com, and referer-from is true, b.com is sent "a.com" as the Referer header. Defaults to false.
scripting boolean Enable/disable JavaScript execution on this site.
document-charset boolean Specify the default encoding for this site. Overrides document-charset in [encoding].
stylesheet CSS stylesheet Specify an additional user-stylesheet for this site. Note: other user-stylesheets (specified under [css] or additional matching siteconfs) are not overridden. (In other words, they will be concatenated with this stylesheet to get the final user stylesheet.)
proxy URL Specify a proxy for network requests fetching contents of this buffer.
## Stylesheets User stylesheets are to be placed in the `[css]` section. 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 relative to the config directory. 2. Place your stylesheet directly in your configuration file using `inline = """your-style"""`. ## Keybindings Keybindings are to be placed in these sections: * for pager interaction: `[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. Examples: ``` # change URL when Control, Escape and j are pressed 'C-M-j' = 'pager.load()' # go to the first line of the page when g is pressed twice 'gg' = 'pager.cursorFirstLine()' # filter the current buffer's source through rdrview, then display the output in # a new buffer when the keys `g' and then `f' are pressed # (see https://github.com/eafer/rdrview) 'gr' = 'pager.externFilterSource("rdrview -H")' ``` An action is a JavaScript expression called by Chawan every time the keybinding is typed in. If an action returns a function, Chawan will also call the returned function automatically. So this works too: ``` U = '() => pager.load()' # works ``` Note however, that JavaScript functions must be called with an appropriate this value. Unfortunately, this also means that the following does not work: ``` q = 'pager.load' # broken!!! ``` A list of built-in pager functions can be found below. ### Browser actions
Name Function
`quit()` Exit the browser.
`suspend()` Temporarily suspend the browser (by delivering the client process a SIGTSTP signal.)
Note: this suspends the entire process group, including e.g. buffer processes or CGI scripts.
### Pager actions
Name Function
`pager.cursorUp(n = 1)` Move the cursor upwards by n lines, or if n is unspecified, by 1.
`pager.cursorDown(n = 1)` Move the cursor downwards by n lines, or if n is unspecified, by 1.
`pager.cursorLeft(n = 1)` Move the cursor to the left by n cells, or if n is unspecified, by 1.
`pager.cursorRight(n = 1)` Move the cursor to the right by n cells, or if n is unspecified, by 1.
`pager.cursorLineBegin()` Move the cursor to the first cell of the line.
`pager.cursorLineTextStart()` Move the cursor to the first non-blank character of the line.
`pager.cursorLineEnd()` Move the cursor to the last cell of the line.
`pager.cursorNextWord()`, `pager.cursorNextViWord()`, `pager.cursorNextBigWord()` Move the cursor to the beginning of the next [word](#word-types).
`pager.cursorPrevWord()`, `pager.cursorPrevViWord()`, `pager.cursorPrevBigWord()` Move the cursor to the end of the previous [word](#word-types).
`pager.cursorWordEnd()`, `pager.cursorViWordEnd()`, `pager.cursorBigWordEnd()` Move the cursor to the end of the current [word](#word-types), or if already there, to the end of the next word.
`pager.cursorWordBegin()`, `pager.cursorViWordBegin()`, `pager.cursorBigWordBegin()` Move the cursor to the beginning of the current [word](#word-types), or if already there, to the end of the previous word.
`pager.cursorNextLink()` Move the cursor to the beginning of the next clickable element.
`pager.cursorPrevLink()` Move the cursor to the beginning of the previous clickable element.
`pager.cursorPrevParagraph(n = 1)` Move the cursor to the beginning of the nth next paragraph.
`pager.cursorNextParagraph(n = 1)` Move the cursor to the end of the nth previous paragraph.
`pager.cursorNthLink(n = 1)` Move the cursor to the nth link of the document.
`pager.cursorRevNthLink(n = 1)` Move the cursor to the nth link of the document, counting backwards from the document's last line.
`pager.pageDown(n = 1)` Scroll down by n pages.
`pager.pageUp(n = 1)` Scroll up by n pages.
`pager.pageLeft(n = 1)` Scroll to the left by n pages.
`pager.pageRight(n = 1)` Scroll to the right n pages.
`pager.halfPageDown(n = 1)` Scroll forwards by n half pages.
`pager.halfPageUp(n = 1)` Scroll backwards by n half pages.
`pager.halfPageLeft(n = 1)` Scroll to the left by n half pages.
`pager.halfPageUp(n = 1)` Scroll to the right by n half pages.
`pager.scrollDown(n = 1)` Scroll forwards by n lines.
`pager.scrollUp(n = 1)` Scroll backwards by n lines.
`pager.scrollLeft(n = 1)` Scroll to the left by n columns.
`pager.scrollRight(n = 1)` Scroll to the right by n columns.
`pager.click()` Click the HTML element currently under the cursor.
`pager.load(url)` Put the specified address into the URL bar, and optionally load it.
Note that this performs auto-expansion of URLs, so Chawan will expand any matching omni-rules (e.g. search), try to open schemeless URLs with the default scheme/local files, etc.
Opens a prompt with the current URL when no parameters are specified; otherwise, the string passed is displayed in the prompt. If this string ends with a newline (e.g. `pager.load("about:chawan\n")`), the URL is loaded directly.
`pager.loadSubmit(url)` Act as if `url` had been input into the address bar.
Same as `pager.load(url + "\n")`.
`pager.gotoURL(url)` Go to the specified URL immediately (without a prompt). This differs from `load` and `loadSubmit` in that it *does not* try to correct the URL.
Use this for loading automatically retrieved (i.e. non-user-provided) URLs.
`pager.dupeBuffer()` Duplicate the current buffer by loading its source to a new buffer.
`pager.discardBuffer()` Discard the current buffer, and move back to its previous sibling buffer, or if that doesn't exist, to its parent. If the current buffer is a root buffer (i.e. it has no parent), move to the next sibling buffer instead.
`pager.discardTree()` Discard all child buffers of the current buffer.
`pager.reload()` Open a new buffer with the current buffer's URL, replacing the current buffer.
`pager.reshape()` Reshape the current buffer (=render the current page anew.)
`pager.redraw()` Redraw screen contents. Useful if something messed up the display.
`pager.toggleSource()` If viewing an HTML buffer, open a new buffer with its source. Otherwise, open the current buffer's contents as HTML.
`pager.cursorFirstLine()` Move to the beginning in the buffer.
`pager.cursorLastLine()` Move to the last line in the buffer.
`pager.cursorTop()` Move to the first line on the screen. (Equivalent to H in vi.)
`pager.cursorMiddle()` Move to the line in the middle of the screen. (Equivalent to M in vi.)
`pager.cursorBottom()` Move to the last line on the screen. (Equivalent to L in vi.)
`pager.lowerPage(n = pager.cursory)` Move cursor to line n, then scroll up so that the cursor is on the top line on the screen. (`zt` in vim.)
`pager.lowerPageBegin(n = pager.cursory)` Move cursor to the first non-blank character of line n, then scroll up so that the cursor is on the top line on the screen. (`z` in vi.)
`pager.centerLine(n = pager.cursory)` Center screen around line n. (`zz` in vim.)
`pager.centerLineBegin(n = pager.cursory)` Center screen around line n, and move the cursor to the line's first non-blank character. (`z.` in vi.)
`pager.raisePage(n = pager.cursory)` Move cursor to line n, then scroll down so that the cursor is on the top line on the screen. (zb in vim.)
`pager.lowerPageBegin(n = pager.cursory)` Move cursor to the first non-blank character of line n, then scroll up so that the cursor is on the last line on the screen. (`z^` in vi.)
`pager.nextPageBegin(n = pager.cursory)` If n was given, move to the screen before the nth line and raise the page. Otherwise, go to the previous screen's last line and raise the page. (`z+` in vi.)
`pager.cursorLeftEdge()` Move to the first column on the screen.
`pager.cursorMiddleColumn()` Move to the column in the middle of the screen.
`pager.cursorRightEdge()` Move to the last column on the screen.
`pager.centerColumn()` Center screen around the current column.
`pager.lineInfo()` Display information about the current line.
`pager.searchForward()` Search for a string in the current buffer.
`pager.searchBackward()` Search for a string, backwards.
`pager.isearchForward()` Incremental-search for a string, highlighting the first result.
`pager.isearchBackward()` Incremental-search and highlight the first result, backwards.
`pager.gotoLine(n?)` Go to the line passed as the first argument.
If no arguments were specified, an input window for entering a line is shown.
`pager.searchNext(n = 1)` Jump to the nth next search result.
`pager.searchPrev(n = 1)` Jump to the nth previous search result.
`pager.peek()` Display an alert message of the current URL.
`pager.peekCursor()` Display an alert message of the URL or title under the cursor. Multiple calls allow cycling through the two. (i.e. by default, press u once -> title, press again -> URL)
`pager.ask(prompt)` Ask the user for confirmation. Returns a promise which resolves to a boolean value indicating whether the user responded with yes.
Can be used to implement an exit prompt like this: ``` q = 'pager.ask("Do you want to exit Chawan?").then(x => x ? pager.quit() : void(0))' ```
`pager.askChar(prompt)` Ask the user for any character.
Like `pager.ask`, but the return value is a character.
`pager.setMark(id, x = pager.cursorx, y = pager.cursory)` Set a mark at (x, y) using the name `id`.
Returns true if no other mark exists with `id`. If one already exists, it will be overridden and the function returns false.
`pager.clearMark(id)` Clear the mark with the name `id`. Returns true if the mark existed, false otherwise.
`pager.gotoMark(id)` If the mark `id` exists, jump to its position and return true. Otherwise, do nothing and return false.
`pager.gotoMarkY(id)` If the mark `id` exists, jump to the beginning of the line at its Y position and return true. Otherwise, do nothing and return false.
`pager.getMarkPos(id)` If the mark `id` exists, return its position as an array where the first element is the X position and the second element is the Y position. If the mark does not exist, return null.
`pager.findNextMark(x = pager.cursorx, y = pager.cursory)` Find the next mark after `x`, `y`, if any; and return its id (or null if none were found.)
`pager.findPrevMark(x = pager.cursorx, y = pager.cursory)` Find the previous mark before `x`, `y`, if any; and return its id (or null if none were found.)
`pager.extern(cmd, options = {setenv: true, suspend: true, wait: false})` Run an external command `cmd`. The `$CHA_URL` and `$CHA_CHARSET` variables are set when `options.setenv` is true. `options.suspend` suspends the pager while the command is being executed, and `options.wait` makes it so the user must press a key before the pager is resumed.
Returns true if the command exit successfully, false otherwise.
Warning: this has a bug where the output is written to stdout even if suspend is true. Redirect to /dev/null in the command if this is not desired. (This will be fixed in the future.)
`pager.externCapture(cmd)` Like extern(), but redirect the command's stdout string into the result. null is returned if the command wasn't executed successfully, or if the command returned a non-zero exit value.
`pager.externInto(cmd, ins)` Like extern(), but redirect `ins` into the command's standard input stream. `true` is returned if the command exits successfully, otherwise the return value is `false`.
`pager.externFilterSource(cmd, buffer = null, contentType = null)` Redirects the specified (or if `buffer` is null, the current) buffer's source into `cmd`.
Then, it pipes the output into a new buffer, with the content type `contentType` (or, if `contentType` is null, the original buffer's content type).
Returns `undefined`. (It should return a promise; TODO.)
`pager.url` Getter for the link of the current buffer. Returns a `URL` object.
`pager.hoverLink` Getter for the link currently under the cursor. Returns the empty string if no link is found.
`pager.hoverTitle` Getter for the title currently under the cursor. Returns the empty string if no title is found.
`pager.buffer` Getter for the currently displayed buffer. Returns a `Buffer` object.
### Line-editing actions
Name Function
`line.submit()` Submit line
`line.cancel()` Cancel operation
`line.backspace()` Delete character before cursor
`line.delete()` Delete character after cursor
`line.clear()` Clear text before cursor
`line.kill()` Clear text after cursor
`line.clearWord()` Delete word before cursor
`line.killWord()` Delete word after cursor
`line.backward()` Move cursor back by one character
`line.forward()` Move cursor forward by one character
`line.prevWord()` Move cursor to the previous word by one character
`line.nextWord()` Move cursor to the previous word by one character
`line.begin()` Move cursor to the previous word by one character
`line.end()` Move cursor to the previous word by one character
`line.escape()` Ignore keybindings for next character
`line.prevHist()` Jump to the previous history entry
`line.nextHist()` Jump to the next history entry
Note: to facilitate URL editing, the line editor has a different definition of what a word is than the pager. For the line editor, a word is either a sequence of alphanumeric characters, or any single non-alphanumeric character. (This means that e.g. `https://` consists of four words: `https`, `:`, `/` and `/`.) ```Examples: # Control+A moves the cursor to the beginning of the line. 'C-a' = 'line.begin()' # Escape+D deletes everything after the cursor until it reaches a word-breaking # character. 'M-d' = 'line.killWord()' ``` ## Appendix ### Regex handling Regular expressions are currently handled using libregexp which is included in QuickJS. This means that all regular expressions should work as in JavaScript. There are two different modes of regex handling in Chawan: "search" mode, and "match" mode. "match" mode is used for configurations (meaning in all values in this document described as "regex"). "search" mode is used for the on-page search function (using searchForward/isearchForward etc.) #### Match mode Regular expressions are assumed to be exact matches, except when they start with a caret (^) sign or end with an unescaped dollar ($) sign. In other words, the following transformations occur: ``` ^abcd -> ^abcd (no change) efgh$ -> efgh$ (no change) ^ijkl$ -> ^ijkl$ (no change) mnop -> ^mnop$ (changed to exact match) ``` Match mode has no way to toggle JavaScript regex flags. #### Search mode For on-page search, the above transformations do not apply; the search `/abcd` searches for the string `abcd` inside all lines. "Search" mode also has some other convenience transformations: * The string `\c` (backslash + lower-case c) inside a search-mode regex enables case-insensitive matching. * Conversely, `\C` (backslash + capital C) disables case-insensitive matching. (Useful if you have the "i" flag inside default-flags.) * `\<` and `\>` is converted to `\b` (as in vi, grep, etc.) Note that none of these work in "match" mode. ### Path handling Rules for path handling are similar to how strings in the shell are handled. * Tilde-expansion is used to determine the user's home directory. So e.g. `~/whatever` works. * Environment variables can be used like `$ENV_VAR`. * Relative paths are relative to the Chawan configuration directory. Some non-external variables are also defined by Chawan. These can be accessed using the syntax `${%VARIABLE}`: * `${%CHA_BIN_DIR}`: the directory which the `cha` binary resides in. Note that symbolic links are automatically resolved to determine this path. * `${%CHA_LIBEXEC_DIR}`: the directory for all executables Chawan uses for operation. By default, this is `${%CHA_BIN_DIR}/../libexec/chawan`. ### Word types Word-based pager commands can operate with different definitions of words. Currently, these are: * w3m words * vi words * Big words #### w3m word A w3m word is a sequence of alphanumeric characters. Symbols are treated in the same way as whitespace. #### vi word A vi word is a sequence of alphanumeric characters, OR a sequence of symbols. vi words may be separated by whitespace; however, symbolic and alphanumeric vi words do not have to be whitespace-separated. e.g. following character sequence contains two words: ``` hello[]+{}@`! ``` #### Big word A big word is a sequence of non-whitespace characters. It is essentially the same as a w3m word, but with symbols being defined as non-whitespace.