docs: add post install instructions for zoxide
authorAjeet D'Souza <98ajeet@gmail.com>
Wed, 16 Jun 2021 20:08:14 +0000 (01:38 +0530)
committerAJ ONeal <aj@therootcompany.com>
Sun, 15 Aug 2021 03:50:50 +0000 (03:50 +0000)
zoxide/README.md
zoxide/install.sh

index 9de855f99c0d5b1c8fd3697b394bd0b7741f5187..4d0ab8bc84ac5fa075b699a0aa02288fa23bc332 100644 (file)
@@ -30,31 +30,31 @@ zi foo      # cd with interactive selection (requires fzf)
 
 To use zoxide, it needs to be first initialized on your shell:
 
-### bash
+### `bash`
 
-Add the following line to your configuration file (usually `~/.bashrc`):
+Add this to your configuration (usually `~/.bashrc`):
 
 ```sh
 eval "$(zoxide init bash)"
 ```
 
-### elvish
+### `elvish`
 
-Add the following line to your configuration file (usually `~/.elvish/rc.elv`):
+Add this to your configuration (usually `~/.elvish/rc.elv`):
 
 ```sh
-eval $(zoxide init elvish | slurp)
+eval (zoxide init elvish | slurp)
 ```
 
-### fish
+### `fish`
 
-Add the following line to your configuration file (usually `~/.config/fish/config.fish`):
+Add this to your configuration (usually `~/.config/fish/config.fish`):
 
 ```fish
 zoxide init fish | source
 ```
 
-### nushell
+### `nushell 0.32.0+`
 
 Initialize zoxide's Nushell script:
 
@@ -62,16 +62,18 @@ Initialize zoxide's Nushell script:
 zoxide init nushell --hook prompt | save ~/.zoxide.nu
 ```
 
-Then, in your Nushell configuration file:
+Add this to your configuration (usually `~/.config/nu/config.toml`):
 
-- Prepend `__zoxide_hook;` to the `prompt` variable.
-- Add the following lines to the `startup` variable:
-  - `zoxide init nushell --hook prompt | save ~/.zoxide.nu`
-  - `source ~/.zoxide.nu`
+```toml
+prompt = "__zoxide_hook;__zoxide_prompt"
+startup = ["zoxide init nushell --hook prompt | save ~/.zoxide.nu", "source ~/.zoxide.nu"]
+```
+
+You can replace `__zoxide_prompt` with a custom prompt.
 
-### powershell
+### `powershell`
 
-Add the following line to your profile:
+Add this to your configuration (the location is stored in `$profile`):
 
 ```powershell
 Invoke-Expression (& {
@@ -80,17 +82,17 @@ Invoke-Expression (& {
 })
 ```
 
-### xonsh
+### `xonsh`
 
-Add the following line to your configuration file (usually `~/.xonshrc`):
+Add this to your configuration (usually `~/.xonshrc`):
 
 ```python
 execx($(zoxide init xonsh), 'exec', __xonsh__.ctx, filename='zoxide')
 ```
 
-### zsh
+### `zsh`
 
-Add the following line to your configuration file (usually `~/.zshrc`):
+Add this to your configuration (usually `~/.zshrc`):
 
 ```sh
 eval "$(zoxide init zsh)"
@@ -98,7 +100,7 @@ eval "$(zoxide init zsh)"
 
 ### Any POSIX shell
 
-Add the following line to your configuration file:
+Add this to your configuration:
 
 ```sh
 eval "$(zoxide init posix --hook prompt)"
index 33127b3f25f4381c2bf3f8c780ef56f3a125807b..0c0c3cded34a4d219aeca6432cc1b58ec8b1504b 100644 (file)
@@ -36,6 +36,21 @@ function __init_zoxide() {
         zoxide --version 2>/dev/null | head -n 1 | cut -d '-' -f 1 | cut -b '9-'
     }
 
+    # shellcheck disable=SC2016
+    pkg_done_message() {
+        echo 'zoxide was installed successfully. Next, you'\''ll need to set it up on your shell:'
+        echo ''
+        echo '- For bash, add this line to ~/.bashrc:'
+        echo '    eval "$(zoxide init bash)"'
+        echo ''
+        echo '- For fish, add this line to ~/.config/fish/config.fish:'
+        echo '    zoxide init fish | source'
+        echo ''
+        echo '- For zsh, add this line to ~/.zshrc:'
+        echo '    eval "$(zoxide init zsh)"'
+        echo ''
+        echo '- For any other shell, see the instructions at https://github.com/ajeetdsouza/zoxide.'
+    }
 }
 
 __init_zoxide