Skip to content

Commit efc4dfb

Browse files
author
Oliver Weiler
committed
chore: Add installation instructions for zsh
1 parent add06c7 commit efc4dfb

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,33 @@ Add the following line to your `.bashrc` (Linux) or `.bash_profile` (macOS) to i
2929
. "$HOME/.up/up"
3030
```
3131

32-
Add the following line to your `.bashrc` (Linux) or `.bash_profile` (macOS) to enable `up`'s Bash completion.
32+
Add the following line to your `.bashrc` (Linux) or `.bash_profile` (macOS) to enable `up`'s shell completion.
3333

3434
```sh
3535
. "$HOME/.up/completion/bash/up"
3636
```
3737

3838
### git & zsh
3939

40-
TBD
40+
Clone `up`'s git repository.
41+
42+
```sh
43+
git clone https://github.com/helpermethod/up ~/.up
44+
```
45+
46+
Add the following line to your `.zshrc` to install `up`.
47+
48+
```
49+
. "$HOME/.up/up"
50+
```
51+
52+
Add the following lines to your `.zshrc` to enable `up`'s shell completion.
53+
54+
```sh
55+
autoload -U +X compinit && compinit
56+
autoload -U +X bashcompinit && bashcompinit
57+
. "$HOME/.up/completion/bash/up"
58+
```
4159

4260
## Usage
4361

completion/bash/up

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ _up() {
55
local -r pwd_without_leading_slash=${PWD:1}
66

77
local basenames=()
8-
IFS=/ read -r -a basenames <<<"${pwd_without_leading_slash%/*}"
8+
while IFS= read -r -d/; do
9+
basenames+=("$REPLY")
10+
done <<<"$pwd_without_leading_slash"
911

1012
[[ $PWD != / ]] && basenames+=(/)
1113

0 commit comments

Comments
 (0)