diff options
Diffstat (limited to 'plugins/sfffe')
-rw-r--r-- | plugins/sfffe/README.md | 17 | ||||
-rw-r--r-- | plugins/sfffe/sfffe.plugin.zsh | 6 |
2 files changed, 20 insertions, 3 deletions
diff --git a/plugins/sfffe/README.md b/plugins/sfffe/README.md new file mode 100644 index 000000000..29044e85b --- /dev/null +++ b/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/plugins/sfffe/sfffe.plugin.zsh b/plugins/sfffe/sfffe.plugin.zsh index a0f034908..177e5fa2f 100644 --- a/plugins/sfffe/sfffe.plugin.zsh +++ b/plugins/sfffe/sfffe.plugin.zsh @@ -6,9 +6,9 @@ # REQUIRE: ack # ------------------------------------------------------------------------------ -if [ ! -x $(which ack) ]; then - echo \'ack\' is not installed! - exit -1 +if (( ! $+commands[ack] )); then + echo "'ack' is not installed!" + return fi ajs() { |