ksh: Add kshrc
This commit is contained in:
parent
bb23b0b0de
commit
89748c9a10
35
.profile
35
.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
|
||||
|
Loading…
Reference in New Issue
Block a user