-
-
Save KaMeHb-UA/7b12035f29dad630f13a63a3dd72d183 to your computer and use it in GitHub Desktop.
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
# don't put duplicate lines or lines starting with space in the history. | |
# See bash(1) for more options | |
HISTCONTROL=ignoreboth | |
# append to the history file, don't overwrite it | |
shopt -s histappend | |
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) | |
HISTSIZE=1000 | |
HISTFILESIZE=2000 | |
# check the window size after each command and, if necessary, | |
# update the values of LINES and COLUMNS. | |
shopt -s checkwinsize | |
# If set, the pattern "**" used in a pathname expansion context will | |
# match all files and zero or more directories and subdirectories. | |
#shopt -s globstar | |
# make less more friendly for non-text input files, see lesspipe(1) | |
[ -x /opt/bin/lesspipe ] && eval "$(SHELL=/system/bin/sh lesspipe)" | |
# Using color promt | |
if [[ ${EUID} == 0 ]] ; then | |
PS1='\[\033[48;2;221;75;57;38;2;255;255;255m\] \$ \[\033[48;2;0;135;175;38;2;221;75;57m\]\[\033[48;2;0;135;175;38;2;255;255;255m\] \h \[\033[48;2;83;85;85;38;2;0;135;175m\]\[\033[48;2;83;85;85;38;2;255;255;255m\] \w \[\033[49;38;2;83;85;85m\]\[\033[00m\] ' | |
else | |
PS1='\[\033[48;2;105;121;16;38;2;255;255;255m\] \$ \[\033[48;2;0;135;175;38;2;105;121;16m\]\[\033[48;2;0;135;175;38;2;255;255;255m\] \u@\h \[\033[48;2;83;85;85;38;2;0;135;175m\]\[\033[48;2;83;85;85;38;2;255;255;255m\] \w \[\033[49;38;2;83;85;85m\]\[\033[00m\] ' | |
fi | |
# Some better definitions | |
alias cp="cp -i" # confirm before overwriting something | |
alias df='df -h' # human-readable sizes | |
alias free='free -m' # show sizes in MB | |
alias more=less | |
# | |
# # ex - archive extractor | |
# # usage: ex <file> | |
ex () | |
{ | |
if [ -f $1 ] ; then | |
case $1 in | |
*.tar.bz2) tar xjf $1 ;; | |
*.tar.gz) tar xzf $1 ;; | |
*.bz2) bunzip2 $1 ;; | |
*.rar) unrar x $1 ;; | |
*.gz) gunzip $1 ;; | |
*.tar) tar xf $1 ;; | |
*.tbz2) tar xjf $1 ;; | |
*.tgz) tar xzf $1 ;; | |
*.zip) unzip $1 ;; | |
*.Z) uncompress $1;; | |
*.7z) 7z x $1 ;; | |
*) echo "'$1' cannot be extracted via ex()" ;; | |
esac | |
else | |
echo "'$1' is not a valid file" | |
fi | |
} | |
# enable color support of ls and also add handy aliases | |
if [ -x /opt/bin/dircolors ]; then | |
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" | |
alias ls='ls --color=auto' | |
#alias dir='dir --color=auto' | |
#alias vdir='vdir --color=auto' | |
alias grep='grep --color=auto' | |
alias fgrep='fgrep --color=auto' | |
alias egrep='egrep --color=auto' | |
fi | |
# some more ls aliases | |
alias ll='ls -alF' | |
alias la='ls -A' | |
alias l='ls -CF' | |
# Alias definitions. | |
# You may want to put all your additions into a separate file like | |
# ~/.bash_aliases, instead of adding them here directly. | |
# See /usr/share/doc/bash-doc/examples in the bash-doc package. | |
if [ -f ~/.bash_aliases ]; then | |
. ~/.bash_aliases | |
fi | |
# enable programmable completion features (you don't need to enable | |
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile | |
# sources /etc/bash.bashrc). | |
if [ -f /opt/etc/bash_completion ] && ! shopt -oq posix; then | |
. /opt/etc/bash_completion | |
fi |
So nice love it thx!
thanks man, really useful since Im forced to not use zsh, which is all I know...
the prompt is not working
according to the screen you've provided, the prompt works but your terminal is unable to display some symbols. It's fine, all you need is to change the font in your terminal app. If none of your favorite fonts works then you can try to install Powerline fonts and use one of them
the prompt is not working
according to the screen you've provided, the prompt works but your terminal is unable to display some symbols. It's fine, all you need is to change the font in your terminal app. If none of your favorite fonts works then you can try to install Powerline fonts and use one of them
thanks for you help! i installed the fonts-powerline package and tried it with "Droid Sans", now it is working :) 👍
thanks
It does not show head of branch or branch name if particular dir have .git folder.
It does not show head of branch or branch name if particular dir have .git folder.
right, it's non full-featured zsh replacement, just an example of more beautiful command line
I'm configured my self.
# Using color promt
if [[ ${EUID} == 0 ]] ; then
PS1='\[\033[48;2;221;75;57;38;2;255;255;255m\] \$ \[\033[48;2;0;135;175;38;2;221;75;57m\]\[\033[48;2;0;135;175;38;2;255;255;255m\] \h \[\033[48;2;83;85;85;38;2;0;135;175m\]\[\033[48;2;83;85;85;38;2;255;255;255m\] \w \[\033[49;38;2;83;85;85m\]$(__git_ps1 " (%s)")\[\033[49;38;2;83;85;85m\]\[\033[00m\] '
else
PS1='\[\033[48;2;105;121;16;38;2;255;255;255m\] \$ \[\033[48;2;0;135;175;38;2;105;121;16m\]\[\033[48;2;0;135;175;38;2;255;255;255m\] \u@\h \[\033[48;2;83;85;85;38;2;0;135;175m\]\[\033[48;2;83;85;85;38;2;255;255;255m\] \w \[\033[49;38;2;83;85;85m\]$(__git_ps1 " (%s)")\[\033[49;38;2;83;85;85m\]\[\033[00m\] '
fi
alias for git
alias root='cd ~/'
alias cls='clear'
# Git Aliases
alias g='git'
alias gs='git status'
alias ga='git add .'
alias gc='git commit -m'
alias gp='git push'
alias gl='git log --oneline --graph --decorate --all'
alias gb='git branch'
alias gco='git checkout'
alias gpl='git pull'
alias gcl='git clone'
alias grh='git reset --hard'
alias grs='git restore --staged .'
alias gd='git diff'
alias gm='git merge'
alias gpr='git pull --rebase'
This will be like powerline shell: