# .kshrc # # note: this file is executed by interactive non-login shell # if it needs to execute for login shells too (i.e. virtual # tty) add export ENV=$HOME/.kshrc to .profile LC_ALL="en_US.UTF-8" # This PS1 is completed at the end, allowing statuses to be included between the directory and closing $ PS1="[\u@\[\e[38;5;148m\]\h\[\e[m\]:\[\e[36m\]\W\[\e[m\]\[\e[m\]]\[\e[m\]" END_PS1="\$\[\e[m\] " # This is the original PS1 #PS1="[\u@\[\e[38;5;148m\]\h\[\e[m\]:\[\e[36m\]\W\[\e[m\]\[\e[m\]]\[\e[m\]\$\[\e[m\] " PATH="${HOME}/bin:${HOME}/.local/bin:${PATH}" # OpenBSD # FreeBSD # Darwin # Linux OS_NAME=`uname` ## Shell History export HISTSIZE=99999 export HISTFILE=$HOME/.ksh_history export HISTCONTROL="ignoredupes:ignorespace" export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" ## Telemetry # Disable various telemetry export SAM_CLI_TELEMETRY=0 ## Warpdir WD=`which warpdir 2> /dev/null` if [ -x "$WD" ]; then wd() { output=$(warpdir $@) status_code=$? if [[ $status_code -eq 0 ]]; then cd "$output" elif [[ "$output" != "" ]]; then echo "$output" fi unset output unset status_code } fi ## FZF FZF=`which fzf 2> /dev/null` if [ -x "$FZF" ]; then # fzf does not have first class ksh support. function fzf-histo { RES=$(fzf --tac --no-sort -e < $HISTFILE) test -n "$RES" || exit 0 eval "$RES" } # space so it isn't saved in the history bind -m ^R=' fzf-histo'^J fi ## Python __workon() { source ~/.virtualenvs/$1/bin/activate } __mkvirtualenv() { python -mvenv ~/.virtualenvs/$1 . $HOME/.virtualenvs/$1/bin/activate } alias workon=__workon alias mkvirtualenv=__mkvirtualenv ## Go if [ -d "$HOME/go/bin" ]; then export PATH=$HOME/go/bin:$PATH fi ## direnv DIRENV=`which direnv 2> /dev/null` if [ -x "$DIRENV" ]; then # https://github.com/direnv/direnv/issues/873 refresh_direnv() { eval "$("$DIRENV" export bash | sed 's@=\$'\''@='\''@g')" } direnv() { "$DIRENV" "$@" refresh_direnv } cd() { builtin cd "$@" refresh_direnv } fi ## nvm export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # Close off the PS1 with the $ export PS1=${PS1}${END_PS1}