From edc449275b6c04445f58b108ca0937a87c1e8430 Mon Sep 17 00:00:00 2001 From: Aditya Date: Mon, 27 Feb 2023 20:04:56 +0530 Subject: add zsh --- oh-my-zsh/plugins/fasd/README.md | 21 +++++++++++++++++++++ oh-my-zsh/plugins/fasd/fasd.plugin.zsh | 16 ++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 oh-my-zsh/plugins/fasd/README.md create mode 100644 oh-my-zsh/plugins/fasd/fasd.plugin.zsh (limited to 'oh-my-zsh/plugins/fasd') diff --git a/oh-my-zsh/plugins/fasd/README.md b/oh-my-zsh/plugins/fasd/README.md new file mode 100644 index 0000000..a5c74e5 --- /dev/null +++ b/oh-my-zsh/plugins/fasd/README.md @@ -0,0 +1,21 @@ +# fasd + +[`Fasd`](https://github.com/clvv/fasd) (pronounced similar to "fast") is a command-line productivity booster. Fasd offers quick access to files and directories for POSIX shells. + +To use it, add `fasd` to the plugins array in your zshrc file: + +```zsh +plugins=(... fasd) +``` + +## Installation + +Please find detailed installation guide [`here`](https://github.com/clvv/fasd#install) + +## Aliases + +| Alias | Command | Description | +|-------|-------------------------------------------|-------------------------------------------------------------| +| v | `fasd -f -e "$EDITOR"` | List frequent/recent files matching the given filename. | +| o | `fasd -a -e xdg-open` | List frequent/recent files and directories matching. | +| j | `fasd_cd -d -i` | cd with interactive selection | diff --git a/oh-my-zsh/plugins/fasd/fasd.plugin.zsh b/oh-my-zsh/plugins/fasd/fasd.plugin.zsh new file mode 100644 index 0000000..6538d09 --- /dev/null +++ b/oh-my-zsh/plugins/fasd/fasd.plugin.zsh @@ -0,0 +1,16 @@ +# check if fasd is installed +if (( ! ${+commands[fasd]} )); then + return +fi + +fasd_cache="${ZSH_CACHE_DIR}/fasd-init-cache" +if [[ "$commands[fasd]" -nt "$fasd_cache" || ! -s "$fasd_cache" ]]; then + fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install \ + zsh-wcomp zsh-wcomp-install >| "$fasd_cache" +fi +source "$fasd_cache" +unset fasd_cache + +alias v='f -e "$EDITOR"' +alias o='a -e xdg-open' +alias j='zz' -- cgit v1.2.3