From 0ddceb666745c020bba9ae7cd77c6001f3df465e Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 19 Aug 2013 13:58:14 +0900 Subject: [PATCH 1/2] update func s --- bashrc | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) 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 } From 75beacee8fb95391998703a9223f6b6259dcd7a2 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 19 Aug 2013 15:09:07 +0900 Subject: [PATCH 2/2] emacs.el: remove tab-mark from whitespace-style which causes unexpected display-mappining for tab --- emacs.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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)