Merge remote-tracking branch 'upstream/master'

# Conflicts:
#	plugins/npm/npm.plugin.zsh
This commit is contained in:
Gaetan Semet 2018-04-27 12:06:08 +02:00
commit e357d762b5
37 changed files with 2399 additions and 591 deletions

View file

@ -141,7 +141,7 @@ export ZSH="$HOME/.dotfiles/oh-my-zsh"; sh -c "$(curl -fsSL https://raw.githubus
##### 1. Clone the repository: ##### 1. Clone the repository:
```shell ```shell
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
``` ```
##### 2. *Optionally*, backup your existing `~/.zshrc` file: ##### 2. *Optionally*, backup your existing `~/.zshrc` file:

View file

@ -0,0 +1 @@
# Put your custom themes in this folder.

View file

@ -25,7 +25,9 @@ function open_command() {
case "$OSTYPE" in case "$OSTYPE" in
darwin*) open_cmd='open' ;; darwin*) open_cmd='open' ;;
cygwin*) open_cmd='cygstart' ;; cygwin*) open_cmd='cygstart' ;;
linux*) open_cmd='xdg-open' ;; linux*) [[ $(uname -a) =~ "Microsoft" ]] && \
open_cmd='cmd.exe /c start' || \
open_cmd='xdg-open' ;;
msys*) open_cmd='start ""' ;; msys*) open_cmd='start ""' ;;
*) echo "Platform $OSTYPE not supported" *) echo "Platform $OSTYPE not supported"
return 1 return 1

View file

@ -86,8 +86,8 @@ function git_current_branch() {
# Gets the number of commits ahead from remote # Gets the number of commits ahead from remote
function git_commits_ahead() { function git_commits_ahead() {
if command git rev-parse --git-dir &>/dev/null; then if command git rev-parse --git-dir &>/dev/null; then
local commits="$(git rev-list --count @{upstream}..HEAD)" local commits="$(git rev-list --count @{upstream}..HEAD 2>/dev/null)"
if [[ "$commits" != 0 ]]; then if [[ -n "$commits" && "$commits" != 0 ]]; then
echo "$ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX$commits$ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX" echo "$ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX$commits$ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX"
fi fi
fi fi
@ -96,8 +96,8 @@ function git_commits_ahead() {
# Gets the number of commits behind remote # Gets the number of commits behind remote
function git_commits_behind() { function git_commits_behind() {
if command git rev-parse --git-dir &>/dev/null; then if command git rev-parse --git-dir &>/dev/null; then
local commits="$(git rev-list --count HEAD..@{upstream})" local commits="$(git rev-list --count HEAD..@{upstream} 2>/dev/null)"
if [[ "$commits" != 0 ]]; then if [[ -n "$commits" && "$commits" != 0 ]]; then
echo "$ZSH_THEME_GIT_COMMITS_BEHIND_PREFIX$commits$ZSH_THEME_GIT_COMMITS_BEHIND_SUFFIX" echo "$ZSH_THEME_GIT_COMMITS_BEHIND_PREFIX$commits$ZSH_THEME_GIT_COMMITS_BEHIND_SUFFIX"
fi fi
fi fi

View file

@ -1,24 +1,41 @@
## Command history configuration ## History wrapper
if [ -z "$HISTFILE" ]; then function omz_history {
HISTFILE=$HOME/.zsh_history # Delete the history file if `-c' argument provided.
fi # This won't affect the `history' command output until the next login.
zparseopts -E c=clear l=list
HISTSIZE=10000 if [[ -n "$clear" ]]; then
SAVEHIST=10000 # if -c provided, clobber the history file
echo -n >| "$HISTFILE"
echo >&2 History file deleted. Reload the session to see its effects.
elif [[ -n "$list" ]]; then
# if -l provided, run as if calling `fc' directly
builtin fc "$@"
else
# otherwise, call `fc -l 1` to show all available
# history (and pass additional parameters)
builtin fc "$@" -l 1
fi
}
# Show history # Timestamp format
case $HIST_STAMPS in case $HIST_STAMPS in
"mm/dd/yyyy") alias history='fc -fl 1' ;; "mm/dd/yyyy") alias history='omz_history -f' ;;
"dd.mm.yyyy") alias history='fc -El 1' ;; "dd.mm.yyyy") alias history='omz_history -E' ;;
"yyyy-mm-dd") alias history='fc -il 1' ;; "yyyy-mm-dd") alias history='omz_history -i' ;;
*) alias history='fc -l 1' ;; *) alias history='omz_history' ;;
esac esac
setopt append_history ## History file configuration
setopt extended_history [ -z "$HISTFILE" ] && HISTFILE="$HOME/.zsh_history"
setopt hist_expire_dups_first HISTSIZE=50000
setopt hist_ignore_dups # ignore duplication command history list SAVEHIST=10000
setopt hist_ignore_space
setopt hist_verify ## History command configuration
setopt inc_append_history setopt extended_history # record timestamp of command in HISTFILE
setopt share_history # share command history data setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
setopt hist_ignore_dups # ignore duplicated commands history list
setopt hist_ignore_space # ignore commands that start with space
setopt hist_verify # show command with history expansion to user before running it
setopt inc_append_history # add commands to HISTFILE in order of execution
setopt share_history # share command history data

