diff --git a/bashrc b/bashrc index 0ffefee..6afbabc 100755 --- a/bashrc +++ b/bashrc @@ -354,26 +354,23 @@ clk(){ } s(){ - # if test $# -eq 0 - # then - # echo "No search word given." 1>&2 - # return 1 - # fi - if git rev-parse --git-dir >/dev/null 2>&1 then - echo ">> Using git-grep" 1>&2 + echo ">> git grep -n $@" 1>&2 git grep -n "$@" elif which ag >/dev/null 2>&1 then - echo ">> Using ag" 1>&2 + echo ">> ag --pager=\"$PAGER\" $@" 1>&2 ag --pager="$PAGER" "$@" elif which ack >/dev/null 2>&1 then - echo ">> Using ack" 1>&2 + echo ">> ack --pager=\"$PAGER\" $@" 1>&2 ack --pager="$PAGER" "$@" else - echo ">> Using grep" 1>&2 + echo \ + ">> grep -nH --color=always" \ + "--exclude=\'.svn/\*\' --exclude=\'.git/\*\'" \ + "$@" "-r ." 1>&2 if test $# -eq 0 then echo "No search word given." 1>&2 @@ -381,8 +378,6 @@ s(){ fi grep -nH --color=always --exclude='.svn/*' --exclude='.git/*' "$@" -r . \ | $PAGER - # echo "No search command found. Use grep." 2>&1 - # return 127 fi } diff --git a/emacs.el b/emacs.el index 488c046..bbc0693 100644 --- a/emacs.el +++ b/emacs.el @@ -384,19 +384,19 @@ found, otherwise returns nil." )) (when (require 'whitespace nil t) + (add-to-list 'whitespace-display-mappings ; not work + `(tab-mark ?\t ,(vconcat "^I\t"))) + (add-to-list 'whitespace-display-mappings + `(newline-mark ?\n ,(vconcat "$\n"))) (setq whitespace-style '(face trailing ; trailing blanks newline ; newlines newline-mark ; use display table for newline - tab-mark + ;; tab-mark empty ; empty lines at beg or end of buffer lines-tail ; lines over 80 )) ;; (setq whitespace-newline 'font-lock-comment-face) - (add-to-list 'whitespace-display-mappings - `(newline-mark ?\n ,(vconcat "$\n"))) - (add-to-list 'whitespace-display-mappings ; not work - `(tab-mark ?\t ,(vconcat "^I\t"))) (global-whitespace-mode t) (when (eq (display-color-cells) 256)