Browse Source

Merge branch 'master' of github.com:10sr/dotfiles

pull/1/head
10sr 11 years ago
parent
commit
b6327cd379
2 changed files with 61 additions and 7 deletions
  1. +4
    -5
      README.txt
  2. +57
    -2
      bashrc

+ 4
- 5
README.txt View File

@@ -10,16 +10,16 @@ __Do not go out of ways how the default environments work__.




There are many cases when I must work on foreign environments, and it is always There are many cases when I must work on foreign environments, and it is always
VERY irritating when things will not work as I expect, yet setting up my own
environment will be troublesome. So I avoid changing behaviors of tools,
except for emacs.
VERY irritating when things do not work as I expected, yet setting up my own
environment is troublesome. So I avoid changing behaviors of tools, except
for emacs.


Emacs is the editor I usually use for coding. I decided to change the behavior Emacs is the editor I usually use for coding. I decided to change the behavior
of emacs as I want without thinking about other environments. When I cannot use of emacs as I want without thinking about other environments. When I cannot use
my emacs.el I'll use vi or vim instead. my emacs.el I'll use vi or vim instead.


Other tools like bash and vim basically work in the same ways even when using my Other tools like bash and vim basically work in the same ways even when using my
rc files. The main changes are related to showing informations, typically the
rc files. The main changes are related to showing informations, typically in the
bash prompt. bash prompt.




@@ -41,4 +41,3 @@ Sourcing flow
|--~/.dotfiles/xprofile |--~/.dotfiles/xprofile
| |
`--~/.dotfiles/xprograms `--~/.dotfiles/xprograms


+ 57
- 2
bashrc View File

@@ -338,12 +338,66 @@ then
|| complete -o default -o nospace -F _git g || complete -o default -o nospace -F _git g
fi fi
git svn --help >/dev/null 2>&1 && alias gsvn="git svn" git svn --help >/dev/null 2>&1 && alias gsvn="git svn"
null type gitmemo && alias m=gitmemo


null type gitmemo && alias m=gitmemo null type gitmemo && alias m=gitmemo


alias setup.py="sudo python3 setup.py install --record files.txt" alias setup.py="sudo python3 setup.py install --record files.txt"


datestr(){
# datestr yyyyMMdd-hhmmss
if test -z "$1" || test "$1" == "-h"
then
echo "datestr: usage: datestr <yyyyMMddhhmmss>"
return 1
fi

dfmt= # actual format for date command
while test -n "$1"
do
fmt="$1"
while test -n "$fmt"
do
case "$fmt" in
yyyy*) # year
dfmt="${dfmt}%Y"
fmt="`echo "$fmt" | cut -c 5-`"
;;
yy*) # last two digits of year
dfmt="${dfmt}%y"
fmt="`echo "$fmt" | cut -c 3-`"
;;
MM*) # month (01..12)
dfmt="${dfmt}%m"
fmt="`echo "$fmt" | cut -c 3-`"
;;
dd*) # day of month (01..12)
dfmt="${dfmt}%d"
fmt="`echo "$fmt" | cut -c 3-`"
;;
HH* | hh*) # hour (00..23)
dfmt="${dfmt}%H"
fmt="`echo "$fmt" | cut -c 3-`"
;;
mm*) # minute (00..59)
dfmt="${dfmt}%M"
fmt="`echo "$fmt" | cut -c 3-`"
;;
ss*) # second (00..60)
dfmt="${dfmt}%S"
fmt="`echo "$fmt" | cut -c 3-`"
;;
*)
char=`echo "$fmt" | cut -c 1`
dfmt="${dfmt}${char}"
fmt="`echo "$fmt" | cut -c 2-`"
;;
esac
done
shift
done
date +"$dfmt"
}

ssh(){ ssh(){
__my_set_screen_title ssh __my_set_screen_title ssh
command ssh "$@" command ssh "$@"
@@ -688,7 +742,8 @@ di(){
} }


tb(){ tb(){
local tb="$HOME/.my/tb"
local datenum=`date +%Y%m%d-%H%M%S`
local tb="$HOME/.my/tb/$datenum"
mkdir -p "$tb" mkdir -p "$tb"
for file in "$@" for file in "$@"
do do


Loading…
Cancel
Save