mirror of https://github.com/kianby/dotfiles
add .bashrc
parent
871ccba304
commit
aec43700af
@ -0,0 +1,82 @@
|
||||
#
|
||||
# ~/.bashrc
|
||||
#
|
||||
|
||||
# If not running interactively, don't do anything
|
||||
[[ $- != *i* ]] && return
|
||||
|
||||
[[ "$(whoami)" = "root" ]] && return
|
||||
|
||||
[[ -z "$FUNCNEST" ]] && export FUNCNEST=100 # limits recursive functions, see 'man bash'
|
||||
|
||||
## Use the up and down arrow keys for finding a command in history
|
||||
## (you can write some initial letters of the command first).
|
||||
bind '"\e[A":history-search-backward'
|
||||
bind '"\e[B":history-search-forward'
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# EDITOR
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
export EDITOR=/usr/bin/vim
|
||||
export SVN_EDITOR=/usr/bin/vim
|
||||
export GIT_EDITOR=/usr/bin/vim
|
||||
export VISUAL=/usr/bin/vim
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# PROMPT
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# set a minimalist prompt
|
||||
red='\[\e[0;31m\]' # Red
|
||||
green='\[\e[0;32m\]' # Green
|
||||
blue='\[\e[0;34m\]' # Bold Blue
|
||||
boldred='\[\e[1;31m\]' # Bold Red
|
||||
reset='\[\e[0m\]' # Text Reset
|
||||
|
||||
if [ "$USER" = "root" ] ; then
|
||||
# $bold$red
|
||||
PROMPT_USER_COLOR=$boldred
|
||||
PROMPT_SYMBOL="#"
|
||||
else
|
||||
PROMPT_USER_COLOR=$green
|
||||
PROMPT_SYMBOL="$"
|
||||
fi
|
||||
|
||||
if [[ -n "$SSH_CLIENT$SSH2_CLIENT$SSH_TTY" ]] ; then
|
||||
PROMPT_SSH="@\h"
|
||||
else
|
||||
PROMPT_SSH=""
|
||||
fi
|
||||
|
||||
PS1="$PROMPT_USER_COLOR\u$PROMPT_SSH $blue\w$reset $PROMPT_SYMBOL "
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# ALIASES
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# The ubiquitous 'll': directories first, with alphanumeric sorting
|
||||
alias ll="ls -lv --group-directories-first --ignore=.." # show long listing but no hidden dotfiles except "."
|
||||
alias la='ls -lav'
|
||||
alias vi='/usr/bin/vim'
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
if [ -f "$HOME/.bash-git-prompt/gitprompt.sh" ]; then
|
||||
GIT_PROMPT_ONLY_IN_REPO=1
|
||||
source $HOME/.bash-git-prompt/gitprompt.sh
|
||||
fi
|
||||
|
||||
# -------------------------------------------------------------
|
||||
# PYTHON
|
||||
# -------------------------------------------------------------
|
||||
|
||||
[[ -s $HOME/.pythonz/etc/bashrc ]] && source $HOME/.pythonz/etc/bashrc
|
||||
|
||||
if [ -f "$HOME/.pythonz/pythons/CPython-3.9.1/bin/python" ]; then
|
||||
export PATH=$HOME/.pythonz/pythons/CPython-3.9.1/bin:$PATH
|
||||
fi
|
||||
|
||||
if [ -f "$HOME/.pythonz/pythons/CPython-3.9.1/bin/pew" ]; then
|
||||
source "$(pew shell_config)"
|
||||
fi
|
Loading…
Reference in New Issue