Browse Source

.bashrc add git change num files, install-new-server add ripgrep

master
arnaucube 4 years ago
parent
commit
01431338f0
2 changed files with 14 additions and 3 deletions
  1. +10
    -3
      .bashrc
  2. +4
    -0
      install-new-server.sh

+ 10
- 3
.bashrc

@ -3,17 +3,24 @@
# #
# after the default config # after the default config
# Show git branch name
# Show git branch name and if there are files not commited show the number
force_color_prompt=yes force_color_prompt=yes
color_prompt=yes color_prompt=yes
parse_git_branch() { parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
} }
check_files_changed() {
if [ -d .git ]; then
if ((0!=$(git diff-index HEAD | wc -l))); then
echo "["$(git diff-index HEAD | wc -l)"]";
fi;
fi
}
if [ "$color_prompt" = yes ]; then if [ "$color_prompt" = yes ]; then
# for username green: # for username green:
# PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;95m\]$(parse_git_branch)\[\033[00m\]\$ '
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;95m\]$(parse_git_branch)\[\033[01;90m\]$(check_files_changed)\[\033[00m\]\$ '
# for username pink: # for username pink:
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;33m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;95m\]$(parse_git_branch)\[\033[00m\]\$ '
# PS1='${debian_chroot:+($debian_chroot)}\[\033[01;33m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;95m\]$(parse_git_branch)\[\033[01;93m\]$(check_files_changed)\[\033[00m\]\$ '
else else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\$ ' PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\$ '
fi fi

+ 4
- 0
install-new-server.sh

@ -16,6 +16,7 @@ cp ./.vimrc ~/.vimrc
# neovim # neovim
echo "installing neovim" echo "installing neovim"
# alternative: apt-get install python3-neovim
apt-get -y install neovim apt-get -y install neovim
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \ curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
@ -56,6 +57,9 @@ echo "installing fzf fuzzy finder"
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install ~/.fzf/install
echo "instaling ripgrep"
curl -LO https://github.com/BurntSushi/ripgrep/releases/download/11.0.2/ripgrep_11.0.2_amd64.deb
dpkg -i ripgrep_11.0.2_amd64.deb
# nginx # nginx
apt install nginx -y apt install nginx -y

Loading…
Cancel
Save