New .bashrc

This commit is contained in:
Sonny Bakker 2017-08-23 21:34:57 +02:00
parent 9a03d6de56
commit 0da56d6ae1
3 changed files with 33 additions and 11 deletions

13
.bashrc
View file

@ -68,11 +68,9 @@ if [ -n "$force_color_prompt" ]; then
fi
if [ "$color_prompt" = yes ]; then
# Purple hostname indicates SSH connection
PS1="\e[1m$ORANGE\e2\u$BLUE@$GREEN\h$white:$BLUE\w$white\$ "
if [ -n "$SSH_CONNECTION" ];then
PS1="\e[1m$ORANGE\e2\u$BLUE@$GREEN\h$white:$BLUE\w$white\$ $RED[SSH]$white "
else
PS1="\e[1m$ORANGE\e2\u$BLUE@$GREEN\h$white:$BLUE\w$white\$ "
PS1="$PS1$RED[SSH]$white "
fi
else
PS1='\u@\h:\w\$ '
@ -81,7 +79,11 @@ fi
# Show different prompt when root
if [ $(id -u) -eq 0 ];
then
PS1="[$RED\u@\h$white]----[$RED\$(pwd)$white]\n# "
if [ -n "$SSH_CONNECTION" ];then
PS1="[$RED\u@\h$white]----[$RED\$(pwd)$white]----$white[$RED SSH $white]\n# "
else
PS1="[$RED\u@\h$white]----[$RED\$(pwd)$white]\n# "
fi
fi
unset color_prompt force_color_prompt
@ -102,7 +104,6 @@ fi
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

View file

@ -9,19 +9,26 @@ function get_path {
}
function user_config {
read -p 'Install the script for a normal user or root account? [user/root]: ' USER
if [[ "$USER" == "user" ]]; then
get_path
mkdir $HOME/.vim
ln -s $SCRIPTPATH/{vim/.vimrc,tmux/.tmux.conf} $HOME/;
mkdir $HOME/.vim
if [[ -a $HOME/.bashrc ]]; then
mv $HOME/.bashrc $HOME/.bashrc.old
echo "Old .bashrc moved to .bashrc.old"
fi
ln -s $SCRIPTPATH/{.bashrc,vim/.vimrc,tmux/.tmux.conf} $HOME/;
ln -s $SCRIPTPATH/vim/colors $HOME/.vim/
echo 'Linking configuration files done'
elif [[ "$USER" == "root" ]]; then
get_path
mkdir /root/.vim
ln -s $SCRIPTPATH/{vim/.vimrc,tmux/.tmux.conf} /root/
mkdir /root/.vim
if [[ -a $HOME/.bashrc ]]; then
mv /root/.bashrc /root/.bashrc.old
echo "Old .bashrc moved to .bashrc.old"
fi
ln -s $SCRIPTPATH/{.bashrc,vim/.vimrc,tmux/.tmux.conf} /root/
ln -s $SCRIPTPATH/vim/colors /root/.vim/
echo 'Linking configuration files done'
else

View file

@ -32,6 +32,18 @@ set t_ut=
" Light colorscheme by default
colorscheme seagull
"Change theme depending on the time of day
let hr = (strftime('%H'))
if hr >= 19
set background=dark
colorscheme spacemacs
elseif hr >= 8
colorscheme xcode
elseif hr >= 0
set background=dark
colorscheme spacemacs
endif
" Terminal colors
set termguicolors
@ -82,6 +94,8 @@ au BufWinEnter * silent loadview
"files in current directory
autocmd FileType python compiler pylint
"Netrw options
function! ToggleVExplorer()
if exists("t:expl_buf_num")