diff --git a/bashrc b/bashrc index 079f893..5f91974 100644 --- a/bashrc +++ b/bashrc @@ -4,8 +4,6 @@ case $- in esac HISTCONTROL=ignoreboth shopt -s histappend -HISTSIZE=1000 -HISTFILESIZE=2000 shopt -s checkwinsize [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then @@ -118,18 +116,6 @@ function tsh(){ echo -e "\n\n\n\n\n\n\nSESSION CLOSED\n\n\n\n\n\n\n" } -#History control -if [ "$BASH" ]; then - export HISTTIMEFORMAT="%Y-%m-%d_%H:%M:%S " - export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ; }"'echo "`date +'%y.%m.%d-%H:%M:%S:'`" $USER "$(pwd)" "$(history 1 | cut -c8-)" >> ~/.bash_eternal_history' - alias ehistory='cat ~/.bash_eternal_history|grep $@' - #readonly PROMPT_COMMAND - #readonly HISTSIZE - readonly HISTFILE - readonly HOME - readonly HISTIGNORE - #readonly HISTCONTROL -fi #Functions extract () { @@ -183,3 +169,76 @@ function initify(){ git co master } export -f initify + + + + + + + + +#Color definitions +txtblk='\e[0;30m' # Black - Regular +txtred='\e[0;31m' # Red +txtgrn='\e[0;32m' # Green +txtylw='\e[0;33m' # Yellow +txtblu='\e[0;34m' # Blue +txtpur='\e[0;35m' # Purple +txtcyn='\e[0;36m' # Cyan +txtwht='\e[0;37m' # White + +bldblk='\e[1;30m' # Black - Bold +bldred='\e[1;31m' # Red +bldgrn='\e[1;32m' # Green +bldylw='\e[1;33m' # Yellow +bldblu='\e[1;34m' # Blue +bldpur='\e[1;35m' # Purple +bldcyn='\e[1;36m' # Cyan +bldwht='\e[1;37m' # White + +unkblk='\e[4;30m' # Black - Underline +undred='\e[4;31m' # Red +undgrn='\e[4;32m' # Green +undylw='\e[4;33m' # Yellow +undblu='\e[4;34m' # Blue +undpur='\e[4;35m' # Purple +undcyn='\e[4;36m' # Cyan +undwht='\e[4;37m' # White + +bakblk='\e[40m' # Black - Background +bakred='\e[41m' # Red +badgrn='\e[42m' # Green +bakylw='\e[43m' # Yellow +bakblu='\e[44m' # Blue +bakpur='\e[45m' # Purple +bakcyn='\e[46m' # Cyan +bakwht='\e[47m' # White + +txtrst='\e[0m' # Text Reset + +#History control +if [ "$BASH" ]; then + parse_git_branch() { + git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/' + } + prompt(){ + printf "[$txtgrn%s$txtrst][$txtred%s$txtrst][$txtblu%s$txtrst]➢" $(whoami) "$PWD" $(parse_git_branch) + } + PS1= + PROMPT_COMMAND=prompt + export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ; }"'echo "`date +'%y.%m.%d-%H:%M:%S:'`" $USER "$(pwd)" "$(history 1 | cut -c8-)" >> ~/.bash_eternal_history' + #PROMPT_COMMAND='PS1="\[\033[0;33m\][\!]\`if [[ \$? = "0" ]]; then echo "\\[\\033[32m\\]"; else echo "\\[\\033[31m\\]"; fi\`[\u.\h: \`if [[ `pwd|wc -c|tr -d " "` > 18 ]]; then echo "\\W"; else echo "\\w"; fi\`]\$\[\033[0m\] "; echo -ne "\033]0;`hostname -s`:`pwd`\007"' + + export HISTFILESIZE= + export HISTSIZE= + export HISTTIMEFORMAT="%Y-%m-%d_%H:%M:%S " + export HISTFILE=~/.bash_eternal_history + + alias ehistory='cat ~/.bash_eternal_history|grep $@' + readonly HOME + readonly HISTIGNORE + #readonly PROMPT_COMMAND + #readonly HISTSIZE + #readonly HISTFILE + #readonly HISTCONTROL +fi diff --git a/vimrc b/vimrc index 55f71bd..77f70ab 100644 --- a/vimrc +++ b/vimrc @@ -5,6 +5,8 @@ endif nnoremap autoformat! :%s/, /,:%s/ \/ /\/:%s/ {/{:%s/} /}:%s/ = /= command! W %!sudo tee > /dev/null % autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o +autocmd FileType * :hi IndentGuidesOdd guibg=red ctermbg=239 +autocmd FileType * :hi IndentGuidesEven guibg=white ctermbg=239 au VimResized * exe "normal! \=" au BufRead,BufNewFile *.twig set filetype=htmljinja "match Error /\s\+$/ @@ -113,7 +115,7 @@ nnoremap :bp nnoremap :bn nnoremap z _| nnoremap bn G?Bundleyyp$hdi'"+gP0Wl3d/\/x:nohlsearch:up:BundleInstall -nnoremap :CtrlPFunky +nnoremap :CtrlPFunky nmap [e nmap ]e vmap [egv