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.

362 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=(~/Local/bin # User specific path
  183. /usr/local/opt/coreutils/libexec/gnubin # Gnu coreutils from Homebrew
  184. /usr/local/opt/findutils/libexec/gnubin # Gnu find from Homebrew
  185. /usr/local/opt/grep/libexec/gnubin # Gnu grep from Homebrew
  186. /usr/local/opt/gnu-sed/libexec/gnubin # Gnu sed from Homebrew
  187. /usr/local/opt/gnu-indent/libexec/gnubin # Gnu indent from Homebrew
  188. /usr/local/opt/gnu-tar/libexec/gnubin # Gnu tar from Homebrew
  189. /usr/local/opt/python/libexec/bin # Unversioned python3
  190. $path)
  191. export -UT PYTHONPATH=~/Local/lib/python/latest/site-packages:$PYTHONPATH pythonpath
  192. ;;
  193. esac
  194. export path
  195. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  196. # Bash behavior
  197. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  198. #[ -z "$PS1" ] && return # If not running interactively, exit here
  199. export EDITOR='vim -display none' # Use vim as default text editor
  200. export GPG_TTY=$(tty) # Fix GPG pin prompt bug with git
  201. #export HISTCONTROL=ignoreboth # No duplicate or space-started lines in history
  202. #shopt -s histappend # Append to the history file, don't overwrite it
  203. #shopt -s checkwinsize # Update $LINES and $COLUMNS after each command
  204. export SDL_VIDEO_FULLSCREEN_HEAD=3
  205. setopt HIST_IGNORE_SPACE
  206. #setopt extended_glob
  207. ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  208. ## Enable advanced tab-completion
  209. ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  210. #
  211. ## Define file paths for tab-completion scripts
  212. #case "$host" in
  213. # ( cluster | astro )
  214. # bash_completion_path=/usr/share/bash-completion/bash_completion
  215. # git_completion_path=/etc/bash_completion.d/git
  216. # ;;
  217. # ( linux )
  218. # bash_completion_path=/usr/share/bash-completion/bash_completion
  219. # git_completion_path=/usr/share/git/completion/git-prompt.sh
  220. # ;;
  221. # ( osx )
  222. # bash_completion_path=/opt/local/etc/bash_completion
  223. # git_completion_path=/opt/local/etc/bash_completion.d/git
  224. # ;;
  225. #esac
  226. #
  227. ## Source bash_completion script if available; otherwise, set completion manually
  228. #if [ -r "$bash_completion_path" ]; then
  229. # . "$bash_completion_path" # Source global definition file
  230. #elif [ -r ~/.bash_completion ]; then
  231. # . ~/.bash_completion # Look in ~ if global file doesn't exist
  232. #else
  233. # complete -cf sudo # Bash auto-completion after sudo
  234. # complete -cf man # Bash auto-completion after man
  235. #fi
  236. #
  237. ## Enable bash tab completion for git commands, if available
  238. #if [ -r "$git_completion_path" ]; then
  239. # . "$git_completion_path"
  240. # git_prompt=yes # This and the following enable the git prompt
  241. # export GIT_PS1_SHOWDIRTYSTATE=1
  242. # export GIT_PS1_SHOWSTASHSTATE=1
  243. # export GIT_PS1_SHOWUNTRACKEDFILES=1
  244. # export GIT_PS1_SHOWUPSTREAM="auto"
  245. #fi
  246. #
  247. #
  248. ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  249. ## Set up a fancy prompt and window title, if available
  250. ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  251. #
  252. ## Use a colored prompt, if available
  253. #[ -t 1 ] && [ -n $(tput colors) ] && [ $(tput colors) -ge 8 ] && color_prompt=yes
  254. #
  255. ## Choose username/hostname color based on whether or not we are the root user
  256. #UserColor="$BCyan"
  257. #[ $UID == "0" ] && UserColor="$BRed"
  258. #
  259. ## Set prompt options based on capabilities
  260. #if [[ "$color_prompt" == yes && "$git_prompt" == yes ]]; then
  261. # PS1='['${UserColor}'\u@\h'${Color_Off}':'${BBlue}'\w'${Green}'$(__git_ps1 " (git-%s) ")'${Color_Off}']\$ '
  262. #elif [[ "$color_prompt" == yes ]]; then
  263. # PS1="[${UserColor}\u@\h${Color_Off}:${BBlue}\w${Color_Off}]\\$ "
  264. #elif [[ "$git_prompt" == yes ]]; then
  265. # PS1='[\u@\h:\w$(__git_ps1 " (git-%s) ")]\$ '
  266. #else
  267. # PS1='[\u@\h:\w]\$ '
  268. #fi
  269. #
  270. ## If this is an xterm, set the title to user@host:dir
  271. #case "$TERM" in
  272. # ( xterm* | rxvt* ) xterm_title="\[\e]0;\u@\h : \w\a\]" ;;
  273. # ( * ) xterm_title= ;;
  274. #esac
  275. #PS1="${xterm_title}${PS1}"
  276. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  277. # Source alias definitions file
  278. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  279. [ -r ~/.aliases ] && . ~/.aliases
  280. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  281. # Program-specific settings and fixes
  282. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  283. # make less more friendly for non-text input files, see lesspipe(1)
  284. [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
  285. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  286. # User-defined functions
  287. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  288. # Enable user-passable growl notifications
  289. growl() { echo -e $'\e]9;'${1}'\007' ; return ; }
  290. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  291. # End
  292. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  293. source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  294. ZSH_HIGHLIGHT_HIGHLIGHTERS=(brackets root) # options: main brackets pattern cursor root line
  295. #ZSH_HIGHLIGHT_STYLES[unknown-token]='none' # example to customize main class tokens
  296. autoload -U colors && colors
  297. #source ~/.zsh/git-prompt/zshrc.sh
  298. #PROMPT='|- %{$fg_no_bold[cyan]%}%n@%m%{$reset_color%} : %{$fg_no_bold[blue]%}%~%{$reset_color%} $(git_super_status)-> '
  299. #PROMPT="|- %{$fg_no_bold[cyan]%}%n@%m%{$reset_color%} : %{$fg_no_bold[blue]%}%~%{$reset_color%} -> "
  300. fpath=( "$HOME/.zsh/functions" $fpath )
  301. #autoload -U promptinit && promptinit
  302. autoload -Uz promptinit && promptinit
  303. PURE_GIT_PULL=0
  304. prompt pure