################################################################################ # Shell Configuration ################################################################################ ### Functions ## Common hup() { (read pid; kill -HUP $pid) /dev/null 2>&1 ; then __TMUX_OPTION__="attach -t ${__TMUX_SESS__}" else __TMUX_OPTION__="new-session -s ${__TMUX_SESS__} ; split-window -h" fi ${__TMUX_BIN__} ${__TMUX_OPTION__} fi unset __TMUX_BIN__ __TMUX_SESS__ __TMUX_OPTION__ } ## for yash if [ -x /usr/local/bin/yash ]; then sh() { yash --posix "$@"; } else sh() { /bin/sh "$@"; } fi ## Yash common configuration if [ ! -z "${YASH_VERSION}" ] ; then # set -f # -f すると'*'が展開されなくなる bindkey --emacs '\^L' clear-and-redraw-all # for emacs mode # POSIX collect modeでは、YASH拡張が使えなくなる # set -o posixlycorrect fi ### Personal Environment Variables # for HomeBrew export HOMEBREW_GITHUB_API_TOKEN="37edea7e3d75b4a84fb2d913008af7ebef407033" # Shell Variables. umask 022 ## Environment Variables EDITOR=vi for i in lv less more; do which $i 2>&1 > /dev/null && PAGER=`which $i`; done; ## Aliases alias h='fc -l' alias j=jobs alias ll='ls -laFo' alias l='ls -l' alias g='egrep -i' alias man="LANG=C /usr/bin/man" alias nossh='ssh -o "UserKnownHostsFile /dev/null"' alias noscp='scp -o "UserKnownHostsFile /dev/null"' alias svn='LANG=ja_JP.UTF-8 svn' ## Shell command line editing ***WARN*** set -o emacs ( set -o tabcomplete 2>/dev/null ) && set -o tabcomplete # for NetBSD /bin/sh : ${__HOSTNAME__:=$(uname -n)} PS1="${__HOSTNAME__%%.*}" case `id -u` in 0) PS1="${PS1}# ";; *) PS1="${PS1}$ ";; esac unset __HOSTNAME__ ## Execute command [ -x /usr/bin/tset ] && eval $(tset -sQrm 'unknown:?unknown') [ -f $HOME/bin/goenv.sh ] && . $HOME/bin/goenv.sh [ -f $HOME/bin/rbenv.sh ] && . $HOME/bin/rbenv.sh start_tmux ################################################################################ # # 予約環境変数 # i : for counter # __HOSTNAME__ : hostname # # __TMUX_BIN__ : tmux executable file # __TMUX_OPTION__ : tmux options # __TMUX_SESS_NAME__ : tmux session name # # __PAGER__ : temporaly pager commands # # This .profile is checked under following OSs. # - MacOS-X BigSur # # This .profile is checked under following shells. # - zsh (5.8) # - yash (2.51) # - dash (from HomeBrew) # - ash (FreeBSD-12.2-p3) # # ***** WARNINGS ***** # - dash included in OS-X BigSur is compiled without commandline completion. Must use HomeBrew version.