feat: Add ability to use an alternate directory truncation style (#239)

* Add ability to use an alternate directory truncation style
This commit is contained in:
Neil Kistner
2019-08-26 20:52:45 -05:00
committed by Matan Kushner
parent 81ea165cec
commit e034253a5e
3 changed files with 231 additions and 14 deletions
+13 -4
View File
@@ -178,13 +178,22 @@ The `directory` module shows the path to your current directory, truncated to
three parent folders. Your directory will also be truncated to the root of the
git repo that you're currently in.
When using the fish style pwd option, instead of hiding the path that is
truncated, you will see a shortened name of each directory based on the number
you enable for the option.
For example, given `~/Dev/Nix/nixpkgs/pkgs` where `nixpkgs` is the repo root,
and the option set to `1`. You will now see `~/D/N/nixpkgs/pkgs`, whereas before
it would have been `nixpkgs/pkgs`.
### Options
| Variable | Default | Description |
| ------------------- | ------- | -------------------------------------------------------------------------------- |
| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. |
| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. |
| `disabled` | `false` | Disables the `directory` module. |
| `truncation_length` | `3` | The number of parent folders that the current directory should be truncated to. |
| `truncate_to_repo` | `true` | Whether or not to truncate to the root of the git repo that you're currently in. |
| `disabled` | `false` | Disables the `directory` module. |
| `fish_style_pwd_dir_length` | `0` | The number of characters to use when applying fish shell pwd path logic. |
### Example
@@ -515,4 +524,4 @@ disabled = true
use_name = true
impure_msg = "impure shell"
pure_msg = "pure shell"
```
```