Last active
June 5, 2025 16:00
-
-
Save raykin/aba97bfe959413ca2174a609036d91c3 to your computer and use it in GitHub Desktop.
bash config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # make less more friendly for non-text input files, see lesspipe(1) | |
| [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" | |
| if [[ $- != *i* ]]; then | |
| #echo "This is a non-interactive shell" | |
| return | |
| fi | |
| # set a fancy prompt (non-color, unless we know we "want" color) | |
| case "$TERM" in | |
| xterm-color) color_prompt=yes;; | |
| esac | |
| alias gf='git fetch' | |
| alias ga='git add . && git ci --amend --no-edit' | |
| alias gs='git status' | |
| alias gp='git push' | |
| alias gl='git log --oneline --decorate' | |
| alias gll='git pull' | |
| alias restartv="cp /root/config.json /usr/local/etc/v2ray/ && systemctl restart v2ray" | |
| # enable color support of ls and also add handy aliases | |
| if [ -x /usr/bin/dircolors ]; then | |
| test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" | |
| alias ls='ls --color=auto' | |
| alias grep='grep --color=auto' | |
| alias fgrep='fgrep --color=auto' | |
| alias egrep='egrep --color=auto' | |
| fi | |
| export PATH=$PATH:/usr/local/bin | |
| function parse_git_branch () { | |
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
| } | |
| RED="\[\033[0;31m\]" | |
| YELLOW="\[\033[0;33m\]" | |
| GREEN="\[\033[0;32m\]" | |
| NO_COLOUR="\[\033[0m\]" | |
| PS1="$GREEN\u@\h$NO_COLOUR:\w$YELLOW\$(parse_git_branch)$NO_COLOUR\$ " | |
| if [ -d $HOME/.rbenv ]; then | |
| export PATH="$HOME/.rbenv/bin:$PATH" | |
| eval "$(rbenv init -)" | |
| fi | |
| if [ "$SSH_TTY" ] | |
| then | |
| free -m | |
| fi | |
| if [ -f ~/.localrc ]; then | |
| source ~/.localrc | |
| fi | |
| p () { ps -eo rss,pid,user,command --sort -size | awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=2 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' | grep "$@" | grep -v grep; } | |
| ha () { history | ag "$@" | tail; } | |
| export DISABLE_NOTIFIER=true | |
| # Path to the bash it configuration | |
| export BASH_IT="/root/.bash_it" | |
| # Lock and Load a custom theme file | |
| # location /.bash_it/themes/ | |
| export BASH_IT_THEME='bobby' | |
| # Don't check mail when opening terminal. | |
| unset MAILCHECK | |
| # Set this to false to turn off version control status checking within the prompt for all themes | |
| export SCM_CHECK=true | |
| # (Advanced): Uncomment this to make Bash-it reload itself automatically | |
| # after enabling or disabling aliases, plugins, and completions. | |
| # export BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE=1 | |
| # Load Bash It | |
| source $BASH_IT/bash_it.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment