Unverified Commit 0232ac4b authored by Marc Cornellà's avatar Marc Cornellà Committed by GitHub
Browse files

Merge branch 'master' into master

parents afb02876 ebc700be
# Laravel 4 plugin
This plugin adds some aliases for common [Laravel 4](https://laravel.com/docs/4.2) commands.
To use it, add `laravel4` to the plugins array in your zshrc file:
```zsh
plugins=(... laravel4)
```
## Aliases
| Alias | Command | Description |
|-----------|-------------------------------------------|-------------------------------------------------------------|
| la4 | `php artisan` | Main Artisan command |
| la4dump | `php artisan dump-autoload` | Regenerate framework autoload files |
| la4cache | `php artisan cache:clear` | Flush the application cache |
| la4routes | `php artisan routes` | List all registered routes |
# Laravel 5 plugin
This plugin adds some aliases for common [Laravel 5](https://laravel.com/docs) commands.
To use it, add `laravel5` to the plugins array in your zshrc file:
```zsh
plugins=(... laravel5)
```
## Aliases
| Alias | Command | Description |
|-----------|------------------------------|----------------------------------------------------|
| la5 | `php artisan` | Main Artisan command |
| la5cache | `php artisan cache:clear` | Flush the application cache |
| la5routes | `php artisan route:list` | List all registered routes |
| la5vendor | `php artisan vendor:publish` | Publish any publishable assets from vendor package |
...@@ -4,8 +4,10 @@ typeset -g ZSH_LAST_WORKING_DIRECTORY ...@@ -4,8 +4,10 @@ typeset -g ZSH_LAST_WORKING_DIRECTORY
# Updates the last directory once directory is changed # Updates the last directory once directory is changed
chpwd_functions+=(chpwd_last_working_dir) chpwd_functions+=(chpwd_last_working_dir)
chpwd_last_working_dir() { chpwd_last_working_dir() {
local cache_file="$ZSH_CACHE_DIR/last-working-dir" if [ "$ZSH_SUBSHELL" = 0 ]; then
pwd >| "$cache_file" local cache_file="$ZSH_CACHE_DIR/last-working-dir"
pwd >| "$cache_file"
fi
} }
# Changes directory to the last working directory # Changes directory to the last working directory
......
#compdef lein
# Lein ZSH completion function
# Drop this somewhere in your $fpath (like /usr/share/zsh/site-functions)
# and rename it _lein
_lein() {
if (( CURRENT > 2 )); then
# shift words so _arguments doesn't have to be concerned with second command
(( CURRENT-- ))
shift words
# use _call_function here in case it doesn't exist
_call_function 1 _lein_${words[1]}
else
_values "lein command" \
"change[Rewrite project.clj by applying a function.]" \
"check[Check syntax and warn on reflection.]" \
"classpath[Print the classpath of the current project.]" \
"clean[Remove all files from project's target-path.]" \
"compile[Compile Clojure source into .class files.]" \
"deploy[Build and deploy jar to remote repository.]" \
"deps[Download all dependencies.]" \
"do[Higher-order task to perform other tasks in succession.]" \
"help[Display a list of tasks or help for a given task.]" \
"install[Install the current project to the local repository.]" \
"jar[Package up all the project's files into a jar file.]" \
"javac[Compile Java source files.]" \
"new[Generate project scaffolding based on a template.]" \
"plugin[DEPRECATED. Please use the :user profile instead.]" \
"pom[Write a pom.xml file to disk for Maven interoperability.]" \
"release[Perform :release-tasks.]" \
"repl[Start a repl session either with the current project or standalone.]" \
"retest[Run only the test namespaces which failed last time around.]" \
"run[Run a -main function with optional command-line arguments.]" \
"search[Search remote maven repositories for matching jars.]" \
"show-profiles[List all available profiles or display one if given an argument.]" \
"test[Run the project's tests.]" \
"trampoline[Run a task without nesting the project's JVM inside Leiningen's.]" \
"uberjar[Package up the project files and dependencies into a jar file.]" \
"update-in[Perform arbitrary transformations on your project map.]" \
"upgrade[Upgrade Leiningen to specified version or latest stable.]" \
"vcs[Interact with the version control system.]" \
"version[Print version for Leiningen and the current JVM.]" \
"with-profile[Apply the given task with the profile(s) specified.]"
fi
}
_lein_plugin() {
_values "lein plugin commands" \
"install[Download, package, and install plugin jarfile into ~/.lein/plugins]" \
"uninstall[Delete the plugin jarfile: \[GROUP/\]ARTIFACT-ID VERSION]"
}
_lein_namespaces() {
if [ -f "./project.clj" -a -d "$1" ]; then
_values "lein valid namespaces" \
$(find "$1" -type f -name "*.clj" -exec awk '/^\(ns */ {gsub("\\)", "", $2); print $2}' '{}' '+')
fi
}
_lein_run() {
_lein_namespaces "src/"
}
_lein_test() {
_lein_namespaces "test/"
}
function _lein_commands() {
local ret=1 state
_arguments ':subcommand:->subcommand' && ret=0
case $state in
subcommand)
subcommands=(
"classpath:print the classpath of the current project"
"clean:remove compiled files and dependencies from project"
"compile:ahead-of-time compile the project"
"deploy:build jar and deploy to remote repository"
"deps:download and install all dependencies"
"help:display a list of tasks or help for a given task"
"install:install the project and its dependencies in your local repository"
"int:enter an interactive task shell"
"interactive:enter an interactive task shell"
"jack-in:jack in to a clojure slime session from emacs."
"jar:create a jar file containing the compiled .class files"
"javac:compile java source files"
"new:create a new project skeleton"
"plugin:manage user-level plugins"
"pom:write a pom.xml file to disk for maven interop"
"repl:start a repl session either with the current project or standalone"
"retest:run only the test namespaces which failed last time around"
"run:run the project's -main function"
"search:search remote maven repositories for matching jars"
"swank:launch swank server for Emacs to connect"
"test:run the project's tests"
"test!:run a project's tests after cleaning and fetching dependencies"
"trampoline:run a task without nesting the project's JVM inside Leiningen's."
"uberjar:Create a jar including the contents of each of deps"
"upgrade:upgrade leiningen to the latest stable release"
"version:print leiningen's version"
)
_describe -t subcommands 'leiningen subcommands' subcommands && ret=0
;;
*) _files
esac
return ret
}
compdef _lein_commands lein
# Lighthouse plugin
This plugin adds commands to manage [Lighthouse](https://lighthouseapp.com/).
To use it, add `lighthouse` to the plugins array in your zshrc file:
```zsh
plugins=(... lighthouse)
```
## Commands
* `open_lighthouse_ticket <issue>` (alias: `lho`):
Opens the URL to the issue passed as an argument. To use it, add a `.lighthouse-url`
file in your directory with the URL to the individual project.
Example:
```zsh
$ cat .lighthouse-url
https://rails.lighthouseapp.com/projects/8994
$ lho 23
Opening ticket #23
# The browser goes to https://rails.lighthouseapp.com/projects/8994/tickets/23
```
# To use: add a .lighthouse file into your directory with the URL to the
# individual project. For example:
# https://rails.lighthouseapp.com/projects/8994
# Example usage: http://screencast.com/t/ZDgwNDUwNT
open_lighthouse_ticket () { open_lighthouse_ticket () {
if [ ! -f .lighthouse-url ]; then if [ ! -f .lighthouse-url ]; then
echo "There is no .lighthouse-url file in the current directory..." echo "There is no .lighthouse-url file in the current directory..."
return 0; return 0
else
lighthouse_url=$(cat .lighthouse-url);
echo "Opening ticket #$1";
open_command "$lighthouse_url/tickets/$1";
fi fi
lighthouse_url=$(cat .lighthouse-url)
echo "Opening ticket #$1"
open_command "$lighthouse_url/tickets/$1"
} }
alias lho='open_lighthouse_ticket' alias lho='open_lighthouse_ticket'
# lol
Plugin for adding catspeak aliases, because why not
## Enabling the plugin
1. Open your `.zshrc` file and add `lol` in the plugins section:
```zsh
plugins=(
# all your enabled plugins
lol
)
```
2. Reload the source file or restart your Terminal session:
```console
$ source ~/.zshrc
$
```
## Aliases
| Alias | Command |
| ------------ | ---------------------------------------------------------------- |
| `:3` | `echo` |
| `alwayz` | `tail -f` |
| `bringz` | `git pull` |
| `btw` | `nice` |
| `byes` | `exit` |
| `chicken` | `git add` |
| `cya` | `reboot` |
| `donotwant` | `rm` |
| `dowant` | `cp` |
| `gimmeh` | `touch` |
| `gtfo` | `mv` |
| `hackzor` | `git init` |
| `hai` | `cd` |
| `icanhas` | `mkdir` |
| `ihasbucket` | `df -h` |
| `iminurbase` | `finger` |
| `inur` | `locate` |
| `invisible` | `cat` |
| `iz` | `ls` |
| `kthxbai` | `halt` |
| `letcat` | `git checkout` |
| `moar` | `more` |
| `nomnom` | `killall` |
| `nomz` | `ps aux` |
| `nowai` | `chmod` |
| `oanward` | `git commit -m` |
| `obtw` | `nohup` |
| `onoz` | `cat /var/log/errors.log` |
| `ooanward` | `git commit -am` |
| `plz` | `pwd` |
| `pwned` | `ssh` |
| `rtfm` | `man` |
| `rulz` | `git push` |
| `tldr` | `less` |
| `violenz` | `git rebase` |
| `visible` | `echo` |
| `wtf` | `dmesg` |
| `yolo` | `git commit -m "$(curl -s https://whatthecommit.com/index.txt)"` |
## Usage Examples
```sh
# mkdir new-directory
icanhas new-directory
# killall firefox
nomnom firefox
# chmod u=r,go= some.file
nowai u=r,go= some.file
# ssh root@catserver.org
pwned root@catserver.org
# git commit -m "$(curl -s https://whatthecommit.com/index.txt)"
yolo
```
# 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,7 +45,7 @@ alias bringz='git pull' ...@@ -45,7 +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 whatthecommit.com/index.txt)"' 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
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