ksh: Add kshrc

This commit is contained in:
Salt 2018-08-08 16:52:09 -05:00
parent bb23b0b0de
commit 89748c9a10
2 changed files with 32 additions and 4 deletions

1
.kshrc Symbolic link
View File

@ -0,0 +1 @@
.local/bin/shrc/kshrc

View File

@ -89,10 +89,6 @@ else
alias ll="ls -Ahl $lsarguments" alias ll="ls -Ahl $lsarguments"
fi fi
if `which sudo`; then
alias fug='sudo `history -p !!`'
fi
alias waitwhat='echo $?' alias waitwhat='echo $?'
# urxvt isn't a very well-known terminal # urxvt isn't a very well-known terminal
@ -100,6 +96,37 @@ if [ "$TERM" = "rxvt-unicode-256color" ]; then
export TERM=xterm-256color export TERM=xterm-256color
fi fi
# Set up a default PS1
# This *should* work for all terminals. I know it works on ksh
_ps1() {
r="\e[0m"
fg_blue="\e[34m"
fg_red="\e[31m"
fg_green="\e[32m"
fg_bold="\e[1m"
hostname_prefix="${fg_blue}"
# Change PWD color in SSH sessions
if [ "$SSH_CLIENT" ]; then
# Also add the machine's hostname
hostname_prefix="${fg_bold}${fg_red}`hostname`${r}${fg_red}:"
fi
# Show the tilde instead of $HOME
cpwd="${PWD/#$HOME/\~}"
# Alert us if the last command failed
fail=""
exitcode=$?
if ! [ "$exitcode" ]; then
fail="${fg_bold}${fg_red}?"
fi
printf "[${hostname_prefix}${cpwd}${r}]${fail}${r}${fg_green}\$${r} "
}
if ! [ "$ZSH_NAME" ]; then
# I've got a different ZSH theme
export PS1='`_ps1`'
fi
# Minor configuration settings # Minor configuration settings
export EDITOR=`which vim` export EDITOR=`which vim`
export PATH=$PATH:$HOME/.local/bin export PATH=$PATH:$HOME/.local/bin