diff options
author | 2025-02-13 14:13:49 +0530 | |
---|---|---|
committer | 2025-02-13 14:13:49 +0530 | |
commit | 8a2e1006b3b272126332aa064f3ad95387129544 (patch) | |
tree | 944c80ac612a65980d94a54ba11b6c7102037ecf /.config/zsh/oh-my-zsh/plugins/sfffe | |
parent | dcbb16d8b08ff5956abef5e6478b59df2e93ad35 (diff) | |
download | dotfiles-master.tar.gz dotfiles-master.tar.bz2 dotfiles-master.zip |
Diffstat (limited to '.config/zsh/oh-my-zsh/plugins/sfffe')
-rw-r--r-- | .config/zsh/oh-my-zsh/plugins/sfffe/README.md | 17 | ||||
-rw-r--r-- | .config/zsh/oh-my-zsh/plugins/sfffe/sfffe.plugin.zsh | 28 |
2 files changed, 45 insertions, 0 deletions
diff --git a/.config/zsh/oh-my-zsh/plugins/sfffe/README.md b/.config/zsh/oh-my-zsh/plugins/sfffe/README.md new file mode 100644 index 0000000..29044e8 --- /dev/null +++ b/.config/zsh/oh-my-zsh/plugins/sfffe/README.md @@ -0,0 +1,17 @@ +# "Search files for Front-End" + +This plugin adds a few functions for searching files used in Front-End web development. + +To use it, add `sfffe` to the plugins array in your zshrc file: +```zsh +plugins=(... sfffe) +``` + +**Requires:** `ack` + +## Functions + +- `ajs`: look for string in `.js` files. +- `acss`: look for string in `.css` files. +- `fjs`: search for `.js` files under the current working directory. +- `fcss`: search for `.css` files under the current working directory. diff --git a/.config/zsh/oh-my-zsh/plugins/sfffe/sfffe.plugin.zsh b/.config/zsh/oh-my-zsh/plugins/sfffe/sfffe.plugin.zsh new file mode 100644 index 0000000..177e5fa --- /dev/null +++ b/.config/zsh/oh-my-zsh/plugins/sfffe/sfffe.plugin.zsh @@ -0,0 +1,28 @@ +# ------------------------------------------------------------------------------ +# FILE: sfffe.plugin.zsh +# DESCRIPTION: search file for FE +# AUTHOR: yleo77 (ylep77@gmail.com) +# VERSION: 0.1 +# REQUIRE: ack +# ------------------------------------------------------------------------------ + +if (( ! $+commands[ack] )); then + echo "'ack' is not installed!" + return +fi + +ajs() { + ack "$@" --type js +} + +acss() { + ack "$@" --type css +} + +fjs() { + find ./ -name "$@*" -type f | grep '\.js' +} + +fcss() { + find ./ -name "$@*" -type f | grep '\.css' +} |