From a5369beaa4a3d0fa69dbc38850890b0c03f82497 Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Mon, 16 Mar 2020 00:06:06 +0530 Subject: [PATCH] Prepare for release v0.2.1 --- Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 16 +++++++++++++++- src/main.rs | 2 -- src/types.rs | 1 - 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 360011a..b62eb82 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -369,7 +369,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "zoxide" -version = "0.2.0" +version = "0.2.1" dependencies = [ "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 64df538..a19e022 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zoxide" -version = "0.2.0" +version = "0.2.1" authors = ["Ajeet D'Souza <98ajeet@gmail.com>"] description = "A cd command that learns your habits" repository = "https://github.com/ajeetdsouza/zoxide/" diff --git a/README.md b/README.md index 482bff8..bcc2122 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ A cd command that learns your habits - [bash](#bash) - [fish](#fish) - [Configuration](#configuration) + - [`init` flags](#init-flags) - [Environment variables](#environment-variables) ## Introduction @@ -60,7 +61,11 @@ If you want the interactive fuzzy selection feature, you will also need to insta ### Step 2: Adding `zoxide` to your shell -By default, `zoxide` defines the `z`, `zi`, `za`, `zq`, and `zr` aliases. If you'd like to go with just the barebones `z`, pass the `--no-define-aliases` flag to `zoxide init`. +If you currently use `z`, `z.lua`, or `zsh-z`, you may want to first migrate your existing database to `zoxide`: + +```sh +zoxide migrate /path/to/db +``` #### zsh @@ -88,7 +93,16 @@ zoxide init fish | source ## Configuration +### `init` flags + +- `--no-define-aliases`: don't define extra aliases like `zi`, `zq`, `za`, and `zr` +- `--hook `: change the event that adds a new entry to the database (default: `prompt`) + - `none`: never add entries - this will make `zoxide` useless unless you manually configure a hook + - `prompt`: add an entry at every prompt + - `pwd`: add an entry whenever you change directories + ### Environment variables +- `$_ZO_ECHO`: `z` will print the matched directory before navigating to it - `$_ZO_DATA`: sets the location of the database (default: `~/.zo`) - `$_ZO_MAXAGE`: sets the maximum total rank after which entries start getting deleted diff --git a/src/main.rs b/src/main.rs index d4a9dc7..78a7a00 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,8 +9,6 @@ use crate::env::Env; use anyhow::{Context, Result}; use structopt::StructOpt; -// TODO: use structopt to parse env variables: - #[derive(Debug, StructOpt)] #[structopt(about = "A cd command that learns your habits")] enum Zoxide { diff --git a/src/types.rs b/src/types.rs index dbdaf8d..1ddffd1 100644 --- a/src/types.rs +++ b/src/types.rs @@ -1,3 +1,2 @@ -// TODO: convert these to newtypes pub use f64 as Rank; pub use i64 as Epoch; // use a signed integer so subtraction can be performed on it