Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2014
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.29 KB | None | 0 0
  1. # ~/.bashrc: executed by bash(1) for non-login shells.
  2. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
  3. # for examples
  4.  
  5. [[ -z $DISPLAY && $TERM = "linux" ]] && . ~/.fbselect
  6.  
  7. export MARKPATH=$HOME/.marks
  8. function jump {
  9.     cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
  10. }
  11. function mark {
  12.     mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$1"
  13. }
  14. function unmark {
  15.     rm -i "$MARKPATH/$1"
  16. }
  17. function marks {
  18.     ls -l "$MARKPATH" | sed 's/  / /g' | cut -d' ' -f9- | sed 's/ -/\t-/g' && echo
  19. }
  20.  
  21. # If not running interactively, don't do anything
  22. case $- in
  23.     *i*) ;;
  24.       *) return;;
  25. esac
  26.  
  27. # Runs tmux as shell
  28. #if which tmux 2>&1 >/dev/null; then
  29. #    test -z "$TMUX" && (tmux attach || tmux new-session)
  30. #fi
  31.  
  32. # don't put duplicate lines or lines starting with space in the history.
  33. # See bash(1) for more options
  34. HISTCONTROL=ignoreboth
  35.  
  36. # append to the history file, don't overwrite it
  37. shopt -s histappend
  38.  
  39. # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
  40. HISTSIZE=1000
  41. HISTFILESIZE=2000
  42.  
  43. # check the window size after each command and, if necessary,
  44. # update the values of LINES and COLUMNS.
  45. shopt -s checkwinsize
  46.  
  47. # If set, the pattern "**" used in a pathname expansion context will
  48. # match all files and zero or more directories and subdirectories.
  49. #shopt -s globstar
  50.  
  51. # make less more friendly for non-text input files, see lesspipe(1)
  52. #[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
  53.  
  54. # set variable identifying the chroot you work in (used in the prompt below)
  55. if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
  56.     debian_chroot=$(cat /etc/debian_chroot)
  57. fi
  58.  
  59. # set a fancy prompt (non-color, unless we know we "want" color)
  60. case "$TERM" in
  61.     xterm-color) color_prompt=yes;;
  62. esac
  63.  
  64. # uncomment for a colored prompt, if the terminal has the capability; turned
  65. # off by default to not distract the user: the focus in a terminal window
  66. # should be on the output of commands, not on the prompt
  67. force_color_prompt=yes
  68.  
  69. if [ -n "$force_color_prompt" ]; then
  70.     if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
  71.     # We have color support; assume it's compliant with Ecma-48
  72.     # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
  73.     # a case would tend to support setf rather than setaf.)
  74.     color_prompt=yes
  75.     else
  76.     color_prompt=
  77.     fi
  78. fi
  79.  
  80. if [ "$color_prompt" = yes ]; then
  81.     PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
  82. else
  83.     PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
  84. fi
  85. unset color_prompt force_color_prompt
  86.  
  87. # If this is an xterm set the title to user@host:dir
  88. case "$TERM" in
  89. xterm*|rxvt*)
  90.     PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
  91.     ;;
  92. *)
  93.     ;;
  94. esac
  95.  
  96. # enable color support of ls and also add handy aliases
  97. if [ -x /usr/bin/dircolors ]; then
  98.     test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
  99.     alias ls='ls --color=auto'
  100.     #alias dir='dir --color=auto'
  101.     #alias vdir='vdir --color=auto'
  102.  
  103.     alias grep='grep --color=auto'
  104.     #alias fgrep='fgrep --color=auto'
  105.     #alias egrep='egrep --color=auto'
  106. fi
  107.  
  108. # some more ls aliases
  109. #alias ll='ls -l'
  110. #alias la='ls -A'
  111. #alias l='ls -CF'
  112.  
  113. # Alias definitions.
  114. # You may want to put all your additions into a separate file like
  115. # ~/.bash_aliases, instead of adding them here directly.
  116. # See /usr/share/doc/bash-doc/examples in the bash-doc package.
  117.  
  118. if [ -f ~/.bash_aliases ]; then
  119.     . ~/.bash_aliases
  120. fi
  121.  
  122. # enable programmable completion features (you don't need to enable
  123. # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
  124. # sources /etc/bash.bashrc).
  125. if ! shopt -oq posix; then
  126.   if [ -f /usr/share/bash-completion/bash_completion ]; then
  127.     . /usr/share/bash-completion/bash_completion
  128.   elif [ -f /etc/bash_completion ]; then
  129.     . /etc/bash_completion
  130.   fi
  131. fi
  132.  
  133.  
  134.  
  135. #functions
  136. function encode() { echo -n $@ | perl -pe's/([^-_.~A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg'; }
  137. function goo() { links http://www.google.com/search?q="`encode $@`" ;}
  138. function wikide() { links http://de.wikipedia.org/w/index.php?search="`encode $@`" ;}
  139. function wikien() { links http://en.wikipedia.org/w/index.php?search="`encode $@`" ;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement