From 0da56d6ae1a51cce7924b47d24908d1a28aa80c8 Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Wed, 23 Aug 2017 21:34:57 +0200 Subject: [PATCH] New .bashrc --- .bashrc | 13 +++++++------ initialize_script | 17 ++++++++++++----- vim/.vimrc | 14 ++++++++++++++ 3 files changed, 33 insertions(+), 11 deletions(-) diff --git a/.bashrc b/.bashrc index ea90a55..3554d6d 100644 --- a/.bashrc +++ b/.bashrc @@ -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 diff --git a/initialize_script b/initialize_script index 40da93a..e8cb0ef 100755 --- a/initialize_script +++ b/initialize_script @@ -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 diff --git a/vim/.vimrc b/vim/.vimrc index 5593412..3aca583 100755 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -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")