From 626c8d61b52c274032cb259b613db521bf396fcf Mon Sep 17 00:00:00 2001 From: Ian Homer Date: Sun, 17 Dec 2023 18:47:03 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20use=20zoxide=20instead=20of=20fasd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/dotme-brew | 2 +- config/brew/Brewfile | 2 +- config/brew/Brewfile.lock.json | 102 ++++++++++++++++++- dotfiles/bash/.bashrc | 10 +- dotfiles/fish/.config/fish/config.fish | 1 + dotfiles/fish/.config/fish/functions/cd.fish | 61 ----------- test/pnpm-lock.yaml | 4 +- 7 files changed, 106 insertions(+), 76 deletions(-) delete mode 100644 dotfiles/fish/.config/fish/functions/cd.fish diff --git a/bin/dotme-brew b/bin/dotme-brew index 7fe9f38a..03bdf197 100755 --- a/bin/dotme-brew +++ b/bin/dotme-brew @@ -66,7 +66,7 @@ brew update log:: "upgrading brew" # Upgrade any already installed formulae -brew upgrade --ignore-pinned +brew upgrade log:: "upgraded brew" cd $DOTFILES_DIR/config/brew diff --git a/config/brew/Brewfile b/config/brew/Brewfile index 30bb8728..0f46f070 100644 --- a/config/brew/Brewfile +++ b/config/brew/Brewfile @@ -41,7 +41,6 @@ brew "coreutils" brew "dos2unix" # Should use eza instead of exa # brew "exa" -brew "fasd" brew "fd" brew "findutils" brew "fish" @@ -72,6 +71,7 @@ brew "universal-ctags" brew "vim" brew "watch" brew "wget" +brew "zoxide" cask "kitty" cask "iterm2" diff --git a/config/brew/Brewfile.lock.json b/config/brew/Brewfile.lock.json index 1b4f826a..93c4a7ee 100644 --- a/config/brew/Brewfile.lock.json +++ b/config/brew/Brewfile.lock.json @@ -4055,6 +4055,104 @@ } } } + }, + "zoxide": { + "version": "0.9.2", + "bottle": { + "rebuild": 0, + "root_url": "https://ghcr.io/v2/homebrew/core", + "files": { + "arm64_sonoma": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/zoxide/blobs/sha256:130c9a0c0e3c4cf09388bb04ee722140508e213949ebb92efda5f57fb897481e", + "sha256": "130c9a0c0e3c4cf09388bb04ee722140508e213949ebb92efda5f57fb897481e" + }, + "arm64_ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/zoxide/blobs/sha256:49f1719c65eec1a3657c6162bb1f768717101df99d7ca3441d305fd3c80fea51", + "sha256": "49f1719c65eec1a3657c6162bb1f768717101df99d7ca3441d305fd3c80fea51" + }, + "arm64_monterey": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/zoxide/blobs/sha256:d88fcbbcfb4ec79355338a1c908c921d32b918495fdaf52adf2494a35cbd7b86", + "sha256": "d88fcbbcfb4ec79355338a1c908c921d32b918495fdaf52adf2494a35cbd7b86" + }, + "arm64_big_sur": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/zoxide/blobs/sha256:af613b9c960a8e755619f1f0397c897fd6f5d15c8f53ed7ffa12ec0202be7f7e", + "sha256": "af613b9c960a8e755619f1f0397c897fd6f5d15c8f53ed7ffa12ec0202be7f7e" + }, + "sonoma": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/zoxide/blobs/sha256:02ebf032157f82cdab906109a76e98b7a8ad9665966fcc5793295ce7e31d0e13", + "sha256": "02ebf032157f82cdab906109a76e98b7a8ad9665966fcc5793295ce7e31d0e13" + }, + "ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/zoxide/blobs/sha256:167c8f49d8e8139de86afb96d825de815332adca5960ddb92260b4d51e464fd3", + "sha256": "167c8f49d8e8139de86afb96d825de815332adca5960ddb92260b4d51e464fd3" + }, + "monterey": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/zoxide/blobs/sha256:3176f2c6aa53131db5502c455495f5ebd3be869468621b2e37c53b054a37b28d", + "sha256": "3176f2c6aa53131db5502c455495f5ebd3be869468621b2e37c53b054a37b28d" + }, + "big_sur": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/zoxide/blobs/sha256:43fea705f20177f4e8b8558a00679ee016199f3787389040e7c8d7944a545953", + "sha256": "43fea705f20177f4e8b8558a00679ee016199f3787389040e7c8d7944a545953" + }, + "x86_64_linux": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/zoxide/blobs/sha256:657c7e0554270cf878dfc3ab249ab7721842655464ecb302e48737c1a8f76f42", + "sha256": "657c7e0554270cf878dfc3ab249ab7721842655464ecb302e48737c1a8f76f42" + } + } + } + }, + "direnv": { + "version": "2.33.0", + "bottle": { + "rebuild": 1, + "root_url": "https://ghcr.io/v2/homebrew/core", + "files": { + "arm64_sonoma": { + "cellar": "/opt/homebrew/Cellar", + "url": "https://ghcr.io/v2/homebrew/core/direnv/blobs/sha256:b1795e6743e0bb769f92d07aa5d2401c57b7bee715fc68894c2f5d1c95aba013", + "sha256": "b1795e6743e0bb769f92d07aa5d2401c57b7bee715fc68894c2f5d1c95aba013" + }, + "arm64_ventura": { + "cellar": "/opt/homebrew/Cellar", + "url": "https://ghcr.io/v2/homebrew/core/direnv/blobs/sha256:1c2d6d8b0bdc071b4344600ec914dd52f521c3d21f9fd38a6e218e65cc50fb36", + "sha256": "1c2d6d8b0bdc071b4344600ec914dd52f521c3d21f9fd38a6e218e65cc50fb36" + }, + "arm64_monterey": { + "cellar": "/opt/homebrew/Cellar", + "url": "https://ghcr.io/v2/homebrew/core/direnv/blobs/sha256:1e365c468da6a471f28c21ef11871641f8414d1c45b9710509884a9aa8b6fe78", + "sha256": "1e365c468da6a471f28c21ef11871641f8414d1c45b9710509884a9aa8b6fe78" + }, + "sonoma": { + "cellar": "/usr/local/Cellar", + "url": "https://ghcr.io/v2/homebrew/core/direnv/blobs/sha256:cd4b008579b836b43778c197cfa953cb3934505db0e65053ae5a9d4c10155c60", + "sha256": "cd4b008579b836b43778c197cfa953cb3934505db0e65053ae5a9d4c10155c60" + }, + "ventura": { + "cellar": "/usr/local/Cellar", + "url": "https://ghcr.io/v2/homebrew/core/direnv/blobs/sha256:55781935916235989a46904640a4728a0a3dc24228db7cc9dbac5954b95e52dd", + "sha256": "55781935916235989a46904640a4728a0a3dc24228db7cc9dbac5954b95e52dd" + }, + "monterey": { + "cellar": "/usr/local/Cellar", + "url": "https://ghcr.io/v2/homebrew/core/direnv/blobs/sha256:6b0c4abed5b230f6e3112df41f9019dd8291a5cb3c82e3337471e2b4aa5e28ea", + "sha256": "6b0c4abed5b230f6e3112df41f9019dd8291a5cb3c82e3337471e2b4aa5e28ea" + }, + "x86_64_linux": { + "cellar": "/home/linuxbrew/.linuxbrew/Cellar", + "url": "https://ghcr.io/v2/homebrew/core/direnv/blobs/sha256:65deffe8cb70793402e4ac64655d9805b0b84f174fe8a32dd0722d1781bc4a1f", + "sha256": "65deffe8cb70793402e4ac64655d9805b0b84f174fe8a32dd0722d1781bc4a1f" + } + } + } } } }, @@ -4085,11 +4183,11 @@ "macOS": "13.5.2" }, "sonoma": { - "HOMEBREW_VERSION": "4.1.25", + "HOMEBREW_VERSION": "4.1.25-79-g3431996", "HOMEBREW_PREFIX": "/opt/homebrew", "Homebrew/homebrew-core": "api", "CLT": "15.1.0.0.1.1700200546", - "Xcode": "15.0", + "Xcode": "15.1", "macOS": "14.2" } } diff --git a/dotfiles/bash/.bashrc b/dotfiles/bash/.bashrc index 5f35b708..aebffe1a 100644 --- a/dotfiles/bash/.bashrc +++ b/dotfiles/bash/.bashrc @@ -18,14 +18,8 @@ if ! command -v dotme &> /dev/null ; then PATH=$PATH:$HOME/.dotfiles/bin fi -if command -v fasd &> /dev/null ; then - # Initialise fasd https://github.com/clvv/fasd - fasd_cache="$HOME/.fasd-init-bash" - if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then - fasd --init posix-alias bash-hook bash-ccomp bash-ccomp-install >| "$fasd_cache" - fi - source ~/.fasd-init-bash - unset fasd_cache +if command -v zoxide &> /dev/null ; then + eval "$(zoxide init bash)" fi # Inline br function, this comes from diff --git a/dotfiles/fish/.config/fish/config.fish b/dotfiles/fish/.config/fish/config.fish index d3774dc0..06d58eaf 100644 --- a/dotfiles/fish/.config/fish/config.fish +++ b/dotfiles/fish/.config/fish/config.fish @@ -129,6 +129,7 @@ end starship init fish | source direnv hook fish | source +zoxide init fish | source # Things bind diff --git a/dotfiles/fish/.config/fish/functions/cd.fish b/dotfiles/fish/.config/fish/functions/cd.fish deleted file mode 100644 index 9994e055..00000000 --- a/dotfiles/fish/.config/fish/functions/cd.fish +++ /dev/null @@ -1,61 +0,0 @@ -# Extension of default fish cd script -function cd -d "Change to directory with fasd and fzf support" - set -l MAX_DIR_HIST 25 - - if test (count $argv) -gt (test "$argv[1]" = "--" && echo 2 || echo 1) - printf "%s\n" (_ "Too many args for cd command") - return 1 - end - - # Skip history in subshells. - if status --is-command-substitution - builtin cd $argv - return $status - end - - # Avoid set completions. - set -l previous $PWD - - if test "$argv" = - - if test "$__fish_cd_direction" = next - nextd - else - prevd - end - return $status - else if test -z "$argv" - set dir (fd -t d | fzf) - # If empty then return - if test -z "$dir" - return - end - end - - fasd -A $argv - builtin cd $argv - set -l cd_status $status - - if test $cd_status -eq 0 -a "$PWD" != "$previous" - set -q dirprev - or set -l dirprev - set -q dirprev[$MAX_DIR_HIST] - and set -e dirprev[1] - - # If dirprev, dirnext, __fish_cd_direction - # are set as universal variables, honor their scope. - - set -U -q dirprev - and set -U -a dirprev $previous - or set -g -a dirprev $previous - - set -U -q dirnext - and set -U -e dirnext - or set -e dirnext - - set -U -q __fish_cd_direction - and set -U __fish_cd_direction prev - or set -g __fish_cd_direction prev - end - - return $cd_status -end diff --git a/test/pnpm-lock.yaml b/test/pnpm-lock.yaml index a6e0d9e6..e08f5271 100644 --- a/test/pnpm-lock.yaml +++ b/test/pnpm-lock.yaml @@ -1440,7 +1440,7 @@ packages: dev: false /concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} /convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} @@ -1486,7 +1486,6 @@ packages: /cucumber-messages@8.0.0: resolution: {integrity: sha512-lUnWRMjwA9+KhDec/5xRZV3Du67ISumHnVLywWQXyvzmc4P+Eqx8CoeQrBQoau3Pw1hs4kJLTDyV85hFBF00SQ==} - deprecated: This package is now published under @cucumber/messages dependencies: '@types/uuid': 3.4.13 protobufjs: 6.11.4 @@ -2043,7 +2042,6 @@ packages: /gherkin@9.0.0: resolution: {integrity: sha512-6xoAepoxo5vhkBXjB4RCfVnSKHu5z9SqXIQVUyj+Jw8BQX8odATlee5otXgdN8llZvyvHokuvNiBeB3naEnnIQ==} - deprecated: This package is now published under @cucumber/gherkin hasBin: true dependencies: commander: 4.1.1