mirror of
https://github.com/Llewellynvdm/zoxide.git
synced 2024-12-28 20:12:38 +00:00
Fixes for elvish 0.16.0 (#255)
This commit is contained in:
parent
bc57339473
commit
6be3998bb6
@ -7,6 +7,13 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## Unreleased
|
||||
|
||||
### Fixed
|
||||
|
||||
- Elvish: unable to `z` into directories by path.
|
||||
- Elvish: don't show traceback when `z` or `zi` fails.
|
||||
|
||||
## [0.7.4] - 2020-08-15
|
||||
|
||||
### Fixed
|
||||
|
@ -149,6 +149,8 @@ Add this to your configuration (usually `~/.elvish/rc.elv`):
|
||||
eval (zoxide init elvish | slurp)
|
||||
```
|
||||
|
||||
Note that zoxide only supports elvish v0.16.0+.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
@ -163,7 +165,7 @@ zoxide init fish | source
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><code>nushell v0.33+</code></summary>
|
||||
<summary><code>nushell</code></summary>
|
||||
|
||||
Add this to your configuration (find it by running `config path` in Nushell):
|
||||
|
||||
@ -172,7 +174,8 @@ 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.
|
||||
You can replace `__zoxide_prompt` with a custom prompt. Note that zoxide only
|
||||
supports Nushell v0.33.0+.
|
||||
|
||||
</details>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
let
|
||||
rust = import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/ad311f5bb5c5ef475985f1e0f264e831470a8510.tar.gz");
|
||||
pkgs = import <nixpkgs> { overlays = [ rust ]; };
|
||||
pkgs-latest = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/1359293549af4f8ca536716d0432f3cdd0afe0c6.tar.gz") {};
|
||||
pkgs-latest = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/b4692e4197869c42c46d77e31af7e687e1892f55.tar.gz") {};
|
||||
pkgs-python = pkgs-latest.python3.withPackages (pkgs: [ pkgs.black pkgs.mypy pkgs.pylint ]);
|
||||
in
|
||||
pkgs.mkShell {
|
||||
|
@ -49,17 +49,29 @@ fn __zoxide_z [@rest]{
|
||||
__zoxide_cd ~
|
||||
} elif (builtin:eq [-] $rest) {
|
||||
__zoxide_cd (builtin:get-env __zoxide_oldpwd)
|
||||
} elif (and (builtin:eq (builtin:count $rest) 1) (path:is-dir $rest[0])) {
|
||||
} elif (and ('builtin:==' (builtin:count $rest) 1) (path:is-dir &follow-symlink=$true $rest[0])) {
|
||||
__zoxide_cd $rest[0]
|
||||
} else {
|
||||
__zoxide_cd (zoxide query --exclude $pwd -- $@rest)
|
||||
var path
|
||||
try {
|
||||
path = (zoxide query --exclude $pwd -- $@rest)
|
||||
} except {
|
||||
} else {
|
||||
__zoxide_cd $path
|
||||
}
|
||||
}
|
||||
}
|
||||
edit:add-var __zoxide_z~ $__zoxide_z~
|
||||
|
||||
# Jump to a directory using interactive search.
|
||||
fn __zoxide_zi [@rest]{
|
||||
__zoxide_cd (zoxide query -i -- $@rest)
|
||||
var path
|
||||
try {
|
||||
path = (zoxide query -i -- $@rest)
|
||||
} except {
|
||||
} else {
|
||||
__zoxide_cd $path
|
||||
}
|
||||
}
|
||||
edit:add-var __zoxide_zi~ $__zoxide_zi~
|
||||
|
||||
@ -83,4 +95,6 @@ edit:add-var zi~ $__zoxide_zi~
|
||||
# To initialize zoxide, add this to your configuration (usually
|
||||
# ~/.elvish/rc.elv):
|
||||
#
|
||||
# eval (zoxide init elvish | slurp)
|
||||
# eval (zoxide init elvish | slurp)
|
||||
#
|
||||
# Note that zoxide only supports elvish v0.16.0+.
|
||||
|
@ -101,4 +101,5 @@ alias {{cmd}}i = __zoxide_zi
|
||||
# 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.
|
||||
# You can replace __zoxide_prompt with a custom prompt. Note that zoxide only
|
||||
# supports Nushell v0.33.0+.
|
||||
|
Loading…
Reference in New Issue
Block a user