diff options
-rw-r--r-- | .zsh/00_skeleton | 8 | ||||
-rw-r--r-- | .zsh/completion/_go.zsh | 160 | ||||
-rw-r--r-- | .zsh/dircolors.256dark | 2 | ||||
-rw-r--r-- | .zsh/zshenv/00_shell | 11 | ||||
-rw-r--r-- | .zsh/zshenv/01_path | 14 | ||||
-rw-r--r-- | .zsh/zshenv/80_go | 9 | ||||
-rw-r--r-- | .zsh/zshenv/99_matlab | 2 | ||||
-rw-r--r-- | .zsh/zshrc/30_aliases | 18 |
8 files changed, 207 insertions, 17 deletions
diff --git a/.zsh/00_skeleton b/.zsh/00_skeleton index f28ffd4..d577548 100644 --- a/.zsh/00_skeleton +++ b/.zsh/00_skeleton @@ -1,11 +1,13 @@ -# <file name> +# zshenv/00_shell # -# <description> +# shell specific variables # -# Copyright © 2013 Tobias Klauser <tklauser@distanz.ch> +# Copyright © 2014 Tobias Klauser <tklauser@distanz.ch> # Released under the terms of the Artistic Licence 2.0 # # Source repository: git://git.distanz.ch/dotfiles/zsh.git +# let the world know we're using zsh (e.g. to use zsh for the shell command in make) +export SHELL=/bin/zsh # vim:ft=zsh diff --git a/.zsh/completion/_go.zsh b/.zsh/completion/_go.zsh new file mode 100644 index 0000000..18bcaaf --- /dev/null +++ b/.zsh/completion/_go.zsh @@ -0,0 +1,160 @@ +# install in /etc/zsh/zshrc or your personal .zshrc + +# gc +prefixes=(5 6 8) +for p in $prefixes; do + compctl -g "*.${p}" ${p}l + compctl -g "*.go" ${p}g +done + +# standard go tools +compctl -g "*.go" gofmt + +# gccgo +compctl -g "*.go" gccgo + +# go tool +__go_tool_complete() { + typeset -a commands build_flags + commands+=( + 'build[compile packages and dependencies]' + 'clean[remove object files]' + 'doc[run godoc on package sources]' + 'env[print Go environment information]' + 'fix[run go tool fix on packages]' + 'fmt[run gofmt on package sources]' + 'get[download and install packages and dependencies]' + 'help[display help]' + 'install[compile and install packages and dependencies]' + 'list[list packages]' + 'run[compile and run Go program]' + 'test[test packages]' + 'tool[run specified go tool]' + 'version[print Go version]' + 'vet[run go tool vet on packages]' + ) + if (( CURRENT == 2 )); then + # explain go commands + _values 'go tool commands' ${commands[@]} + return + fi + build_flags=( + '-a[force reinstallation of packages that are already up-to-date]' + '-n[print the commands but do not run them]' + '-p[number of parallel builds]:number' + '-race[enable data race detection]' + '-x[print the commands]' + '-work[print temporary directory name and keep it]' + '-ccflags[flags for 5c/6c/8c]:flags' + '-gcflags[flags for 5g/6g/8g]:flags' + '-ldflags[flags for 5l/6l/8l]:flags' + '-gccgoflags[flags for gccgo]:flags' + '-compiler[name of compiler to use]:name' + '-installsuffix[suffix to add to package directory]:suffix' + '-tags[list of build tags to consider satisfied]:tags' + ) + __go_list() { + local expl importpaths + declare -a importpaths + importpaths=($(go list ${words[$CURRENT]}... 2>/dev/null)) + _wanted importpaths expl 'import paths' compadd "$@" - "${importpaths[@]}" + } + case ${words[2]} in + clean|doc) + _arguments -s -w : '*:importpaths:__go_list' + ;; + fix|fmt|list|vet) + _alternative ':importpaths:__go_list' ':files:_path_files -g "*.go"' + ;; + install) + _arguments -s -w : ${build_flags[@]} \ + "-v[show package names]" \ + '*:importpaths:__go_list' + ;; + get) + _arguments -s -w : \ + ${build_flags[@]} + ;; + build) + _arguments -s -w : \ + ${build_flags[@]} \ + "-v[show package names]" \ + "-o[output file]:file:_files" \ + "*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }" + ;; + test) + _arguments -s -w : \ + ${build_flags[@]} \ + "-c[do not run, compile the test binary]" \ + "-i[do not run, install dependencies]" \ + "-v[print test output]" \ + "-x[print the commands]" \ + "-short[use short mode]" \ + "-parallel[number of parallel tests]:number" \ + "-cpu[values of GOMAXPROCS to use]:number list" \ + "-run[run tests and examples matching regexp]:regexp" \ + "-bench[run benchmarks matching regexp]:regexp" \ + "-benchmem[print memory allocation stats]" \ + "-benchtime[run each benchmark until taking this long]:duration" \ + "-blockprofile[write goroutine blocking profile to file]:file" \ + "-blockprofilerate[set sampling rate of goroutine blocking profile]:number" \ + "-timeout[kill test after that duration]:duration" \ + "-cpuprofile[write CPU profile to file]:file:_files" \ + "-memprofile[write heap profile to file]:file:_files" \ + "-memprofilerate[set heap profiling rate]:number" \ + "*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }" + ;; + help) + _values "${commands[@]}" \ + 'gopath[GOPATH environment variable]' \ + 'packages[description of package lists]' \ + 'remote[remote import path syntax]' \ + 'testflag[description of testing flags]' \ + 'testfunc[description of testing functions]' + ;; + run) + _arguments -s -w : \ + ${build_flags[@]} \ + '*:file:_path_files -g "*.go"' + ;; + tool) + if (( CURRENT == 3 )); then + _values "go tool" $(go tool) + return + fi + case ${words[3]} in + [568]g) + _arguments -s -w : \ + '-I[search for packages in DIR]:includes:_path_files -/' \ + '-L[show full path in file:line prints]' \ + '-S[print the assembly language]' \ + '-V[print the compiler version]' \ + '-e[no limit on number of errors printed]' \ + '-h[panic on an error]' \ + '-l[disable inlining]' \ + '-m[print optimization decisions]' \ + '-o[file specify output file]:file' \ + '-p[assumed import path for this code]:importpath' \ + '-u[disable package unsafe]' \ + "*:file:_files -g '*.go'" + ;; + [568]l) + local O=${words[3]%l} + _arguments -s -w : \ + '-o[file specify output file]:file' \ + '-L[search for packages in DIR]:includes:_path_files -/' \ + "*:file:_files -g '*.[ao$O]'" + ;; + dist) + _values "dist tool" banner bootstrap clean env install version + ;; + *) + # use files by default + _files + ;; + esac + ;; + esac +} + +compdef __go_tool_complete go diff --git a/.zsh/dircolors.256dark b/.zsh/dircolors.256dark index 5704caf..d12f5a1 100644 --- a/.zsh/dircolors.256dark +++ b/.zsh/dircolors.256dark @@ -86,7 +86,7 @@ TERM xterm-debian NORMAL 00;38;5;244 # no color code at all #FILE 00 # regular file: use no color at all RESET 0 # reset to "normal" color -DIR 00;38;5;33 # directory 01;34 +DIR 00;38;5;4 # directory 01;34 LINK 01;38;5;37 # symbolic link. (If you set this to 'target' instead of a # numerical value, the color is as for the file pointed to.) MULTIHARDLINK 00 # regular file with more than one link diff --git a/.zsh/zshenv/00_shell b/.zsh/zshenv/00_shell new file mode 100644 index 0000000..3b7fa98 --- /dev/null +++ b/.zsh/zshenv/00_shell @@ -0,0 +1,11 @@ +# zshenv/00_shell +# +# <description> +# +# Copyright © 2014 Tobias Klauser <tklauser@distanz.ch> +# Released under the terms of the Artistic Licence 2.0 +# +# Source repository: git://git.distanz.ch/dotfiles/zsh.git + + +# vim:ft=zsh diff --git a/.zsh/zshenv/01_path b/.zsh/zshenv/01_path index 2781e1c..c39ef75 100644 --- a/.zsh/zshenv/01_path +++ b/.zsh/zshenv/01_path @@ -2,7 +2,7 @@ # # Functions to add custom directories to the $PATH # -# Copyright © 2011 Tobias Klauser <tklauser@distanz.ch> +# Copyright © 2011-2013 Tobias Klauser <tklauser@distanz.ch> # Copyright © 1994–2008 martin f. krafft <madduck@madduck.net> # Released under the terms of the Artistic Licence 2.0 # @@ -35,13 +35,17 @@ path_append() path_prepend $HOME/bin #path_append /opt/nios2-new/bin +path_prepend /opt/local/bin + path_append /opt/nios2/bin path_append /opt/nios2mmu/x86-linux2/bin path_prepend /opt/codesourcery/nios2-4.1-211/bin -path_append /opt/codesourcery/arm-2010.09/bin -path_append /opt/android-sdk-linux_86 -path_prepend /opt/local/bin -path_append /opt/MATLAB/R2012a/bin +#path_append /opt/codesourcery/arm-2010.09/bin +#path_append /opt/android-sdk-linux_86 path_append /opt/cov-analysis-linux64-6.5.1/bin +path_append /opt/linaro/gcc-linaro-arm-linux-gnueabihf/bin + +path_append /opt/MATLAB/R2012a/bin +path_append /opt/MATLAB/R2013a/bin # vim:ft=zsh diff --git a/.zsh/zshenv/80_go b/.zsh/zshenv/80_go index b13f255..9da79e8 100644 --- a/.zsh/zshenv/80_go +++ b/.zsh/zshenv/80_go @@ -2,15 +2,18 @@ # # Set variables related to the Go programming language # -# Copyright © 2010 Tobias Klauser <tklauser@distanz.ch> +# Copyright © 2010-2013 Tobias Klauser <tklauser@distanz.ch> # Released under the terms of the Artistic Licence 2.0 # # Source repository: git://git.distanz.ch/dotfiles/zsh.git -_GOROOT=$HOME/src/go +_GOROOT=/opt/local/go/ if [ -d $_GOROOT ] ; then + export GOROOT=$_GOROOT + export GOPATH=$HOME/src/gospace/ + arch="$(uname -m)" case "$arch" in x86_64) export GOARCH="amd64";; @@ -26,7 +29,7 @@ if [ -d $_GOROOT ] ; then *) export GOOS="unsupported";; esac - path_append $_GOROOT/bin + path_append $GOROOT/bin fi # vim:ft=zsh diff --git a/.zsh/zshenv/99_matlab b/.zsh/zshenv/99_matlab index f4c42bb..f4d228d 100644 --- a/.zsh/zshenv/99_matlab +++ b/.zsh/zshenv/99_matlab @@ -8,7 +8,7 @@ # Source repository: git://git.distanz.ch/dotfiles/zsh.git # make MATLAB run on awesome/dwm -export MATLAB_JAVA=/usr/lib/jvm/java-6-openjdk-amd64/jre +export MATLAB_JAVA=/usr/lib/jvm/java-7-openjdk-amd64/jre export _JAVA_AWT_WM_NONREPARENTING=1 # vim:ft=zsh diff --git a/.zsh/zshrc/30_aliases b/.zsh/zshrc/30_aliases index f52c9e5..4776a53 100644 --- a/.zsh/zshrc/30_aliases +++ b/.zsh/zshrc/30_aliases @@ -2,7 +2,7 @@ # # Define command aliases # -# Copyright © 2010 Tobias Klauser <tklauser@distanz.ch> +# Copyright © 2010, 2013 Tobias Klauser <tklauser@distanz.ch> # Released under the terms of the Artistic Licence 2.0 # # Source repository: git://git.distanz.ch/dotfiles/zsh.git @@ -52,10 +52,20 @@ alias bofh='fortune bofh-excuses' alias q3='SDL_VIDEO_FULLSCREEN_HEAD=1 ioquake3' # host aliases -alias distanz="ssh distanz.ch -t \"screen -dRU\"" -alias distanz6="ssh -6 6.distanz.ch -t \"screen -dRU\"" +alias distanz="ssh tklauser@distanz.ch -t \"screen -dRU\"" +alias distanz6="ssh -6 tklauser@6.distanz.ch -t \"screen -dRU\"" alias sym=distanz alias sym6=distanz6 -alias lema="ssh lema.distanz.ch -t \"screen -dRU\"" +alias lema="ssh tklauser@lema.distanz.ch -t \"screen -dRU\"" + +# +# global aliases +# + +alias -g 1N="1>/dev/null" +alias -g 2N="2>/dev/null" +alias -g 12N="1>&2>/dev/null" + +alias -g L="| less" # vim:ft=zsh |