From b41cb6afa477211b867201353066d9a568c0fe06 Mon Sep 17 00:00:00 2001 From: spongle Date: Wed, 3 Aug 2022 21:43:56 +0100 Subject: [PATCH] . --- shared/bash_profile | 61 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/shared/bash_profile b/shared/bash_profile index df8e098..7363b97 100755 --- a/shared/bash_profile +++ b/shared/bash_profile @@ -1,3 +1,60 @@ +_setaliases() { + case "$THISOS" in + darwin) + # Use MacVim's terminal vim for awesomeness support + hash rvim 2>/dev/null && alias vim=rvim + local FIND_EGREP="-E ."; + local LS_COLORFLAG='-G' + ;; + linux) + alias ls='ls -G' + local FIND_EGREP=". -regextype posix-egrep"; + local LS_COLORFLAG='--color=auto' + ;; + esac + + alias ls="ls $LS_COLORFLAG" + alias ll='ls -hl' + alias l.='ls -d .* --color=auto' + alias tree='tree -C' + + alias cruft="find $FIND_EGREP -regex '.*swo|.*swp|.*pyc|.*pyo|.*~' -exec rm {} \;" + + alias p="ps aux |grep " + alias grep="grep --color=auto" + + alias facts="echo -ne '\033[36m'; curl -s randomfunfacts.com | grep '' | sed 's/.*\(.*\)<\/i>.*/\1/'; echo -ne '\033[0m'; tput sgr0" + + # show numeric permissions + local FORMATFLAG="-c" + if ( uname -a | grep Darwin >/dev/null); then + FORMATFLAG="-f" + fi + alias perms="stat $FORMATFLAG '%A %a %n' *" + + # Add an "alert" alias for long running commands. Use like so: + # sleep 10; alert + alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' + +# alias dotfiles='git --git-dir=$HOME/.dotfiles.git/ --work-tree=$HOME' +# alias d='dotfiles' + alias .bashrc='source ~/.bashrc' + +# alias vimall='vim -p $(find . -type f)' + +# alias vp='vagrant provision' +# alias vdu='vagrant destroy -f; vagrant up' +# alias be='bundle exec' +# alias bek='bundle exec kitchen' + alias sha256='shasum -a 256' + +# local JSONCHECK="require 'json';puts(JSON.pretty_generate JSON.parse(STDIN.read))" +# alias checkjson="ruby -e \"$JSONCHECK\"" + + alias path='echo -e ${PATH//:/\\n}' +} + + LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib export LD_LIBRARY_PATH @@ -22,4 +79,6 @@ export LC_CTYPE LC_MESSAGES LC_COLLATE LC_ALL LANGUAGE LANG EDITOR=vi export EDITOR -#localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 \ No newline at end of file +#localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 + +_setaliases \ No newline at end of file