guest@dotshare [~/groups/shells/zsh] $ ls zshrc1/ | cat

zshrc1 (scrot, raw, dl) (+1 likes)

hyperreal Oct 12, 2012 (shells/zsh)

SCROT

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt appendhistory autocd extendedglob notify
bindkey -e
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/jas/.zshrc'

autoload -Uz compinit
compinit
# End of lines added by compinstall

## FILE MGMT ALIASES ##
alias la="ls -a"                                # show hidden files
alias ls="ls --color=auto"                      # colors for filetype
alias ll="ls -l --group-directories-first"      # group dirs first
alias lx="ls -lxB"                              # sort by extension
alias lk="ls -lSr"                              # sort by size, biggest last
alias lc="ls -ltcr"                             # sort by change time, most re$
alias lu="ls -ltur"                             # sort by and show access time$
alias lt="ls -ltr"                              # sort by date, most recent la$
alias lm="ls -al | more"                        # pipe through more
alias lR="ls -lR"                               # recursive ls
alias lsr="tree -Csu"                           # alt. recursive ls

## APP ALIASES ##
alias im="finch"
alias irc="weechat-curses"
alias rss="newsbeuter"
alias exit="clear; exit"
alias ugrub="sudo update-grub"
alias pal3="pal -r 3"
alias pal5="pal -r 5"
alias pal7="pal -r 7"
alias conkyconf="nano -w /home/jas/.conkyrc"

## SYSTEM ALIASES ##
alias reboot="sudo reboot"
alias shutdown="sudo shutdown -h now"
alias clamroot="sudo clamscan -r -l /home/jas/admin/clamscan.log /"
alias clamhome="sudo clamscan -r -l /home/jas/admin/clamhome.log /home/jas"

## NETWORKING ALIASES ##
alias pong="ping -c 3 www.google.com"
alias ifup="sudo ifconfig wlan0 up"
alias associate="sudo wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf"
alias connect="sudo dhcpcd wlan0"

## GENTOO-SPECIFIC ALIASES ##
alias esync="sudo emerge --sync"                        # Sync with remote rep$
alias esearch="sudo emerge --search"                    # Search repos
alias einfo="sudo emerge --info"                        # Pkg info
alias eclean="sudo emerge --clean"                      # Cleans system
alias edepclean="sudo emerge --depclean"
alias unmerge="sudo emerge --unmerge"                   # Removes installed pkg
alias listsets="sudo emerge --list-sets"                # Lists all pkg sets
alias eprune="sudo emerge --prune"                      # Removes all but high$
alias eregen="sudo emerge --regen"                      # Updates dependency c$
alias eresume="sudo emerge --resume"                    # Resumes prior emerge$
alias esearchdesc="sudo emerge --searchdesc"            # Search pkg descripti$
alias newsall="sudo eselect news read all"
alias newslist="sudo eselect news list"
alias newspurge="sudo eselect news purge"

## DICTIONARY FUNCTIONS ##
dwordnet () { curl dict://dict.org/d:${1}:wn; }
dacron () { curl dict://dict.org/d:${1}:vera; }
djargon () { curl dict://dict.org/d:${1}:jargon; }
dfoldoc () { curl dict://dict.org/d:${1}:foldoc; }
dthesaurus () { curl dict://dict.org/d:${1}:moby-thes; }

## WIKIPEDIA SEARCH FUNCTION ##
wikipediaSearch() {
echo -n -e "\n============================================\n\tWelcome to WikiPedia Search"; echo ""; i=1 ; for line in $(lynx --dump "http://en.wikipedia.org/w/index.php?title=Special%3ASearch&profile=default&search=$1&fulltext=Search" | grep http://en.wikipedia.org/wiki | cut -c7-); do echo $i $line; lines[$i]=$line ;  i=$(($i+1)); done ; echo -n -e "\n============================================\n\tPlease select the link to open - "; read answer; w3m ${lines[$answer]}
}

## SEP SEARCH FUNCTION ##
sepSearch() {
echo -n -e "\n============================================\n\tWelcome to WikiPedia Search"; echo ""; i=1 ; for line in $(lynx --dump "http://plato.stanford.edu/search/searcher.py?query=$1" | grep http://plato.stanford.edu | cut -c7-); do echo $i $line; lines[$i]=$line ;  i=$(($i+1)); done ; echo -n -e "\n============================================\n\tPlease select the link to open - "; read answer; w3m ${lines[$answer]}
}

## EXTRACT FUNCTION ##
extract () {
  if [ -f $1 ] ; then
      case $1 in
          *.tar.bz2)   tar xvjf $1    ;;
          *.tar.gz)    tar xvzf $1    ;;
          *.bz2)       bunzip2 $1     ;;
          *.rar)       rar x $1       ;;
          *.gz)        gunzip $1      ;;
          *.tar)       tar xvf $1     ;;
          *.tbz2)      tar xvjf $1    ;;
          *.tgz)       tar xvzf $1    ;;
          *.zip)       unzip $1       ;;
          *.Z)         uncompress $1  ;;
          *.7z)        7z x $1        ;;
          *)           echo "don't know how to extract '$1'..." ;;
      esac
  else
      echo "'$1' is not a valid file!"
  fi
}

## ENABLE PRECONFIGURED PROMPTS ##
#autoload -U promptinit
#promptinit
# prompt adam2

## ENABLE COLORS ##
autoload colors zsh/terminfo
if [[ "$terminfo[colors]" -ge 8 ]]; then
  colors
fi

## PROMPT ##
PROMPT="%{${fg[cyan]}%}[%{${fg[magenta]}%}%n%{${fg[cyan]}%}] %{${fg[yellow]}%}%~ %{${fg[cyan]}%}%#%{${fg[default]}%} "
RPROMPT="%{${fg[cyan]}%}[%{${fg[default]}%}%*%{${fg[cyan]}%}] %{${fg[default]}%} "

CLICK TO VIEW

x

Notes

This .zshrc contains search functions for Wikipedia and Stanford Encyclopedia of Philosophy. Simply type wikipediaSearch “” or sepSearch “” to search them.

Comments

biniar said about 11 years ago

Thanks for posting, that extract function is really helpful! :)