View file

@ -2,6 +2,31 @@
## Features ## Features
#### TRIZEN
| Alias | Command | Description |
|---------|------------------------------------|---------------------------------------------------------------------|
| trconf | trizen -C | Fix all configuration files with vimdiff |
| trin | trizen -S | Install packages from the repositories |
| trins | trizen -U | Install a package from a local file |
| trinsd | trizen -S --asdeps | Install packages as dependencies of another package |
| trloc | trizen -Qi | Display information about a package in the local database |
| trlocs | trizen -Qs | Search for packages in the local database |
| trlst | trizen -Qe | List installed packages including from AUR (tagged as "local") |
| trmir | trizen -Syy | Force refresh of all package lists after updating mirrorlist |
| trorph | trizen -Qtd | Remove orphans using yaourt |
| trre | trizen -R | Remove packages, keeping its settings and dependencies |
| trrem | trizen -Rns | Remove packages, including its settings and unneeded dependencies |
| trrep | trizen -Si | Display information about a package in the repositories |
| trreps | trizen -Ss | Search for packages in the repositories |
| trupd | trizen -Sy && sudo abs && sudo aur | Update and refresh local package, ABS and AUR databases |
| trupd | trizen -Sy && sudo abs | Update and refresh the local package and ABS databases |
| trupd | trizen -Sy && sudo aur | Update and refresh the local package and AUR databases |
| trupd | trizen -Sy | Update and refresh the local package database |
| trupd | trizen -Syua | Sync with repositories before upgrading all packages (from AUR too) |
| trsu | trizen -Syua --no-confirm | Same as `trupg`, but without confirmation |
| upgrade | trizen -Syu | Sync with repositories before upgrading packages |
#### YAOURT #### YAOURT
| Alias | Command | Description | | Alias | Command | Description |
@ -27,7 +52,7 @@
| yasu | yaourt -Syua --no-confirm | Same as `yaupg`, but without confirmation | | yasu | yaourt -Syua --no-confirm | Same as `yaupg`, but without confirmation |
| upgrade | yaourt -Syu | Sync with repositories before upgrading packages | | upgrade | yaourt -Syu | Sync with repositories before upgrading packages |
### PACAUR #### PACAUR
| Alias | Command | Description | | Alias | Command | Description |
|---------|------------------------------------|---------------------------------------------------------------------| |---------|------------------------------------|---------------------------------------------------------------------|
@ -74,7 +99,9 @@
| pacupg | sudo pacman -Syu | Sync with repositories before upgrading packages | | pacupg | sudo pacman -Syu | Sync with repositories before upgrading packages |
| upgrade | sudo pacman -Syu | Sync with repositories before upgrading packages | | upgrade | sudo pacman -Syu | Sync with repositories before upgrading packages |
| pacfileupg | sudo pacman -Fy | Download fresh package databases from the server | | pacfileupg | sudo pacman -Fy | Download fresh package databases from the server |
| pacfiles | pacman -Fs | Search package file names for matching strings. | | pacfiles | pacman -Fs | Search package file names for matching strings |
| pacls | pacman -Ql | List files in a package |
| pacown | pacman -Qo | Show which package owns a file |
| Function | Description | | Function | Description |
|----------------|------------------------------------------------------| |----------------|------------------------------------------------------|
@ -82,6 +109,7 @@
| paclist | List all installed packages with a short description | | paclist | List all installed packages with a short description |
| pacmanallkeys | Get all keys for developers and trusted users | | pacmanallkeys | Get all keys for developers and trusted users |
| pacmansignkeys | Locally trust all keys passed as parameters | | pacmansignkeys | Locally trust all keys passed as parameters |
| pacweb | Open the website of an ArchLinux package |
--- ---
@ -95,3 +123,4 @@
- ornicar - thibault.duplessis@gmail.com - ornicar - thibault.duplessis@gmail.com
- Juraj Fiala - doctorjellyface@riseup.net - Juraj Fiala - doctorjellyface@riseup.net
- Majora320 (Moses Miller) - Majora320@gmail.com - Majora320 (Moses Miller) - Majora320@gmail.com
- Ybalrid (Arthur Brainville) - ybalrid@ybalrid.info

