mirror of
https://github.com/starship/starship.git
synced 2026-06-23 02:05:51 +07:00
feat(directory): Add directory substitutions (#1183)
Adds an option to provide a table of strings to substitute in the directory string. Fixes #1065. Co-authored-by: Radu Butoi <butoi@google.com>
This commit is contained in:
@@ -399,9 +399,19 @@ it would have been `nixpkgs/pkgs`.
|
||||
|
||||
| Variable | Default | Description |
|
||||
| --------------------------- | ------- | ---------------------------------------------------------------------------------------- |
|
||||
| `substitutions` | | A table of substitutions to be made to the path. |
|
||||
| `fish_style_pwd_dir_length` | `0` | The number of characters to use when applying fish shell pwd path logic. |
|
||||
| `use_logical_path` | `true` | Displays the logical path provided by the shell (`PWD`) instead of the path from the OS. |
|
||||
|
||||
`substitutions` allows you to define arbitrary replacements for literal strings that occur in the path, for example long network
|
||||
prefixes or development directories (i.e. Java). Note that this will disable the fish style PWD.
|
||||
|
||||
```toml
|
||||
[directory.substitutions]
|
||||
"/Volumes/network/path" = "/net"
|
||||
"src/com/long/java/path" = "mypath"
|
||||
```
|
||||
|
||||
`fish_style_pwd_dir_length` interacts with the standard truncation options in a way that can be surprising at first: if it's non-zero,
|
||||
the components of the path that would normally be truncated are instead displayed with that many characters. For example, the path
|
||||
`/built/this/city/on/rock/and/roll`, which would normally be displayed as as `rock/and/roll`, would be displayed as
|
||||
|
||||
Reference in New Issue
Block a user