Compare commits

...

4 Commits

Author SHA1 Message Date
phanium 7411ecdb0d
Merge 72c0b59723 into 194f8e31e4 2025-10-15 11:20:44 +02:00
Ajeet D'Souza 194f8e31e4
Update README.md 2025-10-03 02:59:45 +05:30
Ajeet D'Souza eb7b08fed3
Update README.md 2025-09-30 18:34:43 +05:30
phanium 72c0b59723 Support bulk edit 2024-04-25 19:11:21 +08:00
3 changed files with 17 additions and 14 deletions

View File

@ -12,12 +12,12 @@
<sup>Special thanks to:</sup>
<!-- markdownlint-disable-next-line MD013 -->
<div><img alt="Sponsored by Warp" width="230" src="https://raw.githubusercontent.com/warpdotdev/brand-assets/refs/heads/main/Github/Sponsor/Warp-Github-LG-03.png" /></div>
<div><a href="https://go.warp.dev/zoxide"><img alt="Sponsored by Warp" width="230" src="https://raw.githubusercontent.com/warpdotdev/brand-assets/refs/heads/main/Github/Sponsor/Warp-Github-LG-03.png" /></a></div>
<div><sup><b>Warp, built for coding with multiple AI agents.</b></sup></div>
<div><sup>Available for macOS, Linux, and Windows.</sup></div>
<div><sup>
Visit
<a href="https://www.warp.dev/?utm_source=github&utm_medium=referral&utm_campaign=zoxide_20231001"><u>warp.dev</u></a>
<a href="https://go.warp.dev/zoxide"><u>warp.dev</u></a>
to learn more.
</sup></div>

View File

@ -79,11 +79,11 @@ pub struct Edit {
#[derive(Clone, Debug, Subcommand)]
pub enum EditCommand {
#[clap(hide = true)]
Decrement { path: String },
Decrement { paths: Vec<String> },
#[clap(hide = true)]
Delete { path: String },
Delete { paths: Vec<String> },
#[clap(hide = true)]
Increment { path: String },
Increment { paths: Vec<String> },
#[clap(hide = true)]
Reload,
}

View File

@ -15,11 +15,15 @@ impl Run for Edit {
match &self.cmd {
Some(cmd) => {
match cmd {
EditCommand::Decrement { path } => db.add(path, -1.0, now),
EditCommand::Delete { path } => {
EditCommand::Decrement { paths } => paths.iter().for_each(|path| {
db.add(path, -1.0, now);
}),
EditCommand::Delete { paths } => paths.iter().for_each(|path| {
db.remove(path);
}),
EditCommand::Increment { paths } => {
paths.iter().for_each(|path| db.add(path, 1.0, now))
}
EditCommand::Increment { path } => db.add(path, 1.0, now),
EditCommand::Reload => {}
}
db.save()?;
@ -50,17 +54,16 @@ impl Edit {
// Search result
"--no-sort",
// Interface
"--multi",
"--bind=\
btab:up,\
ctrl-r:reload(zoxide edit reload),\
ctrl-d:reload(zoxide edit delete {2..}),\
ctrl-w:reload(zoxide edit increment {2..}),\
ctrl-s:reload(zoxide edit decrement {2..}),\
ctrl-d:reload(zoxide edit delete {+2..}),\
ctrl-w:reload(zoxide edit increment {+2..}),\
ctrl-s:reload(zoxide edit decrement {+2..}),\
ctrl-z:ignore,\
double-click:ignore,\
enter:abort,\
start:reload(zoxide edit reload),\
tab:down",
start:reload(zoxide edit reload)",
"--cycle",
"--keep-right",
// Layout