diff options
-rw-r--r-- | lib/git.zsh | 2 | ||||
-rw-r--r-- | lib/history.zsh | 4 | ||||
-rw-r--r-- | plugins/bower/bower.plugin.zsh | 38 | ||||
-rw-r--r-- | plugins/capistrano/_capistrano | 2 | ||||
-rw-r--r-- | plugins/extract/extract.plugin.zsh | 2 | ||||
-rw-r--r-- | plugins/golang/golang.plugin.zsh | 150 | ||||
-rwxr-xr-x | plugins/grails/grails.plugin.zsh | 28 | ||||
-rw-r--r-- | plugins/mvn/mvn.plugin.zsh | 2 | ||||
-rw-r--r-- | plugins/osx/osx.plugin.zsh | 3 | ||||
-rw-r--r-- | plugins/rbenv/rbenv.plugin.zsh | 2 | ||||
-rw-r--r-- | plugins/sbt/_sbt | 55 | ||||
-rw-r--r-- | plugins/sbt/sbt.plugin.zsh | 23 | ||||
-rw-r--r-- | plugins/scala/_scala | 249 | ||||
-rw-r--r-- | plugins/ssh-agent/ssh-agent.plugin.zsh | 15 | ||||
-rw-r--r-- | themes/michelebologna.zsh-theme | 44 |
15 files changed, 599 insertions, 20 deletions
diff --git a/lib/git.zsh b/lib/git.zsh index 3e14695bd..bcd6cc055 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -112,7 +112,7 @@ function git_compare_version() { local INPUT_GIT_VERSION=$1; local INSTALLED_GIT_VERSION INPUT_GIT_VERSION=(${(s/./)INPUT_GIT_VERSION}); - INSTALLED_GIT_VERSION=($(git --version)); + INSTALLED_GIT_VERSION=($(git --version 2>/dev/null)); INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]}); for i in {1..3}; do diff --git a/lib/history.zsh b/lib/history.zsh index 876936b87..655945166 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -1,5 +1,7 @@ ## Command history configuration -HISTFILE=$HOME/.zsh_history +if [ -z $HISTFILE ]; then + HISTFILE=$HOME/.zsh_history +fi HISTSIZE=10000 SAVEHIST=10000 diff --git a/plugins/bower/bower.plugin.zsh b/plugins/bower/bower.plugin.zsh new file mode 100644 index 000000000..ed9c04840 --- /dev/null +++ b/plugins/bower/bower.plugin.zsh @@ -0,0 +1,38 @@ +alias bi="bower install" +alias bl="bower list" +alias bs="bower search" + +bower_package_list='' + +_bower () +{ + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + ':command:->command' \ + '*::options:->options' + + case $state in + (command) + + local -a subcommands + subcommands=(${=$(bower help | grep help | sed -e 's/,//g')}) + _describe -t commands 'bower' subcommands + ;; + + (options) + case $line[1] in + + (install) + if [ -z "$bower_package_list" ];then + bower_package_list=$(bower search | awk 'NR > 2' | cut -d '-' -f 2 | cut -d ' ' -f 2 | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g") + fi + compadd "$@" $(echo $bower_package_list) + ;; + esac + ;; + esac +} + +compdef _bower bower diff --git a/plugins/capistrano/_capistrano b/plugins/capistrano/_capistrano index cf6b50c7f..1002dad96 100644 --- a/plugins/capistrano/_capistrano +++ b/plugins/capistrano/_capistrano @@ -1,7 +1,7 @@ #compdef cap #autoload -if [ -f config/deploy.rb ]; then +if [[ -f config/deploy.rb || -f Capfile ]]; then if [[ ! -f .cap_tasks~ || config/deploy.rb -nt .cap_tasks~ ]]; then echo "\nGenerating .cap_tasks~..." > /dev/stderr cap --tasks | grep '#' | cut -d " " -f 2 > .cap_tasks~ diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index 5c125e98b..23e86c593 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -53,7 +53,7 @@ function extract() { (*.lzma) unlzma "$1" ;; (*.Z) uncompress "$1" ;; (*.zip) unzip "$1" -d $extract_dir ;; - (*.rar) unrar e -ad "$1" ;; + (*.rar) unrar x -ad "$1" ;; (*.7z) 7za x "$1" ;; (*.deb) mkdir -p "$extract_dir/control" diff --git a/plugins/golang/golang.plugin.zsh b/plugins/golang/golang.plugin.zsh new file mode 100644 index 000000000..e60c4afe4 --- /dev/null +++ b/plugins/golang/golang.plugin.zsh @@ -0,0 +1,150 @@ +# From : http://golang.org/misc/zsh/go?m=text +# 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]' + '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" + '-x[print the commands]' + "-work[print temporary directory name and keep it]" + "-gcflags[flags for 5g/6g/8g]:flags" + "-ldflags[flags for 5l/6l/8l]:flags" + "-gccgoflags[flags for gccgo]:flags" + ) + __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" \ + "-benchtime[run each benchmark during n seconds]:duration" \ + "-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]' \ + 'importpath[description of import paths]' \ + '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
\ No newline at end of file diff --git a/plugins/grails/grails.plugin.zsh b/plugins/grails/grails.plugin.zsh index cc6f9c53b..11777738c 100755 --- a/plugins/grails/grails.plugin.zsh +++ b/plugins/grails/grails.plugin.zsh @@ -24,17 +24,23 @@ _enumerateGrailsScripts() { return fi - # - Strip the path - # - Remove all scripts with a leading '_' - # - PackagePlugin_.groovy -> PackagePlugin - # - PackagePlugin -> Package-Plugin - # - Package-Plugin -> package-plugin - basename $files \ - | sed -E -e 's/^_?([^_]+)_?.groovy/\1/'\ - -e 's/([a-z])([A-Z])/\1-\2/g' \ - | tr "[:upper:]" "[:lower:]" \ - | sort \ - | uniq + scripts=() + for file in $files + do + # - Strip the path + # - Remove all scripts with a leading '_' + # - PackagePlugin_.groovy -> PackagePlugin + # - PackagePlugin -> Package-Plugin + # - Package-Plugin -> package-plugin + command=$(basename $file \ + | sed -E -e 's/^_?([^_]+)_?.groovy/\1/'\ + -e 's/([a-z])([A-Z])/\1-\2/g' \ + | tr "[:upper:]" "[:lower:]" \ + | sort \ + | uniq) + scripts+=($command) + done + echo $scripts } _grails() { diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index da29b4f0a..c2d8e7ed7 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -163,7 +163,7 @@ function listMavenCompletions { cli:execute cli:execute-phase archetype:generate generate-sources cobertura:cobertura - -Dtest= `if [ -d ./src ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dtest=\1?' ; fi` + -Dtest= `if [ -d ./src/test/java ] ; then find ./src/test/java -type f -name '*.java' | grep -v svn | sed 's?.*/\([^/]*\)\..*?-Dtest=\1?' ; fi` ); } diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh index f278d4f8d..51cd7c143 100644 --- a/plugins/osx/osx.plugin.zsh +++ b/plugins/osx/osx.plugin.zsh @@ -154,3 +154,6 @@ function trash() { IFS=$temp_ifs } +function vncviewer() { + open vnc://$@ +} diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh index fb9df4bdd..78f76c3a3 100644 --- a/plugins/rbenv/rbenv.plugin.zsh +++ b/plugins/rbenv/rbenv.plugin.zsh @@ -17,7 +17,7 @@ for rbenvdir in "${rbenvdirs[@]}" ; do FOUND_RBENV=1 export RBENV_ROOT=$rbenvdir export PATH=${rbenvdir}/bin:$PATH - eval "$(rbenv init - zsh)" + eval "$(rbenv init --no-rehash - zsh)" alias rubies="rbenv versions" alias gemsets="rbenv gemset list" diff --git a/plugins/sbt/_sbt b/plugins/sbt/_sbt new file mode 100644 index 000000000..91372aa72 --- /dev/null +++ b/plugins/sbt/_sbt @@ -0,0 +1,55 @@ +#compdef sbt +#autoload + +local -a _sbt_commands +_sbt_commands=( + 'clean:delete files produced by the build' + 'compile:compile sources' + 'console:start the Scala REPL with project classes on the classpath' + 'console-quick:start the Scala REPL with project deps on the classpath' + 'console-project:start the Scala REPL w/sbt+build-def on the classpath' + 'dist:generate distribution artifacts' + 'dist\:clean:clean distribution artifacts' + 'doc:generate API documentation' + 'gen-idea:generate Intellij Idea project files' + 'package:produce the main artifact, such as a binary jar' + 'package-doc:produce a doc artifact, such as a jar containing API docs' + 'package-src:produce a source artifact, such as a jar containing sources' + 'publish:publish artifacts to a repository' + 'publish-local:publish artifacts to the local repository' + 'run:run a main class' + 'run-main:run the main class selected by the first argument' + 'test:execute all tests' + 'test-only:execute the tests provided as arguments' + 'test-quick:execute previously failed tests' + 'update:resolve and optionally retrieve dependencies' +) + +local expl + +_arguments \ + '(-help)-h[prints an help message]' \ + '(-h)-help[prints an help message]' \ + '(-verbose)-v[this runner is chattier]' \ + '(-v)-verbose[this runner is chattier]' \ + '(-debug)-d[set sbt log level to debug]' \ + '(-d)-debug[set sbt log level to debug]' \ + '-no-colors[disable ANSI color codes]' \ + '-sbt-create[start even if current dir contains no sbt project]' \ + '-sbt-dir[path to global settings/plugins dir (default: ~/.sbt)]' \ + '-sbt-boot[path to shared boot dir (default: ~/.sbt/boot)]' \ + '-ivy[path to local Ivy repository (default: ~/.ivy2)]' \ + '-mem[set memory options]' \ + '-no-share[use all local caches; no sharing]' \ + '-no-global[use global caches, but do not use global ~/.sbt dir]' \ + '-jvm-debug[turn on JVM debugging, open at the given port]' \ + '-batch[disable interactive mode]' \ + '-sbt-version[use the specified version of sbt]' \ + '-sbt-jar[use the specified jar as the sbt launcher]' \ + '(-sbt-snapshot)-sbt-rc[use an RC version of sbt]' \ + '(-sbt-rc)-sbt-snapshot[use a snapshot version of sbt]' \ + '-java-home[alternate JAVA_HOME]' \ + '*:: :->subcmds' && return 0 + +_describe -t commands "sbt subcommand" _sbt_commands +return diff --git a/plugins/sbt/sbt.plugin.zsh b/plugins/sbt/sbt.plugin.zsh new file mode 100644 index 000000000..203c691f5 --- /dev/null +++ b/plugins/sbt/sbt.plugin.zsh @@ -0,0 +1,23 @@ +# ------------------------------------------------------------------------------ +# FILE: sbt.plugin.zsh +# DESCRIPTION: oh-my-zsh plugin file. +# AUTHOR: Mirko Caserta (mirko.caserta@gmail.com) +# VERSION: 1.0.2 +# ------------------------------------------------------------------------------ + +# aliases - mnemonic: prefix is 'sb' +alias sbc='sbt compile' +alias sbco='sbt console' +alias sbcq='sbt console-quick' +alias sbcl='sbt clean' +alias sbcp='sbt console-project' +alias sbd='sbt doc' +alias sbdc='sbt dist:clean' +alias sbdi='sbt dist' +alias sbgi='sbt gen-idea' +alias sbp='sbt publish' +alias sbpl='sbt publish-local' +alias sbr='sbt run' +alias sbrm='sbt run-main' +alias sbu='sbt update' +alias sbx='sbt test' diff --git a/plugins/scala/_scala b/plugins/scala/_scala new file mode 100644 index 000000000..c4ccb37d3 --- /dev/null +++ b/plugins/scala/_scala @@ -0,0 +1,249 @@ +#compdef scala scalac +# ------------------------------------------------------------------------------ +# Copyright (c) 2012 Github zsh-users - http://github.com/zsh-users +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the zsh-users nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ------------------------------------------------------------------------------ +# Description +# ----------- +# +# Completion script for scala and scalac (http://www.scala-lang.org/). +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * Tony Sloane <inkytonik@gmail.com> +# +# ------------------------------------------------------------------------------ + +typeset -A opt_args +local context state line + +_scala_features () { + compadd "postfixOps" "reflectiveCalls" "implicitConversions" "higherKinds" \ + "existentials" "experimental.macros" "_" +} + +_scala_phases () { + compadd "parser" "namer" "packageobjects" "typer" "patmat" "superaccessors" \ + "extmethods" "pickler" "refchecks" "selectiveanf" "selectivecps" "uncurry" \ + "tailcalls" "specialize" "explicitouter" "erasure" "posterasure" "lazyvals" \ + "lambdalift" "constructors" "flatten" "mixin" "cleanup" "icode" "inliner" \ + "inlineExceptionHandlers" "closelim" "dce" "jvm" "terminal" +} + +local -a shared_opts +shared_opts=( + "-bootclasspath+[Override location of bootstrap class files]:bootstrap class directory:_files -/" + "-classpath+[Specify where to find user class files]:directory:_files -/" + "-D-[Pass -Dproperty=value directly to the runtime system]" + "-d+[Destination for generated classfiles]: directory or jar file:_files" + "-dependencyfile+[Set dependency tracking file]:dependency tracking file:_files" + "-deprecation[Emit warning and location for usages of deprecated APIs]" + "-encoding+[Specify character encoding used by source files]:encoding:" + "-explaintypes[Explain type errors in more detail]" + "-extdirs+[Override location of installed extensions]:extensions directory:_files -/" + "-g\:-[Set level of generated debugging info (default\: vars)]:debugging info level:(none source line vars notailcalls)" + "-help[Print a synopsis of standard options]" + "-J-[pass argument directly to Java runtime system]:JVM argument:" + "-javabootclasspath+[Override java boot classpath]:Java boot class path directory]:_files -/" + "-javaextdirs+[Override java extdirs classpath]:Java extdirs directory:_files -/" + "-language\:-[Enable one or more language features]:feature:_scala_features" + "-no-specialization[Ignore @specialize annotations]" + "-nobootcp[Do not use the boot classpath for the scala jars]" + "-nowarn[Generate no warnings]" + "-optimise[Generate faster bytecode by applying optimisations to the program]" + "-P\:-[Pass an option to a plugin (written plugin\:opt)]:plugin option:" + "-print[Print program with Scala-specific features removed]" + "-sourcepath+[Specify location(s) of source files]:source file directory:_files -/" + "-target\:-[Target platform for object files (default\: jvm-1.5)]:platform name:(jvm-1.5 msil)" + "-toolcp+[Add to the runner classpath]:directory:_files -/" + "-unchecked[Enable detailed unchecked (erasure) warnings]" + "-uniqid[Uniquely tag all identifiers in debugging output]" + "-usejavacp[Utilize the java.class.path in classpath resolution]" + "-verbose[Output messages about what the compiler is doing]" + "-version[Print product version and exit]" + "-X[Print a synopsis of advanced options]" + "-Y[Print a synopsis of private options]" +) + +local -a X_opts +X_opts=( + "-Xcheck-null[Warn upon selection of nullable reference]" + "-Xcheckinit[Wrap field accessors to throw an exception on uninitialized access]" + "-Xdisable-assertions[Generate no assertions or assumptions]" + "-Xelide-below+[Calls to @elidable methods are omitted if method priority is lower than integer argument]" + "-Xexperimental[Enable experimental extensions]" + "-Xfatal-warnings[Fail the compilation if there are any warnings]" + "-Xfull-lubs[Retains pre 2.10 behavior of less aggressive truncation of least upper bounds]" + "-Xfuture[Turn on future language features]" + "-Xgenerate-phase-graph+[Generate the phase graphs (outputs .dot files) to fileX.dot]:output file:_files" + "-Xlint[Enable recommended additional warnings]" + "-Xlog-free-terms[Print a message when reification creates a free term]" + "-Xlog-free-types[Print a message when reification resorts to generating a free type]" + "-Xlog-implicits[Show more detail on why some implicits are not applicable]" + "-Xlog-implicit-conversions[Print a message whenever an implicit conversion is inserted]" + "-Xlog-reflective-calls[Print a message when a reflective method call is generated]" + "-Xmacro-settings\:-[Custom settings for macros]:option" + "-Xmain-class+[Class for manifest's Main-Class entry (only useful with -d jar)]:path:" + "-Xmax-classfile-name+[Maximum filename length for generated classes]" + "-Xmigration[Warn about constructs whose behavior may have changed]" + "-Xno-forwarders[Do not generate static forwarders in mirror classes]" + "-Xno-patmat-analysis[Don't perform exhaustivity/unreachability analysis. Also, ignore @switch annotation]" + "-Xno-uescape[Disable handling of \u unicode escapes]" + "-Xnojline[Do not use JLine for editing]" + "-Xoldpatmat[Use the pre-2.10 pattern matcher. Otherwise, the 'virtualizing' pattern matcher is used in 2.10]" + "-Xprint\:-[Print out program after <phase>]:phase name:_scala_phases" + "-Xprint-icode\:-[Log internal icode to *.icode files after phase (default\: icode)]:phase name:_scala_phases" + "-Xprint-pos[Print tree positions, as offsets]" + "-Xprint-types[Print tree types (debugging option)]" + "-Xprompt[Display a prompt after each error (debugging option)]" + "-Xresident[Compiler stays resident: read source filenames from standard input]" + "-Xscript+[Treat the source file as a script and wrap it in a main method]:main object name" + "-Xshow-class+[Show internal representation of class]:class name" + "-Xshow-object+[Show internal representation of object]:object name" + "-Xshow-phases[Print a synopsis of compiler phases]" + "-Xsource-reader+[Specify a class name for a custom method of reading source files]:class name" + "-Xverify[Verify generic signatures in generated bytecode]" + + "-Xassem-extdirs+[List of directories containing assemblies (requires -target:msil) (default\: lib)]:assembly directory:_files -/" + "-Xassem-name+[Name of the output assembly (requires -target:msil)]:assembly name:_files" + "-Xassem-path+[List of assemblies referenced by the program (requires -target:msil)]:assembly path:_files" + "-Xsourcedir+[Mirror source folder structure in output directory (requires -target:msil)]:source directory:_files -/" + + "-Xplugin\:-[Load one or more plugins from file]:plugin file:_files" + "-Xpluginsdir+[Path to search compiler plugins]:plugin directory:_files -/" + "-Xplugin-list[Print a synopsis of loaded plugins]" + "-Xplugin-disable\:-[Disable the given plugin(s)]" + "-Xplugin-require\:-[Abort unless the given plugin(s) are available]" +) + +local -a Y_opts +Y_opts=( + "-Y[Print a synopsis of private options]" + "-Ybuild-manager-debug[Generate debug information for the Refined Build Manager compiler]" + "-Ybuilder-debug\:-[Compile using the specified build manager (default\: none)]:build manager:(none refined simple)" + "-Yclosure-elim[Perform closure elimination]" + "-Ycompact-trees[Use compact tree printer when displaying trees]" + "-Ydead-code[Perform dead code elimination]" + "-Ydependent-method-types[Allow dependent method types]" + "-Ydump-classes+[Dump the generated bytecode to .class files (useful for reflective compilation that utilizes in-memory classloaders)]:output directory:_files -/" + "-Yeta-expand-keeps-star[Eta-expand varargs methods to T* rather than Seq[T]. This is a temporary option to ease transition.]" + "-Ygen-javap+[Generate a parallel output directory of .javap files]:output directory:_files -/" + "-Yinfer-argument-types[Infer types for arguments of overriden methods]" + "-Yinline[Perform inlining when possible]" + "-Yinline-handlers[Perform exception handler inlining when possible]" + "-Yinline-warnings[Emit inlining warnings (normally surpressed due to high volume)]" + "-Yinvalidate+[Invalidate classpath entry before run]:classpath entry" + "-Ylinearizer\:-[Linearizer to use (default\: rpo)]:linearizer:(normal dfs rpo dump)" + "-Ylog-classpath[Output information about what classpath is being applied]" + "-Yno-adapted-args[Do not adapt an argument list (either by inserting unit or creating a tuple) to match the receiver]" + "-Ymacro-debug-lite[Trace essential macro-related activities]" + "-Ymacro-debug-verbose[Trace all macro-related activities: compilation, generation of synthetics, classloading, expansion, exceptions]" + "-Yno-completion[Disable tab-completion in the REPL]" + "-Yno-generic-signatures[Suppress generation of generic signatures for Java]" + "-Yno-imports[Compile without any implicit imports]" + "-Yno-predef[Compile without importing Predef]" + "-Yno-self-type-checks[Suppress check for self-type conformance among inherited members]" + "-Yno-squeeze[Disable creation of compact code in matching]" + "-Ynotnull[Enable (experimental and incomplete) scala.NotNull]" + "-Yoverride-objects[Allow member objects to be overridden]" + "-Yoverride-vars[Allow vars to be overridden]" + "-Ypmat-naive[Desugar matches as naively as possible]" + "-Ypresentation-delay+[Wait number of ms after typing before starting typechecking]" + "-Ypresentation-log+[Log presentation compiler events into file]:log file:_files" + "-Ypresentation-replay+[Replay presentation compiler events from file]:log file:_files" + "-Ypresentation-strict[Do not report type errors in sources with syntax errors]" + "-Ypresentation-verbose[Print information about presentation compiler tasks]" + "-Yprofile-class+[Specify name of profiler class]:profiler class name" + "-Yprofile-memory[Heap snapshot after compiler run (requires jgpagent on JVM -agentpath)]" + "-Yrangepos[Use range positions for syntax trees]" + "-Yrecursion+[Set recursion depth used when locking symbols]" + "-Yreify-copypaste[Dump the reified trees in copypasteable representation]" + "-Yrepl-sync[Do not use asynchronous code for REPL startup]" + "-Yresolve-term-conflict\:-[Resolve term conflicts (default\: error)]:resolution strategy:(package object error)" + "-Yself-in-annots[Include a \"self\" identifier inside of annotations]" + "-Yshow\:-[Show after <phase> (requires -Xshow-class or -Xshow-object)]:phase name:_scala_phases" + "-Yshow-syms[Print the AST symbol hierarchy after each phase]" + "-Yshow-symkinds[Print abbreviated symbol kinds next to symbol names]" + "-Yshow-trees[Print detailed ASTs (requires -Xprint\:phase)]" + "-Yshow-trees-compact[Print detailed ASTs in compact form (requires -Xprint\:)]" + "-Yshow-trees-stringified[Print stringifications along with detailed ASTs (requires -Xprint\:)]" + "-Ystatistics[Print compiler statistics]" + "-Ystruct-dispatch\:-[Structural method dispatch policy (default\: poly-cache)]:policy name:(no-cache mono-cache poly-cache invoke-dynamic)" + + "-Ybrowse\:-[Browse the abstract syntax tree after <phase>]:phase name:_scala_phases" + "-Ycheck\:-[Check the tree at the end of <phase>]:phase name:_scala_phases" + "-Ylog\:-[Log operations during <phase>]:phase name:_scala_phases" + "-Yprofile\:-[Profile CPU usage of given phases (requires jgpagent on JVM -agentpath)]:phase name:_scala_phases" + "-Yskip\:-[Skip <phase>]:phase name:_scala_phases" + "-Ystop-after\:-[Stop after given phase <phase>]:phase name:_scala_phases" + "-Ystop-before\:-[Stop before given phase <phase>]:phase name:_scala_phases" + + "-Ywarn-adapted-args[Warn if an argument list is modified to match the receiver]" + "-Ywarn-all[Enable all -Y warnings]" + "-Ywarn-dead-code[Warn when dead code is identified]" + "-Ywarn-inaccessible[Warn about inaccessible types in method signatures]" + "-Ywarn-nullary-override[Warn when non-nullary overrides nullary, e.g. def foo() over def foo]" + "-Ywarn-nullary-unit[Warn when nullary methods return Unit]" + "-Ywarn-numeric-widen[Warn when numerics are widened]" + "-Ywarn-value-discard[Warn when non-Unit expression results are unused]" + + "-Ybuild-manager-debug[Generate debug information for the Refined Build Manager compiler]" + "-Ybuilder-debug\:-[Compile using the specified build manager (default\: none)]:manager:(none refined simple)" + "-Ycompletion-debug[Trace all tab completion activity]" + "-Ydebug[Increase the quantity of debugging output]" + "-Ydoc-debug[Trace all scaladoc activity]" + "-Yide-debug[Generate, validate and output trees using the interactive compiler]" + "-Yinfer-debug[Trace type inference and implicit search]" + "-Yissue-debug[Print stack traces when a context issues an error]" + "-Ypatmat-debug[Trace pattern matching translation]" + "-Ypmat-debug[Trace all pattern matcher activity]" + "-Ypos-debug[Trace position validation]" + "-Ypresentation-debug[Enable debugging output for the presentation compiler]" + "-Yreify-debug[Trace reification]" + "-Yrepl-debug[Trace all REPL activity]" + "-Ytyper-debug[Trace all type assignments]" +) + +local -a scala_opts +scala_opts=( + "-e+[execute <string> as if entered in the repl]:string" \ + "-howtorun+[what to run (default\: guess)]:execution mode:(script object jar guess)" \ + "-i+[preload <file> before starting the repl]:file to preload:_files" \ + "-nc[no compilation daemon\: do not use the fsc offline compiler]" \ + "-save[save the compiled script in a jar for future use]" +) + +case $words[$CURRENT] in + -X*) _arguments $X_opts;; + -Y*) _arguments $Y_opts;; + *) case $service in + scala) _arguments $scala_opts $shared_opts "*::filename:_files";; + scalac) _arguments $shared_opts "*::filename:_files";; + esac +esac + +return 0 diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index c4e92a1fe..7468749f8 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -6,11 +6,17 @@ # # zstyle :omz:plugins:ssh-agent agent-forwarding on # -# To load multiple identies use the identities style, For +# To load multiple identities use the identities style, For # example: # # zstyle :omz:plugins:ssh-agent id_rsa id_rsa2 id_github # +# To set the maximum lifetime of the identities, use the +# lifetime style. The lifetime may be specified in seconds +# or as described in sshd_config(5) (see TIME FORMATS) +# If left unspecified, the default lifetime is forever. +# +# zstyle :omz:plugins:ssh-agent lifetime 4h # # CREDITS # @@ -27,15 +33,18 @@ local _plugin__forwarding function _plugin__start_agent() { local -a identities + local lifetime + zstyle -s :omz:plugins:ssh-agent lifetime lifetime # start ssh-agent and setup environment - /usr/bin/env ssh-agent | sed 's/^echo/#echo/' > ${_plugin__ssh_env} + /usr/bin/env ssh-agent ${lifetime:+-t} ${lifetime} | sed 's/^echo/#echo/' > ${_plugin__ssh_env} chmod 600 ${_plugin__ssh_env} . ${_plugin__ssh_env} > /dev/null # load identies zstyle -a :omz:plugins:ssh-agent identities identities - echo starting... + echo starting ssh-agent... + /usr/bin/ssh-add $HOME/.ssh/${^identities} } diff --git a/themes/michelebologna.zsh-theme b/themes/michelebologna.zsh-theme new file mode 100644 index 000000000..ef4c6d740 --- /dev/null +++ b/themes/michelebologna.zsh-theme @@ -0,0 +1,44 @@ +# reference colors +GREEN="%{$fg_bold[green]%}" +RED="%{$fg_bold[red]%}" +CYAN="%{$fg_bold[cyan]%}" +YELLOW="%{$fg_bold[yellow]%}" +BLUE="%{$fg_bold[blue]%}" +MAGENTA="%{$fg_bold[magenta]%}" +WHITE="%{$fg_bold[white]%}" + +COLOR_ARRAY=($GREEN $RED $CYAN $YELLOW $BLUE $MAGENTA $WHITE) + +# color reset +RESET_COLOR="%{$reset_color%}" + +# which color should be applied? +USERNAME_NORMAL_COLOR=$WHITE +USERNAME_ROOT_COLOR=$RED +HOSTNAME_NORMAL_COLOR=$BLUE +# uncomment next line if you want auto-generated hostname color +#for i in `hostname`; HOSTNAME_NORMAL_COLOR=$COLOR_ARRAY[$[((#i))%7+1]] +HOSTNAME_ROOT_COLOR=$RED +HOSTNAME_COLOR=%(!.$HOSTNAME_ROOT_COLOR.$HOSTNAME_NORMAL_COLOR) +CURRENT_DIR_COLOR=$CYAN + +# zsh commands +USERNAME_COMMAND="%n" +HOSTNAME_COMMAND="%m" +CURRENT_DIR="%~" + +# output: colors + commands +USERNAME_OUTPUT="%(!..$USERNAME_NORMAL_COLOR$USERNAME_COMMAND$RESET_COLOR@)" +HOSTNAME_OUTPUT="$HOSTNAME_COLOR$HOSTNAME_COMMAND$RESET_COLOR" +CURRENT_DIR_OUTPUT="$CURRENT_DIR_COLOR$CURRENT_DIR" +LAST_COMMAND_OUTPUT="%(?.%(!.$RED.$GREEN).$YELLOW)" + +# git theming +ZSH_THEME_GIT_PROMPT_PREFIX="(" +ZSH_THEME_GIT_PROMPT_SUFFIX="" +ZSH_THEME_GIT_PROMPT_DIRTY=")$RED*" +ZSH_THEME_GIT_PROMPT_CLEAN=")" + +# wrap all together +PROMPT='$USERNAME_OUTPUT$HOSTNAME_OUTPUT:$CURRENT_DIR_OUTPUT $LAST_COMMAND_OUTPUT%#$RESET_COLOR ' +RPROMPT='%1(j.fg: [%j].) $GREEN$(git_prompt_info)$RESET_COLOR [%@]' |