From 5be29f675fc27974ff256cb2094ccd0854e19b07 Mon Sep 17 00:00:00 2001 From: bptato Date: Thu, 15 Dec 2022 17:35:41 +0100 Subject: Add discardTree, update docs --- doc/config.md | 395 ++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 329 insertions(+), 66 deletions(-) (limited to 'doc/config.md') diff --git a/doc/config.md b/doc/config.md index 95b55f92..d64d0d59 100644 --- a/doc/config.md +++ b/doc/config.md @@ -371,7 +371,7 @@ escape to the keybinding respectively (essentially making `M-` the same as `C-[`). Modifiers can be escaped with the `\` sign. ```Examples: -'C-M-j' = 'pager.changeLocation()' # change URL when Control, Escape and j are pressed +'C-M-j' = 'pager.load()' # change URL when Control, Escape and j are pressed 'gg' = 'pager.cursorFirstLine()' # go to the first line of the page when g is pressed twice ``` An action is a JavaScript function called by chawan every time the keybinding @@ -380,78 +380,341 @@ is typed in. A list of built-in pager functions can be found below. ### Pager actions - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
**Name****Function** -
`pager.quit()`Exit the browser -
`pager.cursorUp()`Move the cursor to the previous line -
`pager.cursorDown()`Move cursor to the next line -
`pager.cursorLeft()`Move cursor to the previous cell -
`pager.cursorRight()`Move cursor to the next cell -
`pager.cursorLineBegin()`Move cursor to the first cell of the line -
`pager.cursorLineEnd()`Move cursor to the last cell of the line -
`pager.cursorNextWord()`Move cursor to the beginning of the next word -
`pager.cursorPrevWord()`Move cursor to the end of the previous word -
`pager.cursorNextLink()`Move cursor to the beginning of the next clickable element -
`pager.cursorPrevLink()`Move cursor to the beginning of the previous clickable element -
`pager.pageDown()`Move screen down by one page -
`pager.pageUp()`Move screen up by one page -
`pager.pageLeft()`Move screen to the left by one page -
`pager.pageRight()`Move screen to the right by one page -
`pager.halfPageDown()`Move screen down by half a page -
`pager.halfPageUp()`Move screen up by half a page -
`pager.scrollDown()`Move screen down by one line -
`pager.scrollUp()`Move screen up by one line -
`pager.scrollLeft()`Move screen to the left by one line -
`pager.scrollRight()`Move screen to the right by one line -
`pager.click()`Click element currently under cursor -
`pager.changeLocation()`Go to URL -
`pager.dupeBuffer()`Duplicate the current buffer -
`pager.reload()`Reload page -
`pager.reshape()`Reshape buffer (=render page anew) -
`pager.redraw()`Redraw buffer (=redraw screen) -
`pager.toggleSource()`Source view -
`pager.cursorFirstLine()`Move cursor to the first line of the buffer -
`pager.cursorLastLine()`Move cursor to the last line of the buffer -
`pager.cursorTop()`Move cursor to the first line of the page -
`pager.cursorMiddle()`Move cursor to the middle of the page -
`pager.cursorBottom()`Move cursor to the last line of the page -
`pager.centerLine()`Center screen around line -
`pager.lineInfo()`Display information about line -
`pager.searchForward()`Search for a string in the current buffer -
`pager.searchBackward()`Search for a string, backwards -
`pager.isearchForward()`Search for a string and highlight the first result -
`pager.isearchBackward()`Search and highlight the first result, backwards -
`pager.searchPrev()`Jump to the next search result -
`pager.searchNext()`Jump to the previous search result -
`pager.peek()`Display an alert of the current URL -
`pager.peekCursor()`Display an alert of the URL under the cursor + +
**Name****Function**
`pager.quit()`Exit the browser.
`pager.cursorUp()`Move the cursor to the previous line.
`pager.cursorDown()`Move cursor to the next line.
`pager.cursorLeft()`Move the cursor to the previous cell.
`pager.cursorRight()`Move the cursor to the next cell.
`pager.cursorLineBegin()`Move the cursor to the first cell of the line.
`pager.cursorLineEnd()`Move the cursor to the last cell of the line.
`pager.cursorNextWord()`Move the cursor to the beginning of the next word.
`pager.cursorPrevWord()`Move the cursor 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.pageDown()`Scroll down by one page.
`pager.pageUp()`Scroll up by one page.
`pager.pageLeft()`Scroll to the left by one page.
`pager.pageRight()`Scroll to the right by one page.
`pager.halfPageDown()`Scroll forwards by half a page.
`pager.halfPageUp()`Scroll backwards by half a page.
`pager.scrollDown()`Scroll forwards by one line.
`pager.scrollUp()`Scroll backwards by one line.
`pager.scrollLeft()`Scroll to the left by one column.
`pager.scrollRight()`Scroll to the right by one column.
`pager.click()`Click the HTML element currently under the cursor.
`pager.load(url)`Go to the specified URL. 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:cha\n")`), the URL is loaded directly.
`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 parent. If the current +buffer is a root buffer (i.e. it has no parent), move to the first child +buffer instead.
`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 a 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 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.centerLine()`Center screen around the current line.
`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.searchNext()`Jump to the next search result.
`pager.searchPrev()`Jump to the previous search result.
`pager.peek()`Display an alert message of the current URL.
`pager.peekCursor()`Display an alert message of the URL under the cursor.
+ ### 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(bounds)`Delete word before cursor -
`line.killWord(bounds)`Delete word after cursor -
`line.backward()`Move cursor back by one character -
`line.forward()`Move cursor forward by one character -
`line.prevWord(bounds)`Move cursor to the previous word by one character -
`line.nextWord(bounds)`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 + +
**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(bounds)`Delete word before cursor
`line.killWord(bounds)`Delete word after cursor
`line.backward()`Move cursor back by one character
`line.forward()`Move cursor forward by one character
`line.prevWord(bounds)`Move cursor to the previous word by one character
`line.nextWord(bounds)`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
-Some entries have an optional `bounds` parameter. If passed, this must be a -JavaScript function that expects one parameter (the current unicode character), -and returns true if the passed character should count as a word boundary. +Some of these entries have an optional `bounds` parameter. If passed, this +must be a JavaScript function that expects one parameter (the current +unicode character), and returns true if the passed character should count +as a word boundary. ```Examples: # Control+A moves the cursor to the beginning of the line. -- cgit 1.4.1-2-gfad0