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