# w3m-like keybindings for Chawan. # Copy-paste this into your config file, or just include it (place it in # ~/.config/chawan/w3m.toml, then at the beginning of # ~/.config/chawan/chawan.toml, include = "w3m.toml".) [page] # Page/cursor movement ' ' = 'n => pager.pageDown(n)' C-v = 'n => pager.pageDown(n)' b = 'n => pager.pageUp(n)' M-v = 'n => pager.pageUp(n)' l = 'n => pager.cursorRight(n)' h = 'n => pager.cursorLeft(n)' j = 'n => pager.cursorDown(n)' k = 'n => pager.cursorUp(n)' C-f = 'n => pager.cursorRight(n)' C-b = 'n => pager.cursorLeft(n)' C-n = 'n => pager.cursorDown(n)' C-p = 'n => pager.cursorUp(n)' J = 'n => pager.scrollUp(n)' K = 'n => pager.scrollDown(n)' '^' = 'pager.cursorLineBegin()' C-a = 'pager.cursorLineBegin()' '$' = 'pager.cursorLineEnd()' C-e = 'pager.cursorLineEnd()' w = 'pager.cursorNextWord()' W = 'pager.cursorWordBegin()' '<' = 'n => pager.pageLeft(n)' '>' = 'n => pager.pageRight(n)' '.' = 'n => pager.scrollLeft(n)' ',' = 'n => pager.scrollRight(n)' g = 'n => n ? pager.gotoLine(n) : pager.cursorFirstLine()' 'M-<' = 'pager.cursorFirstLine()' G = 'n => n ? pager.gotoLine(n) : pager.cursorLastLine()' 'M->' = 'pager.cursorLastLine()' M-g = 'n => pager.gotoLine(n)' Z = 'pager.centerColumn()' z = 'pager.centerLine()' C-i = 'n => pager.cursorNextLink(n)' C-u = 'n => pager.cursorPrevLink(n)' M-C-i = 'n => pager.cursorPrevLink(n)' '[' = 'n => pager.cursorNthLink(n)' ']' = 'n => pager.cursorRevNthLink(n)' # Hyperlink selection C-j = 'pager.click()' C-m = 'pager.click()' c = 'pager.peek()' u = 'pager.peekCursor()' #TODO download, etc # File and URL-related actions U = 'pager.load()' V = 'pager.load()' #TODO file only #TODO exec shell # Buffer operations B = 'pager.discardBuffer()' v = 'pager.toggleSource()' #TODO edit C-l = 'pager.redraw()' R = 'pager.reload()' #TODO save, save source, view in editor #TODO buffer selection mode 'C-@' = ''' () => { /* id is always the current position; this way we can clear by setting a mark twice at the same position. */ const id = pager.buffer.cursorx + " " + pager.buffer.cursory; if (!pager.getMarkPos(id)) pager.setMark(id); else pager.clearMark(id); } ''' M-p = ''' () => { const next = pager.findPrevMark(); if (next) pager.gotoMark(next); else pager.alert("No mark exists before here"); } ''' M-n = ''' () => { const next = pager.findNextMark(); if (next) pager.gotoMark(next); else pager.alert("No mark exists after here"); } ''' # Search '/' = 'pager.searchForward()' C-s = 'pager.searchForward()' '?' = 'pager.searchBackward()' C-r = 'pager.searchBackward()' n = 'pager.searchNext()' N = 'pager.searchPrev()' C-w = ''' config.search.wrap = !config.search.wrap; pager.alert("Wrap search " + (config.search.wrap ? "on" : "off")); ''' # Misc #TODO shell out, help file, options, cookies C-c = 'pager.cancel()' q = 'pager.ask("Do you want to exit Chawan?").then(x => x ? quit() : void(0))' Q = 'quit()' # w3m line editing is equivalent to Chawan's defaults.