CHA-CONFIG(5) File Formats Manual CHA-CONFIG(5) (NAME) cha-config - Chawan (DESCRIPTION) Chawan (user stylesheets) . toml : o ([table]) (table = {}) . (additive) . (destructive) . o [[table-array]] [table-array.n] n . (siteconf) [[siteconf]] . ~/.chawan/config.toml XDG : 1. -C -> 2. $CHA_DIR -> $CHA_DIR/config.toml 3. ${XDG_CONFIG_HOME:-~/.config}/chawan/config.toml -> 4. ~/.chawan/config.toml -> (Path handling) . bonus/config.toml . (Start) [start] . : visual-home = "about:chawan" URL Chawan -V . startup-script = "" JavaScript Chawan . . ( setTimeout .) headless = false boolean / "dump" true "dump" . true "dump" true "dump" . ( setInterval ) true . cha (pipe) -d "dump" . console-buffer = true boolean Chawan headless . : . (standard error) . (Buffer) [buffer] . . [[siteconf]] . : [buffer] # images = true # CSS styling = false # user-style = ''' /* UA : */ @import 'user.css'; /* . */ /* */ a[href] { text-decoration: revert !important } @media (monochrome) { /* "monochrome" ( -M) */ /* UA */ a[href]:hover { font-weight: initial } /* ... */ a[href]:hover { font-style: italic !important } } ''' # scripting true # [[siteconf]] . : styling = true boolean / (author style sheets). . scripting = false boolean / "app" / JavaScript . "app" JavaScript (fingerprinting) ( ). . JavaScript [[siteconf]] . images = false boolean / . cookie = false boolean / "save" / . "save" external.cookie-file . true cookies.txt . Chawan (cookie jar) (cross-site) . "share-cookie-jar" [[siteconf]] . referer-from = false boolean / "Referer". false . [[siteconf]] . autofocus = false boolean true "autofocus" . . meta-refresh = "ask" "never" / "always" / "ask" http-equiv=refresh . "never" "always" "ask" . history = true boolean . mark-links = false boolean . headless/dump URL . user-style = "" CSS stylesheet . @import 'file.css'; . . @import . (Search) [search] . : wrap = true boolean (wrap) . ignore-case = "auto" "auto" / boolean true (case-insensitive). "auto" . : ( vim) \c ( ) \C ( ) . (Search mode) . (Encoding) [encoding] . : document-charset = ["utf-8", "sjis", "euc-jp", "latin2"] (character sets) . . HTML BOM . display-charset = "auto" / "auto" . dump . ( cha -I EUC-JP -O UTF-8 a > b iconv -f EUC-JP -t UTF-8 .) (External) [external] . : tmpdir = { "/tmp/cha-tmp-user"} . editor = "${VISUAL:-${EDITOR:-vi}}" . %s %d . mailcap = ["~/.mailcap", "/etc/mailcap", "/usr/etc/mailcap", "/usr/local/etc/mailcap"] mailcap. cha-mailcap(5) . . mime-types = ["~/.mime.types", "/etc/mime.types", "/usr/etc/mime.types", "/usr/local/etc/mime.types"] mime.types. cha-mime.types(5) . auto-mailcap = "$CHA_DIR/mailcap" mailcap . "Open as" . "mailcap" Chawan "auto.mailcap" . cgi-dir = ["$CHA_DIR/cgi-bin", "$CHA_LIBEXEC_DIR/cgi-bin"] CGI . cha-cgi(5) . urimethodmap = ["$CHA_DIR/urimethodmap", "~/.urimethodmap", "/etc/urimethodmap"] urimethodmap. cha-urimethodmap(5) . w3m-cgi-compat = false boolean CGI w3m. file:///cgi-bin/* file:///$LIB/cgi-bin/* cgi-bin:* . cha-cgi(5) . download-dir = "${TMPDIR:-/tmp}/" "Save to:" . show-download-panel = true boolean about:downloads . copy-cmd = "xsel -bi" " ". input.osc52-copy "auto" () OSC 52 copy-cmd . paste-cmd = "xsel -bo" " ". bookmark = "$CHA_DATA_DIR/bookmark.md" bookmark.md. ( .md .) history-file = "$CHA_DATA_DIR/history.uri" . history-size = 100 number . cookie-file = "$CHA_DATA_DIR/cookies.txt" . "cookies.txt" curl "jar@" . "buffer.cookie" ( siteconf) true "save" . true cookie-file "" . (Input) [input] . vi-numeric-prefix = true boolean vi . [page] . use-mouse = "auto" boolean / "auto" Chawan . w3m . "auto" () Chawan . osc52-copy = "auto" boolean / "auto" Chawan OSC 52 . OSC 52 external.copy-cmd . "auto" () Chawan OSC 52 . osc52-primary = "auto" boolean / "auto" Chawan (primary selection) OSC 52 . . "auto" () Chawan . OSC 52 ( XTerm Kitty) . bracketed-paste = "auto" boolean / "auto" Chawan bracketed paste . (true) : ) (submit) ) Chawan URL . "auto" () Chawan bracketed paste . wheel-scroll = 5 number . side-wheel-scroll = 5 number . link-hint-chars = "abcdefghijklmnoprstuvxyz" string toggleLinkHints. (Unicode codepoint) . : [input] vi-numeric-prefix = true [page] # vi # . # . G = 'n => n ? pager.gotoLine(n) : pager.cursorLastLine()' (Network) [network] . max-redirect = 10 number (redirections) . max-net-connections = 12 number . . prepend-scheme = "https://" string URL (scheme) Chawan ( URL ). ( file:) Chawan prepend-scheme . proxy = "" URL Chawan . http://user:pass@domain socks5://user:pass@domain . curl socks5h socks5 DNS . siteconf . default-headers = {bonus/config.toml } table HTTP(S). siteconf . allow-http-from-file = false boolean : . HTTP HTTPS file: stream: . ( HTML ). HTML . (Display) [display] . : color-mode = "auto" "monochrome" / "ansi" / "eight-bit" / "true-color" / "auto" . "auto" "monochrome" "ansi" ANSI aixterm "eight-bit" "true-color" . format-mode = "auto" "auto" / ["bold", "italic", "underline", "reverse", "strike", "overline", "blink"] . "auto" . "auto" () dump . ([]) . no-format-mode = ["overline"] ["bold", "italic", "underline", "reverse", "strike", "overline", "blink"] . image-mode = "auto" "auto" / "none" / "sixel" / "kitty" . "sixel" sixel "kitty" Kitty "none" . "auto" () sixel kitty "none" . . buffer.images . sixel-colors = "auto" "auto" / 2..65535 display.image-mode="sixel" . sixel . alt-screen = "auto" "auto" / boolean / (alternative screen). "auto" () . ( Chawan terminfo terminfo .) highlight-color = "-cha-ansi(bright-cyan)" CSS color . CSS . (monochrome) (reverse video) . highlight-marks = true boolean / . double-width-ambiguous = false boolean (East Asian Ambiguous) . O . minimum-contrast = 100 0..235 (Y) YUV . 0 ( ). : v0.3 . . set-title = true boolean . default-background-color = "auto" "auto" / RGB color . "auto" Chawan . default-foreground-color = "auto" "auto" / RGB color . "auto" Chawan . columns = 80, lines = 24, pixels-per-column = 9, pixels-per-line = 18 number (fallback) . ( dump .) force-columns = false, force-lines = false, force-pixels-per-column = false, force-pixels-per-line = false boolean . (Status) ( ) [status] . : show-cursor-position = true boolean . show-hover-link = true boolean . format-mode = "reverse" { [display] } . Omnibar (Omnirule) omni-bar ( C-l ) omni-rules . [omnirule] . ( .) : # DuckDuckGo Lite. # ( C-k Brave .) [omnirule.ddg] match = '^ddg:' substitute-url = '(x) => "https://lite.duckduckgo.com/lite/?kp=-1&kd=-1&q=" + encodeURIComponent(x.split(":").slice(1).join(":"))' # URL C-k C-u ddg:keyword . # C-k : [page] 'C-k' = '() => pager.load("ddg:")' # . # [[omnirule]] omnirule . [[omnirule]] match = '^@wikipedia' substitute-url = '(x) => "https://en.wikipedia.org/wiki/Special:Search?search=" + encodeURIComponent(x.replace(/@wikipedia/, ""))' JavaScript . : o ddg: - DuckDuckGo Lite. o br: - Brave. o wk: - . o wd: - (English Wiktionary). o mo: - Mojeek. Omnirule: match regex . . : regex (match mode) . substitute-url JavaScript JavaScript Chawan . . (Siteconf) . [siteconf] . ( .) siteconf "overrides" . : # (Hacker News) . [siteconf.hn] url = 'https://news\.ycombinator\.com/.*' cookie = true # npr.org text.npr.org. [siteconf.npr] 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); /* URL . */ } ''' # *sr.ht. [siteconf.sr-ht] host = '(.*\.)?sr\.ht' # 'something.sr.ht' 'sr.ht' cookie = true # ( "save" ) share-cookie-jar = 'sr.ht' # 'sr.ht' # "vector" . # [[siteconf]] siteconf . [[siteconf]] url = '^https?://[a-z]+\.wikipedia\.org/wiki/(?!.*useskin=.*)' rewrite-url = 'x => x.searchParams.append("useskin", "vector")' # imgur . [siteconf.imgur] host = '(i\.)?imgur\.com' default-headers = { User-Agent = "Mozilla/5.0 chawan", Accept = "*/*", Accept-Encoding = "gzip, deflate", Accept-Language = "en;q=1.0", Pragma = "no-cache", Cache-Control = "no-cache" } Siteconf: url regex URL. host . : regex (match mode) . host regex URL ( / IP). url ( ) . : regex (match mode) . rewrite-url JavaScript JavaScript Chawan URL . URL URL Chawan URL . cookie = buffer.cookie boolean / "save" ( "save" ) URL . share-cookie-jar (host) . . referer-from = buffer.referer-from boolean Chawan Referer . : a.com b.com referer-from true b.com Referer "a.com" . scripting = buffer.scripting boolean / "app" / JavaScript . buffer.scripting . styling = buffer.styling boolean / (CSS) . images = buffer.images boolean / . document-charset = encoding.document-charset . proxy = network.proxy URL . default-headers = network.default-headers table HTTP(S) . insecure-ssl-no-verify = false boolean true (peer) SSL curl --insecure . . autofocus = buffer.autofocus boolean true "autofocus" . . meta-refresh = buffer.meta-refresh "never" / "always" / "ask" http-equiv=refresh . "never" "always" "ask" . history = buffer.history boolean URL . mark-links = buffer.mark-links boolean . user-style = buffer.user-style string . buffer.user-style . (Keybindings) : o (pager): [page] o : [line] : '' = '' . [cmd] JavaScript . API cha-api(7) . : # URL Control Escape j 'C-M-j' = 'load' # g # . 'g g' = 'gotoLineOrStart' # JS . # DuckDuckGo Lite . # ( api.md .) 'C-k' = '() => pager.load("ddg:")' (Keybinding format) S- (shift) C- (control) M- (meta) . ASCII/Unicode . SPC . : TAB ESC RET ( return) LF ( enter/line feed) Left Up Down Right ( ) PageUp PageDown ( /) Home End F1 F20. . 'gg' 'g g' . ( 'Gg') ( 'G g'). / SPC . (Pager actions) (bold) . quit q . suspend C-z . : CGI . load C-l URL. loadCursor M-l URL. / URL . loadEmpty . webSearch C-k URL . Brave . dupeBuffer M-u . (shallow clone) . reloadBuffer U URL . lineInfo C-g . toggleSource \ HTML . HTML . saveScreen s s . saveSource s S . editScreen s e . editSource s E . discardBuffer D / . discardBufferPrev, discardBufferNext d ,, d . / . discardTree M-d . nextBuffer, prevBuffer ., , . enterCommand M-c JavaScript. . searchForward, searchBackward . isearchForward, searchBackward /, ? . searchNext, searchPrev n, N n- ( ) /. peek URL . peekCursor u URL . ( u -> -> URL). showFullAlert s u . C-p C-n . copyURL M-y URL . copyCursorLink y u . copyCursorImage y I URL . gotoClipboardURL M-p URL . openBookmarks M-b (bookmarks). addBookmark M-a . toggleLinkHints f (hints) ( ). . input.link-hint-chars . toggleLinkHintsAutoClick toggleLinkHints . (Buffer actions) n . 10gg n . . (bold) . cursorUp, cursorDown j/C-p/Up, k/C-n/Down / n n . cursorLeft, cursorRight h/Left, l/Right / n n . cursorLineBegin 0/Home . cursorLineTextStart ^ . cursorLineEnd $/End . cursorNextWord, cursorNextViWord, cursorNextBigWord w, W n- . cursorPrevWord, cursorPrevViWord, cursorPrevBigWord n- . cursorWordEnd, cursorViWordEnd, cursorBigWordEnd e, E n- . cursorWordBegin, cursorViWordBegin, cursorBigWordBegin b, B n- . cursorPrevLink, cursorNextLink [, ] / / ( ). cursorPrevParagraph, cursorNextParagraph {, } / n- (paragraph) /. cursorRevNthLink n- . cursorNthLink n- . pageUp, pageDown, pageLeft, pageRight C-b/PageUp, C-f/PageDown, z H, z L /// n n . halfPageUp, halfPageDown, halfPageLeft, halfPageUp C-u, C-d /// n n . scrollUp, scrollDown, scrollLeft, scrollRight K/C-y, J/C-e, z h, z l /// n n . click RET/LF HTML . n JS . rightClick c . ( JS ) (toggle) . toggleMenu C . viewImage I . reshape R . . redraw r . . cursorFirstLine, cursorLastLine / . cursorTop, cursorMiddle, cursorBottom H, M, L / / . ( H M L vi.) raisePage, raisePageBegin, centerLine, centerLineBegin, lowerPage, lowerPageBegin z t, z RET, z z, z ., z b, z - n n . : o raisePage . ( vi z RET vim z t.) o centerLine . ( vi z . vim z z.) o lowerPage . ( vi z - vim z b.) -Begin vi . nextPageBegin z + n n- . . previousPageBegin z ^ n n- . . cursorLeftEdge, cursorMiddleColumn, cursorRightEdge g 0, g c, g $ // . centerColumn . ( w3m Z.) gotoLineOrStart, gotoLineOrEnd g g, G n n . / . gotoColumnOrBegin, gotoColumnOrEnd | n n . / . mark m x x . gotoMark, gotoMarkY `, ' x x ( ) . gotoMark (X) (Y) gotoMarkY Y . markURL : URL . saveLink s RET URL . saveSource s S . saveImage s I . toggleImages M-i . toggleScripting M-j / . toggleCookie M-k / . cursorSearchWordForward C-a, * . cursorSearchWordBackward # . (Line-editing actions) line.submit RET, LF . line.cancel C-g . line.copyOrCancel C-c . line.cancel . line.backspace, line.delete C-h, C-d (backspace) (delete) . line.clear, line.kill C-u/C-x C-?, C-k (clear) (kill) . line.openEditor C-x C-e $EDITOR. line.clearWord, line.killWord C-w, M-d (clear) (kill) . line.backward, line.forward C-b, C-f /. line.prevWord, line.nextWord M-b, M-f /. line.begin, line.end C-a/Home, C-e/End / . line.escape C-v . line.prevHist, line.nextHist C-p, C-n / . : URL . . ( https:// : https : / /.) # Control+A . 'C-a' = 'line.begin' # Escape+D . 'M-d' = 'line.killWord' (Appendix) (Regex handling) libregexp QuickJS . JavaScript . Chawan : "" (search) "" (match). ( "regex" ). ( searchForward/isearchForward ). (Match mode) (^) ($) . : ^abcd -> ^abcd ( ) efgh$ -> efgh$ ( ) ^ijkl$ -> ^ijkl$ ( ) mnop -> ^mnop$ ( ) match mode / regex i . (Search mode) /abcd abcd . ( match mode ): o \c ( + c ) regex . o \C ( + C ) . ( ignore-case true .) o \< \> \b ( vi grep ). . (wrapped) . (Path handling) . o (tilde-expansion) ~/whatever . o $ENV_VAR . o Chawan ( $CHA_DIR). Chawan (export) : o $CHA_BIN_DIR: cha . . o $CHA_LIBEXEC_DIR: Chawan . $CHA_BIN_DIR/../libexec/chawan . o $CHA_DIR: . ( .) o $CHA_DATA_DIR: XDG ${XDG_DATA_HOME:-$HOME/.local/share}/chawan . $CHA_DIR . o : $CHA_DIR cha $CHA_DATA_DIR . XDG . (Word types) . : o w3m o vi o (Big words) w3m w3m . (whitespace) . vi vi . : han . vi vi . : hello[]+{}@`! (Big word) . w3m . (SEE ALSO) cha(1), cha-api(7) CHA-CONFIG(5)