summaryrefslogtreecommitdiffstats
path: root/website/docs/documentation/tricks.md
blob: 18d3fa31d387e0e7e0004deb3e1fe633bd9015b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
## `dcd` : Deep fuzzy cd

When you want to cd to a deep directory, using `br` is fast and easy enough:

* you type `br` (and `enter`)
* you type the name of the deep folder (or part of it)
* you check the right line is selected
* you do `alt-enter`
* you're done

But when you frequently go to a few specific places, you may prefer a shortcut.

As broot can be driven by commands, you can define this function:

	# deep fuzzy cd
	function dcd {
		br --only-folders --cmd "$1 :c"
	}

(paste this for example in your .bashrc)

This is the *"I'm feeling lucky"* of broot, you can use it to directly jump to directories you know, when you don't need the interactive search of br.

Example:

![dcd ruleset](../img/20190122-dcd_rulset.png)

## focus a new directory but keep the current filter

Similarly, `:back` keeps can be used in place of `esc` to keep the filter when going to the previous state.

## Going from a fixed search to an exact one

Let's assume you type `too` to search for some files. You might have got too many matches including some where the letters aren't consecutive.

You may switch to an exact search by just adding `/`, which changes the fuzzy pattern to a regular expression.

Or if you realize you want to match `tOo` too, then you make it case insensitive by adding an i: `too/i`.