From 58425dad65d0b48663b80056d72737a1642ea30d Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Mon, 8 Mar 2021 01:15:26 -0800 Subject: [PATCH 1/3] Improve Fish installation instructions Most notably, this adds instructions of changing $_Z_CD. I think many `fish` users would find them useful. See https://github.com/skywind3000/z.lua/pull/131 for more background. This makes the installation instructions more conventional (`|source` instead of `psub`). This also deletes the second (equivalent) set of instructions. If the warning in that sentence is important, we could add it back, but it would apply to all the shells, wouldn't it? Finally, some wording is improved. --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 04f769b..c916b71 100644 --- a/README.md +++ b/README.md @@ -105,17 +105,17 @@ z -b foo # cd to the parent directory starting with foo To generate old posix compatible script. -- Fish Shell: +- Fish Shell (version `2.4.0` or above): Create `~/.config/fish/conf.d/z.fish` with following code - source (lua /path/to/z.lua --init fish | psub) - - Fish version `2.4.0` or above is required. + lua /path/to/z.lua --init fish | source + + If you'd like `z.lua` to cooperate with fish's own [directory history](https://fishshell.com/docs/3.2/index.html#id34), you can put - lua /path/to/z.lua --init fish > ~/.config/fish/conf.d/z.fish + set -gx _ZL_CD cd - This is another way to initialize z.lua in fish shell, but remember to regenerate z.fish if z.lua has been updated or moved. + into the same file. - Power Shell: From 695533cee16095ef6dcd12b621a838c76c274c7a Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Mon, 8 Mar 2021 01:17:50 -0800 Subject: [PATCH 2/3] Fixup --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c916b71..b7d4dd1 100644 --- a/README.md +++ b/README.md @@ -109,8 +109,8 @@ z -b foo # cd to the parent directory starting with foo Create `~/.config/fish/conf.d/z.fish` with following code - lua /path/to/z.lua --init fish | source - + lua /path/to/z.lua --init fish | source + If you'd like `z.lua` to cooperate with fish's own [directory history](https://fishshell.com/docs/3.2/index.html#id34), you can put set -gx _ZL_CD cd From a01b28a8d3495920e7095251e04edcd85e484a9a Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Mon, 8 Mar 2021 01:26:22 -0800 Subject: [PATCH 3/3] Fixup #2 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b7d4dd1..c3da9a9 100644 --- a/README.md +++ b/README.md @@ -268,7 +268,7 @@ To enable this, you can set `$_ZL_ADD_ONCE` to `1` before init z.lua. Or you can ````bash eval "$(lua /path/to/z.lua --init bash once)" eval "$(lua /path/to/z.lua --init zsh once)" -source (lua /path/to/z.lua --init fish once | psub) +lua /path/to/z.lua --init fish once | source ```` With `add once` mode off (default), z.lua will consider the time you spent in the directory (like z.sh). When this mode is on, consider the times you accessed the directory (like autojump), and that could be much faster on slow hardware.