diff --git a/.kshrc b/.kshrc new file mode 120000 index 00000000..966df152 --- /dev/null +++ b/.kshrc @@ -0,0 +1 @@ +.local/bin/shrc/kshrc \ No newline at end of file diff --git a/.profile b/.profile index 6790b4cc..7eb8ac02 100755 --- a/.profile +++ b/.profile @@ -89,10 +89,6 @@ else alias ll="ls -Ahl $lsarguments" fi -if `which sudo`; then - alias fug='sudo `history -p !!`' -fi - alias waitwhat='echo $?' # urxvt isn't a very well-known terminal @@ -100,6 +96,37 @@ if [ "$TERM" = "rxvt-unicode-256color" ]; then export TERM=xterm-256color 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 export EDITOR=`which vim` export PATH=$PATH:$HOME/.local/bin