Skip to content

Commit

Permalink
* Add init subcommand for bash, fish, and zsh
Browse files Browse the repository at this point in the history
* Migrate errors from failure to anyhow
* Migrate argument parsing from clap to structopt
* Empty z command now goes to $HOME
* DB updates are now atomic and isolated
  • Loading branch information
ajeetdsouza committed Mar 10, 2020
1 parent 6d91b4e commit f0c5e28
Show file tree
Hide file tree
Showing 12 changed files with 434 additions and 388 deletions.
145 changes: 83 additions & 62 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "zoxide"
version = "0.1.1"
version = "0.2.0"
authors = ["Ajeet D'Souza <98ajeet@gmail.com>"]
description = "A cd command that learns your habits"
repository = "https://github.com/ajeetdsouza/zoxide/"
Expand All @@ -13,12 +13,13 @@ license = "MIT"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
anyhow = "1.0.26"
bincode = "1.2.1"
clap = "2.33.0"
dirs = "2.0.2"
failure = "0.1.7"
fs2 = "0.4.3"
serde = { version = "1.0.104", features = ["derive"] }
structopt = "0.3.11"

[profile.release]
codegen-units = 1
Expand Down
41 changes: 10 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

[![crates.io](https://img.shields.io/crates/v/zoxide)](https://crates.io/crates/zoxide)

![.github/workflows/release.yml](https://github.com/ajeetdsouza/zoxide/workflows/.github/workflows/release.yml/badge.svg)

A cd command that learns your habits

## Table of contents
Expand All @@ -12,6 +14,7 @@ A cd command that learns your habits
- [Installing `zoxide`](#installing-zoxide)
- [Adding `zoxide` to your shell](#adding-zoxide-to-your-shell)
- [zsh](#zsh)
- [bash](#bash)
- [fish](#fish)
- [Configuration](#configuration)
- [Environment variables](#environment-variables)
Expand Down Expand Up @@ -60,50 +63,26 @@ If you want the interactive fuzzy selection feature, you will also need to insta

#### zsh

Using [antibody](https://github.com/getantibody/antibody):
Add the following line to your `~/.zshrc`:

```sh
antibody bundle ajeetdsouza/zoxide
eval "$(zoxide init zsh)"
```

Using [zinit](https://github.com/zdharma/zinit):
#### bash

```sh
zinit light ajeetdsouza/zoxide
```

Using [antigen](https://github.com/zsh-users/antigen):
Add the following line to your `~/.bashrc`:

```sh
antigen bundle ajeetdsouza/zoxide
eval "$(zoxide init bash)"
```

Using [zgen](https://github.com/tarjoilija/zgen):

```sh
zgen load ajeetdsouza/zoxide
```

Using [zplug](https://github.com/zplug/zplug):

```sh
zplug "ajeetdsouza/zoxide"
```

If you'd rather not use a package manager, add the contents of [zoxide.plugin.zsh](zoxide.plugin.zsh) to your `.zshrc`.

#### 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):
Add the following line to your `~/.config/fish/config.fish`:

```sh
omf install https://github.com/ajeetdsouza/zoxide
zoxide init fish | source
```

## Configuration
Expand Down
13 changes: 0 additions & 13 deletions functions/z.fish

This file was deleted.

9 changes: 1 addition & 8 deletions init.fish
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
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"
zoxide init fish | source

0 comments on commit f0c5e28

Please sign in to comment.