From 51c2446ffbff34faebd1453302a7ce194b13a047 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 23 Jan 2013 20:59:35 +0900 Subject: [PATCH 01/10] update path for gem --- profile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/profile b/profile index fb397a4..a136c25 100755 --- a/profile +++ b/profile @@ -21,11 +21,15 @@ test -f "${HOME}/.dotfiles/rc.py" && \ export PYTHONSTARTUP="${HOME}/.dotfiles/rc.py" #export PYTHONPATH="~/.local/share/lib/python3.2/site-packages" +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="${PATH}:$p" + PATH="$p:${PATH}" done } # export PATH="${PATH}:${HOME}/bin" From 506df5437dcc75c9465f61448659a68c567b23be Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 23 Jan 2013 22:03:08 +0900 Subject: [PATCH 02/10] alias aun=aunpack --- bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bashrc b/bashrc index 904ce50..1c2ca77 100755 --- a/bashrc +++ b/bashrc @@ -175,7 +175,7 @@ null type screen && alias screen="screen -e^z^z" null type gtags && alias gtags="gtags --verbose" null type htags && alias htags="htags --xhtml --symbol --line-number \ --frame --alphabet --verbose" -null type aunpack && alias aunp=aunpack +null type aunpack && alias aun=aunpack null type lv && alias lv="lv|less" isdarwin && alias updatedb="LC_ALL=C updatedb" From 26dacfd46af59cbf3d4e83cb1477ec0b56f16874 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 26 Jan 2013 00:58:49 +0900 Subject: [PATCH 03/10] change eol mnemonics --- emacs.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/emacs.el b/emacs.el index c7cc6f7..47b2371 100644 --- a/emacs.el +++ b/emacs.el @@ -213,9 +213,9 @@ found, otherwise returns nil." t) (require 'terminal-title nil t)) -(setq eol-mnemonic-dos "crlf") -(setq eol-mnemonic-mac "cr") -(setq eol-mnemonic-unix "lf") +(setq eol-mnemonic-dos "\\r\\n") +(setq eol-mnemonic-mac "\\r") +(setq eol-mnemonic-unix "\\n") (which-function-mode 0) From 4d8f6c76cd99854f0af0e48ba9eae6182c715efe Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 26 Jan 2013 18:39:06 +0900 Subject: [PATCH 04/10] always popup buffer when my-term --- emacs.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/emacs.el b/emacs.el index 47b2371..ed96500 100644 --- a/emacs.el +++ b/emacs.el @@ -1716,11 +1716,13 @@ if arg given, use that eshell buffer, otherwise make new eshell buffer." (buffer-name my-term)) (pop-to-buffer my-term) (setq my-term - (if (eq system-type 'windows-nt) - (eshell) - (if (require 'multi-term nil t) - (multi-term) - (ansi-term shell-file-name)))))) + (save-window-excursion + (if (eq system-type 'windows-nt) + (eshell) + (if (require 'multi-term nil t) + (multi-term) + (ansi-term shell-file-name))))) + (my-term))) (defun my-delete-frame-or-kill-emacs () "delete frame when opening multiple frame, kill emacs when only one." From 1b7c3b5bb60b3d5c476e154552957ea6638011c2 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 29 Jan 2013 17:31:44 +0900 Subject: [PATCH 05/10] add config tar.txz.command --- setup.sh | 62 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/setup.sh b/setup.sh index 0b6a1f8..a44ee38 100755 --- a/setup.sh +++ b/setup.sh @@ -48,36 +48,40 @@ install_symlink_script(){ git_config(){ type git >/dev/null 2>&1 || return 1 - git config --global user.name '10sr' - git config --global user.email '8slashes+git@gmail.com' - git config --global core.autocrlf false - git config --global core.excludesfile '~/.gitignore' - git config --global color.ui auto - git config --global status.relativePaths false - git config --global status.showUntrackedFiles normal - git config --global log.date iso - git config --global alias.graph "log --graph --date-order -C -M --pretty=tformat:\"%C(green)%h%C(reset) %C(white)%ad%C(reset) %C(red)%an%C(reset)%C(yellow)%d%C(reset) %C(white bold)%s%C(reset)\" --all --date=iso -n 499" - git config --global alias.st "status -s -b" - git config --global alias.b "branch" - git config --global alias.sb "show-branch" - git config --global alias.ci "commit --verbose" - git config --global alias.co "checkout" - git config --global alias.cim "commit --verbose -m" - git config --global alias.di "diff --color" - git config --global alias.me "merge --no-ff --stat -v" - git config --global alias.gr "grep -n" - git config --global alias.ls "ls-files" - # git config --global alias.ls "ls-files -v --full-name" - # git config --global alias.ls "status -u -s ." - git config --global alias.sl "!sl" - # git config --global alias.my-ls "ls-files | xargs ls" - # git config --global alias.ll "!git ls-files | xargs ls -l -CFG --color=auto --time-style=long-iso" - git config --global alias.addi "add -i" - git config --global alias.clean-p "!test -z \"\$(git status -s -uno)\"" - #git config --global alias.wc "!git ls-files -z | xargs -0 wc" - # git config --global push.default "simple" + _gitconfig="git config --global" + + $_gitconfig user.name '10sr' + $_gitconfig user.email '8slashes+git@gmail.com' + $_gitconfig core.autocrlf false + $_gitconfig core.excludesfile '~/.gitignore' + $_gitconfig color.ui auto + $_gitconfig status.relativePaths false + $_gitconfig status.showUntrackedFiles normal + $_gitconfig log.date iso + $_gitconfig tar.txz.command "xz -c" + + $_gitconfig alias.graph "log --graph --date-order -C -M --pretty=tformat:\"%C(green)%h%C(reset) %C(white)%ad%C(reset) %C(red)%an%C(reset)%C(yellow)%d%C(reset) %C(white bold)%s%C(reset)\" --all --date=iso -n 499" + $_gitconfig alias.st "status -s -b" + $_gitconfig alias.b "branch" + $_gitconfig alias.sb "show-branch" + $_gitconfig alias.ci "commit --verbose" + $_gitconfig alias.co "checkout" + $_gitconfig alias.cim "commit --verbose -m" + $_gitconfig alias.di "diff --color" + $_gitconfig alias.me "merge --no-ff --stat -v" + $_gitconfig alias.gr "grep -n" + $_gitconfig alias.ls "ls-files" + # $_gitconfig alias.ls "ls-files -v --full-name" + # $_gitconfig alias.ls "status -u -s ." + $_gitconfig alias.sl "!sl" + # $_gitconfig alias.my-ls "ls-files | xargs ls" + # $_gitconfig alias.ll "!git ls-files | xargs ls -l -CFG --color=auto --time-style=long-iso" + $_gitconfig alias.addi "add -i" + $_gitconfig alias.clean-p "!test -z \"\$(git status -s -uno)\"" + #$_gitconfig alias.wc "!git ls-files -z | xargs -0 wc" + # $_gitconfig push.default "simple" if _iswindows; then - git config --global core.fileMode false + $_gitconfig core.fileMode false fi } From 7c005f0b8037b72271c2e710a9fbd8c484b9417e Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 29 Jan 2013 17:33:24 +0900 Subject: [PATCH 06/10] do not add txz config when xz is not available --- setup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index a44ee38..ab3fecb 100755 --- a/setup.sh +++ b/setup.sh @@ -58,7 +58,8 @@ git_config(){ $_gitconfig status.relativePaths false $_gitconfig status.showUntrackedFiles normal $_gitconfig log.date iso - $_gitconfig tar.txz.command "xz -c" + type xz && \ + $_gitconfig tar.txz.command "xz -c" $_gitconfig alias.graph "log --graph --date-order -C -M --pretty=tformat:\"%C(green)%h%C(reset) %C(white)%ad%C(reset) %C(red)%an%C(reset)%C(yellow)%d%C(reset) %C(white bold)%s%C(reset)\" --all --date=iso -n 499" $_gitconfig alias.st "status -s -b" From 8a7a83091c1fc4b8e8fa6a57ccaf0fdff8d0b496 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 29 Jan 2013 20:02:25 +0900 Subject: [PATCH 07/10] add ls alias for darwin ls --- bashrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bashrc b/bashrc index 1c2ca77..7ca0a9b 100755 --- a/bashrc +++ b/bashrc @@ -127,6 +127,11 @@ _timeformat_iso="%Y-%m-%dT%H:%M:%S%z" _timeformat_rfc2822="%a, %d %b %Y %T %z" alias ls="ls -hCF${_coloroption}${_timeoption}" +if ! with_coreutils +then + export LSCOLORS=gxfxcxdxbxegedabagacad + alias ls="ls -G" +fi # export GREP_OPTIONS="" alias gr="grep -n --color=always" iswindows && alias grep="grep -n" From 64b4d274da75e5408177117eba0fd55ec99b2f0c Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 29 Jan 2013 21:37:52 +0900 Subject: [PATCH 08/10] supress warning of makefile --- emacs.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/emacs.el b/emacs.el index ed96500..8f5e9ad 100644 --- a/emacs.el +++ b/emacs.el @@ -703,7 +703,11 @@ found, otherwise returns nil." (add-hook 'makefile-mode-hook (lambda () - (define-key makefile-mode-map (kbd "C-m") 'newline-and-indent))) + (define-key makefile-mode-map (kbd "C-m") 'newline-and-indent) + ;; this functions is set in write-file-functions, i cannot find any + ;; good way to remove this. + (fset 'makefile-warn-suspicious-lines 'ignore) + )) (defun make () "Run \"make -k\" in current directory." From ab1722b413ec7d70013e20bc8c22613b2f326d8b Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 30 Jan 2013 18:55:18 +0900 Subject: [PATCH 09/10] change darwin color --- bashrc | 14 ++++++++++++-- tmux.conf.pl | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/bashrc b/bashrc index 7ca0a9b..2efd0c3 100755 --- a/bashrc +++ b/bashrc @@ -685,16 +685,19 @@ ip-address(){ test -n "$ip" && printf $1 $ip } + __my_ps1_script(){ local last=$? test -n "$SCRIPT" && echo "${__my_c5}SCR${__my_cdef} " return $last } + __my_ps1_scale(){ local last=$? printf "${LINES}x${COLUMNS}" return $last } + __my_ps1_tmux(){ local last=$? null type tmux || return $last @@ -702,11 +705,13 @@ __my_ps1_tmux(){ test -n "$TMUX" && echo "[TMUX:$tmuxc]" return $last } + __my_ps1_moc(){ local last=$? __my_moc_state "[MOC:%s]" return $last } + for f in /usr/share/git/git-prompt.sh \ /opt/local/share/doc/git-core/contrib/completion/git-prompt.sh do @@ -721,11 +726,13 @@ __my_ps1_git(){ __git_ps1 "[GIT:$(__try_exec git config --get user.name):%s]" return $last } + __my_ps1_ipaddr(){ local last=$? ! iswindows && ip-address [Addr:%s] return $last } + __my_ps1_bttry(){ local last=$? local bst="${TMP}/batterystatus" @@ -738,19 +745,22 @@ __my_ps1_bttry(){ fi return $last } + __my_ps1_dirs(){ dirs | wc -l } + __my_ps1_jobs(){ jobs | wc -l } + if test "$TERM" != dumb then - __my_c1="\[\e[1;31m\]" # color for PWD + __my_c1="\[\e[0;33m\]" # color for PWD __my_c2="\[\e[0;36m\]" # color for user __my_c3="\[\e[1;30m\]" # color for OLDPWD if test "`hostname`" = arch-aspireone; then __my_c4="\[\e[1;34m\]" - elif test "`hostname`" = darwin-mba.local; then __my_c4="\[\e[1;33m\]" + elif test "`hostname`" = darwin-mba.local; then __my_c4="\[\e[1;31m\]" elif test "`hostname`" = newkiwi; then __my_c4="\[\e[1;35m\]" else __my_c4="\[\e[1;32m\]" # color for :: fi diff --git a/tmux.conf.pl b/tmux.conf.pl index 4c3e920..06beb4e 100755 --- a/tmux.conf.pl +++ b/tmux.conf.pl @@ -9,7 +9,7 @@ my @tmux_setw_command = ("setw", "-g"); my %color_prefs = ( "arch-aspireone" => "blue,white", - "darwin-mba.local" => "yellow,black", + "darwin-mba.local" => "red,white", "newkiwi" => "magenta,white" ); my $color_def = "green,white"; From fff0a1a5eb39d238e54fe1404e3849706fe005f8 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 2 Feb 2013 14:51:48 +0900 Subject: [PATCH 10/10] add memo --- emacs.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/emacs.el b/emacs.el index 8f5e9ad..f745bad 100644 --- a/emacs.el +++ b/emacs.el @@ -270,6 +270,10 @@ found, otherwise returns nil." (add-to-list 'nbl b))) nbl)) +;; http://www.masteringemacs.org/articles/2012/09/10/hiding-replacing-modeline-strings/ +;; (add-to-list 'minor-mode-alist +;; '(global-whitespace-mode "")) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; show current info (defun my-message-current-info ()