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.

364 lines
14 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. #DIRSTACKFILE="$HOME/.cache/zsh/dirs"
  80. #if [[ -f $DIRSTACKFILE ]] && [[ $#dirstack -eq 0 ]]; then
  81. # dirstack=( ${(f)"$(< $DIRSTACKFILE)"} )
  82. # [[ -d $dirstack[1] ]] && cd $dirstack[1]
  83. #fi
  84. #chpwd() {
  85. # print -l $PWD ${(u)dirstack} >$DIRSTACKFILE
  86. #}
  87. #
  88. #DIRSTACKSIZE=20
  89. #
  90. #setopt autopushd pushdsilent pushdtohome
  91. #
  92. ### Remove duplicate entries
  93. #setopt pushdignoredups
  94. #
  95. ### This reverts the +/- operators.
  96. #setopt pushdminus
  97. #---------------
  98. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  99. # .zshrc
  100. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  101. # User-specific ~/.zshrc, generalized for GNU/Linux and Apple OS X
  102. # Excecuted by bash(1) for non-login shells
  103. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  104. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  105. # Source external definitions
  106. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  107. [ -r ~/.colornames ] && . ~/.colornames # Human-readable color variables
  108. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  109. # Determine local environment
  110. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  111. case $( uname ) in
  112. ( *[Ll]inux* )
  113. case "$HOSTNAME" in
  114. ( vmp* ) host='cluster';; # Auto-detect whether we're running on the
  115. ( vpac* ) host='astro';; # ACCRE cluster or the VPAC network at
  116. ( * ) host='linux';; # Vanderbilt, and set options appropriately
  117. esac;;
  118. ( *[Dd]arwin* ) host='osx';;
  119. ( * ) echo 'running on unknown host' && return;;
  120. esac
  121. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  122. # Import packages
  123. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  124. if [[ $host == cluster ]]; then
  125. setpkgs -a gcc_compiler
  126. setpkgs -a intel_compiler
  127. setpkgs -a fftw2-mpich2_gcc_ether
  128. setpkgs -a mpich2_gcc_ether
  129. setpkgs -a gsl_gcc
  130. setpkgs -a gsl_intel
  131. setpkgs -a hdf5
  132. setpkgs -a valgrind
  133. setpkgs -a python
  134. setpkgs -a scipy
  135. setpkgs -a perl
  136. setpkgs -a idl-8.0
  137. setpkgs -a matlab
  138. setpkgs -a octave
  139. setpkgs -a R
  140. setpkgs -a ImageMagick
  141. fi
  142. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  143. # Path definitions
  144. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  145. typeset -U path
  146. case "$host" in
  147. ( cluster )
  148. path=(/usr/local/supermongo/bin # Supermongo path
  149. /usr/local/cuda/bin # Nvidia CUDA path
  150. /usr/lpp/mmfs/bin # GPFS utilities path
  151. ~/local/bin # User-specific path
  152. $path)
  153. export -UT LD_LIBRARY_PATH=/usr/scheduler/torque/lib:$LD_LIBRARY_PATH ld_library_path
  154. export -UT LD_LIBRARY_PATH=/usr/local/supermongo/lib:$LD_LIBRARY_PATH ld_library_path
  155. export -UT LD_LIBRARY_PATH=/usr/local/python/lib:$LD_LIBRARY_PATH ld_library_path
  156. export -UT LD_LIBRARY_PATH=/usr/local/cuda/lib:$LD_LIBRARY_PATH ld_library_path
  157. export -UT PYTHONPATH=~/local/lib/python/site-packages:$PYTHONPATH pythonpath
  158. export -UT IDL_STARTUP=~/.idl/idl_startup.pro idl_starup
  159. export -UT IDL_PATH=+/home/sinham/utils/idl:$IDL_PATH idl_path
  160. export -UT IDL_PATH=.:+/usr/local/idl/idl/lib:+/usr/local/idl/idl/:$IDL_PATH idl_path
  161. ;;
  162. ( astro )
  163. path=(/usr/local/python64/bin # Python path (64 bit)
  164. ~/local/bin # User specific path
  165. $path)
  166. export -UT LD_LIBRARY_PATH=/usr/local/python64/lib:$LD_LIBRARY_PATH ld_library_path
  167. export -UT PYTHONPATH=~/local/lib/python/latest/site-packages:$PYTHONPATH pythonpath
  168. export -UT PYTHONPATH=/usr/local/python64/lib/python*/site-packages:$PYTHONPATH pythonpath
  169. source /usr/local/itt/idl80/idl/bin/idl_setup.bash
  170. export IDL_PATH=.:/home/sinham/psu/utils/idl/:+$IDL_DIR
  171. export IDL_STARTUP=~/.idl/idl_startup.pro
  172. ;;
  173. ( linux )
  174. path=(~/Local/bin $path) # User specific path
  175. export -UT PYTHONPATH=~/Local/lib/python/python-2.7/site-packages:$PYTHONPATH pythonpath
  176. export -UT PYTHONPATH=~/Local/lib/python/latest/site-packages:$PYTHONPATH pythonpath
  177. export -UT PYTHONPATH=~/Local/lib/python3/site-packages:$PYTHONPATH pythonpath
  178. export -UT TEXINPUTS=.:./style:$TEXINPUTS texinputs
  179. export -UT BSTINPUTS=.:./style:$BSTINPUTS bstinputs
  180. export -UT BIBINPUTS=.:./style:$BIBINPUTS bibinputs
  181. ;;
  182. ( osx )
  183. path=(~/Local/bin # User specific path
  184. /usr/local/opt/coreutils/libexec/gnubin # Gnu coreutils from Homebrew
  185. /usr/local/opt/findutils/libexec/gnubin # Gnu find from Homebrew
  186. /usr/local/opt/grep/libexec/gnubin # Gnu grep from Homebrew
  187. /usr/local/opt/gnu-sed/libexec/gnubin # Gnu sed from Homebrew
  188. /usr/local/opt/gnu-indent/libexec/gnubin # Gnu indent from Homebrew
  189. /usr/local/opt/gnu-tar/libexec/gnubin # Gnu tar from Homebrew
  190. /usr/local/opt/python/libexec/bin # Unversioned python3
  191. $path)
  192. export -UT PYTHONPATH=~/Local/lib/python/latest/site-packages:$PYTHONPATH pythonpath
  193. ;;
  194. esac
  195. export path
  196. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  197. # Bash behavior
  198. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  199. #[ -z "$PS1" ] && return # If not running interactively, exit here
  200. export EDITOR='vim -display none' # Use vim as default text editor
  201. export GPG_TTY=$(tty) # Fix GPG pin prompt bug with git
  202. #export HISTCONTROL=ignoreboth # No duplicate or space-started lines in history
  203. #shopt -s histappend # Append to the history file, don't overwrite it
  204. #shopt -s checkwinsize # Update $LINES and $COLUMNS after each command
  205. export SDL_VIDEO_FULLSCREEN_HEAD=3
  206. setopt HIST_IGNORE_SPACE
  207. #setopt extended_glob
  208. ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  209. ## Enable advanced tab-completion
  210. ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  211. #
  212. ## Define file paths for tab-completion scripts
  213. #case "$host" in
  214. # ( cluster | astro )
  215. # bash_completion_path=/usr/share/bash-completion/bash_completion
  216. # git_completion_path=/etc/bash_completion.d/git
  217. # ;;
  218. # ( linux )
  219. # bash_completion_path=/usr/share/bash-completion/bash_completion
  220. # git_completion_path=/usr/share/git/completion/git-prompt.sh
  221. # ;;
  222. # ( osx )
  223. # bash_completion_path=/opt/local/etc/bash_completion
  224. # git_completion_path=/opt/local/etc/bash_completion.d/git
  225. # ;;
  226. #esac
  227. #
  228. ## Source bash_completion script if available; otherwise, set completion manually
  229. #if [ -r "$bash_completion_path" ]; then
  230. # . "$bash_completion_path" # Source global definition file
  231. #elif [ -r ~/.bash_completion ]; then
  232. # . ~/.bash_completion # Look in ~ if global file doesn't exist
  233. #else
  234. # complete -cf sudo # Bash auto-completion after sudo
  235. # complete -cf man # Bash auto-completion after man
  236. #fi
  237. #
  238. ## Enable bash tab completion for git commands, if available
  239. #if [ -r "$git_completion_path" ]; then
  240. # . "$git_completion_path"
  241. # git_prompt=yes # This and the following enable the git prompt
  242. # export GIT_PS1_SHOWDIRTYSTATE=1
  243. # export GIT_PS1_SHOWSTASHSTATE=1
  244. # export GIT_PS1_SHOWUNTRACKEDFILES=1
  245. # export GIT_PS1_SHOWUPSTREAM="auto"
  246. #fi
  247. #
  248. #
  249. ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  250. ## Set up a fancy prompt and window title, if available
  251. ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  252. #
  253. ## Use a colored prompt, if available
  254. #[ -t 1 ] && [ -n $(tput colors) ] && [ $(tput colors) -ge 8 ] && color_prompt=yes
  255. #
  256. ## Choose username/hostname color based on whether or not we are the root user
  257. #UserColor="$BCyan"
  258. #[ $UID == "0" ] && UserColor="$BRed"
  259. #
  260. ## Set prompt options based on capabilities
  261. #if [[ "$color_prompt" == yes && "$git_prompt" == yes ]]; then
  262. # PS1='['${UserColor}'\u@\h'${Color_Off}':'${BBlue}'\w'${Green}'$(__git_ps1 " (git-%s) ")'${Color_Off}']\$ '
  263. #elif [[ "$color_prompt" == yes ]]; then
  264. # PS1="[${UserColor}\u@\h${Color_Off}:${BBlue}\w${Color_Off}]\\$ "
  265. #elif [[ "$git_prompt" == yes ]]; then
  266. # PS1='[\u@\h:\w$(__git_ps1 " (git-%s) ")]\$ '
  267. #else
  268. # PS1='[\u@\h:\w]\$ '
  269. #fi
  270. #
  271. ## If this is an xterm, set the title to user@host:dir
  272. #case "$TERM" in
  273. # ( xterm* | rxvt* ) xterm_title="\[\e]0;\u@\h : \w\a\]" ;;
  274. # ( * ) xterm_title= ;;
  275. #esac
  276. #PS1="${xterm_title}${PS1}"
  277. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  278. # Source alias definitions file
  279. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  280. [ -r ~/.aliases ] && . ~/.aliases # this is going to have to go above completion stuff
  281. setopt complete_aliases
  282. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  283. # Program-specific settings and fixes
  284. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  285. # make less more friendly for non-text input files, see lesspipe(1)
  286. [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
  287. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  288. # User-defined functions
  289. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  290. # Enable user-passable growl notifications
  291. growl() { echo -e $'\e]9;'${1}'\007' ; return ; }
  292. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  293. # End
  294. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  295. zsh_hl_path=/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  296. [ -r $zsh_hl_path ] && source $zsh_hl_path
  297. ZSH_HIGHLIGHT_HIGHLIGHTERS=(brackets root) # options: main brackets pattern cursor root line
  298. #ZSH_HIGHLIGHT_STYLES[unknown-token]='none' # example to customize main class tokens
  299. autoload -U colors && colors
  300. #source ~/.zsh/git-prompt/zshrc.sh
  301. #PROMPT='|- %{$fg_no_bold[cyan]%}%n@%m%{$reset_color%} : %{$fg_no_bold[blue]%}%~%{$reset_color%} $(git_super_status)-> '
  302. #PROMPT="|- %{$fg_no_bold[cyan]%}%n@%m%{$reset_color%} : %{$fg_no_bold[blue]%}%~%{$reset_color%} -> "
  303. #autoload -U promptinit && promptinit
  304. autoload -Uz promptinit && promptinit
  305. PURE_GIT_PULL=0
  306. prompt pure