Merge pull request #4 from alin23/master

Add fish integration
This commit is contained in:
Ajeet D'Souza 2020-03-08 23:54:45 +05:30 committed by GitHub
commit 842c03bd84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 0 deletions

View File

@ -78,6 +78,17 @@ alias zq="zoxide query"
alias zr="zoxide remove"
```
#### fish
Using [fisher](https://github.com/jorgebucaran/fisher):
```sh
fisher add ajeetdsouza/zoxide
```
Using [oh-my-fish](https://github.com/oh-my-fish/oh-my-fish):
```sh
omf install https://github.com/ajeetdsouza/zoxide
```
## Configuration
### Environment variables

13
functions/z.fish Normal file
View File

@ -0,0 +1,13 @@
function z
if test (count $argv) -gt 0
set _Z_RESULT (zoxide query $argv)
switch "$_Z_RESULT"
case 'query: *'
cd (string sub -s 8 -- "$_Z_RESULT")
commandline -f repaint
case '*'
echo -n "$_Z_RESULT"
end
end
end

8
init.fish Normal file
View File

@ -0,0 +1,8 @@
function zoxide-add --on-event fish_prompt
zoxide add
end
abbr -a zi "z -i"
abbr -a za "zoxide add"
abbr -a zq "zoxide query"
abbr -a zr "zoxide remove"