From a9111488e4945a29b8afa9a4eab12ee2e6fc9a0e Mon Sep 17 00:00:00 2001 From: yleo77 Date: Fri, 17 May 2013 17:48:06 +0800 Subject: [PATCH] add search by filename and file content feature --- .gitignore | 5 ++--- custom/plugins/sfffe/sfffe.plugin.zsh | 28 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 custom/plugins/sfffe/sfffe.plugin.zsh diff --git a/.gitignore b/.gitignore index 51a5ee6c3..5db11ce5c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,8 @@ locals.zsh log/.zsh_history projects.zsh -custom/* -!custom/example -!custom/example.zsh +custom/example +custom/example.zsh *.swp !custom/example.zshcache cache/ diff --git a/custom/plugins/sfffe/sfffe.plugin.zsh b/custom/plugins/sfffe/sfffe.plugin.zsh new file mode 100644 index 000000000..a0f034908 --- /dev/null +++ b/custom/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 [ ! -x $(which ack) ]; then + echo \'ack\' is not installed! + exit -1 +fi + +ajs() { + ack "$@" --type js +} + +acss() { + ack "$@" --type css +} + +fjs() { + find ./ -name "$@*" -type f | grep '\.js' +} + +fcss() { + find ./ -name "$@*" -type f | grep '\.css' +}