mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-04-03 04:20:01 +02:00
Merge remote-tracking branch 'robbyrussell/master'
* robbyrussell/master: (75 commits) Update custom location command and fix code format Fix typo. Fix backwards logic in uninstaller once and for all Refactor for method in plugins/rake-fast/rake-fast.plugin.zsh Fix conditional in uninstall prompt Fix syntax error in confirmation prompt of uninstall.sh Fix syntax error in #4515 on certain shells Revert "Make install script safer" Fix "be" -> "b" typo in coffee plugin README.md. Make install script safer [FIX #4525]: Fix typo Fixd bug for pyenv plugin Fix install.sh/upgrade.sh for tput-less systems Check for git before trying to upgrade, as per #4504 Enable pyenv rehash Init pyenv virtualenvs too Add option '--port' to 'rails server' alias. Add an alias for upstream autoenv: actually source autoenv once located add alias to sort by version ...
This commit is contained in:
commit
049724070a
45 changed files with 521 additions and 275 deletions
|
|
@ -1,23 +0,0 @@
|
|||
## atom
|
||||
|
||||
This plugin makes "at" a useful function for invoking the Atom Editor.
|
||||
|
||||
Originally by Github user [aforty](https://github.com/aforty) for OSX, modified to alias 'at' to 'atom' for Linux, since atom already works on the terminal for Linux, and calling 'at' in a non-OSX environment should still work.
|
||||
|
||||
### Requirements
|
||||
|
||||
* [Atom](https://atom.io/)
|
||||
|
||||
### Usage
|
||||
|
||||
* If `at` command is called without an argument, launch Atom
|
||||
|
||||
* If `at` is passed a directory, open it in Atom
|
||||
|
||||
* If `at` is passed a file, open it in Atom
|
||||
|
||||
### Examples
|
||||
|
||||
* Open the current dir in atom: `at .`
|
||||
* Open another dir in atom: `at path/to/folder`
|
||||
* Open a file: `at filename.extension`
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
# Gets OS Type
|
||||
unamestr=$(uname -s)
|
||||
|
||||
# If OSX
|
||||
if [[ "$unamestr" == 'Darwin' ]]; then
|
||||
local _atom_paths > /dev/null 2>&1
|
||||
_atom_paths=(
|
||||
"$HOME/Applications/Atom.app"
|
||||
"/Applications/Atom.app"
|
||||
)
|
||||
|
||||
for _atom_path in $_atom_paths; do
|
||||
if [[ -a $_atom_path ]]; then
|
||||
alias at="open -a '$_atom_path'"
|
||||
break
|
||||
fi
|
||||
done
|
||||
# If Linux
|
||||
elif [[ "$unamestr" == 'Linux' ]]; then
|
||||
# Alerts the user if 'atom' is not a found command.
|
||||
type atom >/dev/null 2>&1 && alias at="atom" || { echo >&2 "You have enabled the atom oh-my-zsh plugin on Linux, but atom is not a recognized command. Please make sure you have it installed before using this plugin."; }
|
||||
fi
|
||||
|
|
@ -1,12 +1,26 @@
|
|||
# Activates autoenv or reports its failure
|
||||
if ! source $HOME/.autoenv/activate.sh 2>/dev/null; then
|
||||
echo '-------- AUTOENV ---------'
|
||||
echo 'Could not find ~/.autoenv/activate.sh.'
|
||||
echo 'Please check if autoenv is correctly installed.'
|
||||
echo 'In the meantime the autoenv plugin is DISABLED.'
|
||||
echo '--------------------------'
|
||||
return 1
|
||||
() {
|
||||
if ! type autoenv_init >/dev/null; then
|
||||
for d (~/.autoenv /usr/local/opt/autoenv); do
|
||||
if [[ -e $d/activate.sh ]]; then
|
||||
autoenv_dir=$d
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [[ -z $autoenv_dir ]]; then
|
||||
cat <<END >&2
|
||||
-------- AUTOENV ---------
|
||||
Could not locate autoenv installation.
|
||||
Please check if autoenv is correctly installed.
|
||||
In the meantime the autoenv plugin is DISABLED.
|
||||
--------------------------
|
||||
END
|
||||
return 1
|
||||
fi
|
||||
source $autoenv_dir/activate.sh
|
||||
fi
|
||||
}
|
||||
[[ $? != 0 ]] && return $?
|
||||
|
||||
# The use_env call below is a reusable command to activate/create a new Python
|
||||
# virtualenv, requiring only a single declarative line of code in your .env files.
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ _arguments -C \
|
|||
_cap_tasks() {
|
||||
if [[ -f config/deploy.rb || -f Capfile ]]; then
|
||||
if [[ ! -f .cap_tasks~ ]]; then
|
||||
shipit -v --tasks | sed 's/\(\[\)\(.*\)\(\]\)/\2:/' | awk '{command=$2; $1=$2=$3=""; gsub(/^[ \t\r\n]+/, "", $0); gsub(":", "\\:", command); print command"["$0"]"}' > .cap_tasks~
|
||||
shipit --tasks | sed 's/\(\[\)\(.*\)\(\]\)/\2:/' | awk '{command=$2; $1=$2=$3=""; gsub(/^[ \t\r\n]+/, "", $0); gsub(":", "\\:", command); print command"["$0"]"}' > .cap_tasks~
|
||||
fi
|
||||
|
||||
OLD_IFS=$IFS
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ _homebrew-installed() {
|
|||
}
|
||||
|
||||
_chruby-from-homebrew-installed() {
|
||||
[ -r $(brew --prefix chruby)] &> /dev/null
|
||||
[ -r $(brew --prefix chruby) ] &> /dev/null
|
||||
}
|
||||
|
||||
_ruby-build_installed() {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,28 @@
|
|||
if [ ! -f $ZSH/plugins/chucknorris/fortunes/chucknorris.dat ]; then
|
||||
strfile $ZSH/plugins/chucknorris/fortunes/chucknorris $ZSH/plugins/chucknorris/fortunes/chucknorris.dat
|
||||
# chucknorris: Chuck Norris fortunes
|
||||
|
||||
# Automatically generate or update Chuck's compiled fortune data file
|
||||
# $0 must be used outside a local function. This variable name is unlikly to collide.
|
||||
CHUCKNORRIS_PLUGIN_DIR=${0:h}
|
||||
|
||||
() {
|
||||
local DIR=$CHUCKNORRIS_PLUGIN_DIR/fortunes
|
||||
if [[ ! -f $DIR/chucknorris.dat ]] || [[ $DIR/chucknorris.dat -ot $DIR/chucknorris ]]; then
|
||||
# For some reason, Cygwin puts strfile in /usr/sbin, which is not on the path by default
|
||||
local strfile=strfile
|
||||
if ! which strfile &>/dev/null && [[ -f /usr/sbin/strfile ]]; then
|
||||
strfile=/usr/sbin/strfile
|
||||
fi
|
||||
if which $strfile &> /dev/null; then
|
||||
$strfile $DIR/chucknorris $DIR/chucknorris.dat >/dev/null
|
||||
else
|
||||
echo "[oh-my-zsh] chucknorris depends on strfile, which is not installed" >&2
|
||||
echo "[oh-my-zsh] strfile is often provided as part of the 'fortune' package" >&2
|
||||
fi
|
||||
fi
|
||||
|
||||
alias chuck="fortune -a $ZSH/plugins/chucknorris/fortunes"
|
||||
# Aliases
|
||||
alias chuck="fortune -a $DIR"
|
||||
alias chuck_cow="chuck | cowthink"
|
||||
}
|
||||
|
||||
unset CHUCKNORRIS_PLUGIN_DIR
|
||||
|
|
|
|||
|
|
@ -17,9 +17,11 @@ Chuck Norris' blood type is AK+. Ass-Kicking Positive. It is compatible only wit
|
|||
Chuck Norris is 1/8th Cherokee. This has nothing to do with ancestry, the man ate a fucking Indian.
|
||||
%
|
||||
In fine print on the last page of the Guinness Book of World Records it notes that all world records are held by Chuck Norris, and those listed in the book are simply the closest anyone else has ever gotten.
|
||||
%
|
||||
There is no chin behind Chuck Norris' beard. There is only another fist.
|
||||
%
|
||||
Chuck Norris does not teabag the ladies. He potato-sacks them.
|
||||
%
|
||||
Pluto is actually an orbiting group of British soldiers from the American Revolution who entered space after the Chuck gave them a roundhouse kick to the face.
|
||||
%
|
||||
When Chuck Norris goes to donate blood, he declines the syringe, and instead requests a hand gun and a bucket.
|
||||
|
|
@ -127,6 +129,7 @@ Chuck Norris can drink an entire gallon of milk in thirty-seven seconds.
|
|||
Little known medical fact: Chuck Norris invented the Caesarean section when he roundhouse-kicked his way out of his monther's womb.
|
||||
%
|
||||
Chuck Norris doesn't bowl strikes, he just knocks down one pin and the other nine faint.
|
||||
%
|
||||
The show Survivor had the original premise of putting people on an island with Chuck Norris. There were no survivors, and nobody is brave enough to go to the island to retrieve the footage.
|
||||
%
|
||||
It takes Chuck Norris 20 minutes to watch 60 Minutes.
|
||||
|
|
@ -281,6 +284,7 @@ In a recent survey it was discovered the 94% of American women lost their virgin
|
|||
Chuck Norris invented a language that incorporates karate and roundhouse kicks. So next time Chuck Norris is kicking your ass, don't be offended or hurt, he may be just trying to tell you he likes your hat.
|
||||
%
|
||||
If at first you don't succeed, you're not Chuck Norris.
|
||||
%
|
||||
If Chuck Norris were a calendar, every month would be named Chucktober, and every day he'd kick your ass.
|
||||
%
|
||||
Fear is not the only emotion Chuck Norris can smell. He can also detect hope, as in "I hope I don't get a roundhouse kick from Chuck Norris."
|
||||
|
|
@ -349,7 +353,7 @@ As President Roosevelt said: "We have nothing to fear but fear itself. And Chuck
|
|||
%
|
||||
Chuck Norris just says "no" to drugs. If he said "yes", it would collapse Colombia's infrastructure.
|
||||
%
|
||||
Since 1940, the year Chuck Norris was born, roundhouse-kick related deaths have increased 13,000 percent.
|
||||
Since 1940, the year Chuck Norris was born, roundhouse-kick related deaths have increased 13,000 percent.?
|
||||
%
|
||||
Crime does not pay - unless you are an undertaker following Walker, Texas Ranger, on a routine patrol.
|
||||
%
|
||||
|
|
@ -497,7 +501,8 @@ When Chuck Norris works out on the Total Gym, the Total Gym feels like it's been
|
|||
%
|
||||
Chuck Norris can skeletize a cow in two minutes.
|
||||
%
|
||||
The only sure things are Death and Taxes?and when Chuck Norris goes to work for the IRS, they'll be the same thing.
|
||||
The only sure things are Death and Taxes, and when Chuck Norris goes to work for the IRS, they'll be the same thing.
|
||||
%
|
||||
Chuck Norris' first job was as a paperboy. There were no survivors.
|
||||
%
|
||||
With the rising cost of gasoline, Chuck Norris is beginning to worry about his drinking habit.
|
||||
|
|
@ -527,8 +532,6 @@ Chuck Norris uses 8'x10' sheets of plywood as toilet paper.
|
|||
Noah was the only man notified before Chuck Norris relieved himself in the Atlantic Ocean.
|
||||
%
|
||||
Chuck Norris once invited all of the other badasses from TV to duke it out in order to see who was the supreme badass. Only two showed up-- Jack Bauer and MacGyver.
|
||||
%
|
||||
|
||||
%
|
||||
MacGyver immediately tried to make a bomb out of some Q-Tips and Gatorade, but Chuck Norris roundhouse-kicked him in the solar plexus. MacGyver promptly threw up his own heart.
|
||||
%
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ Preview the compiled result of your coffeescript with `cf "code"` as per the
|
|||
following:
|
||||
|
||||
```zsh
|
||||
$ cf 'if a then be else c'
|
||||
$ cf 'if a then b else c'
|
||||
if (a) {
|
||||
b;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@ cf () {
|
|||
}
|
||||
# compile & copy to clipboard
|
||||
cfc () {
|
||||
cf "$1" | pbcopy
|
||||
cf "$1" | clipcopy
|
||||
}
|
||||
|
||||
# compile from pasteboard & print
|
||||
alias cfp='coffeeMe "$(pbpaste)"'
|
||||
# compile from clipboard & print
|
||||
alias cfp='cf "$(clippaste)"'
|
||||
|
||||
# compile from pasteboard and copy to clipboard
|
||||
alias cfpc='cfp | pbcopy'
|
||||
# compile from clipboard and copy to clipboard
|
||||
alias cfpc='cfp | clipcopy'
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# Copies the pathname of the current directory to the system or X Windows clipboard
|
||||
function copydir {
|
||||
pwd | tr -d "\r\n" | pbcopy
|
||||
}
|
||||
emulate -L zsh
|
||||
print -n $PWD | clipcopy
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
# Copies the contents of a given file to the system or X Windows clipboard
|
||||
#
|
||||
# copyfile <file>
|
||||
function copyfile {
|
||||
[[ "$#" != 1 ]] && return 1
|
||||
local file_to_copy=$1
|
||||
cat $file_to_copy | pbcopy
|
||||
emulate -L zsh
|
||||
clipcopy $1
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
encode64(){ echo -n $1 | base64 }
|
||||
decode64(){ echo -n $1 | base64 --decode }
|
||||
encode64(){ printf '%s' $1 | base64 }
|
||||
decode64(){ printf '%s' $1 | base64 --decode }
|
||||
alias e64=encode64
|
||||
alias d64=decode64
|
||||
|
|
|
|||
3
plugins/fedora/README.md
Normal file
3
plugins/fedora/README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
This is a plugin based on yum plugin, but using dnf as main frontend
|
||||
(from Fedora 22 onwards, yum is deprecated in favor of dnf).
|
||||
|
||||
16
plugins/fedora/fedora.plugin.zsh
Normal file
16
plugins/fedora/fedora.plugin.zsh
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
## Aliases
|
||||
|
||||
alias dnfs="dnf search" # search package
|
||||
alias dnfp="dnf info" # show package info
|
||||
alias dnfl="dnf list" # list packages
|
||||
alias dnfgl="dnf grouplist" # list package groups
|
||||
alias dnfli="dnf list installed" # print all installed packages
|
||||
alias dnfmc="dnf makecache" # rebuilds the dnf package list
|
||||
|
||||
alias dnfu="sudo dnf upgrade" # upgrade packages
|
||||
alias dnfi="sudo dnf install" # install package
|
||||
alias dnfgi="sudo dnf groupinstall" # install package group
|
||||
alias dnfr="sudo dnf remove" # remove package
|
||||
alias dnfgr="sudo dnf groupremove" # remove pagage group
|
||||
alias dnfrl="sudo dnf remove --remove-leaves" # remove package and leaves
|
||||
alias dnfc="sudo dnf clean all" # clean cache
|
||||
11
plugins/git-extras/README.md
Normal file
11
plugins/git-extras/README.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# git-extras
|
||||
|
||||
This plugin provides completion definitions for some of the commands defined by [git-extras](http://github.com/tj/git-extras).
|
||||
|
||||
## Setup notes
|
||||
|
||||
The completions work by augmenting the `_git` completion provided by `zsh`. This only works with the `zsh`-provided `_git`, not the `_git` provided by `git` itself. If you have both `zsh` and `git` installed, you need to make sure that the `zsh`-provided `_git` takes precedence.
|
||||
|
||||
### OS X Homebrew Setup
|
||||
|
||||
On OS X with Homebrew, you need to install `git` with `brew install git --without-completions`. Otherwise, `git`'s `_git` will take precedence, and you won't see the completions for `git-extras` commands.
|
||||
|
|
@ -1,10 +1,13 @@
|
|||
#compdef git
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for git-extras (http://github.com/tj/git-extras).
|
||||
#
|
||||
# This depends on and reueses some of the internals of the _git completion
|
||||
# function that ships with zsh itself. It will not work with the _git that ships
|
||||
# with git.
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
|
|
@ -22,16 +25,18 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
__git_command_successful () {
|
||||
if (( ${#pipestatus:#0} > 0 )); then
|
||||
_message 'not a git repository'
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
# Internal functions
|
||||
# These are a lot like their __git_* equivalents inside _git
|
||||
|
||||
__gitex_command_successful () {
|
||||
if (( ${#*:#0} > 0 )); then
|
||||
_message 'not a git repository'
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
__git_commits() {
|
||||
__gitex_commits() {
|
||||
declare -A commits
|
||||
git log --oneline -15 | sed 's/\([[:alnum:]]\{7\}\) /\1:/' | while read commit
|
||||
do
|
||||
|
|
@ -42,7 +47,7 @@ __git_commits() {
|
|||
_describe -t commits commit commits && ret=0
|
||||
}
|
||||
|
||||
__git_tag_names() {
|
||||
__gitex_tag_names() {
|
||||
local expl
|
||||
declare -a tag_names
|
||||
tag_names=(${${(f)"$(_call_program tags git for-each-ref --format='"%(refname)"' refs/tags 2>/dev/null)"}#refs/tags/})
|
||||
|
|
@ -51,7 +56,7 @@ __git_tag_names() {
|
|||
}
|
||||
|
||||
|
||||
__git_branch_names() {
|
||||
__gitex_branch_names() {
|
||||
local expl
|
||||
declare -a branch_names
|
||||
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/})
|
||||
|
|
@ -59,7 +64,7 @@ __git_branch_names() {
|
|||
_wanted branch-names expl branch-name compadd $* - $branch_names
|
||||
}
|
||||
|
||||
__git_specific_branch_names() {
|
||||
__gitex_specific_branch_names() {
|
||||
local expl
|
||||
declare -a branch_names
|
||||
branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads/"$1" 2>/dev/null)"}#refs/heads/$1/})
|
||||
|
|
@ -67,32 +72,28 @@ __git_specific_branch_names() {
|
|||
_wanted branch-names expl branch-name compadd $* - $branch_names
|
||||
}
|
||||
|
||||
|
||||
__git_feature_branch_names() {
|
||||
__git_specific_branch_names 'feature'
|
||||
__gitex_feature_branch_names() {
|
||||
__gitex_specific_branch_names 'feature'
|
||||
}
|
||||
|
||||
|
||||
__git_refactor_branch_names() {
|
||||
__git_specific_branch_names 'refactor'
|
||||
__gitex_refactor_branch_names() {
|
||||
__gitex_specific_branch_names 'refactor'
|
||||
}
|
||||
|
||||
|
||||
__git_bug_branch_names() {
|
||||
__git_specific_branch_names 'bug'
|
||||
__gitex_bug_branch_names() {
|
||||
__gitex_specific_branch_names 'bug'
|
||||
}
|
||||
|
||||
|
||||
__git_submodule_names() {
|
||||
__gitex_submodule_names() {
|
||||
local expl
|
||||
declare -a submodule_names
|
||||
submodule_names=(${(f)"$(_call_program branchrefs git submodule status | awk '{print $2}')"})
|
||||
submodule_names=(${(f)"$(_call_program branchrefs git submodule status | awk '{print $2}')"}) # '
|
||||
__git_command_successful || return
|
||||
_wanted submodule-names expl submodule-name compadd $* - $submodule_names
|
||||
}
|
||||
|
||||
|
||||
__git_author_names() {
|
||||
__gitex_author_names() {
|
||||
local expl
|
||||
declare -a author_names
|
||||
author_names=(${(f)"$(_call_program branchrefs git log --format='%aN' | sort -u)"})
|
||||
|
|
@ -123,7 +124,7 @@ _git-bug() {
|
|||
case $line[1] in
|
||||
(finish)
|
||||
_arguments -C \
|
||||
':branch-name:__git_bug_branch_names'
|
||||
':branch-name:__gitex_bug_branch_names'
|
||||
;;
|
||||
esac
|
||||
esac
|
||||
|
|
@ -139,7 +140,7 @@ _git-changelog() {
|
|||
|
||||
_git-contrib() {
|
||||
_arguments \
|
||||
':author:__git_author_names'
|
||||
':author:__gitex_author_names'
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -151,19 +152,19 @@ _git-count() {
|
|||
|
||||
_git-delete-branch() {
|
||||
_arguments \
|
||||
':branch-name:__git_branch_names'
|
||||
':branch-name:__gitex_branch_names'
|
||||
}
|
||||
|
||||
|
||||
_git-delete-submodule() {
|
||||
_arguments \
|
||||
':submodule-name:__git_submodule_names'
|
||||
':submodule-name:__gitex_submodule_names'
|
||||
}
|
||||
|
||||
|
||||
_git-delete-tag() {
|
||||
_arguments \
|
||||
':tag-name:__git_tag_names'
|
||||
':tag-name:__gitex_tag_names'
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -172,6 +173,7 @@ _git-effort() {
|
|||
'--above[ignore file with less than x commits]'
|
||||
}
|
||||
|
||||
|
||||
_git-extras() {
|
||||
local curcontext=$curcontext state line ret=1
|
||||
declare -A opt_args
|
||||
|
|
@ -216,7 +218,7 @@ _git-feature() {
|
|||
case $line[1] in
|
||||
(finish)
|
||||
_arguments -C \
|
||||
':branch-name:__git_feature_branch_names'
|
||||
':branch-name:__gitex_feature_branch_names'
|
||||
;;
|
||||
esac
|
||||
esac
|
||||
|
|
@ -225,8 +227,8 @@ _git-feature() {
|
|||
|
||||
_git-graft() {
|
||||
_arguments \
|
||||
':src-branch-name:__git_branch_names' \
|
||||
':dest-branch-name:__git_branch_names'
|
||||
':src-branch-name:__gitex_branch_names' \
|
||||
':dest-branch-name:__gitex_branch_names'
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -236,12 +238,14 @@ _git-ignore() {
|
|||
'(--global -g)'{--global,-g}'[show global gitignore]'
|
||||
}
|
||||
|
||||
|
||||
_git-missing() {
|
||||
_arguments \
|
||||
':first-branch-name:__git_branch_names' \
|
||||
':second-branch-name:__git_branch_names'
|
||||
':first-branch-name:__gitex_branch_names' \
|
||||
':second-branch-name:__gitex_branch_names'
|
||||
}
|
||||
|
||||
|
||||
_git-refactor() {
|
||||
local curcontext=$curcontext state line ret=1
|
||||
declare -A opt_args
|
||||
|
|
@ -263,7 +267,7 @@ _git-refactor() {
|
|||
case $line[1] in
|
||||
(finish)
|
||||
_arguments -C \
|
||||
':branch-name:__git_refactor_branch_names'
|
||||
':branch-name:__gitex_refactor_branch_names'
|
||||
;;
|
||||
esac
|
||||
esac
|
||||
|
|
@ -272,12 +276,12 @@ _git-refactor() {
|
|||
|
||||
_git-squash() {
|
||||
_arguments \
|
||||
':branch-name:__git_branch_names'
|
||||
':branch-name:__gitex_branch_names'
|
||||
}
|
||||
|
||||
_git-summary() {
|
||||
_arguments '--line[summarize with lines other than commits]'
|
||||
__git_commits
|
||||
_arguments '--line[summarize with lines rather than commits]'
|
||||
__gitex_commits
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -298,7 +302,7 @@ zstyle ':completion:*:*:git:*' user-commands \
|
|||
count:'count commits' \
|
||||
create-branch:'create local and remote branch' \
|
||||
delete-branch:'delete local and remote branch' \
|
||||
delete-merged-brancees:'delete merged branches'\
|
||||
delete-merged-branches:'delete merged branches'\
|
||||
delete-submodule:'delete submodule' \
|
||||
delete-tag:'delete local and remote tag' \
|
||||
effort:'display effort statistics' \
|
||||
|
|
|
|||
|
|
@ -20,6 +20,13 @@
|
|||
# c. Or, use this file as an oh-my-zsh plugin.
|
||||
#
|
||||
|
||||
alias ghf='git hf'
|
||||
alias ghff='git hf feature'
|
||||
alias ghfr='git hf release'
|
||||
alias ghfh='git hf hotfix'
|
||||
alias ghfs='git hf support'
|
||||
alias ghfu='git hf update'
|
||||
|
||||
_git-hf ()
|
||||
{
|
||||
local curcontext="$curcontext" state line
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ alias gcs='git commit -S'
|
|||
|
||||
alias gd='git diff'
|
||||
alias gdca='git diff --cached'
|
||||
alias gdct='git describe --tags `git rev-list --tags --max-count=1`'
|
||||
alias gdt='git diff-tree --no-commit-id --name-only -r'
|
||||
gdv() { git diff -w "$@" | view - }
|
||||
compdef _git gdv=git-diff
|
||||
|
|
@ -211,11 +212,13 @@ alias gsts='git stash show --text'
|
|||
alias gsu='git submodule update'
|
||||
|
||||
alias gts='git tag -s'
|
||||
alias gtv='git tag | sort -V'
|
||||
|
||||
alias gunignore='git update-index --no-assume-unchanged'
|
||||
alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1'
|
||||
alias gup='git pull --rebase'
|
||||
alias gupv='git pull --rebase -v'
|
||||
alias glum='git pull upstream master'
|
||||
|
||||
alias gvt='git verify-tag'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!zsh
|
||||
##############################################################################
|
||||
# A descriptive listing of core Gradle commands
|
||||
# A descriptive listing of core Gradle commands
|
||||
############################################################################
|
||||
function _gradle_core_commands() {
|
||||
local ret=1 state
|
||||
|
|
@ -32,14 +32,22 @@ function _gradle_arguments() {
|
|||
'--stop[Stop the Gradle daemon]' \
|
||||
'--daemon[Use the Gradle daemon]' \
|
||||
'--no-daemon[Do not use the Gradle daemon]' \
|
||||
'--no-opt[Do not perform any task optimization]' \
|
||||
'--rerun-task [Specifies that any task optimization is ignored.]' \
|
||||
'-i[Log at the info level]' \
|
||||
'-m[Dry run]' \
|
||||
'-P[Set a project property]' \
|
||||
'-p[Specifies the start directory]' \
|
||||
'--profile[Profile the build time]' \
|
||||
'-q[Log at the quiet level (only show errors)]' \
|
||||
'-v[Print the Gradle version info]' \
|
||||
'-x[Specify a task to be excluded]' \
|
||||
'-b[Specifies the build file.]' \
|
||||
'-c[Specifies the settings file.]' \
|
||||
'--continue[Continues task execution after a task failure.]' \
|
||||
'-g[Specifies the Gradle user home directory.]' \
|
||||
'-I[Specifies an initialization script.]' \
|
||||
'--refresh-dependencies[Refresh the state of dependencies.]' \
|
||||
'-u[Don''t search in parent directories for a settings.gradle file.]' \
|
||||
'*::command:->command' \
|
||||
&& return 0
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@
|
|||
# Grabs all available tasks from the `gulpfile.js`
|
||||
# in the current directory.
|
||||
#
|
||||
function $$gulp_completion() {
|
||||
compls=$(grep -Eo "gulp.task\(('(([a-zA-Z0-9]|-)*)',)" gulpfile.js 2>/dev/null | grep -Eo "'(([a-zA-Z0-9]|-)*)'" | sed s/"'"//g | sort)
|
||||
function $$gulp_completion {
|
||||
compls="$(grep -Eo "gulp.task\((['\"](([a-zA-Z0-9]|-)*)['\"],)" gulpfile.js 2>/dev/null | grep -Eo "['\"](([a-zA-Z0-9]|-)*)['\"]" | sed s/"['\"]"//g | sort)"
|
||||
|
||||
completions=(${=compls})
|
||||
compadd -- $completions
|
||||
}
|
||||
|
||||
compdef $$gulp_completion gulp
|
||||
compdef $$gulp_completion gulp
|
||||
|
|
|
|||
|
|
@ -19,14 +19,19 @@ Nmap options are:
|
|||
|
||||
## Aliases explained
|
||||
|
||||
* nmap_open_ports - scan for open ports on target
|
||||
* nmap_list_interfaces - list all network interfaces on host where the command runs
|
||||
* nmap_slow - slow scan that avoids to spam the targets logs
|
||||
* nmap_fin - scan to see if hosts are up with TCP FIN scan
|
||||
* nmap_full - aggressive full scan that scans all ports, tries to determine OS and service versions
|
||||
* nmap_open_ports - Scan for open ports on target
|
||||
* nmap_list_interfaces - List all network interfaces on host where the command runs
|
||||
* nmap_slow - Slow scan that avoids to spam the targets logs
|
||||
* nmap_fin - Scan to see if hosts are up with TCP FIN scan
|
||||
* nmap_full - Aggressive full scan that scans all ports, tries to determine OS and service versions
|
||||
* nmap_check_for_firewall - TCP ACK scan to check for firewall existence
|
||||
* nmap_ping_through_firewall - Host discovery with SYN and ACK probes instead of just pings to avoid firewall
|
||||
restrictions
|
||||
* nmap_fast - Fast scan of the top 300 popular ports
|
||||
* nmap_detect_versions - detects versions of services and OS, runs on all ports
|
||||
* nmap_check_for_vulns - uses vulscan script to check target services for vulnerabilities
|
||||
* nmap_detect_versions - Detects versions of services and OS, runs on all ports
|
||||
* nmap_check_for_vulns - Uses vulscan script to check target services for vulnerabilities
|
||||
* nmap_full_udp - Same as full but via UDP
|
||||
* nmap_traceroute - Try to traceroute using the most common ports
|
||||
* nmap_full_with_scripts - Same as nmap_full but also runs all the scripts
|
||||
* nmap_web_safe_osscan - Little "safer" scan for OS version as connecting to only HTTP and HTTPS ports doesn't look so attacking.
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,11 @@ alias nmap_fin="nmap -sF -v"
|
|||
alias nmap_full="nmap -sS -T4 -PE -PP -PS80,443 -PY -g 53 -A -p1-65535 -v"
|
||||
alias nmap_check_for_firewall="nmap -sA -p1-65535 -v -T4"
|
||||
alias nmap_ping_through_firewall="nmap -PS -PA"
|
||||
alias nmap_fast="nmap -F -T5 --top-ports 300"
|
||||
alias nmap_fast="nmap -F -T5 --version-light --top-ports 300"
|
||||
alias nmap_detect_versions="nmap -sV -p1-65535 -O --osscan-guess -T4 -Pn"
|
||||
alias nmap_check_for_vulns="nmap --script=vulscan"
|
||||
alias nmap_full_udp="nmap -sS -sU -T4 -A -v -PE -PS22,25,80 -PA21,23,80,443,3389 "
|
||||
alias nmap_traceroute="nmap -sP -PE -PS22,25,80 -PA21,23,80,3389 -PU -PO --traceroute "
|
||||
alias nmap_full_with_scripts="sudo nmap -sS -sU -T4 -A -v -PE -PP -PS21,22,23,25,80,113,31339 -PA80,113,443,10042 -PO --script all "
|
||||
alias nmap_web_safe_osscan="sudo nmap -p 80,443 -O -v --osscan-guess --fuzzy "
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
eval "$(npm completion 2>/dev/null)"
|
||||
|
||||
# Install dependencies globally
|
||||
alias npmg="npm i -g "
|
||||
|
||||
# npm package names are lowercase
|
||||
# - https://twitter.com/substack/status/23122603153150361
|
||||
# Thus, we've used camelCase for the following aliases:
|
||||
|
||||
# Install and save to dependencies in your package.json
|
||||
|
|
@ -12,6 +13,7 @@ alias npmS="npm i -S "
|
|||
# Install and save to dev-dependencies in your package.json
|
||||
# npmd is used by https://github.com/dominictarr/npmd
|
||||
alias npmD="npm i -D "
|
||||
|
||||
# Execute command from node_modules folder based on current directory
|
||||
# i.e npmE gulp
|
||||
alias npmE='PATH="$(npm bin)":"$PATH"'
|
||||
|
|
|
|||
|
|
@ -167,6 +167,17 @@ function itunes() {
|
|||
vol)
|
||||
opt="set sound volume to $1" #$1 Due to the shift
|
||||
;;
|
||||
playing|status)
|
||||
local state=`osascript -e 'tell application "iTunes" to player state as string'`
|
||||
if [[ "$state" = "playing" ]]; then
|
||||
currenttrack=`osascript -e 'tell application "iTunes" to name of current track as string'`
|
||||
currentartist=`osascript -e 'tell application "iTunes" to artist of current track as string'`
|
||||
echo -E "Listening to $fg[yellow]$currenttrack$reset_color by $fg[yellow]$currentartist$reset_color";
|
||||
else
|
||||
echo "iTunes is" $state;
|
||||
fi
|
||||
return 0
|
||||
;;
|
||||
shuf|shuff|shuffle)
|
||||
# The shuffle property of current playlist can't be changed in iTunes 12,
|
||||
# so this workaround uses AppleScript to simulate user input instead.
|
||||
|
|
@ -205,6 +216,7 @@ EOF
|
|||
echo "\tnext|previous\tplay next or previous track"
|
||||
echo "\tshuf|shuffle [on|off|toggle]\tSet shuffled playback. Default: toggle. Note: toggle doesn't support the MiniPlayer."
|
||||
echo "\tvol\tSet the volume, takes an argument from 0 to 100"
|
||||
echo "\tplaying|status\tShow what song is currently playing in iTunes."
|
||||
echo "\thelp\tshow this message and exit"
|
||||
return 0
|
||||
;;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,11 @@ for pyenvdir in "${pyenvdirs[@]}" ; do
|
|||
FOUND_PYENV=1
|
||||
export PYENV_ROOT=$pyenvdir
|
||||
export PATH=${pyenvdir}/bin:$PATH
|
||||
eval "$(pyenv init --no-rehash - zsh)"
|
||||
eval "$(pyenv init - zsh)"
|
||||
|
||||
if pyenv commands | command grep -q virtualenv-init; then
|
||||
eval "$(pyenv virtualenv-init - zsh)"
|
||||
fi
|
||||
|
||||
function pyenv_prompt_info() {
|
||||
echo "$(pyenv version-name)"
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ alias rp='rails plugin'
|
|||
alias ru='rails runner'
|
||||
alias rs='rails server'
|
||||
alias rsd='rails server --debugger'
|
||||
alias rsp='rails server --port'
|
||||
|
||||
# Rake aliases
|
||||
alias rdm='rake db:migrate'
|
||||
|
|
@ -59,7 +60,7 @@ alias rn='rake notes'
|
|||
alias rr='rake routes'
|
||||
alias rrg='rake routes | grep'
|
||||
alias rt='rake test'
|
||||
|
||||
alias rmd='rake middleware'
|
||||
|
||||
# legacy stuff
|
||||
alias sstat='thin --stats "/thin/stats" start'
|
||||
|
|
|
|||
|
|
@ -8,17 +8,7 @@ _rake_refresh () {
|
|||
}
|
||||
|
||||
_rake_does_task_list_need_generating () {
|
||||
if [ ! -f .rake_tasks ]; then return 0;
|
||||
else
|
||||
if [[ "$OSTYPE" = darwin* ]]; then
|
||||
accurate=$(stat -f%m .rake_tasks)
|
||||
changed=$(stat -f%m Rakefile)
|
||||
else
|
||||
accurate=$(stat -c%Y .rake_tasks)
|
||||
changed=$(stat -c%Y Rakefile)
|
||||
fi
|
||||
return $(expr $accurate '>=' $changed)
|
||||
fi
|
||||
[[ ! -f .rake_tasks ]] || [[ Rakefile -nt .rake_tasks ]]
|
||||
}
|
||||
|
||||
_rake_generate () {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
# Sublime Text 2 Aliases
|
||||
|
||||
if [[ $('uname') == 'Linux' ]]; then
|
||||
local _sublime_linux_paths > /dev/null 2>&1
|
||||
_sublime_linux_paths=(
|
||||
|
|
@ -33,7 +31,6 @@ elif [[ "$OSTYPE" = darwin* ]]; then
|
|||
"$HOME/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
|
||||
"$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
|
||||
)
|
||||
|
||||
for _sublime_path in $_sublime_darwin_paths; do
|
||||
if [[ -a $_sublime_path ]]; then
|
||||
subl () { "$_sublime_path" $* }
|
||||
|
|
@ -41,6 +38,21 @@ elif [[ "$OSTYPE" = darwin* ]]; then
|
|||
break
|
||||
fi
|
||||
done
|
||||
|
||||
elif [[ "$OSTYPE" = 'cygwin' ]]; then
|
||||
local _sublime_cygwin_paths > /dev/null 2>&1
|
||||
_sublime_cygwin_paths=(
|
||||
"$(cygpath $ProgramW6432/Sublime\ Text\ 2)/sublime_text.exe"
|
||||
"$(cygpath $ProgramW6432/Sublime\ Text\ 3)/sublime_text.exe"
|
||||
)
|
||||
for _sublime_path in $_sublime_cygwin_paths; do
|
||||
if [[ -a $_sublime_path ]]; then
|
||||
subl () { "$_sublime_path" $* }
|
||||
alias st=subl
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
alias stt='st .'
|
||||
|
|
|
|||
|
|
@ -10,3 +10,7 @@ sudo_commands=(
|
|||
|
||||
for c in $user_commands; do; alias sc-$c="systemctl $c"; done
|
||||
for c in $sudo_commands; do; alias sc-$c="sudo systemctl $c"; done
|
||||
|
||||
alias sc-enable-now="sc-enable --now"
|
||||
alias sc-disable-now="sc-disable --now"
|
||||
alias sc-mask-now="sc-mask --now"
|
||||
|
|
|
|||
|
|
@ -1,11 +1,3 @@
|
|||
alias et='mate .'
|
||||
alias ett='mate Gemfile app config features lib db public spec test Rakefile Capfile Todo'
|
||||
alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo'
|
||||
alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo'
|
||||
|
||||
# Edit Ruby app in TextMate
|
||||
alias mr='mate CHANGELOG app config db lib public script spec test'
|
||||
|
||||
# If the tm command is called without an argument, open TextMate in the current directory
|
||||
# If tm is passed a directory, cd to it and open it in TextMate
|
||||
# If tm is passed a file, open it in TextMate
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ Insertion
|
|||
Delete and Insert
|
||||
-----------------
|
||||
|
||||
- `ctrl-h` : While in *Insert mode*: delete character after the cursor
|
||||
- `ctrl-w` : While in *Insert mode*: delete word after the cursor
|
||||
- `ctrl-h` : While in *Insert mode*: delete character before the cursor
|
||||
- `ctrl-w` : While in *Insert mode*: delete word before the cursor
|
||||
- `d{motion}` : Delete text that {motion} moves over
|
||||
- `dd` : Delete line
|
||||
- `D` : Delete characters under the cursor until the end of the line
|
||||
|
|
|
|||
|
|
@ -179,7 +179,10 @@ function simulator {
|
|||
if [[ -d "${devfolder}/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app" ]]; then
|
||||
open "${devfolder}/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app"
|
||||
# Xcode ≥ 6.x
|
||||
else
|
||||
elif [[ -d "${devfolder}/Applications/iOS Simulator.app" ]]; then
|
||||
open "${devfolder}/Applications/iOS Simulator.app"
|
||||
# Xcode ≥ 7.x
|
||||
else
|
||||
open "${devfolder}/Applications/Simulator.app"
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue