Fix Elvish install instructions

This commit is contained in:
Ajeet D'Souza 2021-05-27 02:34:01 +05:30
parent b8bb6f0f85
commit d39c9a1fc6
10 changed files with 15 additions and 21 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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:

View File

@ -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.

View File

@ -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.

View File

@ -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

View File

@ -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))

View File

@ -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()
}

View File

@ -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)