diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-07-03 21:20:42 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-07-03 21:20:42 -0700 |
| commit | 1d54d6a29269d89248f65d9f2874b88c34e63691 (patch) | |
| tree | b0f35c1fd7a77164c8e666ae66b1214d2ba18fe6 /README.md | |
| parent | 67b62c7294984eaa3b199765dd76b258dc979473 (diff) | |
Removed outdated info
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 41 |
1 files changed, 6 insertions, 35 deletions
@@ -10,6 +10,7 @@  + ## Building `bb` has no build dependencies besides `make` and a C compiler, just: @@ -21,12 +22,12 @@ To run `bb`, it's expected that you have some basic unix tools: `cat`, `cp`, `echo`, `find`, `kill`, `less`, `ln`, `mkdir`, `more`, `mv`, `printf`, `read`, `rm`, `sed`, `sh`, `tput`, `tr`. + ## Usage Run `bb` to launch the file browser. `bb` also has the flags: -- `-d`: when `bb` exits successfully, print the directory `bb` was browsing - (see the section on "Changing Directories with bb" in the FAQ below). +- `-d`: when `bb` exits successfully, print the directory `bb` was browsing. - `-s`: when `bb` exits successfully, print the files that were selected. - `-0`: use NULL-terminated strings instead of newline-separated strings with the `-s` flag. @@ -44,6 +45,7 @@ without printing anything. More information about usage can also be found by running `man bb` after installing. + ## bb's Philosophy The core idea behind `bb` is that `bb` is a file **browser**, not a file @@ -57,6 +59,7 @@ which means selecting `file1` and `file2`, then pressing `D` will cause `bb` to run the shell command `rm -rf file1 file2` and then tell `bb` to deselect all (now deleted) files and refresh. + ## Customizing bb When `bb` launches, it first updates `bb`'s `$PATH` environment variable to @@ -72,6 +75,7 @@ You can also create temporary bindings at runtime by hitting `Ctrl-b`, pressing the key you want to bind, and then entering in a script to run (in case you want to set up an easy way to repeat some custom workflow). + ### API `bb` also exposes an API that allows shell scripts to modify `bb`'s internal @@ -80,38 +84,6 @@ default, `j` is bound to `bbcmd move:+1`, which has the effect of moving `bb`'s cursor down one item. More details about the API can be found in [the API documentation](API.md) or by running `man bbcmd` after installing. -## FAQ - -### Using bb to Change Directory - -Applications cannot change the shell's working directory on their own, but you -can define a shell function that uses the shell's builtin `cd` function on the -output of `bb -d` (print directory on exit). For bash (or sh, zsh, etc.), you can -put the following function in your `~/.profile` (or `~/.bashrc`, `~/.zshrc`, -etc.): - - function bcd() { cd "$(bb -d "$@")"; } - -For [fish](https://fishshell.com/) (v3.0.0+), you can put this in your -`~/.config/fish/functions/`: - - function bcd; cd (bb -d $argv); end - -In both versions, the directory will not change if `bb` exits with failure -(e.g. by pressing `Ctrl-c`). - -### Launching bb with a Keyboard Shortcut - -Using a keyboard shortcut to launch `bb` from the shell is something that is -handled by your shell. Here are some examples for binding `Ctrl-b` to launch -`bb` and change directory to `bb`'s directory (using the `bcd` function defined -above). For sh and bash, put this in your `~/.profile`: - - bind '"\C-b":"bcd\n"' - -For fish, put this in your `~/.config/fish/functions/fish_user_key_bindings.fish`: - - bind \cB 'bcd; commandline -f repaint' ## License @@ -119,4 +91,3 @@ For fish, put this in your `~/.config/fish/functions/fish_user_key_bindings.fish (you can't sell this software without the developer's permission, but you're otherwise free to use, modify, and redistribute it free of charge). See [LICENSE](LICENSE) for details. - |
