Advertisement
Guest User

Untitled

a guest
Aug 6th, 2017
557
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.61 KB | None | 0 0
  1. ###############################################################################
  2. # Zsh settings file for Greg Fitzgerald <netzdamon@gmail.com>
  3. #
  4. # Most recent update: Fri Sep 28 18:38:41 2007
  5. #
  6. ###############################################################################
  7. ##############################################################################
  8. # Clear screen on logout
  9. ##############################################################################
  10. trap clear 0
  11. ################################################################################
  12. # Enviroment Variables
  13. ################################################################################
  14. #export MAILCHECK=10
  15. export MAILDIR="${HOME}/mbox"
  16. export MAIL="${HOME}/mbox/inbox"
  17. export VISUAL="vim"
  18. export EDITOR="vim"
  19. export RSYNC_RSH="ssh"
  20. #export MANPAGER="col -b | view -c 'set ft=man nomod nolist' -"
  21. export MANPAGER="less"
  22. #export LANG=en_US.utf8
  23. #export LC_CTYPE=en_US.utf8
  24. #export TZ=EST5EDT
  25. export PAGER="less"
  26. export GIT_AUTHOR_EMAIL="claneys.skyne@gmail.com"
  27. export GIT_AUTHOR_NAME="Claneys Skyne"
  28. export GIT_COMMITTER_EMAIL="claneys.skyne@gmail.com"
  29. export MPD_HOST="192.168.1.20"
  30. export MPD_PORT="6601"
  31. export CVS_RSH='ssh'
  32. export RSYNC_RSH='ssh'
  33. ################################################################################
  34. # Resource Limits
  35. ################################################################################
  36. limit stack 8192
  37. #limit core 9999
  38. limit core 0
  39. limit -s
  40. ###############################################################################
  41. # Setup History Options
  42. ################################################################################
  43. HISTSIZE=5000
  44. HISTFILE=${HOME}/.history_zsh
  45. SAVEHIST=5000
  46. ################################################################################
  47. # Term Settings
  48. ################################################################################
  49. #auto logout after timeout in seconds
  50. TMOUT=1800
  51.  
  52. # if we are in X then disable TMOUT
  53. case $TERM in
  54. *xterm*|rxvt|(dt|k|E)term)
  55. unset TMOUT
  56. ;;
  57. esac
  58.  
  59. #case $TERM in
  60. # *xterm*|rxvt|(dt|k|E)term)
  61. # ## display user@host and full dir in *term title
  62. # precmd () {
  63. # print -Pn <span>"\033]0;%n@%m %~\007"
  64. # }
  65. # ## display user@host and name of current process in *term title
  66. # preexec () {
  67. # print -Pn "\033]0;%n@%m <$1> %~\007"
  68. # }
  69. # ;;
  70. #esac
  71. ################################################################################
  72. # Default Aliases
  73. ################################################################################
  74. alias xlog=" grep --binary-files=without-match --color -nsie '(EE)' -e '(WW)' /var/log/Xorg.0.log"
  75. alias which="whence"
  76. alias sd='export DISPLAY=:0.0'
  77. alias ctar="tar -cvpf"
  78. alias cpan="perl -MCPAN -e shell"
  79. alias cup='cvs -z3 update -Pd'
  80. alias mv='nocorrect /bin/mv'
  81. alias rm='nocorrect /bin/rm -i'
  82. alias cp='nocorrect /bin/cp'
  83. alias man='nocorrect man'
  84. alias mkdir='nocorrect /bin/mkdir -p'
  85. alias find='noglob find'
  86. alias wget="wget -c"
  87. alias ls="ls --color"
  88. alias lsd='ls -lh --color'
  89. #alias cgrep='grep --binary-files=without-match --color -nsi'
  90. alias mpalyer="mplayer"
  91. alias mplyaer="mplayer"
  92. alias ncmpc="ncmpc -c"
  93. alias fixdbus="dbus-uuidgen --ensure"
  94. alias fspot="dbus-launch f-spot"
  95. alias m="mplayer"
  96. alias e="vim"
  97. alias p="paludis"
  98. alias repo='cd /var/paludis/repositories'
  99. alias blog='cd /home/gregf/code/rails_apps/blog/'
  100. alias scm='cd /home/gregf/code/scm/'
  101. alias sc='script/console'
  102. alias ss='script/server'
  103. alias diff='colordiff'
  104. alias nv=' paludis -i nvidia-drivers'
  105. alias burniso='wodim -v dev=/dev/cdrw'
  106. alias usepretend='paludis -ip --dl-reinstall if-use-changed everything'
  107. alias usedo=' paludis -i --dl-reinstall if-use-changed everything'
  108. alias use=' -e /etc/paludis/use.conf'
  109. alias whats_installed="eix -I --nocolor -c > /tmp/installed.txt && less /tmp/installed.txt && rm /tmp/installed.txt"
  110. ################################################################################
  111. # Functions and Completion
  112. ################################################################################
  113. # Magically quote urls
  114. autoload -U url-quote-magic
  115. zle -N self-insert url-quote-magic
  116.  
  117.  
  118. #dload zsh/complist
  119. autoload -U compinit && compinit
  120.  
  121. ### If you want zsh's completion to pick up new commands in $path automatically
  122. #### comment out the next line and un-comment the following 5 lines
  123. #zstyle ':completion:::::' completer _complete _approximate
  124. ##_force_rehash() {
  125. ## (( CURRENT == 1 )) && rehash
  126. ## return 1 # Because we didn't really complete anything
  127. ##}
  128. #zstyle ':completion:::::' completer _force_rehash _complete _approximate
  129. zstyle -e ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX + $#SUFFIX) / 3 )) )'
  130. zstyle ':completion:*:descriptions' format "- %d -"
  131. zstyle ':completion:*:corrections' format "- %d - (errors %e})"
  132. zstyle ':completion:*:default' list-prompt '%S%M matches%s'
  133. zstyle ':completion:*' group-name ''
  134. zstyle ':completion:*:manuals' separate-sections true
  135. zstyle ':completion:*:manuals.(^1*)' insert-sections true
  136. zstyle ':completion:*' menu select
  137. zstyle ':completion:*' verbose yes
  138.  
  139. ################################################################################
  140. # Custom Functions
  141. ################################################################################
  142. # keep these around to try with vde again later on
  143. #-net vde,vlan=0,sock=/var/run/vde.ctl \
  144. #-net nic,vlan=0,macaddr 52:54:00:00:AA:02 \
  145.  
  146. function pskill {
  147. kill -9 `pgrep $1`
  148. echo "slaughtered."
  149. }
  150.  
  151.  
  152. function kscreen {
  153. echo -ne "\017"
  154. reset
  155. }
  156.  
  157. function date {
  158. if [ $# = 0 ]; then
  159. # Format: Saturday, December 21, 2002 06:46:38 PM EST
  160. command date +"%A, %B %e %Y %I:%M:%S %p %Z"
  161. else
  162. # Execute real `date'
  163. command date $@
  164. fi
  165. }
  166.  
  167. function mcdrom {
  168. local mounted
  169. local cpwd
  170. mounted=$(grep cdrom /etc/mtab)
  171. if [[ $mounted = "" ]];then
  172. mount /mnt/cdrom
  173. echo "-- mounted cdrom --"
  174. cd /media/amovible/cdrom ; ls
  175. else
  176. cpwd=$(pwd|grep cdrom)
  177. if [[ $cpwd = "" ]];then
  178. umount /mnt/cdrom
  179. echo "-- umounted cdrom --"
  180. else
  181. cd;umount /mnt/cdrom
  182. echo "-- umounted cdrom --"
  183. pwd
  184. fi
  185. fi
  186. }
  187.  
  188. function decompress {
  189. if [[ -f "$1" ]]
  190. then
  191. case "$1" in
  192. (*.tar.bz2) tar -xvjf "$1" ;;
  193. (*.tar.gz) tar -xvzf "$1" ;;
  194. (*.ace) unace e "$1" ;;
  195. (*.rar) unrar e "$1" ;;
  196. (*.deb) ar -x "$1" ;;
  197. (*.bz2) bzip2 -d "$1" ;;
  198. (*.lzh) lha x "$1" ;;
  199. (*.gz) gunzip -d "$1" ;;
  200. (*.tar) tar -xvf "$1" ;;
  201. (*.tgz) gunzip -d "$1" ;;
  202. (*.tbz2) tar -jxvf "$1" ;;
  203. (*.zip) unzip "$1" ;;
  204. (*.Z) uncompress "$1" ;;
  205. (*.shar) sh "$1" ;;
  206. (*) echo "'"$1"' Error. Please go away" ;;
  207. esac
  208. else
  209. echo <span>"'<span>"$1"' is not a valid file<span>"
  210. fi
  211. }
  212.  
  213. function ddcompress {
  214. for dir in `ls -1 --color=none --group-directories-first`
  215. do
  216. cd $dir
  217. decompress *.rar
  218. cd ..
  219. done
  220. }
  221.  
  222. function mps { /bin/ps $@ -u $USER -o pid,%cpu,%mem,bsdtime,command ; }
  223.  
  224. function ech {
  225. CHPTH=`eix --only-names -e $1`
  226. less /usr/portage/$CHPTH/ChangeLog
  227. }
  228.  
  229. ################################################################################
  230. # Get keys working
  231. ################################################################################
  232. #
  233. # For this to work you have to first run 'zsh /usr/share/zsh/4.1.0_pre7/functions/Misc/zkbd'.
  234. # The location of this script on your system may vary.
  235. # Also note you must change the 'source' line below to match your zkbd config.
  236. bindkey -v
  237. case `echo $TERM` in
  238. linux)
  239. source ~/.zkbd/linux-pc-linux-gnu
  240. ;;
  241. xterm-color)
  242. source ~/.zkbd/xterm-color-pc-linux-gnu
  243. ;;
  244. xterm)
  245. source ~/.zkbd/xterm-redhat-linux-gnu
  246. ;;
  247. esac
  248.  
  249. [[ -n ${key[Left]} ]] && bindkey "${key[Left]}" backward-char
  250. [[ -n ${key[Right]} ]] && bindkey "${key[Right]}" forward-char
  251. [[ -n ${key[Up]} ]] && bindkey "${key[Up]}" up-history
  252. [[ -n ${key[Down]} ]] && bindkey "${key[Down]}" down-history
  253. [[ -n ${key[Home]} ]] && bindkey "${key[Home]}" beginning-of-line
  254. [[ -n ${key[End]} ]] && bindkey "${key[End]}" end-of-line
  255. [[ -n ${key[Delete]} ]] && bindkey "${key[Delete]}" delete-char
  256.  
  257. case $TERM in
  258. linux)
  259. source ~/.zkbd/linux-pc-linux-gnu
  260. bindkey "^[[2~" yank
  261. bindkey "^[[3~" delete-char
  262. bindkey "^[[5~" up-line-or-history ## PageUp
  263. bindkey "^[[6~" down-line-or-history ## PageDown
  264. bindkey "^[[4~" end-of-line
  265. bindkey "^[e" expand-cmd-path
  266. bindkey "^[[A" up-line-or-search ## up arrow for back-history-search
  267. bindkey "^[[B" down-line-or-search ## down arrow for fwd-history-search
  268. bindkey " " magic-space ## do history expansion on space
  269. bindkey "^[[1~" beginning-of-line
  270. ;;
  271. xterm|xterm-color)
  272. source ~/.zkbd/xterm-redhat-linux-gnu
  273. bindkey "^[[2~" yank
  274. bindkey "^[[3~" delete-char
  275. bindkey "^[[5~" up-line-or-history ## PageUp
  276. bindkey "^[[6~" down-line-or-history ## PageDown
  277. bindkey "^[[7~" beginning-of-line
  278. bindkey "^[[8~" end-of-line
  279. bindkey "^[e" expand-cmd-path ## C-e for expanding path of typed command
  280. bindkey "^[[A" up-line-or-search ## up arrow for back-history-search
  281. bindkey "^[[B" down-line-or-search ## down arrow for fwd-history-search
  282. bindkey " " magic-space ## do history expansion on space
  283. ;;
  284. esac
  285.  
  286. ###############################################################################
  287. # Autocomplete for current dir on filetypes
  288. ################################################################################
  289. # Set Prompt
  290. autoload -U promptinit
  291. # Follow GNU LS_COLORS
  292. promptinit
  293. prompt_adam2_setup
  294. zmodload -i zsh/complist
  295. eval $(dircolors -b /etc/DIR_COLORS)
  296. zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
  297. zstyle ':completion:*:*:kill:*' list-colors '=%*=01;31'
  298.  
  299. autoload -U compinit
  300. compinit
  301.  
  302. compctl -g '*.Z *.gz *.tgz' + -g '*' zcat gunzip open
  303. compctl -g '*.tar.Z *.tar.gz *.tgz *.tar.bz2' + -g '*' tar open
  304. compctl -g '*.zip *.ZIP' + -g '*' unzip zip open
  305. compctl -g '*.rar *.RAR' + -g '*' rar unrar open
  306. compctl -g '*.(mp3|MP3|ogg|OGG|WAV|wav)' + -g '*(-/)' ogg123 mpg123 audacious wma123 mplayer
  307. compctl -g '*.(divx|DIVX|m4v|M4V|wmv|WMV|avi|AVI|mpg|mpeg|MPG|MPEG|WMV|wmv|mov|MOV|wma|WMA|w4a|W4A)' + -g '*(-/)' xine mplayer kmplayer gmplayer vlc
  308. compctl -g '*.(pdf|PDF|ps|PS|tiff|TIFF)' + -g '*(-/)' evince acroread xpdf epdfview
  309. compctl -g '*.(jpg|JPG|jpeg|JPEG|gif|GIF|tiff|TIFF|png|PNG)' + -g '*(-/)' feh gthumb xv
  310.  
  311. #compdef -a _portage emerge
  312.  
  313. # Select Prompt
  314. zstyle ':completion:*' menu select=1
  315.  
  316. # Expansion options
  317. zstyle ':completion:*' completer _complete _prefix
  318. zstyle ':completion::prefix-1:*' completer _complete
  319. zstyle ':completion:incremental:*' completer _complete _correct
  320. zstyle ':completion:predict:*' completer _complete
  321.  
  322. # Completion caching
  323. zstyle ':completion::complete:*' use-cache 1
  324. zstyle ':completion::complete:*' cache-path ~/.zsh/cache/$HOST
  325.  
  326. # Expand partial paths
  327. zstyle ':completion:*' expand 'yes'
  328. zstyle ':completion:*' squeeze-slashes 'yes'
  329.  
  330. # Include non-hidden directories in globbed file completions
  331. # for certain commands
  332.  
  333. zstyle ':completion::complete:*' '\'
  334.  
  335. # Use menuselection for pid completion
  336. zstyle ':completion:*:*:kill:*' menu yes select
  337. zstyle ':completion:*:kill:*' force-list always
  338. zstyle ':completion:*:processes' command 'ps -au$USER'
  339. zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;32'
  340.  
  341. # tag-order 'globbed-files directories' all-files
  342. zstyle ':completion::complete:*:tar:directories' file-patterns '*~.*(-/)'
  343.  
  344. # Don't complete backup files as executables
  345. zstyle ':completion:*:complete:-command-::commands' ignored-patterns '*\~'
  346.  
  347. # Separate matches into groups
  348. zstyle ':completion:*:matches' group 'yes'
  349.  
  350. # With commands like rm, it's annoying if you keep getting offered the same
  351. # file multiple times. This fixes it. Also good for cp, et cetera..
  352. zstyle ':completion:*:rm:*' ignore-line yes
  353. zstyle ':completion:*:cp:*' ignore-line yes
  354.  
  355. # Describe each match group.
  356. zstyle ':completion:*:descriptions' format "%B---- %d%b"
  357.  
  358. # Messages/warnings format
  359. zstyle ':completion:*:messages' format '%B%U---- %d%u%b'
  360. zstyle ':completion:*:warnings' format '%B%U---- no match for: %d%u%b'
  361.  
  362. # Describe options in full
  363. zstyle ':completion:*:options' description 'yes'
  364. zstyle ':completion:*:options' auto-description '%d'
  365.  
  366. # tag-order 'globbed-files directories' all-files
  367. #zstyle ':completion::complete:*:tar:directories' file-patterns '*~.*(-/)'
  368.  
  369. # Don't complete backup files as executables
  370. zstyle ':completion:*:complete:-command-::commands' ignored-patterns '*\~'
  371.  
  372. setopt \
  373. NO_all_export \
  374. always_last_prompt \
  375. always_to_end \
  376. share_history \
  377. append_history \
  378. auto_cd \
  379. auto_list \
  380. auto_menu \
  381. auto_name_dirs \
  382. auto_param_keys \
  383. auto_param_slash \
  384. auto_pushd \
  385. auto_remove_slash \
  386. NO_auto_resume \
  387. bad_pattern \
  388. bang_hist \
  389. NO_beep \
  390. brace_ccl \
  391. NO_correct_all \
  392. NO_bsd_echo \
  393. NO_cdable_vars \
  394. NO_chase_links \
  395. clobber \
  396. complete_aliases \
  397. complete_in_word \
  398. NO_correct \
  399. NO_correct_all \
  400. csh_junkie_history \
  401. NO_csh_junkie_loops \
  402. NO_csh_junkie_quotes \
  403. NO_csh_null_glob \
  404. equals \
  405. extended_glob \
  406. extended_history \
  407. function_argzero \
  408. glob \
  409. NO_glob_assign \
  410. glob_complete \
  411. NO_glob_dots \
  412. glob_subst \
  413. NO_hash_cmds \
  414. NO_hash_dirs \
  415. hash_list_all \
  416. hist_allow_clobber \
  417. hist_beep \
  418. hist_ignore_dups \
  419. hist_ignore_space \
  420. NO_hist_no_store \
  421. hist_verify \
  422. NO_hup \
  423. NO_ignore_braces \
  424. NO_ignore_eof \
  425. interactive_comments \
  426. inc_append_history \
  427. NO_list_ambiguous \
  428. NO_list_beep \
  429. list_types \
  430. long_list_jobs \
  431. magic_equal_subst \
  432. NO_mail_warning \
  433. NO_mark_dirs \
  434. menu_complete \
  435. multios \
  436. nomatch \
  437. notify \
  438. NO_null_glob \
  439. numeric_glob_sort \
  440. NO_overstrike \
  441. path_dirs \
  442. posix_builtins \
  443. NO_print_exit_value \
  444. NO_prompt_cr \
  445. prompt_subst \
  446. pushd_ignore_dups \
  447. NO_pushd_minus \
  448. pushd_silent \
  449. pushd_to_home \
  450. rc_expand_param \
  451. NO_rc_quotes \
  452. NO_rm_star_silent \
  453. NO_sh_file_expansion \
  454. sh_option_letters \
  455. short_loops \
  456. NO_sh_word_split \
  457. NO_single_line_zle \
  458. NO_sun_keyboard_hack \
  459. unset \
  460. NO_verbose \
  461. zle \
  462. NO_equals
  463.  
  464. ################################################################################
  465. # Set global unmask
  466. ################################################################################
  467. #umask 077 #Safe permissions
  468. #umask 022 #More usefull for me
  469.  
  470. # Run devtodo if not root, to annoy me to do something.
  471. if [ -x /usr/bin/devtodo ]; then
  472. if [ "`id -u`" != "0" ]; then
  473. /usr/bin/devtodo
  474. fi
  475. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement