New .bashrc
This commit is contained in:
parent
9a03d6de56
commit
0da56d6ae1
3 changed files with 33 additions and 11 deletions
13
.bashrc
13
.bashrc
|
|
@ -68,11 +68,9 @@ if [ -n "$force_color_prompt" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$color_prompt" = yes ]; then
|
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
|
if [ -n "$SSH_CONNECTION" ];then
|
||||||
PS1="\e[1m$ORANGE\e2\u$BLUE@$GREEN\h$white:$BLUE\w$white\$ $RED[SSH]$white "
|
PS1="$PS1$RED[SSH]$white "
|
||||||
else
|
|
||||||
PS1="\e[1m$ORANGE\e2\u$BLUE@$GREEN\h$white:$BLUE\w$white\$ "
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
PS1='\u@\h:\w\$ '
|
PS1='\u@\h:\w\$ '
|
||||||
|
|
@ -81,7 +79,11 @@ fi
|
||||||
# Show different prompt when root
|
# Show different prompt when root
|
||||||
if [ $(id -u) -eq 0 ];
|
if [ $(id -u) -eq 0 ];
|
||||||
then
|
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
|
fi
|
||||||
|
|
||||||
unset color_prompt force_color_prompt
|
unset color_prompt force_color_prompt
|
||||||
|
|
@ -102,7 +104,6 @@ fi
|
||||||
# You may want to put all your additions into a separate file like
|
# You may want to put all your additions into a separate file like
|
||||||
# ~/.bash_aliases, instead of adding them here directly.
|
# ~/.bash_aliases, instead of adding them here directly.
|
||||||
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
|
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
|
||||||
|
|
||||||
if [ -f ~/.bash_aliases ]; then
|
if [ -f ~/.bash_aliases ]; then
|
||||||
. ~/.bash_aliases
|
. ~/.bash_aliases
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -9,19 +9,26 @@ function get_path {
|
||||||
}
|
}
|
||||||
|
|
||||||
function user_config {
|
function user_config {
|
||||||
|
|
||||||
read -p 'Install the script for a normal user or root account? [user/root]: ' USER
|
read -p 'Install the script for a normal user or root account? [user/root]: ' USER
|
||||||
|
|
||||||
if [[ "$USER" == "user" ]]; then
|
if [[ "$USER" == "user" ]]; then
|
||||||
get_path
|
get_path
|
||||||
mkdir $HOME/.vim
|
mkdir $HOME/.vim
|
||||||
ln -s $SCRIPTPATH/{vim/.vimrc,tmux/.tmux.conf} $HOME/;
|
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/
|
ln -s $SCRIPTPATH/vim/colors $HOME/.vim/
|
||||||
echo 'Linking configuration files done'
|
echo 'Linking configuration files done'
|
||||||
elif [[ "$USER" == "root" ]]; then
|
elif [[ "$USER" == "root" ]]; then
|
||||||
get_path
|
get_path
|
||||||
mkdir /root/.vim
|
mkdir /root/.vim
|
||||||
ln -s $SCRIPTPATH/{vim/.vimrc,tmux/.tmux.conf} /root/
|
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/
|
ln -s $SCRIPTPATH/vim/colors /root/.vim/
|
||||||
echo 'Linking configuration files done'
|
echo 'Linking configuration files done'
|
||||||
else
|
else
|
||||||
|
|
|
||||||
14
vim/.vimrc
14
vim/.vimrc
|
|
@ -32,6 +32,18 @@ set t_ut=
|
||||||
" Light colorscheme by default
|
" Light colorscheme by default
|
||||||
colorscheme seagull
|
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
|
" Terminal colors
|
||||||
set termguicolors
|
set termguicolors
|
||||||
|
|
||||||
|
|
@ -82,6 +94,8 @@ au BufWinEnter * silent loadview
|
||||||
"files in current directory
|
"files in current directory
|
||||||
autocmd FileType python compiler pylint
|
autocmd FileType python compiler pylint
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
"Netrw options
|
"Netrw options
|
||||||
function! ToggleVExplorer()
|
function! ToggleVExplorer()
|
||||||
if exists("t:expl_buf_num")
|
if exists("t:expl_buf_num")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue