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.

355 lines
13 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. autoload -Uz compinit
  24. compinit
  25. # End of lines added by compinstall
  26. # Lines configured by zsh-newuser-install
  27. HISTFILE=~/.histfile
  28. HISTSIZE=2500
  29. SAVEHIST=2500
  30. setopt appendhistory extendedglob nomatch notify
  31. unsetopt autocd beep
  32. bindkey -v
  33. bindkey "^?" backward-delete-char # fix backspacing over newlines
  34. bindkey '^R' history-incremental-pattern-search-backward # search
  35. bindkey '^F' history-incremental-pattern-search-forward # search
  36. # End of lines configured by zsh-newuser-install
  37. setopt HIST_IGNORE_DUPS
  38. setopt RM_STAR_SILENT
  39. #---------------
  40. # create a zkbd compatible hash;
  41. # to add other keys to this hash, see: man 5 terminfo
  42. typeset -A key
  43. key[Home]=${terminfo[khome]}
  44. key[End]=${terminfo[kend]}
  45. key[Insert]=${terminfo[kich1]}
  46. key[Delete]=${terminfo[kdch1]}
  47. key[Up]=${terminfo[kcuu1]}
  48. key[Down]=${terminfo[kcud1]}
  49. key[Left]=${terminfo[kcub1]}
  50. key[Right]=${terminfo[kcuf1]}
  51. key[PageUp]=${terminfo[kpp]}
  52. key[PageDown]=${terminfo[knp]}
  53. # setup key accordingly
  54. [[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line
  55. [[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line
  56. [[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode
  57. [[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char
  58. [[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history
  59. [[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history
  60. [[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char
  61. [[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char
  62. [[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" beginning-of-buffer-or-history
  63. [[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" end-of-buffer-or-history
  64. # Finally, make sure the terminal is in application mode, when zle is
  65. # active. Only then are the values from $terminfo valid.
  66. if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
  67. function zle-line-init () {
  68. printf '%s' "${terminfo[smkx]}"
  69. }
  70. function zle-line-finish () {
  71. printf '%s' "${terminfo[rmkx]}"
  72. }
  73. zle -N zle-line-init
  74. zle -N zle-line-finish
  75. fi
  76. #---------------
  77. #---------------
  78. #DIRSTACKFILE="$HOME/.cache/zsh/dirs"
  79. #if [[ -f $DIRSTACKFILE ]] && [[ $#dirstack -eq 0 ]]; then
  80. # dirstack=( ${(f)"$(< $DIRSTACKFILE)"} )
  81. # [[ -d $dirstack[1] ]] && cd $dirstack[1]
  82. #fi
  83. #chpwd() {
  84. # print -l $PWD ${(u)dirstack} >$DIRSTACKFILE
  85. #}
  86. #
  87. #DIRSTACKSIZE=20
  88. #
  89. #setopt autopushd pushdsilent pushdtohome
  90. #
  91. ### Remove duplicate entries
  92. #setopt pushdignoredups
  93. #
  94. ### This reverts the +/- operators.
  95. #setopt pushdminus
  96. #---------------
  97. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  98. # .zshrc
  99. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  100. # User-specific ~/.zshrc, generalized for GNU/Linux and Apple OS X
  101. # Excecuted by bash(1) for non-login shells
  102. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  103. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  104. # Source external definitions
  105. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  106. [ -r ~/.colornames ] && . ~/.colornames # Human-readable color variables
  107. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  108. # Determine local environment
  109. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  110. case $( uname ) in
  111. ( *[Ll]inux* )
  112. case "$HOSTNAME" in
  113. ( vmp* ) host='cluster';; # Auto-detect whether we're running on the
  114. ( vpac* ) host='astro';; # ACCRE cluster or the VPAC network at
  115. ( * ) host='linux';; # Vanderbilt, and set options appropriately
  116. esac;;
  117. ( *[Dd]arwin* ) host='osx';;
  118. ( * ) echo 'running on unknown host' && return;;
  119. esac
  120. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  121. # Import packages
  122. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  123. if [[ $host == cluster ]]; then
  124. setpkgs -a gcc_compiler
  125. setpkgs -a intel_compiler
  126. setpkgs -a fftw2-mpich2_gcc_ether
  127. setpkgs -a mpich2_gcc_ether
  128. setpkgs -a gsl_gcc
  129. setpkgs -a gsl_intel
  130. setpkgs -a hdf5
  131. setpkgs -a valgrind
  132. setpkgs -a python
  133. setpkgs -a scipy
  134. setpkgs -a perl
  135. setpkgs -a idl-8.0
  136. setpkgs -a matlab
  137. setpkgs -a octave
  138. setpkgs -a R
  139. setpkgs -a ImageMagick
  140. fi
  141. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  142. # Path definitions
  143. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  144. typeset -U path
  145. case "$host" in
  146. ( cluster )
  147. path=(/usr/local/supermongo/bin # Supermongo path
  148. /usr/local/cuda/bin: # Nvidia CUDA path
  149. /usr/lpp/mmfs/bin # GPFS utilities path
  150. ~/local/bin: # User-specific path
  151. $path)
  152. export -UT LD_LIBRARY_PATH=/usr/scheduler/torque/lib:$LD_LIBRARY_PATH ld_library_path
  153. export -UT LD_LIBRARY_PATH=/usr/local/supermongo/lib:$LD_LIBRARY_PATH ld_library_path
  154. export -UT LD_LIBRARY_PATH=/usr/local/python/lib:$LD_LIBRARY_PATH ld_library_path
  155. export -UT LD_LIBRARY_PATH=/usr/local/cuda/lib:$LD_LIBRARY_PATH ld_library_path
  156. export -UT PYTHONPATH=~/local/lib/python/site-packages:$PYTHONPATH pythonpath
  157. export -UT IDL_STARTUP=~/.idl/idl_startup.pro idl_starup
  158. export -UT IDL_PATH=+/home/sinham/utils/idl:$IDL_PATH idl_path
  159. export -UT IDL_PATH=.:+/usr/local/idl/idl/lib:+/usr/local/idl/idl/:$IDL_PATH idl_path
  160. ;;
  161. ( astro )
  162. path=(/usr/local/python64/bin # Python path (64 bit)
  163. ~/local/bin # User specific path
  164. path)
  165. export -UT LD_LIBRARY_PATH=/usr/local/python64/lib:$LD_LIBRARY_PATH ld_library_path
  166. export -UT PYTHONPATH=~/local/lib/python/latest/site-packages:$PYTHONPATH pythonpath
  167. export -UT PYTHONPATH=/usr/local/python64/lib/python*/site-packages:$PYTHONPATH pythonpath
  168. source /usr/local/itt/idl80/idl/bin/idl_setup.bash
  169. export IDL_PATH=.:/home/sinham/psu/utils/idl/:+$IDL_DIR
  170. export IDL_STARTUP=~/.idl/idl_startup.pro
  171. ;;
  172. ( linux )
  173. path=(~/Local/bin $path) # User specific path
  174. export -UT PYTHONPATH=~/Local/lib/python/python-2.7/site-packages:$PYTHONPATH pythonpath
  175. export -UT PYTHONPATH=~/Local/lib/python/latest/site-packages:$PYTHONPATH pythonpath
  176. export -UT PYTHONPATH=~/Local/lib/python3/site-packages:$PYTHONPATH pythonpath
  177. export -UT TEXINPUTS=.:./style:$TEXINPUTS texinputs
  178. export -UT BSTINPUTS=.:./style:$BSTINPUTS bstinputs
  179. export -UT BIBINPUTS=.:./style:$BIBINPUTS bibinputs
  180. ;;
  181. ( osx )
  182. path=(/opt/local/bin:/opt/local/sbin # Macports path
  183. ~/Local/bin # User specific path
  184. /usr/local/opt/coreutils/libexec/gnubin # Gnu coreutils from Homebrew
  185. /usr/local/opt/python/libexec/bin # Unversioned python3
  186. $path)
  187. export -UT PYTHONPATH=~/Local/lib/python/latest/site-packages:$PYTHONPATH pythonpath
  188. ;;
  189. esac
  190. export path
  191. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  192. # Bash behavior
  193. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  194. #[ -z "$PS1" ] && return # If not running interactively, exit here
  195. export EDITOR='vim -display none' # Use vim as default text editor
  196. export GPG_TTY=$(tty) # Fix GPG pin prompt bug with git
  197. #export HISTCONTROL=ignoreboth # No duplicate or space-started lines in history
  198. #shopt -s histappend # Append to the history file, don't overwrite it
  199. #shopt -s checkwinsize # Update $LINES and $COLUMNS after each command
  200. export SDL_VIDEO_FULLSCREEN_HEAD=3
  201. setopt HIST_IGNORE_SPACE
  202. #setopt extended_glob
  203. ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  204. ## Enable advanced tab-completion
  205. ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  206. #
  207. ## Define file paths for tab-completion scripts
  208. #case "$host" in
  209. # ( cluster | astro )
  210. # bash_completion_path=/usr/share/bash-completion/bash_completion
  211. # git_completion_path=/etc/bash_completion.d/git
  212. # ;;
  213. # ( linux )
  214. # bash_completion_path=/usr/share/bash-completion/bash_completion
  215. # git_completion_path=/usr/share/git/completion/git-prompt.sh
  216. # ;;
  217. # ( osx )
  218. # bash_completion_path=/opt/local/etc/bash_completion
  219. # git_completion_path=/opt/local/etc/bash_completion.d/git
  220. # ;;
  221. #esac
  222. #
  223. ## Source bash_completion script if available; otherwise, set completion manually
  224. #if [ -r "$bash_completion_path" ]; then
  225. # . "$bash_completion_path" # Source global definition file
  226. #elif [ -r ~/.bash_completion ]; then
  227. # . ~/.bash_completion # Look in ~ if global file doesn't exist
  228. #else
  229. # complete -cf sudo # Bash auto-completion after sudo
  230. # complete -cf man # Bash auto-completion after man
  231. #fi
  232. #
  233. ## Enable bash tab completion for git commands, if available
  234. #if [ -r "$git_completion_path" ]; then
  235. # . "$git_completion_path"
  236. # git_prompt=yes # This and the following enable the git prompt
  237. # export GIT_PS1_SHOWDIRTYSTATE=1
  238. # export GIT_PS1_SHOWSTASHSTATE=1
  239. # export GIT_PS1_SHOWUNTRACKEDFILES=1
  240. # export GIT_PS1_SHOWUPSTREAM="auto"
  241. #fi
  242. #
  243. #
  244. ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  245. ## Set up a fancy prompt and window title, if available
  246. ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  247. #
  248. ## Use a colored prompt, if available
  249. #[ -t 1 ] && [ -n $(tput colors) ] && [ $(tput colors) -ge 8 ] && color_prompt=yes
  250. #
  251. ## Choose username/hostname color based on whether or not we are the root user
  252. #UserColor="$BCyan"
  253. #[ $UID == "0" ] && UserColor="$BRed"
  254. #
  255. ## Set prompt options based on capabilities
  256. #if [[ "$color_prompt" == yes && "$git_prompt" == yes ]]; then
  257. # PS1='['${UserColor}'\u@\h'${Color_Off}':'${BBlue}'\w'${Green}'$(__git_ps1 " (git-%s) ")'${Color_Off}']\$ '
  258. #elif [[ "$color_prompt" == yes ]]; then
  259. # PS1="[${UserColor}\u@\h${Color_Off}:${BBlue}\w${Color_Off}]\\$ "
  260. #elif [[ "$git_prompt" == yes ]]; then
  261. # PS1='[\u@\h:\w$(__git_ps1 " (git-%s) ")]\$ '
  262. #else
  263. # PS1='[\u@\h:\w]\$ '
  264. #fi
  265. #
  266. ## If this is an xterm, set the title to user@host:dir
  267. #case "$TERM" in
  268. # ( xterm* | rxvt* ) xterm_title="\[\e]0;\u@\h : \w\a\]" ;;
  269. # ( * ) xterm_title= ;;
  270. #esac
  271. #PS1="${xterm_title}${PS1}"
  272. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  273. # Source alias definitions file
  274. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  275. [ -r ~/.aliases ] && . ~/.aliases
  276. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  277. # Program-specific settings and fixes
  278. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  279. # make less more friendly for non-text input files, see lesspipe(1)
  280. [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
  281. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  282. # User-defined functions
  283. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  284. # Enable user-passable growl notifications
  285. growl() { echo -e $'\e]9;'${1}'\007' ; return ; }
  286. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  287. # End
  288. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  289. autoload -U colors && colors
  290. #source ~/.zsh/git-prompt/zshrc.sh
  291. #PROMPT='|- %{$fg_no_bold[cyan]%}%n@%m%{$reset_color%} : %{$fg_no_bold[blue]%}%~%{$reset_color%} $(git_super_status)-> '
  292. #PROMPT="|- %{$fg_no_bold[cyan]%}%n@%m%{$reset_color%} : %{$fg_no_bold[blue]%}%~%{$reset_color%} -> "
  293. fpath=( "$HOME/.zsh/functions" $fpath )
  294. #autoload -U promptinit && promptinit
  295. autoload -Uz promptinit && promptinit
  296. PURE_GIT_PULL=0
  297. prompt pure