CLI config/dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

260 lines
9.8 KiB

  1. # The following lines were added by compinstall
  2. zstyle ':completion:*' auto-description 'Specify parameter: %d'
  3. zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate
  4. zstyle ':completion:*' completions 1
  5. zstyle ':completion:*' expand prefix suffix
  6. zstyle ':completion:*' format 'Completing %d...'
  7. zstyle ':completion:*' glob 1
  8. zstyle ':completion:*' group-name ''
  9. zstyle ':completion:*' ignore-parents parent pwd directory
  10. zstyle ':completion:*' insert-unambiguous true
  11. zstyle ':completion:*' list-colors ''
  12. zstyle ':completion:*' list-prompt %SAt %l: Hit TAB for more, or the character to insert%s
  13. zstyle ':completion:*' list-suffixes true
  14. zstyle ':completion:*' matcher-list '' 'm:{[:lower:]}={[:upper:]}' 'r:|[._-()@]=** r:|=**' 'l:|=* r:|=*'
  15. zstyle ':completion:*' max-errors 1
  16. zstyle ':completion:*' menu select=long
  17. zstyle ':completion:*' original true
  18. zstyle ':completion:*' preserve-prefix '//[^/]##/'
  19. zstyle ':completion:*' select-prompt %SScrolling active: current selection at %l%s
  20. zstyle ':completion:*' substitute 1
  21. zstyle ':completion:*' verbose true
  22. zstyle :compinstall filename '/home/djsissom/.zshrc'
  23. fpath=(~/.zsh $fpath)
  24. fpath=( "$HOME/.zsh/functions" $fpath )
  25. autoload -Uz compinit && compinit
  26. # End of lines added by compinstall
  27. # Lines configured by zsh-newuser-install
  28. HISTFILE=~/.histfile
  29. HISTSIZE=2500
  30. SAVEHIST=2500
  31. setopt appendhistory extendedglob nomatch notify
  32. unsetopt autocd beep
  33. bindkey -v
  34. bindkey "^?" backward-delete-char # fix backspacing over newlines
  35. bindkey '^R' history-incremental-pattern-search-backward # search
  36. bindkey '^F' history-incremental-pattern-search-forward # search
  37. # End of lines configured by zsh-newuser-install
  38. setopt HIST_IGNORE_DUPS
  39. setopt RM_STAR_SILENT
  40. #---------------
  41. # create a zkbd compatible hash;
  42. # to add other keys to this hash, see: man 5 terminfo
  43. typeset -A key
  44. key[Home]=${terminfo[khome]}
  45. key[End]=${terminfo[kend]}
  46. key[Insert]=${terminfo[kich1]}
  47. key[Delete]=${terminfo[kdch1]}
  48. key[Up]=${terminfo[kcuu1]}
  49. key[Down]=${terminfo[kcud1]}
  50. key[Left]=${terminfo[kcub1]}
  51. key[Right]=${terminfo[kcuf1]}
  52. key[PageUp]=${terminfo[kpp]}
  53. key[PageDown]=${terminfo[knp]}
  54. # setup key accordingly
  55. [[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line
  56. [[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line
  57. [[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode
  58. [[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char
  59. [[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history
  60. [[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history
  61. [[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char
  62. [[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char
  63. [[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" beginning-of-buffer-or-history
  64. [[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" end-of-buffer-or-history
  65. # Finally, make sure the terminal is in application mode, when zle is
  66. # active. Only then are the values from $terminfo valid.
  67. if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
  68. function zle-line-init () {
  69. printf '%s' "${terminfo[smkx]}"
  70. }
  71. function zle-line-finish () {
  72. printf '%s' "${terminfo[rmkx]}"
  73. }
  74. zle -N zle-line-init
  75. zle -N zle-line-finish
  76. fi
  77. #---------------
  78. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  79. # .zshrc
  80. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  81. # User-specific ~/.zshrc, generalized for GNU/Linux and Apple OS X
  82. # Excecuted by bash(1) for non-login shells
  83. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  84. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  85. # Source external definitions
  86. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  87. [ -r ~/.colornames ] && . ~/.colornames # Human-readable color variables
  88. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  89. # Determine local environment
  90. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  91. case $( uname ) in
  92. ( *[Ll]inux* )
  93. case "$HOSTNAME" in
  94. ( vmp* ) host='cluster';; # Auto-detect whether we're running on the
  95. ( vpac* ) host='astro';; # ACCRE cluster or the VPAC network at
  96. ( * ) host='linux';; # Vanderbilt, and set options appropriately
  97. esac;;
  98. ( *[Dd]arwin* ) host='osx';;
  99. ( * ) echo 'running on unknown host' && return;;
  100. esac
  101. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  102. # Import packages
  103. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  104. if [[ $host == cluster ]]; then
  105. setpkgs -a gcc_compiler
  106. setpkgs -a intel_compiler
  107. setpkgs -a fftw2-mpich2_gcc_ether
  108. setpkgs -a mpich2_gcc_ether
  109. setpkgs -a gsl_gcc
  110. setpkgs -a gsl_intel
  111. setpkgs -a hdf5
  112. setpkgs -a valgrind
  113. setpkgs -a python
  114. setpkgs -a scipy
  115. setpkgs -a perl
  116. setpkgs -a idl-8.0
  117. setpkgs -a matlab
  118. setpkgs -a octave
  119. setpkgs -a R
  120. setpkgs -a ImageMagick
  121. fi
  122. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  123. # Path definitions
  124. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  125. typeset -U path
  126. case "$host" in
  127. ( cluster )
  128. path=(/usr/local/supermongo/bin # Supermongo path
  129. /usr/local/cuda/bin # Nvidia CUDA path
  130. /usr/lpp/mmfs/bin # GPFS utilities path
  131. ~/local/bin # User-specific path
  132. $path)
  133. export -UT LD_LIBRARY_PATH=/usr/scheduler/torque/lib:$LD_LIBRARY_PATH ld_library_path
  134. export -UT LD_LIBRARY_PATH=/usr/local/supermongo/lib:$LD_LIBRARY_PATH ld_library_path
  135. export -UT LD_LIBRARY_PATH=/usr/local/python/lib:$LD_LIBRARY_PATH ld_library_path
  136. export -UT LD_LIBRARY_PATH=/usr/local/cuda/lib:$LD_LIBRARY_PATH ld_library_path
  137. export -UT PYTHONPATH=~/local/lib/python/site-packages:$PYTHONPATH pythonpath
  138. export -UT IDL_STARTUP=~/.idl/idl_startup.pro idl_starup
  139. export -UT IDL_PATH=+/home/sinham/utils/idl:$IDL_PATH idl_path
  140. export -UT IDL_PATH=.:+/usr/local/idl/idl/lib:+/usr/local/idl/idl/:$IDL_PATH idl_path
  141. ;;
  142. ( astro )
  143. path=(/usr/local/python64/bin # Python path (64 bit)
  144. ~/local/bin # User specific path
  145. $path)
  146. export -UT LD_LIBRARY_PATH=/usr/local/python64/lib:$LD_LIBRARY_PATH ld_library_path
  147. export -UT PYTHONPATH=~/local/lib/python/latest/site-packages:$PYTHONPATH pythonpath
  148. export -UT PYTHONPATH=/usr/local/python64/lib/python*/site-packages:$PYTHONPATH pythonpath
  149. source /usr/local/itt/idl80/idl/bin/idl_setup.bash
  150. export IDL_PATH=.:/home/sinham/psu/utils/idl/:+$IDL_DIR
  151. export IDL_STARTUP=~/.idl/idl_startup.pro
  152. ;;
  153. ( linux )
  154. path=(~/Local/bin $path) # User specific path
  155. export -UT PYTHONPATH=~/Local/lib/python/python-2.7/site-packages:$PYTHONPATH pythonpath
  156. export -UT PYTHONPATH=~/Local/lib/python/latest/site-packages:$PYTHONPATH pythonpath
  157. export -UT PYTHONPATH=~/Local/lib/python3/site-packages:$PYTHONPATH pythonpath
  158. export -UT TEXINPUTS=.:./style:$TEXINPUTS texinputs
  159. export -UT BSTINPUTS=.:./style:$BSTINPUTS bstinputs
  160. export -UT BIBINPUTS=.:./style:$BIBINPUTS bibinputs
  161. ;;
  162. ( osx )
  163. path=(~/Local/bin # User specific path
  164. /usr/local/opt/coreutils/libexec/gnubin # Gnu coreutils from Homebrew
  165. /usr/local/opt/findutils/libexec/gnubin # Gnu find from Homebrew
  166. /usr/local/opt/grep/libexec/gnubin # Gnu grep from Homebrew
  167. /usr/local/opt/gnu-sed/libexec/gnubin # Gnu sed from Homebrew
  168. /usr/local/opt/gnu-indent/libexec/gnubin # Gnu indent from Homebrew
  169. /usr/local/opt/gnu-tar/libexec/gnubin # Gnu tar from Homebrew
  170. /usr/local/opt/python/libexec/bin # Unversioned python3
  171. $path)
  172. export -UT PYTHONPATH=~/Local/lib/python/latest/site-packages:$PYTHONPATH pythonpath
  173. ;;
  174. esac
  175. export path
  176. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  177. # Shell behavior
  178. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  179. export EDITOR='vim -display none' # Use vim as default text editor
  180. export GPG_TTY=$(tty) # Fix GPG pin prompt bug with git
  181. export SDL_VIDEO_FULLSCREEN_HEAD=3
  182. setopt HIST_IGNORE_SPACE
  183. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  184. # Source alias definitions file
  185. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  186. [ -r ~/.aliases ] && . ~/.aliases
  187. setopt complete_aliases
  188. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  189. # Program-specific settings and fixes
  190. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  191. # make less more friendly for non-text input files, see lesspipe(1)
  192. [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
  193. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  194. # User-defined functions
  195. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  196. # Enable user-passable growl notifications
  197. growl() { echo -e $'\e]9;'${1}'\007' ; return ; }
  198. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  199. # End
  200. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  201. zsh_hl_path=/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  202. [ -r $zsh_hl_path ] && source $zsh_hl_path
  203. ZSH_HIGHLIGHT_HIGHLIGHTERS=(brackets root) # options: main brackets pattern cursor root line
  204. #ZSH_HIGHLIGHT_STYLES[unknown-token]='none' # example to customize main class tokens
  205. autoload -U colors && colors
  206. autoload -Uz promptinit && promptinit
  207. PURE_GIT_PULL=0
  208. prompt pure