From 25e221ccd7bba7d13d7c3447e9f1e384488d4456 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 8 Sep 2012 15:00:31 +0900 Subject: [PATCH 1/5] fix open_file --- bashrc | 1 + 1 file changed, 1 insertion(+) diff --git a/bashrc b/bashrc index 24095e3..48bdc4a 100755 --- a/bashrc +++ b/bashrc @@ -386,6 +386,7 @@ open_file(){ open "$@" elif islinux then + touch "$@" if null type pcmanfm; then LC_MESSAGES= pcmanfm "$@" else From 7ff9fea4974b3bdde2b801439aa573aefa27950e Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 8 Sep 2012 15:24:20 +0900 Subject: [PATCH 2/5] fix tmux color --- tmux.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tmux.conf b/tmux.conf index 3a771d2..a81b049 100644 --- a/tmux.conf +++ b/tmux.conf @@ -20,9 +20,9 @@ set message-fg yellow set -g set-titles on set -g status-bg green -set -g status-fg black +set -g status-fg white if "test `hostname` = arch-aspireone" "set -g status-bg blue" if "test `hostname` = darwin-mba.local" "set -g status-bg yellow; set -g status-fg black" -if "test `hostname` = newkiwi" "set -g status-bg magenta" +if "test `hostname` = newkiwi" "set -g status-bg magenta; set -g status-fg white" if "test -f /opt/local/bin/reattach-to-user-namespace" "set-option -g default-command '/opt/local/bin/reattach-to-user-namespace bash'" From a8549ff0f83265a297902b254d7268c098b028c4 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 8 Sep 2012 19:44:09 +0900 Subject: [PATCH 3/5] updage pupgrade alias --- bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bashrc b/bashrc index 0c3ec72..8176e45 100755 --- a/bashrc +++ b/bashrc @@ -187,7 +187,7 @@ null type pacmatic && { null type apt-get && \ alias aupgrade="sudo apt-get autoremove --yes && sudo apt-get update --yes && sudo apt-get upgrade --yes" null type port && \ - alias pupgrade="sudo port -v selfupdate && sudo port -v upgrade outdated && sudo port -v uninstall leaves" + alias pupgrade="sudo port -v selfupdate && { sudo port -v upgrade outdated; sudo port -v uninstall leaves; }" if iscygwin; then null type windate || alias windate="/c/Windows/System32/cmd.exe //c 'echo %DATE%-%TIME%'" From 61eab2f4c01b83e3b3b50131009ce67795b21185 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 9 Sep 2012 01:54:59 +0900 Subject: [PATCH 4/5] rm duplicate item when pushd --- bashrc | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/bashrc b/bashrc index 20343c0..12e374e 100755 --- a/bashrc +++ b/bashrc @@ -187,6 +187,7 @@ null type pacmatic && { null type apt-get && \ alias aupgrade="sudo apt-get autoremove --yes && sudo apt-get update --yes && sudo apt-get upgrade --yes" null type port && \ + alias port="port -v" alias pupgrade="sudo port -v selfupdate && { sudo port -v upgrade outdated; sudo port -v uninstall leaves; }" if iscygwin; then @@ -214,27 +215,27 @@ netwait(){ cd(){ if test $# -eq 0 then - pushd ~/ + pushd ~/ >/dev/null elif test $1 = - then local pwd="$PWD" popd >/dev/null - pushd -n "$pwd" # stack last dir + pushd -n "$pwd" >/dev/null # stack last dir else - pushd "$@" + pushd "$@" >/dev/null fi } -# pushd(){ -# local pwd="$PWD" -# for l in $(\dirs -v -l | \grep "^ [0-9]\+ ${pwd}$" | cut -d " " -f 2 | tac) -# do -# echo $l -# test $l -eq 0 && continue -# popd +$l -n -# done -# command pushd "$@" >/dev/null -# } +pushd(){ + local pwd="$PWD" + for l in $(\dirs -v -l | \grep "^ [0-9]\+ *${pwd}$" | cut -d " " -f 2 | tac) + do + echo $l + test $l -eq 0 && continue + popd +$l -n + done + command pushd "$@" >/dev/null +} input(){ local foo From 5637a3c49748b9572bfe1fbfbd630ea6fb1fe10e Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 9 Sep 2012 02:03:31 +0900 Subject: [PATCH 5/5] fix cd and pushd --- bashrc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bashrc b/bashrc index 12e374e..5a5cedd 100755 --- a/bashrc +++ b/bashrc @@ -216,25 +216,29 @@ cd(){ if test $# -eq 0 then pushd ~/ >/dev/null + elif ! test -d "$1" + then + echo `basename ${SHELL}`: cd: "$1": No such file or directory 2>&1 + return 1 elif test $1 = - then local pwd="$PWD" popd >/dev/null pushd -n "$pwd" >/dev/null # stack last dir else - pushd "$@" >/dev/null + pushd "$1" >/dev/null fi } pushd(){ - local pwd="$PWD" - for l in $(\dirs -v -l | \grep "^ [0-9]\+ *${pwd}$" | cut -d " " -f 2 | tac) + local next="$(realpath "$1")" + for l in $(\dirs -v -l | \grep "^ [0-9]\+ *${next}$" | cut -d " " -f 2 | tac) do echo $l test $l -eq 0 && continue popd +$l -n done - command pushd "$@" >/dev/null + command pushd "$1" >/dev/null } input(){