From b7ad0e93a243da19e39fc750054afcfa3c6bb9b0 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 11 Nov 2019 12:29:40 -0800 Subject: Refactored `bb +...` to `bbcmd ...` within bb bindings. This makes things a lot less ambiguous. Also removed the default marks created in bbstartup.sh and ensured that `$XDG_DATA_HOME` and `$XDG_CONFIG_HOME` always get set as environment variables. --- API.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'API.md') diff --git a/API.md b/API.md index 0b21c36..2d4af06 100644 --- a/API.md +++ b/API.md @@ -36,7 +36,7 @@ environment variables: ## BB Internal State Commands -In order to modify bb's internal state, you can call `bb +cmd`, where "cmd" +In order to modify bb's internal state, you can call `bbcmd `, where "cmd" is one of the following commands (or a unique prefix of one): - `.:[01]` Whether to show "." in each directory @@ -57,10 +57,10 @@ is one of the following commands (or a unique prefix of one): - `spread:` Spread the selection state at the cursor - `toggle:` Toggle the selection status of -For any of these commands (e.g. `+select`), an empty parameter followed by -additional arguments (e.g. `bb +select: ...`) is equivalent to -repeating the command with each argument (e.g. `bb +select: -+select: ...`). +For any of these commands (e.g. `select`), an empty parameter followed by +additional arguments (e.g. `bbcmd select: ...`) is equivalent to +repeating the command with each argument (e.g. `bbcmd select: +select: ...`). Note: for numeric-based commands (like scroll), the number can be either an absolute value or a relative value (starting with `+` or `-`), and/or a percent @@ -70,12 +70,13 @@ height down, and `100%n` means the last file) ## Final Notes -Internally, `bb` writes the commands (NUL terminated) to a file whose path is -in`$BBCMD` and reads from that file when `bb` resumes. These commands can also -be passed to bb at startup, and will run immediately. E.g. `bb '+col:n' -'+sort:+r' .` will launch `bb` only showing the name column, randomly sorted. +Internally, `bbcmd` writes the commands (NUL terminated) to a file whose path is +in`$BBCMD` and `bb` reads from that file when it resumes. These commands can also +be passed to `bb` at startup as command line arugments starting with `+`, and +will run immediately. E.g. `bbcmd +'col:n' +'sort:+r' .` will launch `bb` only +showing the name column, randomly sorted. -`bb` also optimizes any scripts that only contain just a `bb` command and no -shell variables, other commands, etc. (e.g. `bb +move:+1`) These -`bb`-command-only scripts directly modify `bb`'s internal state without +`bb` also optimizes any scripts that only contain just a `bbcmd` command and no +shell variables, other commands, etc. (e.g. `bbcmd move:+1`) These +`bbcmd`-command-only scripts directly modify `bb`'s internal state without spawning a shell, so they're much faster and avoid flickering the screen. -- cgit v1.2.3