mirror of
https://github.com/b-ryan/powerline-shell.git
synced 2026-09-10 07:26:28 -04:00
"cwd": { "mode": "compact" }
This commit is contained in:
parent
3e025e2947
commit
a7f17f2dc4
|
|
@ -217,8 +217,9 @@ for the `cwd` segment are set in `~/.powerline-shell.py` like:
|
|||
The options for the `cwd` segment are:
|
||||
|
||||
- `mode`: If "plain" then simple text will be used to show the cwd. If
|
||||
"dironly," only the current directory will be shown. Otherwise expands the
|
||||
cwd into individual directories.
|
||||
"dironly," only the current directory will be shown. If "compact",
|
||||
simple text is used but is shortened according to "max_depth" and
|
||||
"max_dir_size". Otherwise expands the cwd into individual directories.
|
||||
- `max_depth`: Maximum number of directories to show in path
|
||||
- `max_dir_size`: Maximum number of characters displayed for each directory in
|
||||
the path
|
||||
|
|
|
|||
|
|
@ -83,6 +83,10 @@ def add_cwd_segment(powerline):
|
|||
# displayed, so chop everything else off
|
||||
names = names[-1:]
|
||||
|
||||
if powerline.segment_conf("cwd", "mode") == "compact":
|
||||
# Like plain but uses max_depth.
|
||||
names = [os.path.join(*names)]
|
||||
|
||||
for i, name in enumerate(names):
|
||||
is_last_dir = (i == len(names) - 1)
|
||||
fg, bg = get_fg_bg(powerline, name, is_last_dir)
|
||||
|
|
|
|||
Loading…
Reference in a new issue