Skip to content

Commit

Permalink
docs: arch instructions w pacman (#960)
Browse files Browse the repository at this point in the history
  • Loading branch information
jthegedus committed May 26, 2021
1 parent 75d5589 commit 24ff458
Showing 1 changed file with 270 additions and 16 deletions.
286 changes: 270 additions & 16 deletions docs/core-manage-asdf.md
Expand Up @@ -87,6 +87,18 @@ To use the latest changes, you can point Homebrew to the master branch of the re
brew install asdf --HEAD
```

### --Pacman--

Install using `pacman`:

```shell
git clone https://aur.archlinux.org/asdf-vm.git
cd asdf-vm
makepkg -si
```

Or use your preferred [AUR helper](https://wiki.archlinux.org/index.php/AUR_helpers)

<!-- select:end -->

### Add to your Shell
Expand Down Expand Up @@ -147,6 +159,36 @@ compinit

!> if you are using a ZSH Framework the associated `asdf` plugin may need to be updated to use the new ZSH completions properly via `fpath`. The Oh-My-ZSH asdf plugin is yet to be updated, see https://github.com/ohmyzsh/ohmyzsh/pull/8837.

#### --Linux,Bash,Pacman--

Add the following to `~/.bashrc`:

```shell
. /opt/asdf-vm/asdf.sh
```

?> [`bash-completion` needs to be installed for the completions to work](https://wiki.archlinux.org/title/bash#Common_programs_and_options)

#### --Linux,Fish,Pacman--

Add the following to `~/.config/fish/config.fish`:

```shell
source /opt/asdf-vm/asdf.sh
```

!> Completions are automatically configured on installation by the AUR package.

#### --Linux,ZSH,Pacman--

Add the following to `~/.zshrc`:

```shell
. /opt/asdf-vm/asdf.sh
```

?> Completions are placed in a ZSH friendly location, but [ZSH must be configured to use the autocompletions](https://wiki.archlinux.org/index.php/zsh#Command_completion).

#### --macOS,Bash,Git--

If using **macOS Catalina or newer**, the default shell has changed to **ZSH**. Unless changing back to Bash, follow the ZSH instructions.
Expand Down Expand Up @@ -235,10 +277,10 @@ Add `asdf.sh` to your `~/.zshrc` with:
```shell
echo -e "\n. $(brew --prefix asdf)/asdf.sh" >> ${ZDOTDIR:-~}/.zshrc
```
**OR** use a ZSH Framework plugin like [asdf for oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/asdf) which will source this script and setup completions.

?> Completions are configured by either a ZSH Framework `asdf` or will need to be [configured as per Homebrew's instructions](https://docs.brew.sh/Shell-Completion#configuring-completions-in-zsh). If you are using a ZSH Framework the associated asdf plugin may need to be updated to use the new ZSH completions properly via fpath. The Oh-My-ZSH asdf plugin is yet to be updated, see [ohmyzsh/ohmyzsh#8837](https://github.com/ohmyzsh/ohmyzsh/pull/8837).
**OR** use a ZSH Framework plugin like [asdf for oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/asdf) which will source this script and setup completions.

?> Completions are configured by either a ZSH Framework `asdf` or will need to be [configured as per Homebrew's instructions](https://docs.brew.sh/Shell-Completion#configuring-completions-in-zsh). If you are using a ZSH Framework the associated asdf plugin may need to be updated to use the new ZSH completions properly via fpath. The Oh-My-ZSH asdf plugin is yet to be updated, see [ohmyzsh/ohmyzsh#8837](https://github.com/ohmyzsh/ohmyzsh/pull/8837).

### --Docsify Select Default--

Expand All @@ -255,7 +297,6 @@ You are ready to use asdf 🎉

If you're having issues with your shell not detecting newly installed shims, it's most-likely due to the sourcing of `asdf.sh` or `asdf.fish` not being at the **BOTTOM** of your `.bash_profile`, `.zshrc`, `config.fish` config file. It needs to be sourced **AFTER** you have set your `$PATH` and **AFTER** you have sourced your framework (oh-my-zsh etc).


### Migrating Tools

If you're migrating from other tools and want to use your existing version files (eg: `.node-version` or `.ruby-version`), look at the `legacy_version_file` [flag in the configuration section](core-configuration?id=homeasdfrc).
Expand Down Expand Up @@ -283,29 +324,242 @@ asdf update --head
brew upgrade asdf
```

### -- Pacman --

Manually download a new `PKGBUILD` and rebuild or use your preferred AUR helper.

<!-- select:end -->

## Remove

Uninstalling `asdf` is as simple as:
To uninstall `asdf` follow these steps:

<!-- select:start -->
<!-- select-menu-labels: Operating System,Shell,Installation Method -->

### --Linux,Bash,Git--

1. In your `~/.bashrc` remove the lines that source `asdf.sh` and the completions:

```shell
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
```

2. Remove the `$HOME/.asdf` dir:

```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```

### --Linux,Fish,Git--

1. In your `~/.config/fish/config.fish` remove the lines that source `asdf.sh`:

```shell
source ~/.asdf/asdf.fish
```

and remove completions with this command:

```shell
rm -rf ~/.config/fish/completions/asdf.fish
```

2. Remove the `$HOME/.asdf` dir:

```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```

### --Linux,ZSH,Git--

1. In your `~/.zshrc` remove the lines that source `asdf.sh` and completions:

```shell
. $HOME/.asdf/asdf.sh
# ...
fpath=(${ASDF_DIR}/completions $fpath)
autoload -Uz compinit
compinit
```

**OR** the ZSH Framework plugin if used.

2. Remove the `$HOME/.asdf` dir:

```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```

### --Linux,Bash,Pacman--

1. In your `~/.bashrc` remove the lines that source `asdf.sh` and the completions:

```shell
. /opt/asdf-vm/asdf.sh
```

2. Uninstall with your package manager:

```shell
pacman -Rs asdf-vm
```

3. Remove the `$HOME/.asdf` dir:

```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```

### --Linux,Fish,Pacman--

1. In your `~/.config/fish/config.fish` remove the lines that source `asdf.fish`:

```shell
source /opt/asdf-vm/asdf.fish
```

2. Uninstall with your package manager:

```shell
pacman -Rs asdf-vm
```

3. Remove the `$HOME/.asdf` dir:

```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```

### --Linux,ZSH,Pacman--

1. In your `~/.zshrc` remove the lines that source `asdf.sh`:

```shell
. /opt/asdf-vm/asdf.sh
```

2. Uninstall with your package manager:

```shell
pacman -Rs asdf-vm
```

3. Remove the `$HOME/.asdf` dir:

```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```

### --macOS,Bash,Git--

1. In your `~/.bash_profile` remove the lines that source `asdf.sh` and the completions:

```shell
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
```

2. Remove the `$HOME/.asdf` dir:

```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```

### --macOS,Fish,Git--

1. In your `~/.config/fish/config.fish` remove the lines that source `asdf.fish`:

```shell
source ~/.asdf/asdf.fish
```

and remove completions with this command:

```shell
rm -rf ~/.config/fish/completions/asdf.fish
```

2. Remove the `$HOME/.asdf` dir:

1. In your `.bashrc`/`.bash_profile`/`.zshrc`/`config.fish` find the lines that source `asdf.sh` and the completions (this may be a ZSH Framework plugin). In Bash, the lines look something like this:
```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```

### --macOS,ZSH,Git--

```shell
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
```
1. In your `~/.zshrc` remove the lines that source `asdf.sh` and completions:

```shell
. $HOME/.asdf/asdf.sh
# ...
fpath=(${ASDF_DIR}/completions $fpath)
autoload -Uz compinit
compinit
```

Remove these lines and save the file.
**OR** the ZSH Framework plugin if used.

2. Run
2. Remove the `$HOME/.asdf` dir:

```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf} ~/.tool-versions
```
```shell
rm -rf ${ASDF_DATA_DIR:-$HOME/.asdf}
```

### --macOS,Bash,Homebrew--

If using **macOS Catalina or newer**, the default shell has changed to **ZSH**. If you can't find any config in your `~/.bash_profile` it may be in a `~/.zshrc` in which case please follow the ZSH instructions.

1. In your `~/.bash_profile` remove the lines that source `asdf.sh` and the completions:

```shell
. $(brew --prefix asdf)/asdf.sh
. $(brew --prefix asdf)/etc/bash_completion.d/asdf.bash
```

?> Completions may have been [configured as per Homebrew's instructions](https://docs.brew.sh/Shell-Completion#configuring-completions-in-bash) so follow their guide to find out what to remove.

2. Uninstall with your package manager:

```shell
brew uninstall asdf --force
```

to completely remove all the asdf files from your system.
### --macOS,Fish,Homebrew--

3. _(Optional)_ If you installed asdf using a package manager, you may want to use that package manager to uninstall the core asdf files.
1. In your `~/.config/fish/config.fish` remove the lines that source `asdf.fish`:

```shell
source "(brew --prefix asdf)"/asdf.fish
```

2. Uninstall with your package manager:

```shell
brew uninstall asdf --force
```

### --macOS,ZSH,Homebrew--

1. In your `~/.zshrc` remove the lines that source `asdf.sh`:

```shell
. $(brew --prefix asdf)/asdf.sh
```

2. Uninstall with your package manager:

```shell
brew uninstall asdf --force
```

<!-- select:end -->

3. Run this command to remove all `asdf` config files:

```shell
rm -rf $HOME/.tool-versions $HOME/.asdfrc
```

That's it! 🎉

0 comments on commit 24ff458

Please sign in to comment.