浏览代码

add search by filename and file content feature

yleo77 11 年之前
父节点
当前提交
a9111488e4
共有 2 个文件被更改,包括 30 次插入3 次删除
  1. 2 3
      .gitignore
  2. 28 0
      custom/plugins/sfffe/sfffe.plugin.zsh

+ 2 - 3
.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/

+ 28 - 0
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'
+}