Unverified Commit 8c95c523 authored by Kozlov Alexander's avatar Kozlov Alexander Committed by GitHub
Browse files

Merge branch 'master' into master

parents dd30cf10 3d8f2bda
# LOL!!1 # LOL!!1
# Source: http://aur.archlinux.org/packages/lolbash/lolbash/lolbash.sh # Source: https://aur.archlinux.org/packages/lolbash/lolbash/lolbash.sh
alias wtf='dmesg' alias wtf='dmesg'
alias onoz='cat /var/log/errors.log' alias onoz='cat /var/log/errors.log'
...@@ -45,6 +45,7 @@ alias bringz='git pull' ...@@ -45,6 +45,7 @@ alias bringz='git pull'
alias chicken='git add' alias chicken='git add'
alias oanward='git commit -m' alias oanward='git commit -m'
alias ooanward='git commit -am' alias ooanward='git commit -am'
alias yolo='git commit -m "$(curl -s https://whatthecommit.com/index.txt)"'
alias letcat='git checkout' alias letcat='git checkout'
alias violenz='git rebase' alias violenz='git rebase'
# Macports plugin
This plugin adds completion for the package manager [Macports](https://macports.com/),
as well as some aliases for common Macports commands.
To use it, add `macports` to the plugins array in your zshrc file:
```zsh
plugins=(... macports)
```
## Aliases
| Alias | Command | Description |
|-------|------------------------------------|--------------------------------------------------------------|
| pc | `sudo port clean --all installed` | Clean up intermediate installation files for installed ports |
| pi | `sudo port install` | Install package given as argument |
| psu | `sudo port selfupdate` | Update ports tree with MacPorts repository |
| puni | `sudo port uninstall inactive` | Uninstall inactive ports |
| puo | `sudo port upgrade outdated` | Upgrade ports with newer versions available |
| pup | `psu && puo` | Update ports tree, then upgrade ports to newest versions |
#Aliases
alias pc="sudo port clean --all installed" alias pc="sudo port clean --all installed"
alias pi="sudo port install $1" alias pi="sudo port install"
alias psu="sudo port selfupdate" alias psu="sudo port selfupdate"
alias puni="sudo port uninstall inactive" alias puni="sudo port uninstall inactive"
alias puo="sudo port upgrade outdated" alias puo="sudo port upgrade outdated"
alias pup="psu && puo" alias pup="psu && puo"
## Magic Enter
**Maintainer:** [@dufferzafar](https://github.com/dufferzafar)
Makes your enter key magical, by binding commonly used commands to it.
You can set the commands to be run in your .zshrc, before the line containing plugins!
```bash
MAGIC_ENTER_GIT_COMMAND='git status -u .'
MAGIC_ENTER_OTHER_COMMAND='ls -lh .'
plugins=(magic-enter)
```
# Bind quick stuff to enter!
#
# Pressing enter in a git directory runs `git status`
# in other directories `ls`
magic-enter () {
# If commands are not already set, use the defaults
[ -z "$MAGIC_ENTER_GIT_COMMAND" ] && MAGIC_ENTER_GIT_COMMAND="git status -u ."
[ -z "$MAGIC_ENTER_OTHER_COMMAND" ] && MAGIC_ENTER_OTHER_COMMAND="ls -lh ."
if [[ -z $BUFFER ]]; then
echo ""
if git rev-parse --is-inside-work-tree &>/dev/null; then
eval "$MAGIC_ENTER_GIT_COMMAND"
else
eval "$MAGIC_ENTER_OTHER_COMMAND"
fi
zle redisplay
else
zle accept-line
fi
}
zle -N magic-enter
bindkey "^M" magic-enter
# Man plugin
This plugin adds a shortcut to insert man before the previous command.
To use it, add `man` to the plugins array in your zshrc file:
```zsh
plugins=(... man)
```
# Keyboard Shortcuts
| Shortcut | Description |
|-----------------------------------|------------------------------------------------------------------------|
| <kbd>Esc</kbd> + man | add man before the previous command to see the manual for this command |
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# * Jerry Ling<jerryling315@gmail.com> # * Jerry Ling<jerryling315@gmail.com>
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Usgae # Usage
# ----- # -----
# #
# man will be inserted before the command # man will be inserted before the command
...@@ -24,4 +24,4 @@ bindkey "\e"man man-command-line ...@@ -24,4 +24,4 @@ bindkey "\e"man man-command-line
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Also, you might want to use man-preview included in 'osx' plugin # Also, you might want to use man-preview included in 'osx' plugin
# just substitute "man" in the function with "man-preview" after you included OS X in # just substitute "man" in the function with "man-preview" after you included OS X in
# the .zshrc # the .zshrc
\ No newline at end of file
# Mercurial # Mercurial
alias hga='hg add'
alias hgc='hg commit' alias hgc='hg commit'
alias hgb='hg branch' alias hgb='hg branch'
alias hgba='hg branches' alias hgba='hg branches'
......
...@@ -13,19 +13,38 @@ _meteor_installed_packages() { ...@@ -13,19 +13,38 @@ _meteor_installed_packages() {
local -a _1st_arguments local -a _1st_arguments
_1st_arguments=( _1st_arguments=(
'run:[Default] Run this project in local development mode' "add-platform:Add a platform to this project."
'create:Create a new project' "add:Add a package to this project."
'update:Upgrade this project to the latest version of Meteor' "admin:Administrative commands."
'add:Add a package to this project' "authorized:View or change authorized users and organizations for a site."
'remove:Remove a package from this project' "build:Build this project for all platforms."
'list:List available packages' "claim:Claim a site deployed with an old Meteor version."
'help:Display Meteor help' "configure-android:Run the Android configuration tool from Meteor's ADK environment."
'bundle:Pack this project up into a tarball' "create:Create a new project."
'mongo:Connect to the Mongo database for the specified site' "debug:Run the project, but suspend the server process for debugging."
'deploy:Deploy this project to Meteor' "deploy:Deploy this project to Meteor."
'logs:Show logs for specified site' "install-sdk:Installs SDKs for a platform."
'reset:Reset the project state. Erases the local database.' "lint:Build this project and run the linters printing all errors and warnings."
'test-packages:Test one or more packages' "list-platforms:List the platforms added to your project."
"list-sites:List sites for which you are authorized."
"list:List the packages explicitly used by your project."
"login:Log in to your Meteor developer account."
"logout:Log out of your Meteor developer account."
"logs:Show logs for specified site."
"mongo:Connect to the Mongo database for the specified site."
"publish-for-arch:Builds an already-published package for a new platform."
"publish-release:Publish a new meteor release to the package server."
"publish:Publish a new version of a package to the package server."
"remove-platform:Remove a platform from this project."
"remove:Remove a package from this project."
"reset:Reset the project state. Erases the local database."
"run:[default] Run this project in local development mode."
"search:Search through the package server database."
"shell:Launch a Node REPL for interactively evaluating server-side code."
"show:Show detailed information about a release or package."
"test-packages:Test one or more packages."
"update:Upgrade this project's dependencies to their latest versions."
"whoami:Prints the username of your Meteor developer account."
) )
local expl local expl
...@@ -45,4 +64,4 @@ case "$words[2]" in ...@@ -45,4 +64,4 @@ case "$words[2]" in
add) add)
_meteor_all_packages _meteor_all_packages
_wanted packages expl 'all packages' compadd -a packages ;; _wanted packages expl 'all packages' compadd -a packages ;;
esac esac
\ No newline at end of file
# minikube
This plugin provides completion for [minikube](https://github.com/kubernetes/minikube).
To use it, add `minikube` to the plugins array in your zshrc file.
```
plugins=(... minikube)
```
# Autocompletion for Minikube.
#
if [ $commands[minikube] ]; then
source <(minikube completion zsh)
fi
...@@ -8,7 +8,7 @@ to update cache you should remove .mix_tasks file ...@@ -8,7 +8,7 @@ to update cache you should remove .mix_tasks file
Inspired by and based on rake-fast zsh plugin. Inspired by and based on rake-fast zsh plugin.
This is entirely based on [this pull request by Ullrich Schäfer](https://github.com/robb/.dotfiles/pull/10/), which is inspired by [this Ruby on Rails trick from 2006](http://weblog.rubyonrails.org/2006/3/9/fast-mix-task-completion-for-zsh/). This is entirely based on [this pull request by Ullrich Schäfer](https://github.com/robb/.dotfiles/pull/10/), which is inspired by [this Ruby on Rails trick from 2006](https://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh/).
## Installation ## Installation
...@@ -25,4 +25,4 @@ You might consider adding `.mix_tasks` to your [global .gitignore](https://help. ...@@ -25,4 +25,4 @@ You might consider adding `.mix_tasks` to your [global .gitignore](https://help.
`mix`, then press tab `mix`, then press tab
Currently maintained by [styx](https://github.com/styx/) Currently maintained by [styx](https://github.com/styx/)
\ No newline at end of file
...@@ -12,7 +12,7 @@ _mix_does_task_list_need_generating () { ...@@ -12,7 +12,7 @@ _mix_does_task_list_need_generating () {
} }
_mix_generate () { _mix_generate () {
mix --help | grep -v 'iex -S' | tail -n +2 | cut -d " " -f 2 > .mix_tasks mix help | grep -v 'iex -S' | tail -n +2 | cut -d " " -f 2 > .mix_tasks
} }
_mix () { _mix () {
......
# Mix plugin
This plugin adds completions for the [Elixir's Mix build tool](https://hexdocs.pm/mix/Mix.html).
To use it, add `mix` to the plugins array in your zshrc file:
```zsh
plugins=(... mix)
```
## Supported Task Types
| Task Type | Documentation |
|-------------------------|----------------------------------------------------------|
| Elixir | [Elixir Lang](https://elixir-lang.org/) |
| Phoenix v1.2.1 and below| [Phoenix](https://hexdocs.pm/phoenix/1.2.1/Phoenix.html) |
| Phoenix v1.3.0 and above| [Phoenix](https://hexdocs.pm/phoenix/Phoenix.html) |
| Ecto | [Ecto](https://hexdocs.pm/ecto/Ecto.html) |
| Hex | [Hex](https://hex.pm/) |
| Nerves | [Nerves](https://nerves-project.org/) |
...@@ -21,7 +21,19 @@ _1st_arguments=( ...@@ -21,7 +21,19 @@ _1st_arguments=(
'deps.unlock:Unlock the given dependencies' 'deps.unlock:Unlock the given dependencies'
'deps.update:Update the given dependencies' 'deps.update:Update the given dependencies'
'do:Executes the tasks separated by comma' 'do:Executes the tasks separated by comma'
'ecto.create:Create Ecto database'
'ecto.drop:Drop the storage for the given repository'
'ecto.dump:Dumps the current environment’s database structure'
'ecto.gen.migration:Generates a migration'
'ecto.gen.repo:Generates a new repository'
'ecto.load:Loads the current environment’s database structure'
'ecto.migrate:Runs Ecto migration'
'ecto.migrations:Displays the up / down migration status'
'ecto.rollback:Reverts applied migrations'
'escript.build:Builds an escript for the project' 'escript.build:Builds an escript for the project'
'firmware:Nerves - Build a firmware image for the selected target platform'
'firmware.burn:Nerves - Writes the generated firmware image to an attached SDCard or file'
'firmware.image:Nerves - Create a firmware image file that can be copied byte-for-byte'
'help:Print help information for tasks' 'help:Print help information for tasks'
'hex:Print hex help information' 'hex:Print hex help information'
'hex.config:Read or update hex config' 'hex.config:Read or update hex config'
...@@ -39,6 +51,11 @@ _1st_arguments=( ...@@ -39,6 +51,11 @@ _1st_arguments=(
'local.phoenix:Updates Phoenix locally' 'local.phoenix:Updates Phoenix locally'
'local.phx:Updates the Phoenix project generator locally' 'local.phx:Updates the Phoenix project generator locally'
'local.rebar:Install rebar locally' 'local.rebar:Install rebar locally'
'nerves.artifact:Create an artifact for a specified Nerves package'
'nerves.artifact.get:Nerves get artifacts'
'nerves.info:Prints Nerves system information'
'nerves.new:Create a new Nerves application'
'nerves.release.init:Prepare a new Nerves project for use with releases'
'new:Create a new Elixir project' 'new:Create a new Elixir project'
'phoenix.digest:Digests and compress static files' 'phoenix.digest:Digests and compress static files'
'phoenix.gen.channel:Generates a Phoenix channel' 'phoenix.gen.channel:Generates a Phoenix channel'
......
# Mosh Plugin
This plugin allows SSH tab completion for [mosh](https://mosh.org/) hostnames.
To use it, add `mosh` to the plugins array in your zshrc file:
```
plugins=(... mosh)
```
...@@ -20,6 +20,15 @@ BACKGROUND_CYAN=$(tput setab 6) ...@@ -20,6 +20,15 @@ BACKGROUND_CYAN=$(tput setab 6)
BACKGROUND_WHITE=$(tput setab 7) BACKGROUND_WHITE=$(tput setab 7)
RESET_FORMATTING=$(tput sgr0) RESET_FORMATTING=$(tput sgr0)
# if found an executable ./mvnw file execute it otherwise execute orignal mvn
mvn-or-mvnw() {
if [ -x ./mvnw ] ; then
echo "executing mvnw instead of mvn"
./mvnw "$@";
else
mvn "$@";
fi
}
# Wrapper function for Maven's mvn command. # Wrapper function for Maven's mvn command.
mvn-color() { mvn-color() {
...@@ -40,6 +49,9 @@ mvn-color() { ...@@ -40,6 +49,9 @@ mvn-color() {
# Override the mvn command with the colorized one. # Override the mvn command with the colorized one.
#alias mvn="mvn-color" #alias mvn="mvn-color"
# either use orignal mvn oder the mvn wrapper
alias mvn="mvn-or-mvnw"
# aliases # aliases
alias mvncie='mvn clean install eclipse:eclipse' alias mvncie='mvn clean install eclipse:eclipse'
alias mvnci='mvn clean install' alias mvnci='mvn clean install'
...@@ -59,11 +71,13 @@ alias mvn-updates='mvn versions:display-dependency-updates' ...@@ -59,11 +71,13 @@ alias mvn-updates='mvn versions:display-dependency-updates'
alias mvntc7='mvn tomcat7:run' alias mvntc7='mvn tomcat7:run'
alias mvntc='mvn tomcat:run' alias mvntc='mvn tomcat:run'
alias mvnjetty='mvn jetty:run' alias mvnjetty='mvn jetty:run'
alias mvnboot='mvn spring-boot:run'
alias mvndt='mvn dependency:tree' alias mvndt='mvn dependency:tree'
alias mvns='mvn site' alias mvns='mvn site'
alias mvnsrc='mvn dependency:sources' alias mvnsrc='mvn dependency:sources'
alias mvndocs='mvn dependency:resolve -Dclassifier=javadoc' alias mvndocs='mvn dependency:resolve -Dclassifier=javadoc'
function listMavenCompletions { function listMavenCompletions {
reply=( reply=(
# common lifecycle # common lifecycle
...@@ -274,3 +288,5 @@ function listMavenCompletions { ...@@ -274,3 +288,5 @@ function listMavenCompletions {
} }
compctl -K listMavenCompletions mvn compctl -K listMavenCompletions mvn
compctl -K listMavenCompletions mvn-or-mvnw
File mode changed from 100755 to 100644
# Nanoc plugin
This plugin adds some aliases and autocompletion for common [Nanoc](https://nanoc.ws) commands.
To use it, add `nanoc` to the plugins array in your zshrc file:
```zsh
plugins=(... nanoc)
```
## Aliases
| Alias | Command | Description |
|-------|-----------------------|-----------------------------------------------------------------------------------|
| n | `nanoc` | Main Nanoc command |
| nco | `nanoc compile` | Compile all items of the current site |
| ncs | `nanoc create-site` | Create a new site at the given path. The site will use the filesystem data source |
| nd | `nanoc deploy` | Deploy the compiled site to the destination (specified with `--target`) |
| np | `nanoc prune` | Remove files not managed by Nanoc from the output directory |
| nv | `nanoc view` | Start the static web server (on port 3000 and all IP addresses, unless specified) |
#compdef nanoc #compdef nanoc
#autoload #autoload
# nanoc zsh completion - based on the homebrew zsh completion
# requires the 'nanoc' gem to be installed # requires the 'nanoc' gem to be installed
local -a _1st_arguments local -a _1st_arguments
_1st_arguments=( _1st_arguments=(
'autocompile:start the autocompiler' 'check:run issue checks'
'compile:compile items of this site' 'compile:compile items of this site'
'create-item:create an item'
'create-layout:create a layout'
'create-site:create a site' 'create-site:create a site'
'deploy:deploy the compiled site' 'deploy:deploy the compiled site'
'help:show help' 'help:show help'
'prune:remove files not managed by nanoc from the output directory' 'prune:remove files not managed by nanoc from the output directory'
'shell:open a shell on the Nanoc environment'
'show-data:show data in this site' 'show-data:show data in this site'
'show-plugins:show all available plugins' 'show-plugins:show all available plugins'
'show-rules:describe the rules for each item' 'show-rules:describe the rules for each item'
'update:update the data stored by the data source to a newer version'
'validate-css:validate the site’s CSS'
'validate-html:validate the site’s HTML'
'validate-links:validate links in site'
'view:start the web server that serves static files' 'view:start the web server that serves static files'
'watch:start the watcher'
) )
local expl local expl
...@@ -31,13 +24,68 @@ local -a pkgs installed_pkgs ...@@ -31,13 +24,68 @@ local -a pkgs installed_pkgs
_arguments \ _arguments \
'(--color)--color[enable color]' \ '(--color)--color[enable color]' \
'(--debug)--debug[enable debugging]' \ '(--debug)--debug[enable debugging]' \
'(--env)--env[set environment]' \
'(--help)--help[show the help message and quit]' \ '(--help)--help[show the help message and quit]' \
'(--no-color)--no-color[disable color]' \ '(--no-color)--no-color[disable color]' \
'(--verbose)--verbose[make nanoc output more detailed]' \ '(--verbose)--verbose[make output more detailed]' \
'(--version)--version[show version information and quit]' \ '(--version)--version[show version information and quit]' \
'(--warn)--warn[enable warnings]' \ '(--warn)--warn[enable warnings]' \
'*:: :->subcmds' && return 0 '*:: :->subcmds' && return 0
case "$state" in
subcmds)
case $words[1] in
check)
_arguments \
'(--preprocess)--preprocess[run preprocessor]'
;;
compile)
_arguments \
'(--diff)--diff[generate diff]'
;;
compile)
_arguments \
'(--diff)--diff[generate diff]'
;;
create-site)
_arguments \
'(--force)--force[force creation of new site]'
;;
deploy)
_arguments \
'(--target)--target[specify the location to deploy to (default: `default`)]' \
'(--no-check)--no-check[do not run the issue checks marked for deployment]' \
'(--list)--list[list available locations to deploy to]' \
'(--list-deployers)--list-deployers[list available deployers]' \
'(--dry-run)--dry-run[show what would be deployed]'
;;
prune)
_arguments \
'(--yes)--yes[confirm deletion]' \
'(--dry-run)--dry-run[print files to be deleted instead of actually deleting them]'
;;
shell)
_arguments \
'(--preprocess)--preprocess[run preprocessor]'
;;
view)
_arguments \
'(--handler)--handler[specify the handler to use (webrick/mongrel/...)]' \
'(--host)--host[specify the host to listen on (default: 127.0.0.1)]' \
'(--port)--port[specify the port to listen on (default: 3000]' \
'(--live-reload)--live-reload[reload on changes]'
;;
esac
;;
esac
if (( CURRENT == 1 )); then if (( CURRENT == 1 )); then
_describe -t commands "nanoc subcommand" _1st_arguments _describe -t commands "nanoc subcommand" _1st_arguments
return return
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment