summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2020-07-09 17:01:03 +0200
committerCanop <cano.petrole@gmail.com>2020-07-09 17:01:03 +0200
commitd094c44ca6032fdc7f8c2da4bd31bc0aaeaa8adc (patch)
tree8612848721ec9e877163ca0c422f73c285829638
parentefd3ea97514545be187982bbe62d8ad012e17ebd (diff)
add [ext-colors] to color files depending on their extension
-rw-r--r--CHANGELOG.md3
-rw-r--r--src/app/context.rs7
-rw-r--r--src/browser/browser_state.rs1
-rw-r--r--src/conf/conf.rs15
-rw-r--r--src/display/displayable_tree.rs14
-rw-r--r--src/launchable.rs19
-rw-r--r--src/print.rs8
-rw-r--r--src/skin/colors.rs73
-rw-r--r--src/skin/ext_colors.rs33
-rw-r--r--src/skin/mod.rs3
-rw-r--r--src/skin/skin_entry.rs72
-rw-r--r--src/tree/tree_line.rs6
-rw-r--r--website/docs/conf_file.md14
-rw-r--r--website/docs/export.md4
-rw-r--r--website/docs/index.md6
-rw-r--r--website/docs/input.md2
-rw-r--r--website/docs/install.md4
-rw-r--r--website/docs/launch.md2
-rw-r--r--website/docs/navigation.md4
-rw-r--r--website/docs/tricks.md2
20 files changed, 197 insertions, 95 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0512533..a7d0a2b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,6 @@
+### next version
+- `[ext-colors]` section in config
+
<a name="v0.18.5"></a>
### v0.18.5 - 2020-07-05
- git status takes into accout overloading of enter and alt-enter
diff --git a/src/app/context.rs b/src/app/context.rs
index 79261d4..e8bb32d 100644
--- a/src/app/context.rs
+++ b/src/app/context.rs
@@ -5,6 +5,7 @@ use {
conf::Conf,
display::{Cols, DEFAULT_COLS},
pattern::SearchModeMap,
+ skin::ExtColorMap,
tree::SpecialPath,
verb::VerbStore,
},
@@ -23,7 +24,7 @@ pub struct AppContext {
/// the verbs in use (builtins and configured ones)
pub verb_store: VerbStore,
- /// the paths for which there's a special behavior to follow (come from conf)
+ /// the paths for which there's a special behavior to follow (comes from conf)
pub special_paths: Vec<SpecialPath>,
/// the map between search prefixes and the search mode to apply
@@ -32,6 +33,9 @@ pub struct AppContext {
/// order of columns in tree display
pub cols: Cols,
+ /// mapping from file extension to colors (comes from conf)
+ pub ext_colors: ExtColorMap,
+
pub standard_status: StandardStatus,
}
@@ -50,6 +54,7 @@ impl AppContext {
special_paths: config.special_paths.clone(),
search_modes: config.search_modes.clone(),
cols: config.cols_order.unwrap_or(DEFAULT_COLS),
+ ext_colors: config.ext_colors.clone(),
standard_status,
}
}
diff --git a/src/browser/browser_state.rs b/src/browser/browser_state.rs
index a2561c1..968441a 100644
--- a/src/browser/browser_state.rs
+++ b/src/browser/browser_state.rs
@@ -707,6 +707,7 @@ impl AppState for BrowserState {
tree: &self.displayed_tree(),
skin: &panel_skin.styles,
cols: &con.cols,
+ ext_colors: &con.ext_colors,
area,
in_app: true,
};
diff --git a/src/conf/conf.rs b/src/conf/conf.rs
index a17ce6a..4c008f5 100644
--- a/src/conf/conf.rs
+++ b/src/conf/conf.rs
@@ -11,7 +11,7 @@ use {
keys,
pattern::{SearchModeMap, SearchModeMapEntry},
selection_type::SelectionType,
- skin::SkinEntry,
+ skin::{ExtColorMap, SkinEntry},
tree::*,
verb::VerbConf,
},
@@ -20,7 +20,6 @@ use {
collections::HashMap,
fs, io,
path::{Path, PathBuf},
- result::Result,
},
toml::{self, Value},
};
@@ -36,6 +35,7 @@ pub struct Conf {
pub search_modes: SearchModeMap,
pub disable_mouse_capture: bool,
pub cols_order: Option<Cols>,
+ pub ext_colors: ExtColorMap,
}
fn string_field(value: &Value, field_name: &str) -> Option<String> {
@@ -224,7 +224,16 @@ impl Conf {
}
}
}
-
+ }
+ // reading the ext_colors map
+ if let Some(Value::Table(ext_colors_tbl)) = &root.get("ext-colors") {
+ for (k, v) in ext_colors_tbl.iter() {
+ if let Some(v) = v.as_str() {
+ if let Err(e) = self.ext_colors.set(k.to_string(), v) {
+ eprintln!("{}", e);
+ }
+ }
+ }
}
Ok(())
diff --git a/src/display/displayable_tree.rs b/src/display/displayable_tree.rs
index 0482c21..fae7cc5 100644
--- a/src/display/displayable_tree.rs
+++ b/src/display/displayable_tree.rs
@@ -12,7 +12,7 @@ use {
errors::ProgramError,
file_sum::FileSum,
pattern::PatternObject,
- skin::StyleMap,
+ skin::{ExtColorMap, StyleMap},
task_sync::ComputationResult,
tree::{Tree, TreeLine, TreeLineType},
},
@@ -46,6 +46,7 @@ pub struct DisplayableTree<'s, 't> {
pub area: termimad::Area,
pub in_app: bool, // if true we show the selection and scrollbar
pub cols: &'s Cols,
+ pub ext_colors: &'s ExtColorMap,
}
impl<'s, 't> DisplayableTree<'s, 't> {
@@ -54,12 +55,14 @@ impl<'s, 't> DisplayableTree<'s, 't> {
tree: &'t Tree,
skin: &'s StyleMap,
cols: &'s Cols,
+ ext_colors: &'s ExtColorMap,
width: u16,
) -> DisplayableTree<'s, 't> {
DisplayableTree {
tree,
skin,
cols,
+ ext_colors,
area: termimad::Area {
left: 0,
top: 0,
@@ -314,7 +317,7 @@ impl<'s, 't> DisplayableTree<'s, 't> {
pattern_object: PatternObject,
selected: bool,
) -> Result<usize, ProgramError> {
- let style = match &line.line_type {
+ let mut style = match &line.line_type {
TreeLineType::Dir => &self.skin.directory,
TreeLineType::File => {
if line.is_exe() {
@@ -326,6 +329,13 @@ impl<'s, 't> DisplayableTree<'s, 't> {
TreeLineType::SymLinkToFile(_) | TreeLineType::SymLinkToDir(_) => &self.skin.link,
TreeLineType::Pruning => &self.skin.pruning,
};
+ let mut cloned_style;
+ if let Some(ext_color) = line.extension().and_then(|ext| self.ext_colors.get(ext)) {
+ debug!("extension: {:?}", ext_color);
+ cloned_style = style.clone();
+ cloned_style.set_fg(ext_color);
+ style = &cloned_style;
+ }
cond_bg!(style, self, selected, style);
cond_bg!(char_match_style, self, selected, self.skin.char_match);
let label = if pattern_object.subpath {
diff --git a/src/launchable.rs b/src/launchable.rs
index 0c81b22..c24403b 100644
--- a/src/launchable.rs
+++ b/src/launchable.rs
@@ -1,8 +1,16 @@
use {
crate::{
- display::{Cols, DisplayableTree, Screen, W},
+ display::{
+ Cols,
+ DisplayableTree,
+ Screen,
+ W,
+ },
errors::ProgramError,
- skin::StyleMap,
+ skin::{
+ ExtColorMap,
+ StyleMap,
+ },
tree::Tree,
},
crossterm::{
@@ -31,6 +39,7 @@ pub enum Launchable {
tree: Box<Tree>,
skin: Box<StyleMap>,
cols: Cols,
+ ext_colors: ExtColorMap,
width: u16,
},
Program {
@@ -72,11 +81,13 @@ impl Launchable {
screen: &Screen,
style_map: StyleMap,
cols: Cols,
+ ext_colors: ExtColorMap,
) -> Launchable {
Launchable::TreePrinter {
tree: Box::new(tree.clone()),
skin: Box::new(style_map),
cols,
+ ext_colors,
width: screen.width,
}
}
@@ -98,8 +109,8 @@ impl Launchable {
println!("{}", to_print);
Ok(())
}
- Launchable::TreePrinter { tree, skin, cols, width } => {
- let dp = DisplayableTree::out_of_app(&tree, &skin, &cols, *width);
+ Launchable::TreePrinter { tree, skin, cols, ext_colors, width } => {
+ let dp = DisplayableTree::out_of_app(&tree, &skin, &cols, &ext_colors, *width);
dp.write_on(&mut std::io::stdout())
}
Launchable::Program { exe, args } => {
diff --git a/src/print.rs b/src/print.rs
index 86313a3..d9364d8 100644
--- a/src/print.rs
+++ b/src/print.rs
@@ -6,7 +6,7 @@ use {
display::{Cols, DisplayableTree, Screen},
errors::ProgramError,
launchable::Launchable,
- skin::{PanelSkin, StyleMap},
+ skin::{ExtColorMap, PanelSkin, StyleMap},
tree::Tree,
},
pathdiff,
@@ -57,9 +57,10 @@ fn print_tree_to_file(
screen: &mut Screen,
file_path: &str,
cols: &Cols,
+ ext_colors: &ExtColorMap,
) -> Result<AppStateCmdResult, ProgramError> {
let no_style_skin = StyleMap::no_term();
- let dp = DisplayableTree::out_of_app(tree, &no_style_skin, cols, screen.width);
+ let dp = DisplayableTree::out_of_app(tree, &no_style_skin, cols, ext_colors, screen.width);
let mut f = OpenOptions::new()
.create(true)
.append(true)
@@ -76,7 +77,7 @@ pub fn print_tree(
) -> Result<AppStateCmdResult, ProgramError> {
if let Some(ref output_path) = con.launch_args.file_export_path {
// an output path was provided, we write to it
- print_tree_to_file(tree, screen, output_path, &con.cols)
+ print_tree_to_file(tree, screen, output_path, &con.cols, &con.ext_colors)
} else {
// no output path provided. We write on stdout, but we must
// do it after app closing to have the normal terminal
@@ -90,6 +91,7 @@ pub fn print_tree(
screen,
styles,
con.cols,
+ con.ext_colors.clone(),
)))
}
}
diff --git a/src/skin/colors.rs b/src/skin/colors.rs
new file mode 100644
index 0000000..26e1f3b
--- /dev/null
+++ b/src/skin/colors.rs
@@ -0,0 +1,73 @@
+use {
+ crate::errors::InvalidSkinError,
+ crossterm::style::{
+ Color::{self, *},
+ },
+ super::*,
+};
+
+/// read a color from a string.
+/// It may be either
+/// - "none"
+/// - one of the few known color name. Example: "darkred"
+/// - grayscale with level in [0,24[. Example: "grey(5)"
+/// - an Ansi code. Example "ansi(106)"
+/// - RGB. Example: "rgb(25, 100, 0)"
+/// This function needs a lowercase string (assuming lowercasing
+/// has be done before, to ensure case-insensitive parsing)
+pub fn parse(s: &str) -> Result<Option<Color>, InvalidSkinError> {
+ if let Some(c) = regex!(r"^ansi\((?P<value>\d+)\)$").captures(&s) {
+ let value: &str = c.name("value").unwrap().as_str();
+ let value = value.parse();
+ if let Ok(value) = value {
+ return Ok(ansi(value)); // all ANSI values are ok
+ } else {
+ return Err(InvalidSkinError::InvalidColor { raw: s.to_owned() });
+ }
+ }
+
+ if let Some(c) = regex!(r"^gr[ae]y(?:scale)?\((?P<level>\d+)\)$").captures(&s) {
+ let level: &str = c.name("level").unwrap().as_str();
+ let level = level.parse();
+ if let Ok(level) = level {
+ if level > 23 {
+ return Err(InvalidSkinError::InvalidGreyLevel { level });
+ }
+ return Ok(gray(level));
+ } else {
+ return Err(InvalidSkinError::InvalidColor { raw: s.to_owned() });
+ }
+ }
+
+ if let Some(c) = regex!(r"^rgb\((?P<r>\d+),\s*(?P<g>\d+),\s*(?P<b>\d+)\)$").captures(&s) {
+ let r = c.name("r").unwrap().as_str().parse();
+ let g = c.name("g").unwrap().as_str().parse();
+ let b = c.name("b").unwrap().as_str().parse();
+ if let (Ok(r), Ok(g), Ok(b)) = (r, g, b) {
+ return Ok(rgb(r, g, b));
+ } else {
+ return Err(InvalidSkinError::InvalidColor { raw: s.to_owned() });
+ }
+ }
+
+ match s {
+ "black" => Ok(rgb(0, 0, 0)), // crossterm black isn't black
+ "blue" => Ok(Some(Blue)),
+ "cyan" => Ok(Some(Cyan)),
+ "darkblue" => Ok(Some(DarkBlue)),
+ "darkcyan" => Ok(Some(DarkCyan)),
+ "darkgreen" => Ok(Some(DarkGreen)),
+ "darkmagenta" => Ok(Some(DarkMagenta)),
+ "darkred" => Ok(Some(DarkRed)),
+ "green" => Ok(Some(Green)),
+ "grey" => Ok(Some(Grey)),
+ "magenta" => Ok(Some(Magenta)),
+ "red" => Ok(Some(Red)),
+ "yellow" => Ok(Some(Yellow)),
+ "darkyellow" => Ok(Some(DarkYellow)),
+ "white" => Ok(Some(White)),
+ "none" => Ok(None),
+ _ => Err(InvalidSkinError::InvalidColor { raw: s.to_owned() }),
+ }
+}
+
diff --git a/src/skin/ext_colors.rs b/src/skin/ext_colors.rs
new file mode 100644
index 0000000..55a6dae
--- /dev/null
+++ b/src/skin/ext_colors.rs
@@ -0,0 +1,33 @@
+
+use {
+ super::colors,
+ crate::{
+ errors::InvalidSkinError,
+ },
+ crossterm::style::Color,
+ std::{
+ collections::HashMap,
+ },
+};
+
+
+/// a map from file extension to the foreground
+/// color to use when drawing the tree
+#[derive(Debug, Clone, Default)]
+pub struct ExtColorMap {
+ map: HashMap<String, Color>,
+}
+
+impl ExtColorMap {
+ /// return the color to use, or None when the default color
+ /// of files should apply
+ pub fn get(&self, ext: &str) -> Option<Color> {
+ self.map.get(ext).copied()
+ }
+ pub fn set(&mut self, ext: String, raw_color: &str) -> Result<(), InvalidSkinError> {
+ if let Some(color) = colors::parse(raw_color)? {
+ self.map.insert(ext, color);
+ }
+ Ok(())
+ }
+}
diff --git a/src/skin/mod.rs b/src/skin/mod.rs
index fee95ab..43f9f35 100644
--- a/src/skin/mod.rs
+++ b/src/skin/mod.rs
@@ -1,5 +1,7 @@
mod app_skin;
mod cli_mad_skin;
+pub mod colors;
+mod ext_colors;
mod help_mad_skin;
mod panel_skin;
mod purpose_mad_skin;
@@ -10,6 +12,7 @@ mod status_mad_skin;
pub use {
app_skin::AppSkin,
cli_mad_skin::*,
+ ext_colors::ExtColorMap,
help_mad_skin::*,
panel_skin::PanelSkin,
purpose_mad_skin::*,
diff --git a/src/skin/skin_entry.rs b/src/skin/skin_entry.rs
index 8fab1fd..a986013 100644
--- a/src/skin/skin_entry.rs
+++ b/src/skin/skin_entry.rs
@@ -3,14 +3,12 @@
/// a string with TTY colors
use {
+ super::*,
crate::errors::InvalidSkinError,
crossterm::style::{
Attribute::{self, *},
Attributes,
- Color::{self, *},
},
- std::result::Result,
- super::*,
termimad::CompoundStyle,
};
@@ -50,70 +48,6 @@ impl SkinEntry {
}
-/// read a color from a string.
-/// It may be either
-/// - "none"
-/// - one of the few known color name. Example: "darkred"
-/// - grayscale with level in [0,24[. Example: "grey(5)"
-/// - an Ansi code. Example "ansi(106)"
-/// - RGB. Example: "rgb(25, 100, 0)"
-/// This function needs a lowercase string (assuming lowercasing
-/// has be done before, to ensure case-insensitive parsing)
-fn parse_color(s: &str) -> Result<Option<Color>, InvalidSkinError> {
- if let Some(c) = regex!(r"^ansi\((?P<value>\d+)\)$").captures(&s) {
- let value: &str = c.name("value").unwrap().as_str();
- let value = value.parse();
- if let Ok(value) = value {
- return Ok(ansi(value)); // all ANSI values are ok
- } else {
- return Err(InvalidSkinError::InvalidColor { raw: s.to_owned() });
- }
- }
-
- if let Some(c) = regex!(r"^gr[ae]y(?:scale)?\((?P<level>\d+)\)$").captures(&s) {
- let level: &str = c.name("level").unwrap().as_str();
- let level = level.parse();
- if let Ok(level) = level {
- if level > 23 {
- return Err(InvalidSkinError::InvalidGreyLevel { level });
- }
- return Ok(gray(level));
- } else {
- return Err(InvalidSkinError::InvalidColor { raw: s.to_owned() });
- }
- }
-
- if let Some(c) = regex!(r"^rgb\((?P<r>\d+),\s*(?P<g>\d+),\s*(?P<b>\d+)\)$").captures(&s) {
- let r = c.name("r").unwrap().as_str().parse();
- let g = c.name("g").unwrap().as_str().parse();
- let b = c.name("b").unwrap().as_str().parse();
- if let (Ok(r), Ok(g), Ok(b)) = (r, g, b) {
- return Ok(rgb(r, g, b));
- } else {
- return Err(InvalidSkinError::InvalidColor { raw: s.to_owned() });
- }
- }
-
- match s {
- "black" => Ok(rgb(0, 0, 0)), // crossterm black isn't black
- "blue" => Ok(Some(Blue)),
- "cyan" => Ok(Some(Cyan)),
- "darkblue" => Ok(Some(DarkBlue)),
- "darkcyan" => Ok(Some(DarkCyan)),
- "darkgreen" => Ok(Some(DarkGreen)),
- "darkmagenta" => Ok(Some(DarkMagenta)),
- "darkred" => Ok(Some(DarkRed)),
- "green" => Ok(Some(Green)),
- "grey" => Ok(Some(Grey)),
- "magenta" => Ok(Some(Magenta)),
- "red" => Ok(Some(Red)),
- "yellow" => Ok(Some(Yellow)),
- "darkyellow" => Ok(Some(DarkYellow)),
- "white" => Ok(Some(White)),
- "none" => Ok(None),
- _ => Err(InvalidSkinError::InvalidColor { raw: s.to_owned() }),
- }
-}
fn parse_attribute(s: &str) -> Result<Attribute, InvalidSkinError> {
match s {
@@ -153,8 +87,8 @@ fn parse_compound_style(s: &str) -> Result<CompoundStyle, InvalidSkinError> {
"
);
if let Some(c) = parts_rex.captures(&s) {
- let fg_color = parse_color(c.name("fg").unwrap().as_str())?;
- let bg_color = parse_color(c.name("bg").unwrap().as_str())?;
+ let fg_color = colors::parse(c.name("fg").unwrap().as_str())?;
+ let bg_color = colors::parse(c.name("bg").unwrap().as_str())?;
let attrs = parse_attributes(c.name("attributes").unwrap().as_str())?;
Ok(CompoundStyle::new(
fg_color,
diff --git a/src/tree/tree_line.rs b/src/tree/tree_line.rs
index 95d571e..ef186bc 100644
--- a/src/tree/tree_line.rs
+++ b/src/tree/tree_line.rs
@@ -69,6 +69,12 @@ impl TreeLine {
SelectionType::Directory => self.is_dir(),
}
}
+ pub fn extension(&self) -> Option<&str> {
+ regex!(r"\.([^.]+)$")
+ .captures(&self.name)
+ .and_then(|c| c.get(1))
+ .map(|e| e.as_str())
+ }
pub fn selection_type(&self) -> SelectionType {
use TreeLineType::*;
match &self.line_type {
diff --git a/website/docs/conf_file.md b/website/docs/conf_file.md
index 44a0231..42110c6 100644
--- a/website/docs/conf_file.md
+++ b/website/docs/conf_file.md
@@ -97,3 +97,17 @@ cols_order = "gbpdscn"
```
The `n` column should be kept at end as it's the only one with a variable size.
+
+# Colors by file extension
+
+broot doesn't support `LS_COLORS` which isn't available on all systems and is limited to 16 system dependant colors.
+
+But you can still give a color to files by extension:
+
+```toml
+[ext-colors]
+png = "rgb(255, 128, 75)"
+rs = "yellow"
+toml = "ansi(105)"
+```
+
diff --git a/website/docs/export.md b/website/docs/export.md
index 98aa2c7..64d5a83 100644
--- a/website/docs/export.md
+++ b/website/docs/export.md
@@ -3,7 +3,7 @@ If you want to use the pruned tree out of broot (for example for a documentation
It can be used in several ways.
-The easiest is to just execute it from inside the application (the verb is also accessible with the `:pt` shortcut). This quits broot and you find the tree on your console, without the status line and the input, but with the same filtering state as when you were browsing.
+The easiest is to execute it from inside the application (the verb is also accessible with the `:pt` shortcut). This quits broot and you find the tree on your console, without the status line and the input, but with the same filtering state as when you were browsing.
Example with a filter:
@@ -28,7 +28,7 @@ For example
will export the local tree to the `my_file.txt` file.
-Or just
+Or
broot --no-style > tree.txt
diff --git a/website/docs/index.md b/website/docs/index.md
index c2a5590..bcd4410 100644
--- a/website/docs/index.md
+++ b/website/docs/index.md
@@ -20,7 +20,7 @@ That's what makes it usable where the old `tree` command would produce pages of
# Find a directory then `cd` to it
-just type a few letters
+type a few letters
![cd](img/20191112-cd.png)
@@ -103,9 +103,9 @@ You may also toggle options with a few keystrokes while inside broot. For exampl
# Sort, see what takes space:
-You may sort by launching broot with `--sort-by-size` or `--sort-by-date`. Or you may, inside broot, just type a space, then `sd`, and <kbd>enter</kbd> and you toggled the `:sort_by_date` mode.
+You may sort by launching broot with `--sort-by-size` or `--sort-by-date`. Or you may, inside broot, type a space, then `sd`, and <kbd>enter</kbd> and you toggled the `:sort_by_date` mode.
-When sorting, the whole content of directories is taken into account. So if you want to find on monday morning the most recently modified files, just launch `br --sort-by-date ~`.
+When sorting, the whole content of directories is taken into account. So if you want to find on monday morning the most recently modified files, launch `br --sort-by-date ~`.
If you start broot with the `--whale-spotting` option (or its shorcut `-w`), you get a mode tailored to "whale spotting" navigation, making it easy to determine what files or folders take space.
diff --git a/website/docs/input.md b/website/docs/input.md
index 7a63bd7..ec97ab6 100644
--- a/website/docs/input.md
+++ b/website/docs/input.md
@@ -50,7 +50,7 @@ The caracters you use as operators and the parenthesis can be useful in patterns
Most often you'll just type what feels natural and broot will select the interpretation which makes sense but you might be interested in a few rules:
-* parenthesis and operators in the second pattern part (parts being separated by `/`) are part of the pattern, which explains why `/(json|xml)` is interpreted as a regular expression. If you want to do a fuzzy search for a `|` in the name of your files, you'll need to either escape it as `\|` or to have an explicit pattern mode : `nf/a|b` because `a|b` would search for files whose name contains either `a` or `b`. And to ensure an operator or closing parenthesis isn't interpreted as part of your pattern, just close it with a `/`.
+* parenthesis and operators in the second pattern part (parts being separated by `/`) are part of the pattern, which explains why `/(json|xml)` is interpreted as a regular expression. If you want to do a fuzzy search for a `|` in the name of your files, you'll need to either escape it as `\|` or to have an explicit pattern mode : `nf/a|b` because `a|b` would search for files whose name contains either `a` or `b`. And to ensure an operator or closing parenthesis isn't interpreted as part of your pattern, close it with a `/`.
* broot interprets the left operand before the right one and doesn't interpret the second one if it's not necessary. So if you want to search your whole disk for json files containing `abcd`, it will be faster to use `/json$/&c/abcd` rather than `c/abcd/&/json$/` which would look at the file name only after having scanned the content.
## The verb invocation
diff --git a/website/docs/install.md b/website/docs/install.md
index 1bdc06e..d6c5155 100644
--- a/website/docs/install.md
+++ b/website/docs/install.md
@@ -73,7 +73,7 @@ When you start broot, it checks whether the `br` shell function seems to have be
to have been refused). If needed, and if the used shell seems compatible (supported shells today are bash, zsh and fish),
then broot asks the permission to register this shell function.
-When it's done, you can do just `br` to launch broot, and typing <kbd>alt</kbd><kbd>enter</kbd> will cd for you.
+When it's done, you can do `br` to launch broot, and typing <kbd>alt</kbd><kbd>enter</kbd> will cd for you.
## Retry the automatic installation
@@ -97,8 +97,6 @@ As a shortcut for [Nushell](https://www.nushell.sh/), define the following alias
alias br [] { broot | trim | cd $it }
-When it's done, you can do just `br` to launch broot, and typing `:pp` will cd for you.
-
You can bind this command to a key sequence in the [configuration file](../conf_file):
```toml
diff --git a/website/docs/launch.md b/website/docs/launch.md
index aefa8bb..363392d 100644
--- a/website/docs/launch.md
+++ b/website/docs/launch.md
@@ -65,7 +65,7 @@ For example if you launch
br --cmd cow /
-Then broot is launched in the `/` directory and there's simply a filter typed for you.
+Then broot is launched in the `/` directory and there's a filter typed for you.
If you do
diff --git a/website/docs/navigation.md b/website/docs/navigation.md
index 07cebab..0575067 100644
--- a/website/docs/navigation.md
+++ b/website/docs/navigation.md
@@ -30,7 +30,7 @@ and you can define your own [shorcuts](../conf_file/#shortcuts-and-verb-search)
The best way to navigate is by filtering the tree.
-This is done simply by typing a few letters.
+This is done by typing a few letters.
The pattern filters the tree while you type. It's interpreted in a fuzzy way so that you don't have to type all the letters or even consecutive letters. The best match is automatically selected.
@@ -100,7 +100,7 @@ This behavior is tuned with several toggles.
| toggle_sizes | sizes | toggle showing sizes
| toggle_trim_root | t | toggle removing nodes at first level too (default)
-To apply one, just type a space (or `:`), then the start of its shortcut, then hit <kbd class=b>⏎</kbd>.
+To apply one, type a space (or `:`), then the start of its shortcut, then hit <kbd class=b>⏎</kbd>.
For example typing `:s` then enter will show file and directory sizes:
diff --git a/website/docs/tricks.md b/website/docs/tricks.md
index 2f73a46..ed7c8ad 100644
--- a/website/docs/tricks.md
+++ b/website/docs/tricks.md
@@ -34,7 +34,7 @@ If you want to keep the filter, for example to search deeper, you may use `:open
## Run an script or program from broot
-If your system is normally configured, just doing `alt`-`enter` on an executable will close broot and executes the file.
+If your system is normally configured, doing `alt`-`enter` on an executable will close broot and executes the file.
## Change standard file opening