Advertisement
Guest User

.bashrc (MacOSX)

a guest
Sep 21st, 2014
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.07 KB | None | 0 0
  1. # Aliases for ls, cd, mv, etc.
  2. alias ls='ls -FG'
  3. alias ll='ls -lh'
  4. alias la='ls -lA'
  5. alias ..='cd ..'
  6. alias ...='cd ../..'
  7. alias ....='cd ../../..'
  8. alias mv='mv -i'
  9.  
  10. # Some useful alias for Mac OS X
  11. alias nospotlight='sudo mdutil -a -i off'
  12. alias cleardnscache='sudo killall -HUP mDNSResponder'
  13. alias ldd='otool -L'
  14. alias seq='jot - '
  15. alias eject='drutil eject'
  16.  
  17. # Set up bash completion
  18. set show-all-if-ambiguous On    # show list automatically, without double tab
  19.  
  20. # Set up less pager: ignore case on search, do not clear screen on exit, customized status bar
  21. export LESS='-iX --prompt="?f%f:<Standard input>. ?n?m(file %i of %m) ..?lt(lines %lt-%lb?L/%L.) :(byte %bB?s/%s.) .?e(END) ?x- Next\: %x.:?pB%pB\%..%t"'
  22. export MANPAGER='less -iX --prompt="?f%f:<Manual page>. ?n?m(file %i of %m) ..?lt(lines %lt-%lb?L/%L.) :(byte %bB?s/%s.) .?e(END) ?x- Next\: %x.:?pB%pB\%..%t"'
  23.  
  24. # Prompt local "[17:57][user:~]$" y remoto "[17:57][user@machine:~]$"
  25. function __setprompt {
  26.   local BLUE="\[\033[0;34m\]"
  27.   local NO_COLOUR="\[\033[0m\]"
  28.   local SSH_IP=`echo $SSH_CLIENT | awk '{ print $1 }'`
  29.   local SSH2_IP=`echo $SSH2_CLIENT | awk '{ print $1 }'`
  30.   if [ $SSH2_IP ] || [ $SSH_IP ] ; then
  31.     local SSH_FLAG="@\h"
  32.   fi
  33.   PS1="$BLUE[\$(date +%H:%M)][\u$SSH_FLAG:\w]\\$ $NO_COLOUR"
  34.   PS2="$BLUE>$NO_COLOUR "
  35.   PS4='$BLUE+$NO_COLOUR '
  36. }
  37. __setprompt
  38.  
  39. # Use Termcap to add color to man pages
  40. export LESS_TERMCAP_mb=$(tput bold; tput setaf 2) # green
  41. export LESS_TERMCAP_md=$(tput bold; tput setaf 6) # cyan
  42. export LESS_TERMCAP_me=$(tput sgr0)
  43. export LESS_TERMCAP_so=$(tput bold; tput setaf 3; tput setab 4) # yellow on blue
  44. export LESS_TERMCAP_se=$(tput rmso; tput sgr0)
  45. export LESS_TERMCAP_us=$(tput smul; tput bold; tput setaf 7) # white
  46. export LESS_TERMCAP_ue=$(tput rmul; tput sgr0)
  47. export LESS_TERMCAP_mr=$(tput rev)
  48. export LESS_TERMCAP_mh=$(tput dim)
  49. export LESS_TERMCAP_ZN=$(tput ssubm)
  50. export LESS_TERMCAP_ZV=$(tput rsubm)
  51. export LESS_TERMCAP_ZO=$(tput ssupm)
  52. export LESS_TERMCAP_ZW=$(tput rsupm)
  53.  
  54. # Enable colored 'grep' output
  55. export GREP_OPTIONS="--color=auto"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement