Then apply the changes the installer prints, to set up your shell profile.
Then, [set up your shell for fnm](#shell-setup)
#### Using Cargo (Linux/Mac/Windows)
```bash
cargo install fnm
```
Then, [set up your shell for fnm](#shell-setup)
#### Using a release binary (Linux/Mac/Windows)
@ -78,55 +88,70 @@ Then apply the changes the installer prints, to set up your shell profile.
@@ -78,55 +88,70 @@ Then apply the changes the installer prints, to set up your shell profile.
- Make it available globally on `PATH` environment variable
- Configure your shell profile:
- For **Bash** or **Zsh** users, add the following to your `.bashrc`/`.zshrc` respectively:
## Completions
```bash
eval "$(fnm env)"
```
fnm ships its completions with the binary:
- For [**Fish Shell**](https://fishshell.com/) users, create `~/.config/fish/conf.d/fnm.fish` add this line to it:
```
fnm completions --shell <SHELL>
```
```fish
fnm env | source
```
Where `<SHELL>` can be one of the supported shells:
- For **PowerShell** users, add the following to the end of your profile file::
Please follow your shell instructions to install them.
- On Windows, the profile is located at `~\Documents\PowerShell\Microsoft.PowerShell_profile.ps1`
- For Mac/Linux, the profile is located at `~/.config/powershell/Microsoft.PowerShell_profile.ps1`
### Shell Setup
- For **WinCMD**, aka good old **Windows Command Prompt** or **Batch**, fnm is also supported but is not entirely covered. [You can set up a startup script](https://superuser.com/a/144348) and append the following line:
fnm needs to run some shell commands before you can start using it.
This is done by evaluating the output of `fnm env`. Check out the following guides for the shell you use:
```
FOR /f "tokens=*" %i IN ('fnm env --use-on-cd') DO CALL %i
```
#### Bash
#### Using Cargo (Linux/Mac/Windows)
add the following to your `.bashrc` profile:
```bash
cargo install fnm
eval "$(fnm env)"
```
## Completions
#### Zsh
fnm ships its completions with the binary:
add the following to your `.zshrc` profile:
```zsh
eval "$(fnm env)"
```
fnm completions --shell <SHELL>
#### Fish shell
create `~/.config/fish/conf.d/fnm.fish` add this line to it:
```fish
fnm env | source
```
Where `<SHELL>` can be one of the supported shells:
#### PowerShell
- `bash`
- `zsh`
- `fish`
- `powershell`
add the following to the end of your profile file::
Please follow your shell instructions to install them.