first bash ricing
This commit is contained in:
parent
6c93f2f9f7
commit
983a04745f
2 changed files with 61 additions and 2 deletions
60
.bashrc
60
.bashrc
|
|
@ -1,9 +1,64 @@
|
|||
#
|
||||
#
|
||||
# ~/.bashrc
|
||||
#
|
||||
|
||||
# If not running interactively, don't do anything
|
||||
[[ $- != *i* ]] && return
|
||||
FDSG="\[$(tput setaf 158)\]"
|
||||
FINDIANRED="\[$(tput setaf 52)\]"
|
||||
BGREEN="\[$(tput setab 3)\]"
|
||||
BINDIANRED="\[$(tput setab 131)\]"
|
||||
BORANGE="\[$(tput setab 214)\]"
|
||||
FGREEN="\[$(tput setab 3)\]"
|
||||
BOLD="\e[1m\]"
|
||||
HIGHLIght="\e[7m\]"
|
||||
RESET="\[$(tput sgr0)\]"
|
||||
|
||||
function srcdir {
|
||||
dirname $(pwd)
|
||||
}
|
||||
|
||||
function exitstatus {
|
||||
if [[ $1 != 0 ]]; then
|
||||
echo $1
|
||||
fi
|
||||
}
|
||||
|
||||
function __prompt_to_bottom_line() {
|
||||
tput cup $LINES
|
||||
}
|
||||
__prompt_to_bottom_line
|
||||
|
||||
PS1="${BORANGE}${FINDIANRED}\$(exitstatus $(echo '$?'))${RESET}${FDSG}${BINDIANRED}[\u \! \W]>${RESET} "
|
||||
|
||||
|
||||
# function cd {
|
||||
# echo "$1"
|
||||
# if "$1" -ne ""; then
|
||||
# command cdJ "$1"
|
||||
# else
|
||||
# command cd
|
||||
# fi
|
||||
# }
|
||||
|
||||
# function test {
|
||||
# echo 'test'
|
||||
# }
|
||||
# test
|
||||
|
||||
# ahead_behind () {
|
||||
# curr_branch=$(git rev-parse --abbrev-ref HEAD);
|
||||
# curr_remote=$(git config branch.$curr_branch.remote);
|
||||
# curr_merge_branch=$(git config branch.$curr_branch.merge | cut -d / -f 3);
|
||||
# git rev-list --left-right --count $curr_branch...$curr_remote/$curr_merge_branch | tr -s '\t' '|';
|
||||
# }
|
||||
|
||||
# if git rev-parse --git-dir > /dev/null 2>&1; then
|
||||
# PS1="\h:\w[\$(ahead_behind)]$"
|
||||
# else
|
||||
# PS1='[\u@\h \W]\$ '
|
||||
# fi
|
||||
|
||||
|
||||
bind Space:magic-space
|
||||
alias ls='ls --color=auto'
|
||||
|
|
@ -11,6 +66,7 @@ alias grep='grep --color=auto'
|
|||
alias lsp='ls -al --color=auto'
|
||||
alias modosexo='kscreen-doctor output.DP-2.rotation.right'
|
||||
alias nomodosexo='kscreen-doctor output.DP-2.rotation.none'
|
||||
PS1='[\u@\h \W]\$ '
|
||||
alias clear='clear -x && __prompt_to_bottom_line'
|
||||
|
||||
export VITASDK=/usr/local/vitasdk
|
||||
export PATH=$VITASDK/bin:$PATH
|
||||
|
|
|
|||
3
.inputrc
Normal file
3
.inputrc
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
$include /etc/inputrc
|
||||
|
||||
"\C-l":"clear -x && __prompt_to_bottom_line\n"
|
||||
Loading…
Add table
Add a link
Reference in a new issue