From c61092dfbadc94f91613d86eeb87081d8e9789b2 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 18 Jun 2013 13:22:04 +0900 Subject: [PATCH 1/6] fix my-rgrep --- bashrc | 1 + emacs.el | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bashrc b/bashrc index 0e62117..0273c67 100755 --- a/bashrc +++ b/bashrc @@ -284,6 +284,7 @@ then complete -o bashdefault -o default -o nospace -F _git g 2>/dev/null \ || complete -o default -o nospace -F _git g fi +git svn --help >/dev/null 2>&1 && alias gsvn="git svn" null type gitmemo && alias m=gitmemo null type gitmemo && alias m=gitmemo diff --git a/emacs.el b/emacs.el index 869e491..9b36a66 100644 --- a/emacs.el +++ b/emacs.el @@ -1828,7 +1828,7 @@ if arg given, use that eshell buffer, otherwise make new eshell buffer." (require 'grep) (compilation-start (if (eq 0 (shell-command "git rev-parse --git-dir")) - (format "git --no-pager grep -nH -e '%s'" + (format "git --no-pager -c color.grep=false grep -nH -e '%s'" word) (if (executable-find "ag") (format "ag --nocolor --nogroup --nopager '%s'" From 74105e75bf30550a124ead88e4c0f913521d2837 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 18 Jun 2013 16:49:18 +0900 Subject: [PATCH 2/6] fixes for windows --- bashrc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bashrc b/bashrc index 0e62117..46e66ec 100755 --- a/bashrc +++ b/bashrc @@ -266,7 +266,6 @@ if iscygwin; then null type windate || \ alias windate="/c/Windows/System32/cmd.exe //c 'echo %DATE%-%TIME%'" alias cygsu="cygstart /cygwinsetup.exe" - alias emacs="CYGWIN=tty emacs -nw" alias ls="ls -CFG $(iswindows || test "$TERM" = dumb || echo --color=auto)" fi @@ -318,10 +317,10 @@ s(){ if git rev-parse --git-dir >/dev/null 2>&1 then git grep -n "$@" - elif which ag >/dev/null + elif which ag >/dev/null 2>&1 then ag --pager="$PAGER" "$@" - elif which ack >/dev/null + elif which ack >/dev/null 2>&1 then ack --pager="$PAGER" "$@" else From 4e5d12f260d1c6a6c0d5bb42c08bcfd3c83c270f Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 19 Jun 2013 18:04:34 +0900 Subject: [PATCH 3/6] emacs.el: add git-command-default-options but not works --- emacs.el | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs.el b/emacs.el index 869e491..ab5aba3 100644 --- a/emacs.el +++ b/emacs.el @@ -715,6 +715,7 @@ found, otherwise returns nil." "https://raw.github.com/10sr/emacs-lisp/master/git-command.el" t) (lazy-load-eval 'git-command) + (setq git-command-default-options "-c color.ui=always") (define-key ctl-x-map "g" 'git-command)) (and (fetch-library From 9e02f72fb117f2b73641da03040456f753bc9772 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 21 Jun 2013 10:26:16 +0900 Subject: [PATCH 4/6] bashrc: modify for cygwin --- bashrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bashrc b/bashrc index 46e66ec..79dfca4 100755 --- a/bashrc +++ b/bashrc @@ -264,9 +264,9 @@ null type port && { if iscygwin; then null type windate || \ - alias windate="/c/Windows/System32/cmd.exe //c 'echo %DATE%-%TIME%'" - alias cygsu="cygstart /cygwinsetup.exe" - alias ls="ls -CFG $(iswindows || test "$TERM" = dumb || echo --color=auto)" + alias windate="cmd.exe //c 'echo %DATE%-%TIME%'" + # alias cygsu="cygstart /cygwinsetup.exe" + # alias ls="ls -CFG $(iswindows || test "$TERM" = dumb || echo --color=auto)" fi g(){ From 797f90453ec6e97b3f0d8bdfa1849c41915ce441 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 26 Jun 2013 15:27:09 +0900 Subject: [PATCH 5/6] bashrc, profile: fix PATH configs --- bashrc | 46 +++++++++++++++++++++++++++++++++++++++++++--- profile | 34 +--------------------------------- 2 files changed, 44 insertions(+), 36 deletions(-) diff --git a/bashrc b/bashrc index b9e1284..9ffa1cc 100755 --- a/bashrc +++ b/bashrc @@ -46,11 +46,38 @@ fi ################################# -if echo $PATH | grep "$HOME" >/dev/null 2>&1 +__search_string(){ + # __search_string str1 str2 + # return 0 if str2 is found in str1 + expr "$1" : ".*$2.*" >/dev/null +} + +if ! __search_string "$PATH" "$HOME/.local/bin" +then + PATH="${PATH}:${HOME}/.local/bin:$HOME/.local/lib/gems/bin" +fi + +if ismsys && ! __search_string "$PATH" /c/mingw/bin +then + PATH="$PATH:/c/mingw/bin:/c/mingw/msys/1.0/bin" +fi + +# # it is not so good +# # http://archive.linux.or.jp/JF/JFdocs/Program-Library-HOWTO/shared-libraries.html +# # http://superuser.com/questions/324613/installing-a-library-locally-in-home-directory-but-program-doesnt-recognize-it +# without this ENV i cannot run tmux. another way is to use --disable-shared +# when building tmux +if ! __search_string "$LD_LIBRARY_PATH" "$HOME/.local/lib" then - PATH="${PATH}:${HOME}/.local/bin" + LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/.local/lib" fi +################################## + +export TERMCAP="${TERMCAP}:vb=" +ismsys && export HOSTNAME +export ENV=~/.shrc + if false iswindows then export PAGER='tr -d \\r | less' @@ -84,7 +111,20 @@ then TERM=screen-256color fi -test -z "$TMP" && export TMP=/tmp/${USER}-tmp +if test -z "$TMP" +then + if test -n "$TMPDIR" + then + export TMP=$TMPDIR + elif test -n "$TEMP" + then + export TMP="$TEMP" + else + export TMP=/tmp + fi +fi +export TMP="${TMP}/${USER}-tmp" +export TEMP="$TMP" mkdir -p "$TMP" ! iswindows && null type stty && { diff --git a/profile b/profile index 9179c3f..4cd8f3c 100755 --- a/profile +++ b/profile @@ -19,9 +19,6 @@ # export PS1="\$ " export LC_TIME=C -export TERMCAP="${TERMCAP}:vb=" -export HOSTNAME -export ENV=~/.shrc mkdir -p $HOME/.local/lib/python/site-packages export PYTHONDOCS=/usr/share/doc/python/html/ @@ -35,39 +32,10 @@ export GEM_HOME="$HOME/.local/lib/gems" export PATH="$PATH:$HOME/.local/lib/gems/bin" export RUBYLIB="$RUBYLIB:$HOME/.local/lib/gems/lib" -__add_to_path(){ - for p in "$@" - do - echo $PATH | grep -E "^$p:|:$p:|:$p$" >/dev/null 2>&1 || \ - PATH="$p:${PATH}" - done -} -# export PATH="${PATH}:${HOME}/bin" -__add_to_path ${HOME}/.local/bin /c/mingw/bin /c/mingw/msys/1.0/bin - -# # it is not so good -# # http://archive.linux.or.jp/JF/JFdocs/Program-Library-HOWTO/shared-libraries.html -# # http://superuser.com/questions/324613/installing-a-library-locally-in-home-directory-but-program-doesnt-recognize-it -# without this ENV i cannot run tmux. another way is to use --disable-shared -# when building tmux -export LD_LIBRARY_PATH="$HOME/.local/lib:$LD_LIBRARY_PATH" -# this should be used when ./configure -#export CFLAGS="$CFLAGS -I$HOME/.local/include" - #_python_pkg_conf="/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/pkgconfig" export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$_python_pkg_conf" export MANPATH="$MANPATH:$HOME/.local/share/man" -type setterm >/dev/null 2>&1 && setterm -blank 30 -powersave on # -powerdown 10 # in my environment powerdown does not work - -if test -n "$TMPDIR" -then - export TMP=$TMPDIR -else - export TMP=/tmp/ -fi -export TMP="${TMP}${USER}-tmp" -export TEMP="$TMP" -mkdir -p "$TMP" +type setterm >/dev/null 2>&1 && setterm -blank 30 -powersave on # -powerdown 10 From 972b9da3a340caf25cb346ac2be2aa1017b677e3 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Thu, 27 Jun 2013 22:07:31 +0900 Subject: [PATCH 6/6] add GIT_MERGE_AUTOEDIT=no --- bashrc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bashrc b/bashrc index ec5ae33..d2546e0 100755 --- a/bashrc +++ b/bashrc @@ -51,6 +51,9 @@ then PATH="${PATH}:${HOME}/.local/bin" fi +export LANG=ja_JP.UTF-8 +export LC_MESSAGES=C + if false iswindows then export PAGER='tr -d \\r | less' @@ -71,12 +74,13 @@ then else export EDITOR=vi fi -export LANG=ja_JP.UTF-8 -export LC_MESSAGES=C # export CDPATH=".:~" export VISUAL="$EDITOR" + export GIT_PAGER="less -F" export GIT_EDITOR="$EDITOR" +export GIT_MERGE_AUTOEDIT=no + if test -n "$TMUX" && \ echo $TERM | grep screen >/dev/null 2>&1 && \ tmux display -p '#{client_termname}' | grep 256color >/dev/null 2>&1