From f709cd45484ff7a451414fcd53bca8529323512d Mon Sep 17 00:00:00 2001 From: "ohmyzsh[bot]" <54982679+ohmyzsh[bot]@users.noreply.github.com> Date: Sun, 15 Sep 2024 08:16:50 +0200 Subject: [PATCH] feat(wd): update to 7054de2b (#12675) Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com> --- .github/dependencies.yml | 2 +- plugins/wd/README.md | 17 +++++++---------- plugins/wd/wd.plugin.zsh | 3 +-- plugins/wd/wd.sh | 14 +++----------- 4 files changed, 12 insertions(+), 24 deletions(-) diff --git a/.github/dependencies.yml b/.github/dependencies.yml index be2d02cd8..2be4cdfb0 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -28,7 +28,7 @@ dependencies: plugins/wd: repo: mfaerevaag/wd branch: master - version: tag:v0.7.1 + version: tag:v0.9.0 precopy: | set -e rm -r test diff --git a/plugins/wd/README.md b/plugins/wd/README.md index bf19031f8..b345d65f5 100644 --- a/plugins/wd/README.md +++ b/plugins/wd/README.md @@ -115,9 +115,11 @@ wd() { 3. Install manpage (optional): +Move manpage into an appropriate directory, then trigger `mandb` to discover it + ```zsh -sudo cp ~/.local/wd/wd.1 /usr/share/man/man1/wd.1 -sudo chmod 644 /usr/share/man/man1/wd.1 +sudo install -m 644 ~/.local/wd/wd.1 /usr/share/man/man1/wd.1 +sudo mandb /usr/share/man/man1 ``` **Note:** when pulling and updating `wd`, you'll need to repeat step 3 should the manpage change @@ -139,10 +141,11 @@ rm -f ~/.zcompdump; compinit ## Browse -If you want to make use of the `fzf`-powered browse feature to fuzzy search through all your warp points, set up a keybind in your `.zshrc`: +`wd` comes with an `fzf`-powered browse feature to fuzzy search through all your warp points. It's available through the `wd browse` command. For quick access you can set up an alias or keybind in your `.zshrc`: ```zsh -bindkey ${FZF_WD_BINDKEY:-'^B'} fuzzy_wd_widget +# ctrl-b to open the fzf browser +bindkey ${FZF_WD_BINDKEY:-'^B'} wd_browse_widget ``` ## Usage @@ -255,12 +258,6 @@ wd --version wd --config ./file ``` -* Force `exit` with return code after running. This is not default, as it will *exit your terminal*, though required for testing/debugging. - -```zsh -wd --debug -``` - * Silence all output: ```zsh diff --git a/plugins/wd/wd.plugin.zsh b/plugins/wd/wd.plugin.zsh index 9910cb968..2397e6f31 100644 --- a/plugins/wd/wd.plugin.zsh +++ b/plugins/wd/wd.plugin.zsh @@ -1,4 +1,4 @@ -#!/bin/zsh +#!/usr/bin/env zsh # WARP DIRECTORY # ============== @@ -18,4 +18,3 @@ zle -N wd_browse_widget zle -N wd_restore_buffer autoload -Uz add-zle-hook-widget add-zle-hook-widget line-init wd_restore_buffer -bindkey ${FZF_WD_BINDKEY:-'^B'} wd_browse_widget diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh index 34f887a0e..ddd31e6f6 100755 --- a/plugins/wd/wd.sh +++ b/plugins/wd/wd.sh @@ -1,4 +1,4 @@ -#!/bin/zsh +#!/usr/bin/env zsh # WARP DIRECTORY # ============== @@ -8,7 +8,7 @@ # @github.com/mfaerevaag/wd # version -readonly WD_VERSION=0.7.0 +readonly WD_VERSION=0.9.0 # colors readonly WD_BLUE="\033[96m" @@ -90,7 +90,6 @@ Commands: clean Remove points warping to nonexistent directories (will prompt unless --force is used) -v | --version Print version - -d | --debug Exit after execution with exit codes (for testing) -c | --config Specify config file (default ~/.warprc) -q | --quiet Suppress all output -f | --force Allows overwriting without warning (for add & clean) @@ -426,7 +425,6 @@ wd_export_static_named_directories() { WD_CONFIG=${WD_CONFIG:-$HOME/.warprc} local WD_QUIET=0 local WD_EXIT_CODE=0 -local WD_DEBUG=0 # Parse 'meta' options first to avoid the need to have them before # other commands. The `-D` flag consumes recognized options so that @@ -436,7 +434,6 @@ zparseopts -D -E \ c:=wd_alt_config -config:=wd_alt_config \ q=wd_quiet_mode -quiet=wd_quiet_mode \ v=wd_print_version -version=wd_print_version \ - d=wd_debug_mode -debug=wd_debug_mode \ f=wd_force_mode -force=wd_force_mode if [[ ! -z $wd_print_version ]] @@ -583,9 +580,4 @@ unset args unset points unset val &> /dev/null # fixes issue #1 -if [[ -n $wd_debug_mode ]] -then - exit $WD_EXIT_CODE -else - unset wd_debug_mode -fi +return $WD_EXIT_CODE