View file

@ -1,3 +1,32 @@
if (( $+commands[trizen] )); then
alias trconf='trizen -C'
alias trupg='trizen -Syua'
alias trsu='trizen -Syua --noconfirm'
alias trin='trizen -S'
alias trins='trizen -U'
alias trre='trizen -R'
alias trrem='trizen -Rns'
alias trrep='trizen -Si'
alias trreps='trizen -Ss'
alias trloc='trizen -Qi'
alias trlocs='trizen -Qs'
alias trlst='trizen -Qe'
alias trorph='trizen -Qtd'
alias trinsd='trizen -S --asdeps'
alias trmir='trizen -Syy'
if (( $+commands[abs] && $+commands[aur] )); then
alias trupd='trizen -Sy && sudo abs && sudo aur'
elif (( $+commands[abs] )); then
alias trupd='trizen -Sy && sudo abs'
elif (( $+commands[aur] )); then
alias trupd='trizen -Sy && sudo aur'
else
alias trupd='trizen -Sy'
fi
fi
if (( $+commands[yaourt] )); then if (( $+commands[yaourt] )); then
alias yaconf='yaourt -C' alias yaconf='yaourt -C'
alias yaupg='yaourt -Syua' alias yaupg='yaourt -Syua'
@ -54,16 +83,20 @@ if (( $+commands[pacaur] )); then
fi fi
fi fi
if (( $+commands[pacaur] )); then if (( $+commands[trizen] )); then
upgrade() { function upgrade() {
trizen -Syu
}
elif (( $+commands[pacaur] )); then
function upgrade() {
pacaur -Syu pacaur -Syu
} }
elif (( $+commands[yaourt] )); then elif (( $+commands[yaourt] )); then
upgrade() { function upgrade() {
yaourt -Syu yaourt -Syu
} }
else else
upgrade() { function upgrade() {
sudo pacman -Syu sudo pacman -Syu
} }
fi fi
@ -83,7 +116,9 @@ alias pacmir='sudo pacman -Syy'
alias paclsorphans='sudo pacman -Qdt' alias paclsorphans='sudo pacman -Qdt'
alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)' alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)'
alias pacfileupg='sudo pacman -Fy' alias pacfileupg='sudo pacman -Fy'
alias pacfiles='pacman tFs' alias pacfiles='pacman -Fs'
alias pacls='pacman -Ql'
alias pacown='pacman -Qo'
if (( $+commands[abs] && $+commands[aur] )); then if (( $+commands[abs] && $+commands[aur] )); then
@ -96,13 +131,13 @@ else
alias pacupd='sudo pacman -Sy' alias pacupd='sudo pacman -Sy'
fi fi
paclist() { function paclist() {
# Source: https://bbs.archlinux.org/viewtopic.php?id=93683 # Source: https://bbs.archlinux.org/viewtopic.php?id=93683
LC_ALL=C pacman -Qei $(pacman -Qu | cut -d " " -f 1) | \ LC_ALL=C pacman -Qei $(pacman -Qu | cut -d " " -f 1) | \
awk 'BEGIN {FS=":"} /^Name/{printf("\033[1;36m%s\033[1;37m", $2)} /^Description/{print $2}' awk 'BEGIN {FS=":"} /^Name/{printf("\033[1;36m%s\033[1;37m", $2)} /^Description/{print $2}'
} }
pacdisowned() { function pacdisowned() {
emulate -L zsh emulate -L zsh
tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$ tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$
@ -120,14 +155,14 @@ pacdisowned() {
comm -23 "$fs" "$db" comm -23 "$fs" "$db"
} }
pacmanallkeys() { function pacmanallkeys() {
emulate -L zsh emulate -L zsh
curl -s https://www.archlinux.org/people/{developers,trustedusers}/ | \ curl -s https://www.archlinux.org/people/{developers,trustedusers}/ | \
awk -F\" '(/pgp.mit.edu/) { sub(/.*search=0x/,""); print $1}' | \ awk -F\" '(/pgp.mit.edu/) { sub(/.*search=0x/,""); print $1}' | \
xargs sudo pacman-key --recv-keys xargs sudo pacman-key --recv-keys
} }
pacmansignkeys() { function pacmansignkeys() {
emulate -L zsh emulate -L zsh
for key in $*; do for key in $*; do
sudo pacman-key --recv-keys $key sudo pacman-key --recv-keys $key
@ -136,3 +171,16 @@ pacmansignkeys() {
--no-permission-warning --command-fd 0 --edit-key $key --no-permission-warning --command-fd 0 --edit-key $key
done done
} }
if (( $+commands[xdg-open] )); then
function pacweb() {
pkg="$1"
infos="$(pacman -Si "$pkg")"
if [[ -z "$infos" ]]; then
return
fi
repo="$(grep '^Repo' <<< "$infos" | grep -oP '[^ ]+$')"
arch="$(grep '^Arch' <<< "$infos" | grep -oP '[^ ]+$')"
xdg-open "https://www.archlinux.org/packages/$repo/$arch/$pkg/" &>/dev/null
}
fi

View file

@ -5,3 +5,8 @@ ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}"
if [ -f $ASDF_DIR/asdf.sh ]; then if [ -f $ASDF_DIR/asdf.sh ]; then
. $ASDF_DIR/asdf.sh . $ASDF_DIR/asdf.sh
fi fi
# Load asdf completions, if found.
if [ -f $ASDF_DIR/completions/asdf.bash ]; then
. $ASDF_DIR/completions/asdf.bash
fi

View file

@ -1,2 +0,0 @@
License: GPL v2
Thanks to http://www.k-lug.org/~kessler/projects.html for the fortune file.

File diff suppressed because it is too large Load diff

View file

@ -26,13 +26,14 @@ function emotty() {
# Use emotty set defined by user, fallback to default # Use emotty set defined by user, fallback to default
local emotty=${_emotty_sets[${emotty_set:-$emotty_default_set}]} local emotty=${_emotty_sets[${emotty_set:-$emotty_default_set}]}
# Parse $TTY number, normalizing it to an emotty set index # Parse $TTY number, normalizing it to an emotty set index
(( tty = (${TTY##/dev/ttys} % ${#${=emotty}}) + 1 )) (( tty = (${TTY##/dev/tty} % ${#${=emotty}}) + 1 ))
local character_name=${${=emotty}[tty]} local character_name=${${=emotty}[tty]}
echo "${emoji[${character_name}]}${emoji2[emoji_style]}" echo "${emoji[${character_name}]}${emoji2[emoji_style]}"
} }
function display_emotty() { function display_emotty() {
local name=$1 local name=${1:-$emotty_set}
echo $name
for i in ${=_emotty_sets[$name]}; do for i in ${=_emotty_sets[$name]}; do
printf "${emoji[$i]}${emoji2[emoji_style]} " printf "${emoji[$i]}${emoji2[emoji_style]} "
done done

View file

@ -180,8 +180,8 @@ alias glgg='git log --graph'
alias glgga='git log --graph --decorate --all' alias glgga='git log --graph --decorate --all'
alias glgm='git log --graph --max-count=10' alias glgm='git log --graph --max-count=10'
alias glo='git log --oneline --decorate' alias glo='git log --oneline --decorate'
alias glol="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" alias glol="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'"
alias glola="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --all" alias glola="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --all"
alias glog='git log --oneline --decorate --graph' alias glog='git log --oneline --decorate --graph'
alias gloga='git log --oneline --decorate --graph --all' alias gloga='git log --oneline --decorate --graph --all'
alias glp="_git_log_prettily" alias glp="_git_log_prettily"

View file

@ -89,6 +89,7 @@ __hub_setup_zsh_fns () {
browse:'browse the project on GitHub' browse:'browse the project on GitHub'
compare:'open GitHub compare view' compare:'open GitHub compare view'
ci-status:'lookup commit in GitHub Status API' ci-status:'lookup commit in GitHub Status API'
sync:'update local branches from upstream'
) )
_describe -t hub-commands 'hub command' hub_commands && ret=0 _describe -t hub-commands 'hub command' hub_commands && ret=0
@ -115,6 +116,7 @@ create
browse browse
compare compare
ci-status ci-status
sync
EOF EOF
__git_list_all_commands_without_hub __git_list_all_commands_without_hub
} }

View file

@ -1,8 +1,6 @@
# Set up hub wrapper for git, if it is available; http://github.com/github/hub # Set up hub wrapper for git, if it is available; http://github.com/github/hub
if [ "$commands[(I)hub]" ]; then if (( $+commands[hub] )); then
if hub --version &>/dev/null; then alias git=hub
eval $(hub alias -s zsh)
fi
fi fi
# Functions ################################################################# # Functions #################################################################

View file

@ -1,7 +1,7 @@
function gi() { curl -sL https://www.gitignore.io/api/${(j:,:)@} } function gi() { curl -fL https://www.gitignore.io/api/${(j:,:)@} }
_gitignoreio_get_command_list() { _gitignoreio_get_command_list() {
curl -sL https://www.gitignore.io/api/list | tr "," "\n" curl -fL https://www.gitignore.io/api/list | tr "," "\n"
} }
_gitignoreio () { _gitignoreio () {

View file

@ -1,14 +1,16 @@
# Enable gpg-agent if it is not running # Enable gpg-agent if it is not running-
GPG_AGENT_SOCKET="${XDG_RUNTIME_DIR}/gnupg/S.gpg-agent.ssh" # --use-standard-socket will work from version 2 upwards
if [ ! -S $GPG_AGENT_SOCKET ]; then
gpg-agent --daemon >/dev/null 2>&1
export GPG_TTY=$(tty)
fi
# Set SSH to use gpg-agent if it is configured to do so AGENT_SOCK=`gpgconf --list-dirs | grep agent-socket | cut -d : -f 2`
GNUPGCONFIG="${GNUPGHOME:-"$HOME/.gnupg"}/gpg-agent.conf"
if [ -r "$GNUPGCONFIG" ] && grep -q enable-ssh-support "$GNUPGCONFIG"; then if [ ! -S ${AGENT_SOCK} ]; then
gpg-agent --daemon --use-standard-socket >/dev/null 2>&1
fi
export GPG_TTY=$(tty)
# Set SSH to use gpg-agent if it's enabled
if [ -S "${AGENT_SOCK}.ssh" ]; then
export SSH_AUTH_SOCK="${AGENT_SOCK}.ssh"
unset SSH_AGENT_PID unset SSH_AGENT_PID
export SSH_AUTH_SOCK=$GPG_AGENT_SOCKET
fi fi

32
plugins/hanami/README.md Normal file
View file

@ -0,0 +1,32 @@
# Hanami Plugin #
This plugin adds convenient ways to work with [Hanami](http://hanamirb.org/) via console.
It's inspired by Rails plugin, so if you've used it, you'll feel like home.
## Usage ##
For example, type `hc` into your console when you're within Hanami project directory to run
the application console. Have a look at available shortcuts below. You can read more about
these commands [on the official website](http://hanamirb.org/guides/command-line/applications/).
## Aliases ##
| Alias | Command | Description |
|-------|---------------------------|---------------------------------------------------------|
| HED | HANAMI_ENV=development | Set environment variable HANAMI_ENV to development |
| HEP | HANAMI_ENV=production | Set environment variable HANAMI_ENV to production |
| HET | HANAMI_ENV=test | Set environment variable HANAMI_ENV to test |
| hc | hanami console | Run application console |
| hd | hanami destroy | Remove specified hanami resource |
| hg | hanami generate | Create specified hanami resource |
| hgm | hanami generate migration | Create migration file |
| hs | hanami server | Launch server with hanami application |
| hsp | hanami server -p | Launch server with specified port |
| hr | hanami routes | List application routes |
| hdc | hanami db create | Create application database |
| hdd | hanami db drop | Delete application database |
| hdp | hanami db prepare | Prepare database for the current environment |
| hda | hanami db apply | Recreates a fresh schema after migrations (destructive) |
| hdv | hanami db version | Print current database version |
| hdrs | hdd && hdp | Drop and recreate application database |
| hdtp | HET hdp | Actualize test environment database |
| hrg | hr &#124; grep | Grep hanami routes with specified pattern |

View file

@ -0,0 +1,19 @@
alias -g HED='HANAMI_ENV=development'
alias -g HEP='HANAMI_ENV=production'
alias -g HET='HANAMI_ENV=test'
alias hc='hanami console'
alias hd='hanami destroy'
alias hg='hanami generate'
alias hgm='hanami generate migration'
alias hs='hanami server'
alias hsp='hanami server -p'
alias hr='hanami routes'
alias hdc='hanami db create'
alias hdd='hanami db drop'
alias hdp='hanami db prepare'
alias hda='hanami db apply'
alias hdv='hanami db version'
alias hdrs='hdd && hdp'
alias hdtp='HET hdp'
alias hrg='hr | grep'

View file

@ -7,7 +7,7 @@ _1st_arguments=(
'dashboard:open the dashboard' 'dashboard:open the dashboard'
'reported:search for issues reported by a user' 'reported:search for issues reported by a user'
'assigned:search for issues assigned to a user' 'assigned:search for issues assigned to a user'
'br:open the issue named after the git branch of the current directory' 'branch:open the issue named after the git branch of the current directory'
'dumpconfig:display effective jira configuration' 'dumpconfig:display effective jira configuration'
) )

View file

@ -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 () {

View file

@ -21,6 +21,15 @@ _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 environments database structure'
'ecto.gen.migration:Generates a migration'
'ecto.gen.repo:Generates a new repository'
'ecto.load:Loads the current environments 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'
'help:Print help information for tasks' 'help:Print help information for tasks'
'hex:Print hex help information' 'hex:Print hex help information'

View file

@ -47,3 +47,11 @@ alias npmst="npm start"
# Run npm test # Run npm test
alias npmt="npm test" alias npmt="npm test"
# Run npm scripts
alias npmR="npm run"
# Run npm publish
alias npmP="npm publish"
# Run npm init
alias npmI="npm init"

View file

@ -1,50 +1,17 @@
_homebrew-installed() { # This plugin loads pyenv into the current shell and provides prompt info via
type brew &> /dev/null # the 'pyenv_prompt_info' function. Also loads pyenv-virtualenv if available.
}
_pyenv-from-homebrew-installed() { if (( $+commands[pyenv] )); then
brew --prefix pyenv &> /dev/null eval "$(pyenv init - zsh)"
} if (( $+commands[pyenv-virtualenv-init] )); then
eval "$(pyenv virtualenv-init - zsh)"
FOUND_PYENV=0
pyenvdirs=("$HOME/.pyenv" "/usr/local/pyenv" "/opt/pyenv")
for pyenvdir in "${pyenvdirs[@]}" ; do
if [ -d $pyenvdir/bin -a $FOUND_PYENV -eq 0 ] ; then
FOUND_PYENV=1
export PYENV_ROOT=$pyenvdir
export PATH=${pyenvdir}/bin:$PATH
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)"
}
fi
done
unset pyenvdir
if [ $FOUND_PYENV -eq 0 ] ; then
pyenvdir=$(brew --prefix pyenv 2> /dev/null)
if [ $? -eq 0 -a -d $pyenvdir/bin ] ; then
FOUND_PYENV=1
export PYENV_ROOT=$pyenvdir
export PATH=${pyenvdir}/bin:$PATH
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)"
}
fi fi
fi function pyenv_prompt_info() {
echo "$(pyenv version-name)"
if [ $FOUND_PYENV -eq 0 ] ; then }
function pyenv_prompt_info() { echo "system: $(python -V 2>&1 | cut -f 2 -d ' ')" } else
# fallback to system python
function pyenv_prompt_info() {
echo "system: $(python -V 2>&1 | cut -f 2 -d ' ')"
}
fi fi

View file

@ -51,6 +51,9 @@ _arguments \
if (( CURRENT == 1 )); then if (( CURRENT == 1 )); then
_describe -t commands "rails subcommand" _1st_arguments _describe -t commands "rails subcommand" _1st_arguments
return return
else
_files
return
fi fi
case "$words[1]" in case "$words[1]" in

View file

@ -1,5 +1,9 @@
# Sublime Text Aliases
() {
if [[ "$OSTYPE" == linux* ]]; then if [[ "$OSTYPE" == linux* ]]; then
local _sublime_linux_paths > /dev/null 2>&1 local _sublime_linux_paths
_sublime_linux_paths=( _sublime_linux_paths=(
"$HOME/bin/sublime_text" "$HOME/bin/sublime_text"
"/opt/sublime_text/sublime_text" "/opt/sublime_text/sublime_text"
@ -19,9 +23,8 @@ if [[ "$OSTYPE" == linux* ]]; then
break break
fi fi
done done
elif [[ "$OSTYPE" = darwin* ]]; then elif [[ "$OSTYPE" = darwin* ]]; then
local _sublime_darwin_paths > /dev/null 2>&1 local _sublime_darwin_paths
_sublime_darwin_paths=( _sublime_darwin_paths=(
"/usr/local/bin/subl" "/usr/local/bin/subl"
"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
@ -38,10 +41,9 @@ elif [[ "$OSTYPE" = darwin* ]]; then
break break
fi fi
done done
elif [[ "$OSTYPE" = 'cygwin' ]]; then elif [[ "$OSTYPE" = 'cygwin' ]]; then
local _sublime_cygwin_paths > /dev/null 2>&1 local sublime_cygwin_paths
_sublime_cygwin_paths=( sublime_cygwin_paths=(
"$(cygpath $ProgramW6432/Sublime\ Text\ 2)/sublime_text.exe" "$(cygpath $ProgramW6432/Sublime\ Text\ 2)/sublime_text.exe"
"$(cygpath $ProgramW6432/Sublime\ Text\ 3)/sublime_text.exe" "$(cygpath $ProgramW6432/Sublime\ Text\ 3)/sublime_text.exe"
) )
@ -52,9 +54,10 @@ elif [[ "$OSTYPE" = 'cygwin' ]]; then
break break
fi fi
done done
fi fi
}
alias stt='st .' alias stt='st .'
find_project() find_project()

View file

@ -25,5 +25,7 @@ alias sfcw='sf cache:warmup'
alias sfroute='sf debug:router' alias sfroute='sf debug:router'
alias sfcontainer='sf debug:container' alias sfcontainer='sf debug:container'
alias sfgb='sf generate:bundle' alias sfgb='sf generate:bundle'
alias sfge='sf doctrine:generate:entity'
alias sfsu='sf doctrine:schema:update'
alias sfdev='sf --env=dev' alias sfdev='sf --env=dev'
alias sfprod='sf --env=prod' alias sfprod='sf --env=prod'

View file

@ -81,7 +81,7 @@ __vagrant-box ()
case $state in case $state in
(command) (command)
_describe -t commands "gem subcommand" _box_arguments _describe -t commands "vagrant subcommand" _box_arguments
return return
;; ;;
@ -110,7 +110,7 @@ _arguments -C \
case $state in case $state in
(command) (command)
_describe -t commands "gem subcommand" _1st_arguments _describe -t commands "vagrant subcommand" _1st_arguments
return return
;; ;;

View file

@ -16,6 +16,7 @@ function web_search() {
baidu "https://www.baidu.com/s?wd=" baidu "https://www.baidu.com/s?wd="
ecosia "https://www.ecosia.org/search?q=" ecosia "https://www.ecosia.org/search?q="
goodreads "https://www.goodreads.com/search?q=" goodreads "https://www.goodreads.com/search?q="
qwant "https://www.qwant.com/?q="
) )
# check whether the search engine is supported # check whether the search engine is supported
@ -49,6 +50,7 @@ alias github='web_search github'
alias baidu='web_search baidu' alias baidu='web_search baidu'
alias ecosia='web_search ecosia' alias ecosia='web_search ecosia'
alias goodreads='web_search goodreads' alias goodreads='web_search goodreads'
alias qwant='web_search qwant'
#add your own !bang searches here #add your own !bang searches here
alias wiki='web_search duckduckgo \!w' alias wiki='web_search duckduckgo \!w'

View file

@ -0,0 +1,23 @@
# zsh_reload plugin
The zsh_reload plugin defines a function to reload the zsh session with
just a few keystrokes.
To use it, add `zsh_reload` to the plugins array in your zshrc file:
```zsh
plugins=(... zsh_reload)
```
## Usage
To reload the zsh session, just run `src`:
```zsh
$ vim ~/.zshrc # enabled a plugin
$ src
re-compiling /home/user/.zshrc.zwc: succeeded
re-compiling /home/user/.oh-my-zsh/cache/zcomp-host.zwc: succeeded
# you now have a fresh zsh session. happy hacking!
```

View file

@ -1,13 +1,12 @@
# reload zshrc src() {
function src() local cache="$ZSH_CACHE_DIR"
{ autoload -U compinit zrecompile
local cache=$ZSH_CACHE_DIR compinit -i -d "$cache/zcomp-$HOST"
autoload -U compinit zrecompile
compinit -d "$cache/zcomp-$HOST"
for f in ~/.zshrc "$cache/zcomp-$HOST"; do for f in ~/.zshrc "$cache/zcomp-$HOST"; do
zrecompile -p $f && command rm -f $f.zwc.old zrecompile -p $f && command rm -f $f.zwc.old
done done
source ~/.zshrc # Use $SHELL if available; remove leading dash if login shell
[[ -n "$SHELL" ]] && exec ${SHELL#-} || exec zsh
} }

View file

@ -50,9 +50,7 @@ function _ruby_version() {
# use a neutral color, otherwise colors will vary according to time. # use a neutral color, otherwise colors will vary according to time.
function _git_time_since_commit() { function _git_time_since_commit() {
# Only proceed if there is actually a commit. # Only proceed if there is actually a commit.
if git log -1 > /dev/null 2>&1; then if last_commit=$(git log --pretty=format:'%at' -1 2> /dev/null); then
# Get the last commit.
last_commit=$(git log --pretty=format:'%at' -1 2> /dev/null)
now=$(date +%s) now=$(date +%s)
seconds_since_last_commit=$((now-last_commit)) seconds_since_last_commit=$((now-last_commit))

View file

@ -6,5 +6,5 @@ PROMPT='%{$fg_bold[cyan]%}$ZSH_THEME_CLOUD_PREFIX %{$fg_bold[green]%}%p %{$fg[gr
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}" ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}] %{$fg[yellow]%}⚡%{$reset_color%}" ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}] %{$fg[yellow]%}⚡ %{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}]" ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}]"

View file

@ -68,6 +68,10 @@ prompt_glyph="%{%(#.${root_prompt}.${user_prompt}) %2G%}"
setopt promptsubst setopt promptsubst
# Workaround for zsh 5.2 release (kudos to @timothybasanov)
autoload +X VCS_INFO_nvcsformats
functions[VCS_INFO_nvcsformats]=${functions[VCS_INFO_nvcsformats]/local -a msgs/}
autoload -U add-zsh-hook autoload -U add-zsh-hook
autoload -Uz vcs_info autoload -Uz vcs_info

View file

@ -60,7 +60,7 @@ zstyle ':vcs_info:*:prompt:*' nvcsformats ""
function steeef_preexec { function steeef_preexec {
case "$(history $HISTCMD)" in case "$2" in
*git*) *git*)
PR_GIT_UPDATE=1 PR_GIT_UPDATE=1
;; ;;

View file

@ -1,13 +1,13 @@
# user, host, full path, and time/date # user, host, full path, and time/date on two lines for easier vgrepping
# on two lines for easier vgrepping
# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888
function hg_prompt_info { function hg_prompt_info {
if (( $+commands[hg] )) && grep -q "prompt" ~/.hgrc; then
hg prompt --angle-brackets "\ hg prompt --angle-brackets "\
<hg:%{$fg[magenta]%}<branch>%{$reset_color%}><:%{$fg[magenta]%}<bookmark>%{$reset_color%}>\ <hg:%{$fg[magenta]%}<branch>%{$reset_color%}><:%{$fg[magenta]%}<bookmark>%{$reset_color%}>\
</%{$fg[yellow]%}<tags|%{$reset_color%}, %{$fg[yellow]%}>%{$reset_color%}>\ </%{$fg[yellow]%}<tags|%{$reset_color%}, %{$fg[yellow]%}>%{$reset_color%}>\
%{$fg[red]%}<status|modified|unknown><update>%{$reset_color%}< %{$fg[red]%}<status|modified|unknown><update>%{$reset_color%}<
patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset_color%})|pre_unapplied(%{$fg_bold[black]%})|post_unapplied(%{$reset_color%})>>" 2>/dev/null patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset_color%})|pre_unapplied(%{$fg_bold[black]%})|post_unapplied(%{$reset_color%})>>" 2>/dev/null
fi
} }
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%}+" ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%}+"
@ -33,4 +33,3 @@ function retcode() {}
PROMPT=$'%{$fg_bold[blue]%}┌─[%{$fg_bold[green]%}%n%b%{$fg[black]%}@%{$fg[cyan]%}%m%{$fg_bold[blue]%}]%{$reset_color%} - %{$fg_bold[blue]%}[%{$fg_bold[white]%}%~%{$fg_bold[blue]%}]%{$reset_color%} - %{$fg_bold[blue]%}[%b%{$fg[yellow]%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{$fg_bold[blue]%}] PROMPT=$'%{$fg_bold[blue]%}┌─[%{$fg_bold[green]%}%n%b%{$fg[black]%}@%{$fg[cyan]%}%m%{$fg_bold[blue]%}]%{$reset_color%} - %{$fg_bold[blue]%}[%{$fg_bold[white]%}%~%{$fg_bold[blue]%}]%{$reset_color%} - %{$fg_bold[blue]%}[%b%{$fg[yellow]%}'%D{"%Y-%m-%d %I:%M:%S"}%b$'%{$fg_bold[blue]%}]
%{$fg_bold[blue]%}└─[%{$fg_bold[magenta]%}%?$(retcode)%{$fg_bold[blue]%}] <$(mygit)$(hg_prompt_info)>%{$reset_color%} ' %{$fg_bold[blue]%}└─[%{$fg_bold[magenta]%}%?$(retcode)%{$fg_bold[blue]%}] <$(mygit)$(hg_prompt_info)>%{$reset_color%} '
PS2=$' \e[0;34m%}%B>%{\e[0m%}%b ' PS2=$' \e[0;34m%}%B>%{\e[0m%}%b '

View file

@ -62,7 +62,7 @@ zstyle ':vcs_info:*:prompt:*' nvcsformats ""
function steeef_preexec { function steeef_preexec {
case "$(history $HISTCMD)" in case "$2" in
*git*) *git*)
PR_GIT_UPDATE=1 PR_GIT_UPDATE=1
;; ;;

View file

@ -49,7 +49,7 @@ main() {
umask g-w,o-w umask g-w,o-w
printf "${BLUE}Cloning Oh My Zsh...${NORMAL}\n" printf "${BLUE}Cloning Oh My Zsh...${NORMAL}\n"
hash git >/dev/null 2>&1 || { command -v git >/dev/null 2>&1 || {
echo "Error: git is not installed" echo "Error: git is not installed"
exit 1 exit 1
} }