From d39c9a1fc656ed3b5555533f86bd135f787d4aa4 Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Thu, 27 May 2021 02:34:01 +0530 Subject: [PATCH] Fix Elvish install instructions --- README.md | 8 ++++---- man/zoxide-add.1 | 2 +- man/zoxide-import.1 | 2 +- man/zoxide-init.1 | 2 +- man/zoxide-query.1 | 4 ++-- man/zoxide-remove.1 | 2 +- man/zoxide.1 | 4 ++-- src/app/query.rs | 9 ++------- src/db/stream.rs | 1 - templates/elvish.txt | 2 +- 10 files changed, 15 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index bbc2cff..123fac2 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,10 @@ > A smarter cd command for your terminal [![crates.io][crates.io-badge]][crates.io] +[![releases][releases-badge]][Releases] `zoxide` is a blazing fast replacement for your `cd` command, inspired by -[`z`][z] and [`z.lua`][z.lua]. It keeps track of the directories you use most +`z` and `z.lua`. It keeps track of the directories you use most frequently, and uses a ranking algorithm to navigate to the best match. ![Tutorial][tutorial] @@ -115,7 +116,7 @@ eval "$(zoxide init bash)" Add this to your configuration (usually `~/.elvish/rc.elv`): ```sh -eval $(zoxide init elvish | slurp) +eval (zoxide init elvish | slurp) ``` #### `fish` @@ -260,6 +261,7 @@ Be sure to set these before calling `zoxide init`. [nnn]: https://github.com/jarun/nnn [pkgsrc]: https://pkgsrc.se/sysutils/zoxide [releases]: https://github.com/ajeetdsouza/zoxide/releases +[releases-badge]: https://img.shields.io/github/v/release/ajeetdsouza/zoxide [scoop]: https://github.com/ScoopInstaller/Main/tree/master/bucket/zoxide.json [telescope-zoxide]: https://github.com/jvgrootveld/telescope-zoxide [termux]: https://github.com/termux/termux-packages/tree/master/packages/zoxide @@ -268,7 +270,5 @@ Be sure to set these before calling `zoxide init`. [void linux packages]: https://github.com/void-linux/void-packages/tree/master/srcpkgs/zoxide [xxh-plugin-prerun-zoxide]: https://github.com/xxh/xxh-plugin-prerun-zoxide [xxh]: https://github.com/xxh/xxh -[z.lua]: https://github.com/skywind3000/z.lua -[z]: https://github.com/rupa/z [zoxide.vim]: https://github.com/nanotee/zoxide.vim [zsh-autocomplete]: https://github.com/marlonrichert/zsh-autocomplete diff --git a/man/zoxide-add.1 b/man/zoxide-add.1 index 20d0de1..707fca8 100644 --- a/man/zoxide-add.1 +++ b/man/zoxide-add.1 @@ -15,7 +15,7 @@ If you'd like to prevent a directory from being added to the database, see the .SH OPTIONS .TP .B -h, --help -Prints help information. +Print help information. .SH REPORTING BUGS For any issues, feature requests, or questions, please visit: .sp diff --git a/man/zoxide-import.1 b/man/zoxide-import.1 index de58470..d63a097 100644 --- a/man/zoxide-import.1 +++ b/man/zoxide-import.1 @@ -18,7 +18,7 @@ l l. algorithm is too different to import the scores. .TP .B -h, --help -Prints help information. +Print help information. .TP .B --merge By default, the import fails if the current database is not already empty. This diff --git a/man/zoxide-init.1 b/man/zoxide-init.1 index c38e011..2286443 100644 --- a/man/zoxide-init.1 +++ b/man/zoxide-init.1 @@ -82,7 +82,7 @@ Changes the prefix of predefined aliases (\fBz\fR, \fBzi\fR). e.g. --cmd j would change the aliases to j and ji respectively. .TP .B -h, --help -Prints help information. +Print help information. .TP .B --hook \fIHOOK\fR Changes how often zoxide increments a directory's score: diff --git a/man/zoxide-query.1 b/man/zoxide-query.1 index ff535be..33bd109 100644 --- a/man/zoxide-query.1 +++ b/man/zoxide-query.1 @@ -4,7 +4,7 @@ zoxide-query - search for a directory in the database .SH SYNOPSIS .B zoxide query \fI[KEYWORDS] [OPTIONS]\fR .SH DESCRIPTION -Queries the database for paths matching the keywords. The exact \fBMATCHING\fR +Query the database for paths matching the keywords. The exact \fBMATCHING\fR algorithm is described in \fBzoxide\fR(1). .SH OPTIONS .TP @@ -12,7 +12,7 @@ algorithm is described in \fBzoxide\fR(1). Show deleted directories. .TP .B -h, --help -Prints help information. +Print help information. .TP .B -i, --interactive Use interactive selection. This option requires fzf. diff --git a/man/zoxide-remove.1 b/man/zoxide-remove.1 index bc89b4f..f0f186e 100644 --- a/man/zoxide-remove.1 +++ b/man/zoxide-remove.1 @@ -9,7 +9,7 @@ If you'd like to permanently exclude a directory from the database, see the .SH OPTIONS .TP .B -h, --help -Prints help information. +Print help information. .TP .B -i, --interactive \fI[KEYWORDS]\fR Use interactive selection. This option requires fzf. diff --git a/man/zoxide.1 b/man/zoxide.1 index 54edce3..d38ac17 100644 --- a/man/zoxide.1 +++ b/man/zoxide.1 @@ -38,10 +38,10 @@ Remove a directory from the database. .SH OPTIONS .TP .B -h, --help -Prints help information. +Print help information. .TP .B -V, --version -Prints version information +Print version information. .SH ENVIRONMENT VARIABLES Environment variables must be set before calling \fBzoxide init\fR. .TP diff --git a/src/app/query.rs b/src/app/query.rs index 63e9569..d936e56 100644 --- a/src/app/query.rs +++ b/src/app/query.rs @@ -7,7 +7,7 @@ use crate::util; use anyhow::{Context, Result}; -use std::io::{self, BufWriter, Write}; +use std::io::{self, Write}; impl Run for Query { fn run(&self) -> Result<()> { @@ -39,13 +39,8 @@ impl Run for Query { print!("{}", path) } } else if self.list { - // Rust does line-buffering by default, i.e. it flushes stdout - // after every newline. This is not ideal when printing a large - // number of lines, so we put stdout in a BufWriter. let stdout = io::stdout(); - let stdout = stdout.lock(); - let mut handle = BufWriter::new(stdout); - + let handle = &mut stdout.lock(); while let Some(dir) = stream.next() { if self.score { writeln!(handle, "{}", dir.display_score(now)) diff --git a/src/db/stream.rs b/src/db/stream.rs index 3abab4a..fd642ea 100644 --- a/src/db/stream.rs +++ b/src/db/stream.rs @@ -91,7 +91,6 @@ impl<'db, 'file> Stream<'db, 'file> { } let resolver = if self.resolve_symlinks { fs::symlink_metadata } else { fs::metadata }; - resolver(path.as_ref()).map(|m| m.is_dir()).unwrap_or_default() } diff --git a/templates/elvish.txt b/templates/elvish.txt index 4a253ee..875f16c 100644 --- a/templates/elvish.txt +++ b/templates/elvish.txt @@ -83,4 +83,4 @@ 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)