summaryrefslogtreecommitdiff
path: root/oh-my-zsh/plugins/fasd
diff options
context:
space:
mode:
authorAditya <bluenerd@protonmail.com>2023-02-27 20:04:56 +0530
committerAditya <bluenerd@protonmail.com>2023-02-27 20:04:56 +0530
commitedc449275b6c04445f58b108ca0937a87c1e8430 (patch)
tree9fd484d58145b616f29a78857cc0b1c8b1c18f05 /oh-my-zsh/plugins/fasd
parent6f5424ca96c4221ef433f545642669e9c104d0ed (diff)
add zsh
Diffstat (limited to 'oh-my-zsh/plugins/fasd')
-rw-r--r--oh-my-zsh/plugins/fasd/README.md21
-rw-r--r--oh-my-zsh/plugins/fasd/fasd.plugin.zsh16
2 files changed, 37 insertions, 0 deletions
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'