Skip to content

Commit

Permalink
chore: Add installation instructions for zsh
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Weiler committed Nov 6, 2024
1 parent add06c7 commit efc4dfb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,33 @@ Add the following line to your `.bashrc` (Linux) or `.bash_profile` (macOS) to i
. "$HOME/.up/up"
```

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

```sh
. "$HOME/.up/completion/bash/up"
```

### git & zsh

TBD
Clone `up`'s git repository.

```sh
git clone https://github.com/helpermethod/up ~/.up
```

Add the following line to your `.zshrc` to install `up`.

```
. "$HOME/.up/up"
```

Add the following lines to your `.zshrc` to enable `up`'s shell completion.

```sh
autoload -U +X compinit && compinit
autoload -U +X bashcompinit && bashcompinit
. "$HOME/.up/completion/bash/up"
```

## Usage

Expand Down
4 changes: 3 additions & 1 deletion completion/bash/up
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ _up() {
local -r pwd_without_leading_slash=${PWD:1}

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

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

Expand Down

0 comments on commit efc4dfb

Please sign in to comment.