From e911f1ecb976f087347446270c05a4ce92edc966 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Mon, 19 Feb 2024 00:47:30 +0000 Subject: [PATCH] feat(shell): add zoxide as cd replacement --- config/mise/config.toml | 1 + zsh/zoxide.zsh | 11 +++++++++++ zshrc | 1 + 3 files changed, 13 insertions(+) create mode 100644 zsh/zoxide.zsh diff --git a/config/mise/config.toml b/config/mise/config.toml index 02e5e3d..6bce5b4 100644 --- a/config/mise/config.toml +++ b/config/mise/config.toml @@ -21,3 +21,4 @@ shellcheck = "latest" shfmt = "latest" starship = "latest" terraform = "latest" +zoxide = "latest" diff --git a/zsh/zoxide.zsh b/zsh/zoxide.zsh new file mode 100644 index 0000000..beed6ba --- /dev/null +++ b/zsh/zoxide.zsh @@ -0,0 +1,11 @@ +# +# zoxide Setup +# + +if command-exists zoxide; then + eval "$(zoxide init --cmd zox zsh)" + + # Use functions to allow regular zsh completion for cd to work. + cd() { __zoxide_z "$@"; } + alias cdi='__zoxide_zi' +fi diff --git a/zshrc b/zshrc index 1203073..3b11b09 100644 --- a/zshrc +++ b/zshrc @@ -162,6 +162,7 @@ source "$DOTZSH/less.zsh" source "$DOTZSH/neovim.zsh" source "$DOTZSH/nix.zsh" source "$DOTZSH/tmux.zsh" +source "$DOTZSH/zoxide.zsh" # Development source "$DOTZSH/containers.zsh"