Skip to content

Commit

Permalink
Merge pull request #942 from alexis-opolka/config-delimiter
Browse files Browse the repository at this point in the history
Update documentation for #941 changes
  • Loading branch information
denisidoro authored Feb 14, 2025
2 parents 72b0d14 + 4fdd371 commit 90a29ed
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions docs/navi_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
- [Changing colors](#changing-colors)
- [Resizing columns](#resizing-columns)
- [Overriding fzf options](#overriding-fzf-options)
- [Defining your own delimiter](#defining-your-own-delimiter)


# Paths and Environment Variables

Expand Down Expand Up @@ -92,3 +94,30 @@ FZF_DEFAULT_OPTS="--height 3" navi
```

In addition, this can be set by properly configuring _navi_'s `config.yaml`. Please check `navi --help` for more instructions.

## Defining your own delimiter

Navi allows you to define your own delimiter to parse the selected result for a variable in your cheats.\
It is equivalent to defining `--delimiter` used with `--column`.

You can define it as such:

```yaml
finder:
delimiter_var: <your-regex-delimiter> ### By default the expression is \s\s+
```
> [!CAUTION]
> Defining the delimiter via the configuration file means that Navi will use this delimiter by default for
> every variable using the `--column` instruction.

You can override this configuration with the `--delimiter` instruction in the variable definition of your cheatsheet.

It can be overriden like this:

```yaml
echo <image_id>
$ image_id: ... --- --column 3 --header-lines 1 --delimiter '\s\s+' # <-- This variable uses \s\s+ as a delimiter
$ image_tag: ... --- --column 3 --header-lines 1 # <-- This variable uses the default delimiter
```

0 comments on commit 90a29ed

Please sign in to comment.