mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-12 01:52:31 +01:00
Merge branch 'master' into patch-1
This commit is contained in:
commit
4963f830cd
323 changed files with 9513 additions and 6286 deletions
|
|
@ -4,7 +4,7 @@ alias-finder() {
|
|||
case $i in
|
||||
-e|--exact) exact=true;;
|
||||
-l|--longer) longer=true;;
|
||||
*)
|
||||
*)
|
||||
if [[ -z $cmd ]]; then
|
||||
cmd=$i
|
||||
else
|
||||
|
|
@ -14,7 +14,7 @@ alias-finder() {
|
|||
esac
|
||||
done
|
||||
cmd=$(sed 's/[].\|$(){}?+*^[]/\\&/g' <<< $cmd) # adds escaping for grep
|
||||
if [[ $(wc -l <<< $cmd) == 1 ]]; then
|
||||
if (( $(wc -l <<< $cmd) == 1 )); then
|
||||
while [[ $cmd != "" ]]; do
|
||||
if [[ $longer = true ]]; then
|
||||
wordStart="'{0,1}"
|
||||
|
|
@ -43,4 +43,5 @@ preexec_alias-finder() {
|
|||
fi
|
||||
}
|
||||
|
||||
preexec_functions+=(preexec_alias-finder)
|
||||
autoload -U add-zsh-hook
|
||||
add-zsh-hook preexec preexec_alias-finder
|
||||
|
|
|
|||
|
|
@ -1,19 +1,21 @@
|
|||
## APACHE2 MACPORTS PLUGIN
|
||||
# apache2-macports plugin
|
||||
|
||||
Enables aliases to control a local Apache2 installed via [MacPorts](https://www.macports.org/).
|
||||
|
||||
---
|
||||
To use it, add `apache2-macports` to the plugins array in your zshrc file:
|
||||
|
||||
### FEATURES
|
||||
```zsh
|
||||
plugins=(... apache2-macports)
|
||||
```
|
||||
|
||||
| Alias | Function | Description |
|
||||
|:--------------:|:-------------------------------------------------------------------------------|----------------------:|
|
||||
| apache2restart | sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper restart | Restart apache daemon |
|
||||
| apache2start | sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper start | Start apache daemon |
|
||||
| apache2stop | sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper stop | Stop apache daemon |
|
||||
## Aliases
|
||||
|
||||
---
|
||||
| Alias | Function | Description |
|
||||
|----------------|-----------------------------------------|-----------------------|
|
||||
| apache2restart | `sudo /path/to/apache2.wrapper restart` | Restart apache daemon |
|
||||
| apache2start | `sudo /path/to/apache2.wrapper start` | Start apache daemon |
|
||||
| apache2stop | `sudo /path/to/apache2.wrapper stop` | Stop apache daemon |
|
||||
|
||||
### CONTRIBUTORS
|
||||
- Alexander Rinass (alex@rinass.net)
|
||||
## Contributors
|
||||
|
||||
---
|
||||
- Alexander Rinass (alex@rinass.net)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,41 @@
|
|||
## arcanist
|
||||
|
||||
**Maintainer:** [@emzar](https://github.com/emzar)
|
||||
This plugin adds many useful aliases for [arcanist](https://github.com/phacility/arcanist).
|
||||
|
||||
This plugin adds many useful aliases.
|
||||
To use it, add `arcanist` to the plugins array of your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... arcanist)
|
||||
```
|
||||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command |
|
||||
| ------- | ---------------------------------- |
|
||||
| ara | `arc amend` |
|
||||
| arb | `arc branch` |
|
||||
| arco | `arc cover` |
|
||||
| arci | `arc commit` |
|
||||
| ard | `arc diff` |
|
||||
| ardc | `arc diff --create` |
|
||||
| ardp | `arc diff --preview` |
|
||||
| ardnu | `arc diff --nounit` |
|
||||
| ardnupc | `arc diff --nounit --plan-changes` |
|
||||
| ardpc | `arc diff --plan-changes` |
|
||||
| are | `arc export` |
|
||||
| arh | `arc help` |
|
||||
| arl | `arc land` |
|
||||
| arli | `arc lint` |
|
||||
| arls | `arc list` |
|
||||
| arpa | `arc patch` |
|
||||
|
||||
## Functions
|
||||
|
||||
The following functions make copy pasting revision ids from the URL bar of your browser
|
||||
easier, as they allow for copy pasting the whole URL. For example: `ardu` accepts
|
||||
both `https://arcanist-url.com/<REVISION>` as well as `<REVISION>`.
|
||||
|
||||
| Function | Command |
|
||||
| ------------------------- | --------------------------------- |
|
||||
| ardu [URL or revision_id] | `arc diff --update` [revision_id] |
|
||||
| arpa [URL or revision_id] | `arc patch` [revision_id] |
|
||||
|
|
|
|||
|
|
@ -9,13 +9,29 @@ alias arco='arc cover'
|
|||
alias arci='arc commit'
|
||||
|
||||
alias ard='arc diff'
|
||||
alias ardc='arc diff --create'
|
||||
alias ardnu='arc diff --nounit'
|
||||
alias ardnupc='arc diff --nounit --plan-changes'
|
||||
alias ardpc='arc diff --plan-changes'
|
||||
alias ardp='arc diff --preview' # creates a new diff in the phab interface
|
||||
|
||||
alias are='arc export'
|
||||
alias arh='arc help'
|
||||
alias arl='arc land'
|
||||
alias arli='arc lint'
|
||||
alias arls='arc list'
|
||||
alias arpa='arc patch'
|
||||
|
||||
#
|
||||
# Functions
|
||||
# (sorted alphabetically)
|
||||
#
|
||||
|
||||
ardu() {
|
||||
# Both `ardu https://arcanist-url.com/<REVISION>`, and `ardu <REVISION>` work.
|
||||
arc diff --update "${1:t}"
|
||||
}
|
||||
|
||||
arpa() {
|
||||
# Both `arpa https://arcanist-url.com/<REVISION>`, and `arpa <REVISION>` work.
|
||||
arc patch "${1:t}"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,13 @@
|
|||
# Archlinux plugin
|
||||
|
||||
This plugin adds some aliases and functions to work with Arch Linux.
|
||||
|
||||
To use it, add `archlinux` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... archlinux)
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
#### YAY
|
||||
|
|
@ -119,7 +127,7 @@
|
|||
| pacupg | 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 |
|
||||
| pacfiles | pacman -Fs | Search package file names for matching strings |
|
||||
| pacfiles | pacman -F | Search package file names for matching strings |
|
||||
| pacls | pacman -Ql | List files in a package |
|
||||
| pacown | pacman -Qo | Show which package owns a file |
|
||||
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ alias pacmir='sudo pacman -Syy'
|
|||
alias paclsorphans='sudo pacman -Qdt'
|
||||
alias pacrmorphans='sudo pacman -Rs $(pacman -Qtdq)'
|
||||
alias pacfileupg='sudo pacman -Fy'
|
||||
alias pacfiles='pacman -Fs'
|
||||
alias pacfiles='pacman -F'
|
||||
alias pacls='pacman -Ql'
|
||||
alias pacown='pacman -Qo'
|
||||
|
||||
|
|
@ -208,7 +208,7 @@ function pacmansignkeys() {
|
|||
if (( $+commands[xdg-open] )); then
|
||||
function pacweb() {
|
||||
pkg="$1"
|
||||
infos="$(pacman -Si "$pkg")"
|
||||
infos="$(LANG=C pacman -Si "$pkg")"
|
||||
if [[ -z "$infos" ]]; then
|
||||
return
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}"
|
|||
ASDF_COMPLETIONS="$ASDF_DIR/completions"
|
||||
|
||||
# If not found, check for Homebrew package
|
||||
if [[ ! -f "$ASDF_DIR/asdf.sh" ]] && (( $+commands[brew] )); then
|
||||
if [[ ! -f "$ASDF_DIR/asdf.sh" || ! -f "$ASDF_COMPLETIONS/asdf.bash" ]] && (( $+commands[brew] )); then
|
||||
ASDF_DIR="$(brew --prefix asdf)"
|
||||
ASDF_COMPLETIONS="$ASDF_DIR/etc/bash_completion.d"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -7,8 +7,14 @@ To use it, add `autoenv` to the plugins array in your zshrc file:
|
|||
```zsh
|
||||
plugins=(... autoenv)
|
||||
```
|
||||
|
||||
## Functions
|
||||
|
||||
* `use_env()`: creates and/or activates a virtualenv. For use in `.env` files.
|
||||
See the source code for details.
|
||||
|
||||
## Requirements
|
||||
|
||||
In order to make this work, you will need to have the autoenv installed.
|
||||
|
||||
More info on the usage and install: https://github.com/inishchith/autoenv
|
||||
More info on the usage and install at [the project's homepage](https://github.com/inishchith/autoenv).
|
||||
|
|
|
|||
|
|
@ -1,12 +1,39 @@
|
|||
# Activates autoenv or reports its failure
|
||||
# Initialization: activate autoenv or report its absence
|
||||
() {
|
||||
local d autoenv_dir install_locations
|
||||
if ! type autoenv_init >/dev/null; then
|
||||
for d (~/.autoenv ~/.local/bin /usr/local/opt/autoenv /usr/local/bin); do
|
||||
# Check if activate.sh is in $PATH
|
||||
if (( $+commands[activate.sh] )); then
|
||||
autoenv_dir="${commands[activate.sh]:h}"
|
||||
fi
|
||||
|
||||
# Locate autoenv installation
|
||||
if [[ -z $autoenv_dir ]]; then
|
||||
install_locations=(
|
||||
~/.autoenv
|
||||
~/.local/bin
|
||||
/usr/local/opt/autoenv
|
||||
/usr/local/bin
|
||||
/usr/share/autoenv-git
|
||||
~/Library/Python/bin
|
||||
)
|
||||
for d ( $install_locations ); do
|
||||
if [[ -e $d/activate.sh ]]; then
|
||||
autoenv_dir=$d
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Look for Homebrew path as a last resort
|
||||
if [[ -z "$autoenv_dir" ]] && (( $+commands[brew] )); then
|
||||
d=$(brew --prefix)/opt/autoenv
|
||||
if [[ -e $d/activate.sh ]]; then
|
||||
autoenv_dir=$d
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Complain if autoenv is not installed
|
||||
if [[ -z $autoenv_dir ]]; then
|
||||
cat <<END >&2
|
||||
-------- AUTOENV ---------
|
||||
|
|
@ -17,6 +44,7 @@ In the meantime the autoenv plugin is DISABLED.
|
|||
END
|
||||
return 1
|
||||
fi
|
||||
# Load autoenv
|
||||
source $autoenv_dir/activate.sh
|
||||
fi
|
||||
}
|
||||
|
|
@ -27,17 +55,17 @@ fi
|
|||
# It only performs an action if the requested virtualenv is not the current one.
|
||||
|
||||
use_env() {
|
||||
typeset venv
|
||||
venv="$1"
|
||||
if [[ "${VIRTUAL_ENV:t}" != "$venv" ]]; then
|
||||
if workon | grep -q "$venv"; then
|
||||
workon "$venv"
|
||||
else
|
||||
echo -n "Create virtualenv $venv now? (Yn) "
|
||||
read answer
|
||||
if [[ "$answer" == "Y" ]]; then
|
||||
mkvirtualenv "$venv"
|
||||
fi
|
||||
fi
|
||||
local venv
|
||||
venv="$1"
|
||||
if [[ "${VIRTUAL_ENV:t}" != "$venv" ]]; then
|
||||
if workon | grep -q "$venv"; then
|
||||
workon "$venv"
|
||||
else
|
||||
echo -n "Create virtualenv $venv now? (Yn) "
|
||||
read answer
|
||||
if [[ "$answer" == "Y" ]]; then
|
||||
mkvirtualenv "$venv"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,4 +8,4 @@ To use it, add `autojump` to the plugins array in your zshrc file:
|
|||
plugins=(... autojump)
|
||||
```
|
||||
|
||||
More info on the usage: https://github.com/wting/autojump
|
||||
**Note:** you have to [install autojump](https://github.com/wting/autojump#installation) first.
|
||||
|
|
|
|||
|
|
@ -29,6 +29,6 @@ if (( ! found && $+commands[brew] )); then
|
|||
fi
|
||||
fi
|
||||
|
||||
(( ! found )) && echo '[oh-my-zsh] autojump script not found'
|
||||
(( ! found )) && echo '[oh-my-zsh] autojump not found. Please install it first.'
|
||||
|
||||
unset autojump_paths file found
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ function asp() {
|
|||
return
|
||||
fi
|
||||
|
||||
local available_profiles=($(aws_profiles))
|
||||
local -a available_profiles
|
||||
available_profiles=($(aws_profiles))
|
||||
if [[ -z "${available_profiles[(r)$1]}" ]]; then
|
||||
echo "${fg[red]}Profile '$1' not found in '${AWS_CONFIG_FILE:-$HOME/.aws/config}'" >&2
|
||||
echo "Available profiles: ${(j:, :)available_profiles:-no profiles found}${reset_color}" >&2
|
||||
|
|
@ -30,12 +31,12 @@ function aws_change_access_key() {
|
|||
|
||||
echo Insert the credentials when asked.
|
||||
asp "$1" || return 1
|
||||
aws iam create-access-key
|
||||
aws configure --profile "$1"
|
||||
AWS_PAGER="" aws iam create-access-key
|
||||
AWS_PAGER="" aws configure --profile "$1"
|
||||
|
||||
echo You can now safely delete the old access key running \`aws iam delete-access-key --access-key-id ID\`
|
||||
echo Your current keys are:
|
||||
aws iam list-access-keys
|
||||
AWS_PAGER="" aws iam list-access-keys
|
||||
}
|
||||
|
||||
function aws_profiles() {
|
||||
|
|
@ -61,36 +62,45 @@ fi
|
|||
|
||||
# Load awscli completions
|
||||
|
||||
function _awscli-homebrew-installed() {
|
||||
# check if Homebrew is installed
|
||||
(( $+commands[brew] )) || return 1
|
||||
# AWS CLI v2 comes with its own autocompletion. Check if that is there, otherwise fall back
|
||||
if [[ -x /usr/local/bin/aws_completer ]]; then
|
||||
autoload -Uz bashcompinit && bashcompinit
|
||||
complete -C aws_completer aws
|
||||
else
|
||||
function _awscli-homebrew-installed() {
|
||||
# check if Homebrew is installed
|
||||
(( $+commands[brew] )) || return 1
|
||||
|
||||
# speculatively check default brew prefix
|
||||
if [ -h /usr/local/opt/awscli ]; then
|
||||
_brew_prefix=/usr/local/opt/awscli
|
||||
else
|
||||
# ok, it is not in the default prefix
|
||||
# this call to brew is expensive (about 400 ms), so at least let's make it only once
|
||||
_brew_prefix=$(brew --prefix awscli)
|
||||
# speculatively check default brew prefix
|
||||
if [ -h /usr/local/opt/awscli ]; then
|
||||
_brew_prefix=/usr/local/opt/awscli
|
||||
else
|
||||
# ok, it is not in the default prefix
|
||||
# this call to brew is expensive (about 400 ms), so at least let's make it only once
|
||||
_brew_prefix=$(brew --prefix awscli)
|
||||
fi
|
||||
}
|
||||
|
||||
# get aws_zsh_completer.sh location from $PATH
|
||||
_aws_zsh_completer_path="$commands[aws_zsh_completer.sh]"
|
||||
|
||||
# otherwise check common locations
|
||||
if [[ -z $_aws_zsh_completer_path ]]; then
|
||||
# Homebrew
|
||||
if _awscli-homebrew-installed; then
|
||||
_aws_zsh_completer_path=$_brew_prefix/libexec/bin/aws_zsh_completer.sh
|
||||
# Ubuntu
|
||||
elif [[ -e /usr/share/zsh/vendor-completions/_awscli ]]; then
|
||||
_aws_zsh_completer_path=/usr/share/zsh/vendor-completions/_awscli
|
||||
# NixOS
|
||||
elif [[ -e "${commands[aws]:P:h:h}/share/zsh/site-functions/aws_zsh_completer.sh" ]]; then
|
||||
_aws_zsh_completer_path="${commands[aws]:P:h:h}/share/zsh/site-functions/aws_zsh_completer.sh"
|
||||
# RPM
|
||||
else
|
||||
_aws_zsh_completer_path=/usr/share/zsh/site-functions/aws_zsh_completer.sh
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# get aws_zsh_completer.sh location from $PATH
|
||||
_aws_zsh_completer_path="$commands[aws_zsh_completer.sh]"
|
||||
|
||||
# otherwise check common locations
|
||||
if [[ -z $_aws_zsh_completer_path ]]; then
|
||||
# Homebrew
|
||||
if _awscli-homebrew-installed; then
|
||||
_aws_zsh_completer_path=$_brew_prefix/libexec/bin/aws_zsh_completer.sh
|
||||
# Ubuntu
|
||||
elif [[ -e /usr/share/zsh/vendor-completions/_awscli ]]; then
|
||||
_aws_zsh_completer_path=/usr/share/zsh/vendor-completions/_awscli
|
||||
# RPM
|
||||
else
|
||||
_aws_zsh_completer_path=/usr/share/zsh/site-functions/aws_zsh_completer.sh
|
||||
fi
|
||||
[[ -r $_aws_zsh_completer_path ]] && source $_aws_zsh_completer_path
|
||||
unset _aws_zsh_completer_path _brew_prefix
|
||||
fi
|
||||
|
||||
[[ -r $_aws_zsh_completer_path ]] && source $_aws_zsh_completer_path
|
||||
unset _aws_zsh_completer_path _brew_prefix
|
||||
|
|
|
|||
|
|
@ -11,22 +11,21 @@
|
|||
# Modified to add support for FreeBSD #
|
||||
###########################################
|
||||
|
||||
if [[ "$OSTYPE" = darwin* ]] ; then
|
||||
if [[ "$OSTYPE" = darwin* ]]; then
|
||||
|
||||
function battery_pct() {
|
||||
local smart_battery_status="$(ioreg -rc "AppleSmartBattery")"
|
||||
typeset -F maxcapacity=$(echo $smart_battery_status | grep '^.*"MaxCapacity"\ =\ ' | sed -e 's/^.*"MaxCapacity"\ =\ //')
|
||||
typeset -F currentcapacity=$(echo $smart_battery_status | grep '^.*"CurrentCapacity"\ =\ ' | sed -e 's/^.*CurrentCapacity"\ =\ //')
|
||||
integer i=$(((currentcapacity/maxcapacity) * 100))
|
||||
echo $i
|
||||
function battery_is_charging() {
|
||||
ioreg -rc AppleSmartBattery | command grep -q '^.*"ExternalConnected"\ =\ Yes'
|
||||
}
|
||||
|
||||
function plugged_in() {
|
||||
[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ Yes') -eq 1 ]
|
||||
function battery_pct() {
|
||||
local battery_status="$(ioreg -rc AppleSmartBattery)"
|
||||
local -i capacity=$(sed -n -e '/MaxCapacity/s/^.*"MaxCapacity"\ =\ //p' <<< $battery_status)
|
||||
local -i current=$(sed -n -e '/CurrentCapacity/s/^.*"CurrentCapacity"\ =\ //p' <<< $battery_status)
|
||||
echo $(( current * 100 / capacity ))
|
||||
}
|
||||
|
||||
function battery_pct_remaining() {
|
||||
if plugged_in ; then
|
||||
if battery_is_charging; then
|
||||
echo "External Power"
|
||||
else
|
||||
battery_pct
|
||||
|
|
@ -35,9 +34,9 @@ if [[ "$OSTYPE" = darwin* ]] ; then
|
|||
|
||||
function battery_time_remaining() {
|
||||
local smart_battery_status="$(ioreg -rc "AppleSmartBattery")"
|
||||
if [[ $(echo $smart_battery_status | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
|
||||
timeremaining=$(echo $smart_battery_status | grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //')
|
||||
if [ $timeremaining -gt 720 ] ; then
|
||||
if [[ $(echo $smart_battery_status | command grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]]; then
|
||||
timeremaining=$(echo $smart_battery_status | command grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //')
|
||||
if [ $timeremaining -gt 720 ]; then
|
||||
echo "::"
|
||||
else
|
||||
echo "~$((timeremaining / 60)):$((timeremaining % 60))"
|
||||
|
|
@ -48,39 +47,36 @@ if [[ "$OSTYPE" = darwin* ]] ; then
|
|||
}
|
||||
|
||||
function battery_pct_prompt () {
|
||||
if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
|
||||
b=$(battery_pct_remaining)
|
||||
if [ $b -gt 50 ] ; then
|
||||
local battery_pct color
|
||||
if ioreg -rc AppleSmartBattery | command grep -q '^.*"ExternalConnected"\ =\ No'; then
|
||||
battery_pct=$(battery_pct_remaining)
|
||||
if [[ $battery_pct -gt 50 ]]; then
|
||||
color='green'
|
||||
elif [ $b -gt 20 ] ; then
|
||||
elif [[ $battery_pct -gt 20 ]]; then
|
||||
color='yellow'
|
||||
else
|
||||
color='red'
|
||||
fi
|
||||
echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
|
||||
echo "%{$fg[$color]%}[${battery_pct}%%]%{$reset_color%}"
|
||||
else
|
||||
echo "∞"
|
||||
fi
|
||||
}
|
||||
|
||||
function battery_is_charging() {
|
||||
[[ $(ioreg -rc "AppleSmartBattery"| grep '^.*"IsCharging"\ =\ ' | sed -e 's/^.*"IsCharging"\ =\ //') == "Yes" ]]
|
||||
}
|
||||
|
||||
elif [[ "$OSTYPE" = freebsd* ]] ; then
|
||||
elif [[ "$OSTYPE" = freebsd* ]]; then
|
||||
|
||||
function battery_is_charging() {
|
||||
[[ $(sysctl -n hw.acpi.battery.state) -eq 2 ]]
|
||||
}
|
||||
|
||||
function battery_pct() {
|
||||
if (( $+commands[sysctl] )) ; then
|
||||
echo "$(sysctl -n hw.acpi.battery.life)"
|
||||
if (( $+commands[sysctl] )); then
|
||||
sysctl -n hw.acpi.battery.life
|
||||
fi
|
||||
}
|
||||
|
||||
function battery_pct_remaining() {
|
||||
if [ ! $(battery_is_charging) ] ; then
|
||||
if ! battery_is_charging; then
|
||||
battery_pct
|
||||
else
|
||||
echo "External Power"
|
||||
|
|
@ -88,45 +84,46 @@ elif [[ "$OSTYPE" = freebsd* ]] ; then
|
|||
}
|
||||
|
||||
function battery_time_remaining() {
|
||||
local remaining_time
|
||||
remaining_time=$(sysctl -n hw.acpi.battery.time)
|
||||
if [[ $remaining_time -ge 0 ]] ; then
|
||||
# calculation from https://www.unix.com/shell-programming-and-scripting/23695-convert-minutes-hours-minutes-seconds.html
|
||||
((hour=$remaining_time/60))
|
||||
((minute=$remaining_time-$hour*60))
|
||||
echo $hour:$minute
|
||||
if [[ $remaining_time -ge 0 ]]; then
|
||||
((hour = $remaining_time / 60 ))
|
||||
((minute = $remaining_time % 60 ))
|
||||
printf %02d:%02d $hour $minute
|
||||
fi
|
||||
}
|
||||
|
||||
function battery_pct_prompt() {
|
||||
b=$(battery_pct_remaining)
|
||||
if [ ! $(battery_is_charging) ] ; then
|
||||
if [ $b -gt 50 ] ; then
|
||||
local battery_pct color
|
||||
battery_pct=$(battery_pct_remaining)
|
||||
if battery_is_charging; then
|
||||
echo "∞"
|
||||
else
|
||||
if [[ $battery_pct -gt 50 ]]; then
|
||||
color='green'
|
||||
elif [ $b -gt 20 ] ; then
|
||||
elif [[ $battery_pct -gt 20 ]]; then
|
||||
color='yellow'
|
||||
else
|
||||
color='red'
|
||||
fi
|
||||
echo "%{$fg[$color]%}$(battery_pct_remaining)%%%{$reset_color%}"
|
||||
else
|
||||
echo "∞"
|
||||
echo "%{$fg[$color]%}${battery_pct}%%%{$reset_color%}"
|
||||
fi
|
||||
}
|
||||
|
||||
elif [[ "$OSTYPE" = linux* ]] ; then
|
||||
elif [[ "$OSTYPE" = linux* ]]; then
|
||||
|
||||
function battery_is_charging() {
|
||||
! [[ $(acpi 2>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]]
|
||||
! acpi 2>/dev/null | command grep -v "rate information unavailable" | command grep -q '^Battery.*Discharging'
|
||||
}
|
||||
|
||||
function battery_pct() {
|
||||
if (( $+commands[acpi] )) ; then
|
||||
echo "$(acpi 2>/dev/null | cut -f2 -d ',' | tr -cd '[:digit:]')"
|
||||
if (( $+commands[acpi] )); then
|
||||
acpi 2>/dev/null | command grep -v "rate information unavailable" | command grep -E '^Battery.*(Full|(Disc|C)harging)' | cut -f2 -d ',' | tr -cd '[:digit:]'
|
||||
fi
|
||||
}
|
||||
|
||||
function battery_pct_remaining() {
|
||||
if [ ! $(battery_is_charging) ] ; then
|
||||
if ! battery_is_charging; then
|
||||
battery_pct
|
||||
else
|
||||
echo "External Power"
|
||||
|
|
@ -134,76 +131,81 @@ elif [[ "$OSTYPE" = linux* ]] ; then
|
|||
}
|
||||
|
||||
function battery_time_remaining() {
|
||||
if [[ $(acpi 2>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
|
||||
echo $(acpi 2>/dev/null | cut -f3 -d ',')
|
||||
if ! battery_is_charging; then
|
||||
acpi 2>/dev/null | command grep -v "rate information unavailable" | cut -f3 -d ','
|
||||
fi
|
||||
}
|
||||
|
||||
function battery_pct_prompt() {
|
||||
b=$(battery_pct_remaining)
|
||||
if [[ $(acpi 2>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
|
||||
if [ $b -gt 50 ] ; then
|
||||
local battery_pct color
|
||||
battery_pct=$(battery_pct_remaining)
|
||||
if battery_is_charging; then
|
||||
echo "∞"
|
||||
else
|
||||
if [[ $battery_pct -gt 50 ]]; then
|
||||
color='green'
|
||||
elif [ $b -gt 20 ] ; then
|
||||
elif [[ $battery_pct -gt 20 ]]; then
|
||||
color='yellow'
|
||||
else
|
||||
color='red'
|
||||
fi
|
||||
echo "%{$fg[$color]%}$(battery_pct_remaining)%%%{$reset_color%}"
|
||||
else
|
||||
echo "∞"
|
||||
echo "%{$fg[$color]%}${battery_pct}%%%{$reset_color%}"
|
||||
fi
|
||||
}
|
||||
|
||||
else
|
||||
# Empty functions so we don't cause errors in prompts
|
||||
function battery_pct_remaining() {
|
||||
}
|
||||
|
||||
function battery_time_remaining() {
|
||||
}
|
||||
|
||||
function battery_pct_prompt() {
|
||||
}
|
||||
function battery_is_charging { false }
|
||||
function battery_pct \
|
||||
battery_pct_remaining \
|
||||
battery_time_remaining \
|
||||
battery_pct_prompt { }
|
||||
fi
|
||||
|
||||
function battery_level_gauge() {
|
||||
local gauge_slots=${BATTERY_GAUGE_SLOTS:-10};
|
||||
local green_threshold=${BATTERY_GREEN_THRESHOLD:-6};
|
||||
local yellow_threshold=${BATTERY_YELLOW_THRESHOLD:-4};
|
||||
local color_green=${BATTERY_COLOR_GREEN:-%F{green}};
|
||||
local color_yellow=${BATTERY_COLOR_YELLOW:-%F{yellow}};
|
||||
local color_red=${BATTERY_COLOR_RED:-%F{red}};
|
||||
local color_reset=${BATTERY_COLOR_RESET:-%{%f%k%b%}};
|
||||
local battery_prefix=${BATTERY_GAUGE_PREFIX:-'['};
|
||||
local battery_suffix=${BATTERY_GAUGE_SUFFIX:-']'};
|
||||
local filled_symbol=${BATTERY_GAUGE_FILLED_SYMBOL:-'▶'};
|
||||
local empty_symbol=${BATTERY_GAUGE_EMPTY_SYMBOL:-'▷'};
|
||||
local charging_color=${BATTERY_CHARGING_COLOR:-$color_yellow};
|
||||
local charging_symbol=${BATTERY_CHARGING_SYMBOL:-'⚡'};
|
||||
local gauge_slots=${BATTERY_GAUGE_SLOTS:-10}
|
||||
local green_threshold=${BATTERY_GREEN_THRESHOLD:-$(( gauge_slots * 0.6 ))}
|
||||
local yellow_threshold=${BATTERY_YELLOW_THRESHOLD:-$(( gauge_slots * 0.4 ))}
|
||||
local color_green=${BATTERY_COLOR_GREEN:-%F{green}}
|
||||
local color_yellow=${BATTERY_COLOR_YELLOW:-%F{yellow}}
|
||||
local color_red=${BATTERY_COLOR_RED:-%F{red}}
|
||||
local color_reset=${BATTERY_COLOR_RESET:-%{%f%k%b%}}
|
||||
local battery_prefix=${BATTERY_GAUGE_PREFIX:-'['}
|
||||
local battery_suffix=${BATTERY_GAUGE_SUFFIX:-']'}
|
||||
local filled_symbol=${BATTERY_GAUGE_FILLED_SYMBOL:-'▶'}
|
||||
local empty_symbol=${BATTERY_GAUGE_EMPTY_SYMBOL:-'▷'}
|
||||
local charging_color=${BATTERY_CHARGING_COLOR:-$color_yellow}
|
||||
local charging_symbol=${BATTERY_CHARGING_SYMBOL:-'⚡'}
|
||||
|
||||
local battery_remaining_percentage=$(battery_pct);
|
||||
local battery_remaining_percentage=$(battery_pct)
|
||||
local filled empty gauge_color
|
||||
|
||||
if [[ $battery_remaining_percentage =~ [0-9]+ ]]; then
|
||||
local filled=$(((( $battery_remaining_percentage + $gauge_slots - 1) / $gauge_slots)));
|
||||
local empty=$(($gauge_slots - $filled));
|
||||
filled=$(( ($battery_remaining_percentage * $gauge_slots) / 100 ))
|
||||
empty=$(( $gauge_slots - $filled ))
|
||||
|
||||
if [[ $filled -gt $green_threshold ]]; then local gauge_color=$color_green;
|
||||
elif [[ $filled -gt $yellow_threshold ]]; then local gauge_color=$color_yellow;
|
||||
else local gauge_color=$color_red;
|
||||
if [[ $filled -gt $green_threshold ]]; then
|
||||
gauge_color=$color_green
|
||||
elif [[ $filled -gt $yellow_threshold ]]; then
|
||||
gauge_color=$color_yellow
|
||||
else
|
||||
gauge_color=$color_red
|
||||
fi
|
||||
else
|
||||
local filled=$gauge_slots;
|
||||
local empty=0;
|
||||
filled_symbol=${BATTERY_UNKNOWN_SYMBOL:-'.'};
|
||||
filled=$gauge_slots
|
||||
empty=0
|
||||
filled_symbol=${BATTERY_UNKNOWN_SYMBOL:-'.'}
|
||||
fi
|
||||
|
||||
local charging=' ' && battery_is_charging && charging=$charging_symbol;
|
||||
local charging=' '
|
||||
battery_is_charging && charging=$charging_symbol
|
||||
|
||||
printf ${charging_color//\%/\%\%}$charging${color_reset//\%/\%\%}${battery_prefix//\%/\%\%}${gauge_color//\%/\%\%}
|
||||
printf ${filled_symbol//\%/\%\%}'%.0s' {1..$filled}
|
||||
# Charging status and prefix
|
||||
print -n ${charging_color}${charging}${color_reset}${battery_prefix}${gauge_color}
|
||||
# Filled slots
|
||||
[[ $filled -gt 0 ]] && printf ${filled_symbol//\%/\%\%}'%.0s' {1..$filled}
|
||||
# Empty slots
|
||||
[[ $filled -lt $gauge_slots ]] && printf ${empty_symbol//\%/\%\%}'%.0s' {1..$empty}
|
||||
printf ${color_reset//\%/\%\%}${battery_suffix//\%/\%\%}${color_reset//\%/\%\%}
|
||||
# Suffix
|
||||
print -n ${color_reset}${battery_suffix}${color_reset}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
5
plugins/bazel/README.md
Normal file
5
plugins/bazel/README.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
## Bazel autocomplete plugin
|
||||
|
||||
A copy of the completion script from the
|
||||
[bazelbuild/bazel](https://github.com/bazelbuild/bazel/master/scripts/zsh_completion/_bazel)
|
||||
git repo.
|
||||
341
plugins/bazel/_bazel
Normal file
341
plugins/bazel/_bazel
Normal file
|
|
@ -0,0 +1,341 @@
|
|||
#compdef bazel
|
||||
|
||||
# Copyright 2015 The Bazel Authors. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Installation
|
||||
# ------------
|
||||
#
|
||||
# 1. Add this script to a directory on your $fpath:
|
||||
# fpath[1,0]=~/.zsh/completion/
|
||||
# mkdir -p ~/.zsh/completion/
|
||||
# cp scripts/zsh_completion/_bazel ~/.zsh/completion
|
||||
#
|
||||
# 2. Optionally, add the following to your .zshrc.
|
||||
# zstyle ':completion:*' use-cache on
|
||||
# zstyle ':completion:*' cache-path ~/.zsh/cache
|
||||
#
|
||||
# This way, the completion script does not have to parse Bazel's options
|
||||
# repeatedly. The directory in cache-path must be created manually.
|
||||
#
|
||||
# 3. Restart the shell
|
||||
#
|
||||
# Options
|
||||
# -------
|
||||
# completion:init:bazel:* cache-lifetime
|
||||
# Lifetime for the completion cache (if turned on, default: 1 week)
|
||||
|
||||
local curcontext="$curcontext" state line
|
||||
|
||||
: ${BAZEL_COMPLETION_PACKAGE_PATH:=%workspace%}
|
||||
: ${BAZEL:=bazel}
|
||||
_bazel_b() { ${BAZEL} --noblock_for_lock "$@" 2>/dev/null; }
|
||||
|
||||
# Default cache lifetime is 1 week
|
||||
zstyle -s ":completion:${curcontext}:" cache-lifetime lifetime
|
||||
if [[ -z "${lifetime}" ]]; then
|
||||
lifetime=$((60*60*24*7))
|
||||
fi
|
||||
|
||||
_bazel_cache_policy() {
|
||||
local -a oldp
|
||||
oldp=( "$1"(Nms+${lifetime}) )
|
||||
(( $#oldp ))
|
||||
}
|
||||
|
||||
_set_cache_policy() {
|
||||
zstyle -s ":completion:*:$curcontext*" cache-policy update_policy
|
||||
|
||||
if [[ -z "$update_policy" ]]; then
|
||||
zstyle ":completion:$curcontext*" cache-policy _bazel_cache_policy
|
||||
fi
|
||||
}
|
||||
|
||||
# Skips over all global arguments. After invocation, OFFSET contains the
|
||||
# position of the bazel command in $words.
|
||||
_adapt_subcommand_offset() {
|
||||
OFFSET=2
|
||||
for w in ${words[2,-1]}; do
|
||||
if [[ $w == (#b)-* ]]; then
|
||||
(( OFFSET++ ))
|
||||
else
|
||||
return
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Retrieve the cache but also check that the value is not empty.
|
||||
_bazel_safe_retrieve_cache() {
|
||||
_retrieve_cache $1 && [[ ${(P)#2} -gt 0 ]]
|
||||
}
|
||||
|
||||
# Puts the name of the variable that contains the options for the bazel
|
||||
# subcommand handed in as the first argument into the global variable
|
||||
# _bazel_cmd_options.
|
||||
_bazel_get_options() {
|
||||
local lcmd=$1
|
||||
_bazel_cmd_options=_bazel_${lcmd}_options
|
||||
_bazel_cmd_args=_bazel_${lcmd}_args
|
||||
if [[ ${(P)#_bazel_cmd_options} != 0 ]]; then
|
||||
return
|
||||
fi
|
||||
if _cache_invalid BAZEL_${lcmd}_options || _cache_invalid BAZEL_${lcmd}_args \
|
||||
|| ! _bazel_safe_retrieve_cache BAZEL_${lcmd}_options ${_bazel_cmd_options} \
|
||||
|| ! _retrieve_cache BAZEL_${lcmd}_args ${_bazel_cmd_args}; then
|
||||
if ! eval "$(_bazel_b help completion)"; then
|
||||
return
|
||||
fi
|
||||
local opts_var
|
||||
if [[ $lcmd == "startup_options" ]]; then
|
||||
opts_var="BAZEL_STARTUP_OPTIONS"
|
||||
else
|
||||
opts_var="BAZEL_COMMAND_${lcmd:u}_FLAGS"
|
||||
fi
|
||||
local -a raw_options
|
||||
if ! eval "raw_options=(\${(@f)$opts_var})"; then
|
||||
return
|
||||
fi
|
||||
|
||||
local -a option_list
|
||||
for opt in $raw_options; do
|
||||
case $opt in
|
||||
--*"={"*)
|
||||
local lst="${${opt##*"={"}%"}"}"
|
||||
local opt="${opt%%=*}="
|
||||
option_list+=("${opt}:string:_values '' ${lst//,/ }") ;;
|
||||
--*=path)
|
||||
option_list+=("${opt%path}:path:_files") ;;
|
||||
--*=label)
|
||||
option_list+=("${opt%label}:target:_bazel_complete_target") ;;
|
||||
--*=*)
|
||||
option_list+=("${opt}:string:") ;;
|
||||
*)
|
||||
option_list+=("$opt") ;;
|
||||
esac
|
||||
done
|
||||
|
||||
local -a cmd_args
|
||||
local cmd_type
|
||||
if eval "cmd_type=\${BAZEL_COMMAND_${lcmd:u}_ARGUMENT}" && [[ -n $cmd_type ]]; then
|
||||
case $cmd_type in
|
||||
label|label-*)
|
||||
cmd_args+=("*::${cmd_type}:_bazel_complete_target_${cmd_type//-/_}") ;;
|
||||
info-key)
|
||||
cmd_args+=('1::key:_bazel_info_key') ;;
|
||||
path)
|
||||
cmd_args+=('1::profile:_path_files') ;;
|
||||
"command|{"*"}")
|
||||
local lst=${${cmd_type#"command|{"}%"}"}
|
||||
cmd_args+=("1::topic:_bazel_help_topic -- ${lst//,/ }") ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
typeset -g "${_bazel_cmd_options}"="${(pj:|:)option_list[*]}"
|
||||
_store_cache BAZEL_${lcmd}_options ${_bazel_cmd_options}
|
||||
typeset -g "${_bazel_cmd_args}"="${(pj:|:)cmd_args[*]}"
|
||||
_store_cache BAZEL_${lcmd}_args ${_bazel_cmd_args}
|
||||
fi
|
||||
}
|
||||
|
||||
_get_build_targets() {
|
||||
local pkg=$1
|
||||
local rule_re
|
||||
typeset -a completions
|
||||
case $target_type in
|
||||
test)
|
||||
rule_re=".*_test"
|
||||
;;
|
||||
build)
|
||||
rule_re=".*"
|
||||
;;
|
||||
bin)
|
||||
rule_re=".*_test|.*_binary"
|
||||
;;
|
||||
esac
|
||||
completions=(${$(_bazel_b query "kind(\"${rule_re}\", ${pkg}:all)" 2>/dev/null)##*:})
|
||||
if ( (( ${#completions} > 0 )) && [[ $target_type != run ]] ); then
|
||||
completions+=(all)
|
||||
fi
|
||||
echo ${completions[*]}
|
||||
}
|
||||
|
||||
# Returns all packages that match $PREFIX. PREFIX may start with //, in which
|
||||
# case the workspace roots are searched. Otherwise, they are completed based on
|
||||
# PWD.
|
||||
_get_build_packages() {
|
||||
local workspace pfx
|
||||
typeset -a package_roots paths final_paths
|
||||
workspace=$PWD
|
||||
package_roots=(${(ps.:.)BAZEL_COMPLETION_PACKAGE_PATH})
|
||||
package_roots=(${^package_roots//\%workspace\%/$workspace})
|
||||
if [[ "${(e)PREFIX}" == //* ]]; then
|
||||
pfx=${(e)PREFIX[2,-1]}
|
||||
else
|
||||
pfx=${(e)PREFIX}
|
||||
fi
|
||||
paths=(${^package_roots}/${pfx}*(/))
|
||||
for p in ${paths[*]}; do
|
||||
if [[ -f ${p}/BUILD || -f ${p}/BUILD.bazel ]]; then
|
||||
final_paths+=(${p##*/}:)
|
||||
fi
|
||||
final_paths+=(${p##*/}/)
|
||||
done
|
||||
echo ${final_paths[*]}
|
||||
}
|
||||
|
||||
_package_remove_slash() {
|
||||
if [[ $KEYS == ':' && $LBUFFER == */ ]]; then
|
||||
LBUFFER=${LBUFFER[1,-2]}
|
||||
fi
|
||||
}
|
||||
|
||||
# Completion function for BUILD targets, called by the completion system.
|
||||
_bazel_complete_target() {
|
||||
local expl
|
||||
typeset -a packages targets
|
||||
if [[ "${(e)PREFIX}" != *:* ]]; then
|
||||
# There is no : in the prefix, completion can be either
|
||||
# a package or a target, if the cwd is a package itself.
|
||||
if [[ -f $PWD/BUILD || -f $PWD/BUILD.bazel ]]; then
|
||||
targets=($(_get_build_targets ""))
|
||||
_description build_target expl "BUILD target"
|
||||
compadd "${expl[@]}" -a targets
|
||||
fi
|
||||
packages=($(_get_build_packages))
|
||||
_description build_package expl "BUILD package"
|
||||
# Chop of the leading path segments from the prefix for display.
|
||||
compset -P '*/'
|
||||
compadd -R _package_remove_slash -S '' "${expl[@]}" -a packages
|
||||
else
|
||||
targets=($(_get_build_targets "${${(e)PREFIX}%:*}"))
|
||||
_description build_target expl "BUILD target"
|
||||
# Ignore the current prefix for the upcoming completion, since we only list
|
||||
# the names of the targets, not the full path.
|
||||
compset -P '*:'
|
||||
compadd "${expl[@]}" -a targets
|
||||
fi
|
||||
}
|
||||
|
||||
_bazel_complete_target_label() {
|
||||
typeset -g target_type=build
|
||||
_bazel_complete_target
|
||||
}
|
||||
|
||||
_bazel_complete_target_label_test() {
|
||||
typeset -g target_type=test
|
||||
_bazel_complete_target
|
||||
}
|
||||
|
||||
_bazel_complete_target_label_bin() {
|
||||
typeset -g target_type=bin
|
||||
_bazel_complete_target
|
||||
}
|
||||
|
||||
### Actual completion commands
|
||||
|
||||
_bazel() {
|
||||
_adapt_subcommand_offset
|
||||
if (( CURRENT - OFFSET > 0 )); then
|
||||
# Remember the subcommand name, stored globally so we can access it
|
||||
# from any subsequent function
|
||||
cmd=${words[OFFSET]//-/_}
|
||||
|
||||
# Set the context for the subcommand.
|
||||
curcontext="${curcontext%:*:*}:bazel-$cmd:"
|
||||
_set_cache_policy
|
||||
|
||||
# Narrow the range of words we are looking at to exclude cmd
|
||||
# name and any leading options
|
||||
(( CURRENT = CURRENT - OFFSET + 1 ))
|
||||
shift $((OFFSET - 1)) words
|
||||
# Run the completion for the subcommand
|
||||
_bazel_get_options $cmd
|
||||
_arguments : \
|
||||
${(Pps:|:)_bazel_cmd_options} \
|
||||
${(Pps:|:)_bazel_cmd_args}
|
||||
else
|
||||
_set_cache_policy
|
||||
# Start special handling for global options,
|
||||
# which can be retrieved by calling
|
||||
# $ bazel help startup_options
|
||||
_bazel_get_options startup_options
|
||||
_arguments : \
|
||||
${(Pps:|:)_bazel_cmd_options} \
|
||||
"*:commands:_bazel_commands"
|
||||
fi
|
||||
return
|
||||
}
|
||||
|
||||
_get_commands() {
|
||||
# bazel_cmd_list is a global (g) array (a)
|
||||
typeset -ga _bazel_cmd_list
|
||||
# Use `bazel help` instead of `bazel help completion` to get command
|
||||
# descriptions.
|
||||
if _bazel_cmd_list=("${(@f)$(_bazel_b help | awk '
|
||||
/Available commands/ { command=1; }
|
||||
/ [-a-z]+[ \t]+.+/ { if (command) { printf "%s:", $1; for (i=2; i<=NF; i++) printf "%s ", $i; print "" } }
|
||||
/^$/ { command=0; }')}"); then
|
||||
_store_cache BAZEL_commands _bazel_cmd_list
|
||||
fi
|
||||
}
|
||||
|
||||
# Completion function for bazel subcommands, called by the completion system.
|
||||
_bazel_commands() {
|
||||
if [[ ${#_bazel_cmd_list} == 0 ]]; then
|
||||
if _cache_invalid BAZEL_commands \
|
||||
|| ! _bazel_safe_retrieve_cache BAZEL_commands _bazel_cmd_list; then
|
||||
_get_commands
|
||||
fi
|
||||
fi
|
||||
|
||||
_describe -t bazel-commands 'Bazel command' _bazel_cmd_list
|
||||
}
|
||||
|
||||
# Completion function for bazel help options, called by the completion system.
|
||||
_bazel_help_topic() {
|
||||
if [[ ${#_bazel_cmd_list} == 0 ]]; then
|
||||
if _cache_invalid BAZEL_commands \
|
||||
|| ! _bazel_safe_retrieve_cache BAZEL_commands _bazel_cmd_list; then
|
||||
_get_commands
|
||||
fi
|
||||
fi
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
if [[ $1 == -- ]]; then
|
||||
shift
|
||||
break
|
||||
fi
|
||||
shift
|
||||
done
|
||||
_bazel_help_list=($@)
|
||||
_bazel_help_list+=($_bazel_cmd_list)
|
||||
_describe -t bazel-help 'Help topic' _bazel_help_list
|
||||
}
|
||||
|
||||
# Completion function for bazel info keys, called by the completion system.
|
||||
_bazel_info_key() {
|
||||
if [[ ${#_bazel_info_keys_list} == 0 ]]; then
|
||||
if _cache_invalid BAZEL_info_keys \
|
||||
|| ! _bazel_safe_retrieve_cache BAZEL_info_keys _bazel_info_keys_list; then
|
||||
typeset -ga _bazel_info_keys_list
|
||||
# Use `bazel help` instead of `bazel help completion` to get info-key
|
||||
# descriptions.
|
||||
if _bazel_info_keys_list=("${(@f)$(_bazel_b help info-keys | awk '
|
||||
{ printf "%s:", $1; for (i=2; i<=NF; i++) printf "%s ", $i; print "" }')}"); then
|
||||
_store_cache BAZEL_info_keys _bazel_info_keys_list
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
_describe -t bazel-info 'Key' _bazel_info_keys_list
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@ This plugin adds completion for [Bower](https://bower.io/) and a few useful alia
|
|||
|
||||
To use it, add `bower` to the plugins array in your zshrc file:
|
||||
|
||||
```
|
||||
```zsh
|
||||
plugins=(... bower)
|
||||
```
|
||||
|
||||
|
|
@ -15,4 +15,3 @@ plugins=(... bower)
|
|||
| bi | `bower install` | Installs the project dependencies listed in bower.json |
|
||||
| bl | `bower list` | List local packages and possible updates |
|
||||
| bs | `bower search` | Finds all packages or a specific package. |
|
||||
|
||||
|
|
|
|||
|
|
@ -3,19 +3,27 @@
|
|||
The plugin adds several aliases for common [brew](https://brew.sh) commands.
|
||||
|
||||
To use it, add `brew` to the plugins array of your zshrc file:
|
||||
```
|
||||
|
||||
```zsh
|
||||
plugins=(... brew)
|
||||
```
|
||||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command | Description |
|
||||
|--------|----------------------|---------------|
|
||||
| brewp | `brew pin` | Pin a specified formulae, preventing them from being upgraded when issuing the brew upgrade <formulae> command. |
|
||||
| brews | `brew list -1` | List installed formulae, one entry per line, or the installed files for a given formulae. |
|
||||
| brewsp | `brew list --pinned` | Show the versions of pinned formulae, or only the specified (pinned) formulae if formulae are given. |
|
||||
| bubo | `brew update && brew outdated` | Fetch the newest version of Homebrew and all formulae, then list outdated formulae. |
|
||||
| bubc | `brew upgrade && brew cleanup` | Upgrade outdated, unpinned brews (with existing install options), then removes stale lock files and outdated downloads for formulae and casks, and removes old versions of installed formulae. |
|
||||
| bubu | `bubo && bubc` | Updates Homebrew, lists outdated formulae, upgrades oudated and unpinned formulae, and removes stale and outdated downloads and versions. |
|
||||
| bcubo | `brew update && brew cask outdated` | Fetch the newest version of Homebrew and all formulae, then list outdated casks. |
|
||||
| bcubc | `brew cask reinstall $(brew cask outdated) && brew cleanup` | Updates outdated casks, then runs cleanup. |
|
||||
| Alias | Command | Description |
|
||||
|----------|-------------------------------------------------------------|---------------------------------------------------------------------|
|
||||
| `brewp` | `brew pin` | Pin a specified formula so that it's not upgraded. |
|
||||
| `brews` | `brew list -1` | List installed formulae or the installed files for a given formula. |
|
||||
| `brewsp` | `brew list --pinned` | List pinned formulae, or show the version of a given formula. |
|
||||
| `bubo` | `brew update && brew outdated` | Update Homebrew and all formulae, then list outdated formulae. |
|
||||
| `bubc` | `brew upgrade && brew cleanup` | Upgrade outdated formulae, then run cleanup. |
|
||||
| `bubu` | `bubo && bubc` | Do the last two operations above. |
|
||||
| `bcubo` | `brew update && brew cask outdated` | Update Homebrew and alll formulae, then list outdated casks. |
|
||||
| `bcubc` | `brew cask reinstall $(brew cask outdated) && brew cleanup` | Update outdated casks, then run cleanup. |
|
||||
|
||||
## Completion
|
||||
|
||||
With the release of Homebrew 1.0, they decided to bundle the zsh completion as part of the
|
||||
brew installation, so we no longer ship it with the brew plugin; now it only has brew
|
||||
aliases. If you find that brew completion no longer works, make sure you have your Homebrew
|
||||
installation fully up to date.
|
||||
|
|
|
|||
|
|
@ -6,19 +6,3 @@ alias bubc='brew upgrade && brew cleanup'
|
|||
alias bubu='bubo && bubc'
|
||||
alias bcubo='brew update && brew cask outdated'
|
||||
alias bcubc='brew cask reinstall $(brew cask outdated) && brew cleanup'
|
||||
|
||||
if command mkdir "$ZSH_CACHE_DIR/.brew-completion-message" 2>/dev/null; then
|
||||
print -P '%F{yellow}'Oh My Zsh brew plugin:
|
||||
cat <<-'EOF'
|
||||
|
||||
With the advent of their 1.0 release, Homebrew has decided to bundle
|
||||
the zsh completion as part of the brew installation, so we no longer
|
||||
ship it with the brew plugin; now it only has brew aliases.
|
||||
|
||||
If you find that brew completion no longer works, make sure you have
|
||||
your Homebrew installation fully up to date.
|
||||
|
||||
You will only see this message once.
|
||||
EOF
|
||||
print -P '%f'
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
# Bundler
|
||||
|
||||
- adds completion for basic bundler commands
|
||||
- adds short aliases for common bundler commands
|
||||
- Adds completion for basic bundler commands
|
||||
|
||||
- Adds short aliases for common bundler commands
|
||||
- `ba` aliased to `bundle add`
|
||||
- `be` aliased to `bundle exec`.
|
||||
It also supports aliases (if `rs` is `rails server`, `be rs` will bundle-exec `rails server`).
|
||||
- `bl` aliased to `bundle list`
|
||||
|
|
@ -10,9 +12,12 @@
|
|||
- `bout` aliased to `bundle outdated`
|
||||
- `bu` aliased to `bundle update`
|
||||
- `bi` aliased to `bundle install --jobs=<cpu core count>` (only for bundler `>= 1.4.0`)
|
||||
- adds a wrapper for common gems:
|
||||
- looks for a binstub under `./bin/` and executes it (if present)
|
||||
- calls `bundle exec <gem executable>` otherwise
|
||||
- `bcn` aliased to `bundle clean`
|
||||
- `bck` aliased to `bundle check`
|
||||
|
||||
- Adds a wrapper for common gems:
|
||||
- Looks for a binstub under `./bin/` and executes it (if present)
|
||||
- Calls `bundle exec <gem executable>` otherwise
|
||||
|
||||
Common gems wrapped by default (by name of the executable):
|
||||
`annotate`, `cap`, `capify`, `cucumber`, `foodcritic`, `guard`, `hanami`, `irb`, `jekyll`, `kitchen`, `knife`, `middleman`, `nanoc`, `pry`, `puma`, `rackup`, `rainbows`, `rake`, `rspec`, `rubocop`, `shotgun`, `sidekiq`, `spec`, `spork`, `spring`, `strainer`, `tailor`, `taps`, `thin`, `thor`, `unicorn` and `unicorn_rails`.
|
||||
|
|
@ -24,25 +29,29 @@ Please use the exact name of the executable and not the gem name.
|
|||
### Add additional gems to be wrapped
|
||||
|
||||
Add this before the plugin-list in your `.zshrc`:
|
||||
|
||||
```sh
|
||||
BUNDLED_COMMANDS=(rubocop)
|
||||
plugins=(... bundler ...)
|
||||
```
|
||||
|
||||
This will add the wrapper for the `rubocop` gem (i.e. the executable).
|
||||
|
||||
|
||||
### Exclude gems from being wrapped
|
||||
|
||||
Add this before the plugin-list in your `.zshrc`:
|
||||
|
||||
```sh
|
||||
UNBUNDLED_COMMANDS=(foreman spin)
|
||||
plugins=(... bundler ...)
|
||||
```
|
||||
|
||||
This will exclude the `foreman` and `spin` gems (i.e. their executable) from being wrapped.
|
||||
|
||||
## Excluded gems
|
||||
|
||||
These gems should not be called with `bundle exec`. Please see [issue #2923](https://github.com/robbyrussell/oh-my-zsh/pull/2923) on GitHub for clarification.
|
||||
These gems should not be called with `bundle exec`. Please see [issue #2923](https://github.com/ohmyzsh/ohmyzsh/pull/2923) on GitHub for clarification.
|
||||
|
||||
`berks`
|
||||
`foreman`
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
alias ba="bundle add"
|
||||
alias be="bundle exec"
|
||||
alias bl="bundle list"
|
||||
alias bp="bundle package"
|
||||
|
|
@ -6,6 +7,7 @@ alias bout="bundle outdated"
|
|||
alias bu="bundle update"
|
||||
alias bi="bundle_install"
|
||||
alias bcn="bundle clean"
|
||||
alias bck="bundle check"
|
||||
|
||||
bundled_commands=(
|
||||
annotate
|
||||
|
|
|
|||
|
|
@ -10,6 +10,6 @@ plugins=(... cake)
|
|||
|
||||
## Note
|
||||
|
||||
This plugin generates a cache file of the cake tasks found, named `.cake_task_cache`, in the current working directory.
|
||||
This plugin generates a cache file of the cake tasks found, named `.cake_task_cache`, in the current working directory.
|
||||
It is regenerated when the Cakefile is newer than the cache file. It is advised that you add the cake file to your
|
||||
`.gitignore` files.
|
||||
|
|
|
|||
|
|
@ -2,28 +2,16 @@
|
|||
|
||||
Plugin for displaying images on the terminal using the the `catimg.sh` script provided by [posva](https://github.com/posva/catimg)
|
||||
|
||||
To use it, add `catimg` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... catimg)
|
||||
```
|
||||
|
||||
## Requirements
|
||||
|
||||
- `convert` (ImageMagick)
|
||||
|
||||
## Enabling the plugin
|
||||
|
||||
1. Open your `.zshrc` file and add `catimg` in the plugins section:
|
||||
|
||||
```zsh
|
||||
plugins=(
|
||||
# all your enabled plugins
|
||||
catimg
|
||||
)
|
||||
```
|
||||
|
||||
2. Reload the source file or restart your Terminal session:
|
||||
|
||||
```console
|
||||
$ source ~/.zshrc
|
||||
$
|
||||
```
|
||||
|
||||
## Functions
|
||||
|
||||
| Function | Description |
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# chucknorris
|
||||
|
||||
Chuck Norris fortunes plugin for oh-my-zsh
|
||||
Chuck Norris fortunes plugin for oh-my-zsh. Perfectly suitable as MOTD.
|
||||
|
||||
**Maintainers**: [apjanke](https://github.com/apjanke) [maff](https://github.com/maff)
|
||||
|
||||
|
|
@ -10,11 +10,31 @@ To use it add `chucknorris` to the plugins array in you zshrc file.
|
|||
plugins=(... chucknorris)
|
||||
```
|
||||
|
||||
|
||||
Depends on fortune (and cowsay if using chuck_cow) being installed (available via homebrew, apt, ...). Perfectly suitable as MOTD.
|
||||
|
||||
## Usage
|
||||
|
||||
| Command | Description |
|
||||
| ----------- | ------------------------------- |
|
||||
| `chuck` | Print random Chuck Norris quote |
|
||||
| `chuck_cow` | Print quote in cowthink |
|
||||
|
||||
Example: output of `chuck_cow`:
|
||||
|
||||
```
|
||||
Last login: Fri Jan 30 23:12:26 on ttys001
|
||||
______________________________________
|
||||
( When Chuck Norris plays Monopoly, it )
|
||||
( affects the actual world economy. )
|
||||
--------------------------------------
|
||||
o ^__^
|
||||
o (oo)\_______
|
||||
(__)\ )\/\
|
||||
||----w |
|
||||
|| ||
|
||||
```
|
||||
|
||||
## Requirements
|
||||
|
||||
- `fortune`
|
||||
- `cowsay` if using `chuck_cow`
|
||||
|
||||
Available via homebrew, apt, ...
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
To use it, add `cloudapp` to the plugins array of your `~/.zshrc` file:
|
||||
|
||||
```
|
||||
plugins=(... dash)
|
||||
```zsh
|
||||
plugins=(... cloudapp)
|
||||
```
|
||||
|
||||
## Requirements
|
||||
|
|
|
|||
8
plugins/codeclimate/README.md
Normal file
8
plugins/codeclimate/README.md
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# codeclimate plugin
|
||||
|
||||
This plugin adds autocompletion for the [`codeclimate` CLI](https://github.com/codeclimate/codeclimate).
|
||||
|
||||
To use it, add `codeclimate` to the plugins array in your zshrc file:
|
||||
```zsh
|
||||
plugins=(... codeclimate)
|
||||
```
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
## Coffeescript Plugin
|
||||
# Coffeescript Plugin
|
||||
|
||||
This plugin provides aliases for quickly compiling and previewing your
|
||||
coffeescript code.
|
||||
|
|
|
|||
|
|
@ -8,6 +8,9 @@ To use it, add `colored-man-pages` to the plugins array in your zshrc file:
|
|||
plugins=(... colored-man-pages)
|
||||
```
|
||||
|
||||
It will also automatically colorize man pages displayed by `dman` or `debman`,
|
||||
from [`debian-goodies`](https://packages.debian.org/stable/debian-goodies).
|
||||
|
||||
You can also try to color other pages by prefixing the respective command with `colored`:
|
||||
|
||||
```zsh
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ EOF
|
|||
fi
|
||||
|
||||
function colored() {
|
||||
env \
|
||||
command env \
|
||||
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
|
||||
LESS_TERMCAP_md=$(printf "\e[1;31m") \
|
||||
LESS_TERMCAP_me=$(printf "\e[0m") \
|
||||
|
|
@ -31,6 +31,9 @@ function colored() {
|
|||
"$@"
|
||||
}
|
||||
|
||||
function man() {
|
||||
colored man "$@"
|
||||
# Colorize man and dman/debman (from debian-goodies)
|
||||
function man \
|
||||
dman \
|
||||
debman {
|
||||
colored $0 "$@"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,30 +6,43 @@ Colorize will highlight the content based on the filename extension. If it can't
|
|||
method for a given extension, it will try to find one by looking at the file contents. If no highlight method
|
||||
is found it will just cat the file normally, without syntax highlighting.
|
||||
|
||||
To use it, add colorize to the plugins array of your zshrc file:
|
||||
## Setup
|
||||
|
||||
To use it, add colorize to the plugins array of your `~/.zshrc` file:
|
||||
```
|
||||
plugins=(... colorize)
|
||||
```
|
||||
|
||||
## Styles
|
||||
## Configuration
|
||||
|
||||
### Requirements
|
||||
|
||||
This plugin requires that at least one of the following tools is installed:
|
||||
|
||||
* [Chroma](https://github.com/alecthomas/chroma)
|
||||
* [Pygments](https://pygments.org/download/)
|
||||
|
||||
### Colorize tool
|
||||
|
||||
Colorize supports `pygmentize` and `chroma` as syntax highlighter. By default colorize uses `pygmentize` unless it's not installed and `chroma` is. This can be overridden by the `ZSH_COLORIZE_TOOL` environment variable:
|
||||
|
||||
```
|
||||
ZSH_COLORIZE_TOOL=chroma
|
||||
```
|
||||
|
||||
### Styles
|
||||
|
||||
Pygments offers multiple styles. By default, the `default` style is used, but you can choose another theme by setting the `ZSH_COLORIZE_STYLE` environment variable:
|
||||
|
||||
`ZSH_COLORIZE_STYLE="colorful"`
|
||||
```
|
||||
ZSH_COLORIZE_STYLE="colorful"
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
* `ccat <file> [files]`: colorize the contents of the file (or files, if more than one are provided).
|
||||
If no arguments are passed it will colorize the standard input or stdin.
|
||||
* `ccat <file> [files]`: colorize the contents of the file (or files, if more than one are provided).
|
||||
If no files are passed it will colorize the standard input.
|
||||
|
||||
* `cless <file> [files]`: colorize the contents of the file (or files, if more than one are provided) and
|
||||
open less. If no arguments are passed it will colorize the standard input or stdin.
|
||||
|
||||
Note that `cless` will behave as less when provided more than one file: you have to navigate files with
|
||||
the commands `:n` for next and `:p` for previous. The downside is that less options are not supported.
|
||||
But you can circumvent this by either using the LESS environment variable, or by running `ccat file1 file2|less --opts`.
|
||||
In the latter form, the file contents will be concatenated and presented by less as a single file.
|
||||
|
||||
## Requirements
|
||||
|
||||
You have to install Pygments first: [pygments.org](http://pygments.org/download/)
|
||||
* `cless [less-options] <file> [files]`: colorize the contents of the file (or files, if more than one are provided) and open less.
|
||||
If no files are passed it will colorize the standard input.
|
||||
The LESSOPEN and LESSCLOSE will be overwritten for this to work, but only in a local scope.
|
||||
|
|
|
|||
|
|
@ -1,57 +1,113 @@
|
|||
# easier alias to use the plugin
|
||||
alias ccat='colorize_via_pygmentize'
|
||||
alias cless='colorize_via_pygmentize_less'
|
||||
# Easier alias to use the plugin
|
||||
alias ccat="colorize_cat"
|
||||
alias cless="colorize_less"
|
||||
|
||||
colorize_via_pygmentize() {
|
||||
if ! (( $+commands[pygmentize] )); then
|
||||
echo "package 'Pygments' is not installed!"
|
||||
# '$0:A' gets the absolute path of this file
|
||||
ZSH_COLORIZE_PLUGIN_PATH=$0:A
|
||||
|
||||
colorize_check_requirements() {
|
||||
local available_tools=("chroma" "pygmentize")
|
||||
|
||||
if [ -z "$ZSH_COLORIZE_TOOL" ]; then
|
||||
if (( $+commands[pygmentize] )); then
|
||||
ZSH_COLORIZE_TOOL="pygmentize"
|
||||
elif (( $+commands[chroma] )); then
|
||||
ZSH_COLORIZE_TOOL="chroma"
|
||||
else
|
||||
echo "Neither 'pygments' nor 'chroma' is installed!" >&2
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ${available_tools[(Ie)$ZSH_COLORIZE_TOOL]} -eq 0 ]]; then
|
||||
echo "ZSH_COLORIZE_TOOL '$ZSH_COLORIZE_TOOL' not recognized. Available options are 'pygmentize' and 'chroma'." >&2
|
||||
return 1
|
||||
elif (( $+commands["$ZSH_COLORIZE_TOOL"] )); then
|
||||
echo "Package '$ZSH_COLORIZE_TOOL' is not installed!" >&2
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
colorize_cat() {
|
||||
if ! colorize_check_requirements; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
# If the environment varianle ZSH_COLORIZE_STYLE
|
||||
# If the environment variable ZSH_COLORIZE_STYLE
|
||||
# is set, use that theme instead. Otherwise,
|
||||
# use the default.
|
||||
if [ -z $ZSH_COLORIZE_STYLE ]; then
|
||||
ZSH_COLORIZE_STYLE="default"
|
||||
if [ -z "$ZSH_COLORIZE_STYLE" ]; then
|
||||
# Both pygmentize & chroma support 'emacs'
|
||||
ZSH_COLORIZE_STYLE="emacs"
|
||||
fi
|
||||
|
||||
# pygmentize stdin if no arguments passed
|
||||
# Use stdin if no arguments have been passed.
|
||||
if [ $# -eq 0 ]; then
|
||||
pygmentize -O style="$ZSH_COLORIZE_STYLE" -g
|
||||
if [[ "$ZSH_COLORIZE_TOOL" == "pygmentize" ]]; then
|
||||
pygmentize -O style="$ZSH_COLORIZE_STYLE" -g
|
||||
else
|
||||
chroma --style="$ZSH_COLORIZE_STYLE"
|
||||
fi
|
||||
return $?
|
||||
fi
|
||||
|
||||
# guess lexer from file extension, or
|
||||
# guess it from file contents if unsuccessful
|
||||
|
||||
# Guess lexer from file extension, or guess it from file contents if unsuccessful.
|
||||
local FNAME lexer
|
||||
for FNAME in "$@"
|
||||
do
|
||||
lexer=$(pygmentize -N "$FNAME")
|
||||
if [[ $lexer != text ]]; then
|
||||
pygmentize -O style="$ZSH_COLORIZE_STYLE" -l "$lexer" "$FNAME"
|
||||
for FNAME in "$@"; do
|
||||
if [[ "$ZSH_COLORIZE_TOOL" == "pygmentize" ]]; then
|
||||
lexer=$(pygmentize -N "$FNAME")
|
||||
if [[ $lexer != text ]]; then
|
||||
pygmentize -O style="$ZSH_COLORIZE_STYLE" -l "$lexer" "$FNAME"
|
||||
else
|
||||
pygmentize -O style="$ZSH_COLORIZE_STYLE" -g "$FNAME"
|
||||
fi
|
||||
else
|
||||
pygmentize -O style="$ZSH_COLORIZE_STYLE" -g "$FNAME"
|
||||
chroma --style="$ZSH_COLORIZE_STYLE" "$FNAME"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
colorize_via_pygmentize_less() (
|
||||
# this function is a subshell so tmp_files can be shared to cleanup function
|
||||
declare -a tmp_files
|
||||
# The less option 'F - Forward forever; like "tail -f".' will not work in this implementation
|
||||
# caused by the lack of the ability to follow the file within pygmentize.
|
||||
colorize_less() {
|
||||
if ! colorize_check_requirements; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
cleanup () {
|
||||
[[ ${#tmp_files} -gt 0 ]] && rm -f "${tmp_files[@]}"
|
||||
exit
|
||||
_cless() {
|
||||
# LESS="-R $LESS" enables raw ANSI colors, while maintain already set options.
|
||||
local LESS="-R $LESS"
|
||||
|
||||
# This variable tells less to pipe every file through the specified command
|
||||
# (see the man page of less INPUT PREPROCESSOR).
|
||||
# 'zsh -ic "colorize_cat %s 2> /dev/null"' would not work for huge files like
|
||||
# the ~/.zsh_history. For such files the tty of the preprocessor will be supended.
|
||||
# Therefore we must source this file to make colorize_cat available in the
|
||||
# preprocessor without the interactive mode.
|
||||
# `2>/dev/null` will suppress the error for large files 'broken pipe' of the python
|
||||
# script pygmentize, which will show up if less has not fully "loaded the file"
|
||||
# (e.g. when not scrolled to the bottom) while already the next file will be displayed.
|
||||
local LESSOPEN="| zsh -c 'source \"$ZSH_COLORIZE_PLUGIN_PATH\"; \
|
||||
ZSH_COLORIZE_TOOL=$ZSH_COLORIZE_TOOL ZSH_COLORIZE_STYLE=$ZSH_COLORIZE_STYLE \
|
||||
colorize_cat %s 2> /dev/null'"
|
||||
|
||||
# LESSCLOSE will be set to prevent any errors by executing a user script
|
||||
# which assumes that his LESSOPEN has been executed.
|
||||
local LESSCLOSE=""
|
||||
|
||||
LESS="$LESS" LESSOPEN="$LESSOPEN" LESSCLOSE="$LESSCLOSE" less "$@"
|
||||
}
|
||||
trap 'cleanup' EXIT HUP TERM INT
|
||||
|
||||
while (( $# != 0 )); do #TODO: filter out less opts
|
||||
tmp_file="$(mktemp -t "tmp.colorize.XXXX.$(sed 's/\//./g' <<< "$1")")"
|
||||
tmp_files+=("$tmp_file")
|
||||
colorize_via_pygmentize "$1" > "$tmp_file"
|
||||
shift 1
|
||||
done
|
||||
|
||||
less -f "${tmp_files[@]}"
|
||||
)
|
||||
if [ -t 0 ]; then
|
||||
_cless "$@"
|
||||
else
|
||||
# The input is not associated with a terminal, therefore colorize_cat will
|
||||
# colorize this input and pass it to less.
|
||||
# Less has now to decide what to use. If any files have been provided, less
|
||||
# will ignore the input by default, otherwise the colorized input will be used.
|
||||
# If files have been supplied and the input has been redirected, this will
|
||||
# lead to unnecessary overhead, but retains the ability to use the less options
|
||||
# without checking for them inside this script.
|
||||
colorize_cat | _cless "$@"
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,10 +26,8 @@ fi
|
|||
|
||||
# OSX command-not-found support
|
||||
# https://github.com/Homebrew/homebrew-command-not-found
|
||||
if type brew &> /dev/null; then
|
||||
if brew command command-not-found-init > /dev/null 2>&1; then
|
||||
eval "$(brew command-not-found-init)";
|
||||
fi
|
||||
if [[ -s '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh' ]]; then
|
||||
source '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh'
|
||||
fi
|
||||
|
||||
# NixOS command-not-found support
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ alias lS='ls -1FSsh'
|
|||
alias lart='ls -1Fcart'
|
||||
alias lrt='ls -1Fcrt'
|
||||
|
||||
alias zshrc='${=EDITOR} ~/.zshrc' # Quick access to the ~/.zshrc file
|
||||
alias zshrc='${=EDITOR} ${ZDOTDIR:-$HOME}/.zshrc' # Quick access to the .zshrc file
|
||||
|
||||
alias grep='grep --color'
|
||||
alias sgrep='grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} '
|
||||
|
|
@ -50,6 +50,7 @@ alias mv='mv -i'
|
|||
|
||||
# zsh is able to auto-do some kungfoo
|
||||
# depends on the SUFFIX :)
|
||||
autoload -Uz is-at-least
|
||||
if is-at-least 4.2.0; then
|
||||
# open browser on urls
|
||||
if [[ -n "$BROWSER" ]]; then
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
This plugin looks for [compleat](https://github.com/mbrubeck/compleat) and loads its completion.
|
||||
|
||||
To use it, add compleat to the plugins array in your zshrc file:
|
||||
```
|
||||
|
||||
```zsh
|
||||
plugins=(... compleat)
|
||||
```
|
||||
|
|
|
|||
|
|
@ -12,18 +12,20 @@ plugins=(... composer)
|
|||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command | Description |
|
||||
| ------ | -------------------------------------------- | -------------------------------------------------------------------------------------- |
|
||||
| `c` | composer | Starts composer |
|
||||
| `csu` | composer self-update | Updates composer to the latest version |
|
||||
| `cu` | composer update | Updates composer dependencies and `composer.lock` file |
|
||||
| `cr` | composer require | Adds new packages to `composer.json` |
|
||||
| `crm` | composer remove | Removes packages from `composer.json` |
|
||||
| `ci` | composer install | Resolves and installs dependencies from `composer.json` |
|
||||
| `ccp` | composer create-project | Create new project from an existing package |
|
||||
| `cdu` | composer dump-autoload | Updates the autoloader |
|
||||
| `cdo` | composer dump-autoload --optimize-autoloader | Converts PSR-0/4 autoloading to classmap for a faster autoloader (good for production) |
|
||||
| `cgu` | composer global update | Allows update command to run on COMPOSER_HOME directory |
|
||||
| `cgr` | composer global require | Allows require command to run on COMPOSER_HOME directory |
|
||||
| `cgrm` | composer global remove | Allows remove command to run on COMPOSER_HOME directory |
|
||||
| `cget` | `curl -s https://getcomposer.org/installer` | Installs composer in the current directory |
|
||||
| Alias | Command | Description |
|
||||
| ------ | ------------------------------------------- | --------------------------------------------------------------------------------------- |
|
||||
| `c` | `composer` | Starts composer |
|
||||
| `csu` | `composer self-update` | Updates composer to the latest version |
|
||||
| `cu` | `composer update` | Updates composer dependencies and `composer.lock` file |
|
||||
| `cr` | `composer require` | Adds new packages to `composer.json` |
|
||||
| `crm` | `composer remove` | Removes packages from `composer.json` |
|
||||
| `ci` | `composer install` | Resolves and installs dependencies from `composer.json` |
|
||||
| `ccp` | `composer create-project` | Create new project from an existing package |
|
||||
| `cdu` | `composer dump-autoload` | Updates the autoloader |
|
||||
| `cdo` | `composer dump-autoload -o` | Converts PSR-0/4 autoloading to classmap for a faster autoloader (good for production) |
|
||||
| `cgu` | `composer global update` | Allows update command to run on COMPOSER_HOME directory |
|
||||
| `cgr` | `composer global require` | Allows require command to run on COMPOSER_HOME directory |
|
||||
| `cgrm` | `composer global remove` | Allows remove command to run on COMPOSER_HOME directory |
|
||||
| `cget` | `curl -s https://getcomposer.org/installer` | Installs composer in the current directory |
|
||||
| `co` | `composer outdated` | Shows a list of installed packages with available updates |
|
||||
| `cod` | `composer outdated --direct` | Shows a list of installed packages with available updates which are direct dependencies |
|
||||
|
|
|
|||
|
|
@ -15,20 +15,16 @@ _composer_get_required_list () {
|
|||
}
|
||||
|
||||
_composer () {
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
_arguments \
|
||||
'1: :->command'\
|
||||
'*: :->args'
|
||||
local curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
_arguments \
|
||||
'*:: :->subcmds'
|
||||
|
||||
case $state in
|
||||
command)
|
||||
compadd $(_composer_get_command_list)
|
||||
;;
|
||||
*)
|
||||
compadd $(_composer_get_required_list)
|
||||
;;
|
||||
esac
|
||||
if (( CURRENT == 1 )) || ( ((CURRENT == 2)) && [ "$words[1]" = "global" ] ) ; then
|
||||
compadd $(_composer_get_command_list)
|
||||
else
|
||||
compadd $(_composer_get_required_list)
|
||||
fi
|
||||
}
|
||||
|
||||
compdef _composer composer
|
||||
|
|
@ -43,17 +39,29 @@ alias crm='composer remove'
|
|||
alias ci='composer install'
|
||||
alias ccp='composer create-project'
|
||||
alias cdu='composer dump-autoload'
|
||||
alias cdo='composer dump-autoload --optimize-autoloader'
|
||||
alias cdo='composer dump-autoload -o'
|
||||
alias cgu='composer global update'
|
||||
alias cgr='composer global require'
|
||||
alias cgrm='composer global remove'
|
||||
alias co='composer outdated'
|
||||
alias cod='composer outdated --direct'
|
||||
|
||||
# install composer in the current directory
|
||||
alias cget='curl -s https://getcomposer.org/installer | php'
|
||||
|
||||
# Add Composer's global binaries to PATH, using Composer if available.
|
||||
if (( $+commands[composer] )); then
|
||||
export PATH=$PATH:$(composer global config bin-dir --absolute 2>/dev/null)
|
||||
_retrieve_cache composer
|
||||
|
||||
if [[ -z $__composer_bin_dir ]]; then
|
||||
__composer_bin_dir=$(composer global config bin-dir --absolute 2>/dev/null)
|
||||
_store_cache composer __composer_bin_dir
|
||||
fi
|
||||
|
||||
# Add Composer's global binaries to PATH
|
||||
export PATH="$PATH:$__composer_bin_dir"
|
||||
|
||||
unset __composer_bin_dir
|
||||
else
|
||||
[ -d $HOME/.composer/vendor/bin ] && export PATH=$PATH:$HOME/.composer/vendor/bin
|
||||
[ -d $HOME/.config/composer/vendor/bin ] && export PATH=$PATH:$HOME/.config/composer/vendor/bin
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# copy the active line from the command line buffer
|
||||
# onto the system clipboard (requires clipcopy plugin)
|
||||
# onto the system clipboard
|
||||
|
||||
copybuffer () {
|
||||
if which clipcopy &>/dev/null; then
|
||||
echo $BUFFER | clipcopy
|
||||
printf "%s" "$BUFFER" | clipcopy
|
||||
else
|
||||
echo "clipcopy function not found. Please make sure you have Oh My Zsh installed correctly."
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
Puts the contents of a file in your system clipboard so you can paste it anywhere.
|
||||
|
||||
To use, add `copyfile` to your plugins array:
|
||||
```
|
||||
|
||||
```zsh
|
||||
plugins=(... copyfile)
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# Cpanm
|
||||
|
||||
This plugin provides completion for [Cpanm](https://github.com/miyagawa/cpanminus) ([docs](https://metacpan.org/pod/App::cpanminus)).
|
||||
|
||||
|
||||
To use it add cpanm to the plugins array in your zshrc file.
|
||||
|
||||
```bash
|
||||
|
||||
```zsh
|
||||
plugins=(... cpanm)
|
||||
```
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@ This plugin enables directory navigation similar to using back and forward on br
|
|||
)
|
||||
```
|
||||
|
||||
2. Reload the source file or restart your Terminal session:
|
||||
2. Restart the shell or restart your Terminal session:
|
||||
|
||||
```console
|
||||
$ source ~/.zshrc
|
||||
$ exec zsh
|
||||
$
|
||||
```
|
||||
|
||||
|
|
|
|||
15
plugins/direnv/README.md
Normal file
15
plugins/direnv/README.md
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# direnv plugin
|
||||
|
||||
This plugin creates the [Direnv](https://direnv.net/) hook.
|
||||
|
||||
To use it, add `direnv` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... direnv)
|
||||
```
|
||||
|
||||
## Requirements
|
||||
|
||||
In order to make this work, you will need to have the direnv installed.
|
||||
|
||||
More info on the usage and install: https://github.com/direnv/direnv
|
||||
16
plugins/direnv/direnv.plugin.zsh
Normal file
16
plugins/direnv/direnv.plugin.zsh
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# Don't continue if direnv is not found
|
||||
command -v direnv &>/dev/null || return
|
||||
|
||||
_direnv_hook() {
|
||||
trap -- '' SIGINT;
|
||||
eval "$(direnv export zsh)";
|
||||
trap - SIGINT;
|
||||
}
|
||||
typeset -ag precmd_functions;
|
||||
if [[ -z ${precmd_functions[(r)_direnv_hook]} ]]; then
|
||||
precmd_functions=( _direnv_hook ${precmd_functions[@]} )
|
||||
fi
|
||||
typeset -ag chpwd_functions;
|
||||
if [[ -z ${chpwd_functions[(r)_direnv_hook]} ]]; then
|
||||
chpwd_functions=( _direnv_hook ${chpwd_functions[@]} )
|
||||
fi
|
||||
|
|
@ -7,6 +7,7 @@ To use it, add `dirhistory` to the plugins array in your zshrc file:
|
|||
```zsh
|
||||
plugins=(... dirhistory)
|
||||
```
|
||||
|
||||
## Keyboard Shortcuts
|
||||
|
||||
| Shortcut | Description |
|
||||
|
|
@ -15,3 +16,24 @@ plugins=(... dirhistory)
|
|||
| <kbd>alt</kbd> + <kbd>right</kbd> | Undo <kbd>alt</kbd> + <kbd>left</kbd> |
|
||||
| <kbd>alt</kbd> + <kbd>up</kbd> | Move into the parent directory |
|
||||
| <kbd>alt</kbd> + <kbd>down</kbd> | Move into the first child directory by alphabetical order |
|
||||
|
||||
## Usage
|
||||
|
||||
This plugin allows you to navigate the history of previous current-working-directories using ALT-LEFT and ALT-RIGHT. ALT-LEFT moves back to directories that the user has changed to in the past, and ALT-RIGHT undoes ALT-LEFT. MAC users may alternately use OPT-LEFT and OPT-RIGHT.
|
||||
|
||||
Also, navigate directory **hierarchy** using ALT-UP and ALT-DOWN. (mac keybindings not yet implemented). ALT-UP moves to higher hierarchy (shortcut for 'cd ..'). ALT-DOWN moves into the first directory found in alphabetical order (useful to navigate long empty directories e.g. java packages)
|
||||
|
||||
For example, if the shell was started, and the following commands were entered:
|
||||
|
||||
```shell
|
||||
cd ~
|
||||
cd /usr
|
||||
cd share
|
||||
cd doc
|
||||
```
|
||||
|
||||
Then entering ALT-LEFT at the prompt would change directory from /usr/share/doc to /usr/share, then if pressed again to /usr/, then ~. If ALT-RIGHT were pressed the directory would be changed to /usr/ again.
|
||||
|
||||
After that, ALT-DOWN will probably go to /usr/bin (depends on your /usr structure), ALT-UP will return to /usr, then ALT-UP will get you to /
|
||||
|
||||
**Currently the max history size is 30**. The navigation should work for xterm, PuTTY xterm mode, GNU screen, and on MAC with alternate keys as mentioned above.
|
||||
|
|
|
|||
|
|
@ -53,7 +53,8 @@ function push_future() {
|
|||
}
|
||||
|
||||
# Called by zsh when directory changes
|
||||
chpwd_functions+=(chpwd_dirhistory)
|
||||
autoload -U add-zsh-hook
|
||||
add-zsh-hook chpwd chpwd_dirhistory
|
||||
function chpwd_dirhistory() {
|
||||
push_past $PWD
|
||||
# If DIRHISTORY_CD is not set...
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
# Dirpersist plugin
|
||||
|
||||
This plugin keeps a running tally of the previous 20 unique directories in the $HOME/.zdirs file. When you cd to a new directory, it is prepended to the beginning of the file.
|
||||
This plugin keeps a running tally of the previous 20 unique directories in the `$HOME/.zdirs` file.
|
||||
When you cd to a new directory, it is prepended to the beginning of the file.
|
||||
|
||||
To use it, add `dirpersist` to the plugins array in your zshrc file:
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@ if [[ -f ${dirstack_file} ]] && [[ ${#dirstack[*]} -eq 0 ]] ; then
|
|||
[[ -d $dirstack[1] ]] && cd $dirstack[1] && cd $OLDPWD
|
||||
fi
|
||||
|
||||
chpwd_functions+=(chpwd_dirpersist)
|
||||
autoload -U add-zsh-hook
|
||||
add-zsh-hook chpwd chpwd_dirpersist
|
||||
chpwd_dirpersist() {
|
||||
if (( $DIRSTACKSIZE <= 0 )) || [[ -z $dirstack_file ]]; then return; fi
|
||||
local -ax my_stack
|
||||
|
|
|
|||
|
|
@ -34,23 +34,3 @@ runfcgi -- run this project as a fastcgi
|
|||
runserver -- start a lightweight web server for development
|
||||
...
|
||||
```
|
||||
|
||||
If you want to see the options available for a specific command, try:
|
||||
|
||||
```zsh
|
||||
$> python manage.py makemessages (press <TAB> here)
|
||||
```
|
||||
|
||||
And that would result in:
|
||||
|
||||
```zsh
|
||||
--all -a -- re-examine all code and templates
|
||||
--domain -d -- domain of the message files (default: "django")
|
||||
--extensions -e -- file extension(s) to examine (default: ".html")
|
||||
--help -- display help information
|
||||
--locale -l -- locale to process (default: all)
|
||||
--pythonpath -- directory to add to the Python path
|
||||
--settings -- python path to settings module
|
||||
...
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -374,7 +374,8 @@ _managepy-commands() {
|
|||
_applist() {
|
||||
local line
|
||||
local -a apps
|
||||
_call_program help-command "python -c \"import os.path as op, re, django.conf, sys;\\
|
||||
_call_program help-command "python -c \"import sys; del sys.path[0];\\
|
||||
import os.path as op, re, django.conf;\\
|
||||
bn=op.basename(op.abspath(op.curdir));[sys\\
|
||||
.stdout.write(str(re.sub(r'^%s\.(.*?)$' %
|
||||
bn, r'\1', i)) + '\n') for i in django.conf.settings.\\
|
||||
|
|
|
|||
|
|
@ -1,10 +1,14 @@
|
|||
## Description
|
||||
# dnf plugin
|
||||
|
||||
This plugin makes `dnf` usage easier by adding aliases for the most
|
||||
common commands.
|
||||
This plugin makes `dnf` usage easier by adding aliases for the most common commands.
|
||||
|
||||
`dnf` is the new package manager for RPM-based distributions, which
|
||||
replaces `yum`.
|
||||
`dnf` is the new package manager for RPM-based distributions, which replaces `yum`.
|
||||
|
||||
To use it, add `dnf` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... dnf)
|
||||
```
|
||||
|
||||
## Aliases
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ This plugin provides completion for [docker-compose](https://docs.docker.com/com
|
|||
aliases for frequent docker-compose commands.
|
||||
|
||||
To use it, add docker-compose to the plugins array of your zshrc file:
|
||||
```
|
||||
|
||||
```zsh
|
||||
plugins=(... docker-compose)
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
This plugin adds auto-completion for [docker](https://www.docker.com/).
|
||||
|
||||
To use it add `docker` to the plugins array in your zshrc file.
|
||||
|
||||
```zsh
|
||||
plugins=(... docker)
|
||||
```
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
# - Felix Riedel
|
||||
# - Steve Durrheimer
|
||||
# - Vincent Bernat
|
||||
# - Rohan Verma
|
||||
#
|
||||
# license:
|
||||
#
|
||||
|
|
@ -604,6 +605,7 @@ __docker_container_subcommand() {
|
|||
"($help)*--blkio-weight-device=[Block IO (relative device weight)]:device:Block IO weight: "
|
||||
"($help)*--cap-add=[Add Linux capabilities]:capability: "
|
||||
"($help)*--cap-drop=[Drop Linux capabilities]:capability: "
|
||||
"($help)--cgroupns=[Cgroup namespace mode to use]:cgroup namespace mode: "
|
||||
"($help)--cgroup-parent=[Parent cgroup for the container]:cgroup: "
|
||||
"($help)--cidfile=[Write the container ID to the file]:CID file:_files"
|
||||
"($help)--cpus=[Number of CPUs (default 0.000)]:cpus: "
|
||||
|
|
@ -676,6 +678,7 @@ __docker_container_subcommand() {
|
|||
"($help -m --memory)"{-m=,--memory=}"[Memory limit]:Memory limit: "
|
||||
"($help)--memory-reservation=[Memory soft limit]:Memory limit: "
|
||||
"($help)--memory-swap=[Total memory limit with swap]:Memory limit: "
|
||||
"($help)--pids-limit[Tune container pids limit (set -1 for unlimited)]"
|
||||
"($help)--restart=[Restart policy]:restart policy:(no on-failure always unless-stopped)"
|
||||
)
|
||||
opts_help=("(: -)--help[Print usage]")
|
||||
|
|
@ -801,7 +804,7 @@ __docker_container_subcommand() {
|
|||
"($help -l --latest)"{-l,--latest}"[Show only the latest created container]" \
|
||||
"($help -n --last)"{-n=,--last=}"[Show n last created containers (includes all states)]:n:(1 5 10 25 50)" \
|
||||
"($help)--no-trunc[Do not truncate output]" \
|
||||
"($help -q --quiet)"{-q,--quiet}"[Only show numeric IDs]" \
|
||||
"($help -q --quiet)"{-q,--quiet}"[Only show container IDs]" \
|
||||
"($help -s --size)"{-s,--size}"[Display total file sizes]" \
|
||||
"($help)--since=[Show only containers created since...]:containers:__docker_complete_containers" && ret=0
|
||||
;;
|
||||
|
|
@ -832,7 +835,7 @@ __docker_container_subcommand() {
|
|||
_arguments $(__docker_arguments) \
|
||||
$opts_help \
|
||||
"($help -t --time)"{-t=,--time=}"[Number of seconds to try to stop for before killing the container]:seconds to before killing:(1 5 10 30 60)" \
|
||||
"($help -)*:containers:__docker_complete_containers_ids" && ret=0
|
||||
"($help -)*:containers:__docker_complete_containers" && ret=0
|
||||
;;
|
||||
(rm)
|
||||
local state
|
||||
|
|
@ -1024,7 +1027,7 @@ __docker_image_subcommand() {
|
|||
$opts_help \
|
||||
"($help -H --human)"{-H,--human}"[Print sizes and dates in human readable format]" \
|
||||
"($help)--no-trunc[Do not truncate output]" \
|
||||
"($help -q --quiet)"{-q,--quiet}"[Only show numeric IDs]" \
|
||||
"($help -q --quiet)"{-q,--quiet}"[Only show image IDs]" \
|
||||
"($help -)*: :__docker_complete_images" && ret=0
|
||||
;;
|
||||
(import)
|
||||
|
|
@ -1056,7 +1059,7 @@ __docker_image_subcommand() {
|
|||
"($help)*"{-f=,--filter=}"[Filter values]:filter:__docker_complete_images_filters" \
|
||||
"($help)--format=[Pretty-print images using a Go template]:template: " \
|
||||
"($help)--no-trunc[Do not truncate output]" \
|
||||
"($help -q --quiet)"{-q,--quiet}"[Only show numeric IDs]" \
|
||||
"($help -q --quiet)"{-q,--quiet}"[Only show image IDs]" \
|
||||
"($help -): :__docker_complete_repositories" && ret=0
|
||||
;;
|
||||
(prune)
|
||||
|
|
@ -1076,6 +1079,7 @@ __docker_image_subcommand() {
|
|||
(push)
|
||||
_arguments $(__docker_arguments) \
|
||||
$opts_help \
|
||||
"($help -a --all-tags)"{-a,--all-tags}"[Push all tagged images in the repository]" \
|
||||
"($help)--disable-content-trust[Skip image signing]" \
|
||||
"($help -): :__docker_complete_images" && ret=0
|
||||
;;
|
||||
|
|
@ -1286,7 +1290,7 @@ __docker_network_subcommand() {
|
|||
"($help)--no-trunc[Do not truncate the output]" \
|
||||
"($help)*"{-f=,--filter=}"[Provide filter values]:filter:__docker_network_complete_ls_filters" \
|
||||
"($help)--format=[Pretty-print networks using a Go template]:template: " \
|
||||
"($help -q --quiet)"{-q,--quiet}"[Only display numeric IDs]" && ret=0
|
||||
"($help -q --quiet)"{-q,--quiet}"[Only display network IDs]" && ret=0
|
||||
;;
|
||||
(prune)
|
||||
_arguments $(__docker_arguments) \
|
||||
|
|
@ -2214,7 +2218,6 @@ __docker_stack_subcommand() {
|
|||
(deploy|up)
|
||||
_arguments $(__docker_arguments) \
|
||||
$opts_help \
|
||||
"($help)--bundle-file=[Path to a Distributed Application Bundle file]:dab:_files -g \"*.dab\"" \
|
||||
"($help -c --compose-file)"{-c=,--compose-file=}"[Path to a Compose file, or '-' to read from stdin]:compose file:_files -g \"*.(yml|yaml)\"" \
|
||||
"($help)--with-registry-auth[Send registry authentication details to Swarm agents]" \
|
||||
"($help -):stack:__docker_complete_stacks" && ret=0
|
||||
|
|
@ -2668,6 +2671,7 @@ __docker_subcommand() {
|
|||
"($help)*--log-opt=[Default log driver options for containers]:log driver options:__docker_complete_log_options" \
|
||||
"($help)--max-concurrent-downloads[Set the max concurrent downloads for each pull]" \
|
||||
"($help)--max-concurrent-uploads[Set the max concurrent uploads for each push]" \
|
||||
"($help)--max-download-attempts[Set the max download attempts for each pull]" \
|
||||
"($help)--mtu=[Network MTU]:mtu:(0 576 1420 1500 9000)" \
|
||||
"($help)--oom-score-adjust=[Set the oom_score_adj for the daemon]:oom-score:(-500)" \
|
||||
"($help -p --pidfile)"{-p=,--pidfile=}"[Path to use for daemon PID file]:PID file:_files" \
|
||||
|
|
@ -2783,7 +2787,7 @@ __docker_subcommand() {
|
|||
$opts_help \
|
||||
"($help -p --password)"{-p=,--password=}"[Password]:password: " \
|
||||
"($help)--password-stdin[Read password from stdin]" \
|
||||
"($help -u --user)"{-u=,--user=}"[Username]:username: " \
|
||||
"($help -u --username)"{-u=,--username=}"[Username]:username: " \
|
||||
"($help -)1:server: " && ret=0
|
||||
;;
|
||||
(logout)
|
||||
|
|
|
|||
|
|
@ -4,9 +4,7 @@ Automatically load your project ENV variables from `.env` file when you `cd` int
|
|||
|
||||
Storing configuration in the environment is one of the tenets of a [twelve-factor app](https://www.12factor.net). Anything that is likely to change between deployment environments, such as resource handles for databases or credentials for external services, should be extracted from the code into environment variables.
|
||||
|
||||
## Installation
|
||||
|
||||
Just add the plugin to your `.zshrc`:
|
||||
To use it, add `dotenv` to the plugins array in your zshrc file:
|
||||
|
||||
```sh
|
||||
plugins=(... dotenv)
|
||||
|
|
@ -17,32 +15,63 @@ plugins=(... dotenv)
|
|||
Create `.env` file inside your project root directory and put your ENV variables there.
|
||||
|
||||
For example:
|
||||
|
||||
```sh
|
||||
export AWS_S3_TOKEN=d84a83539134f28f412c652b09f9f98eff96c9a
|
||||
export SECRET_KEY=7c6c72d959416d5aa368a409362ec6e2ac90d7f
|
||||
export MONGO_URI=mongodb://127.0.0.1:27017
|
||||
export PORT=3001
|
||||
```
|
||||
|
||||
`export` is optional. This format works as well:
|
||||
|
||||
```sh
|
||||
AWS_S3_TOKEN=d84a83539134f28f412c652b09f9f98eff96c9a
|
||||
SECRET_KEY=7c6c72d959416d5aa368a409362ec6e2ac90d7f
|
||||
MONGO_URI=mongodb://127.0.0.1:27017
|
||||
PORT=3001
|
||||
```
|
||||
|
||||
You can even mix both formats, although it's probably a bad idea.
|
||||
|
||||
## Settings
|
||||
|
||||
### ZSH_DOTENV_FILE
|
||||
|
||||
You can also modify the name of the file to be loaded with the variable `ZSH_DOTENV_FILE`.
|
||||
If the variable isn't set, the plugin will default to use `.env`.
|
||||
For example, this will make the plugin look for files named `.dotenv` and load them:
|
||||
|
||||
```
|
||||
```zsh
|
||||
# in ~/.zshrc, before Oh My Zsh is sourced:
|
||||
ZSH_DOTENV_FILE=.dotenv
|
||||
```
|
||||
|
||||
### ZSH_DOTENV_PROMPT
|
||||
|
||||
Set `ZSH_DOTENV_PROMPT=false` in your zshrc file if you don't want the confirmation message.
|
||||
You can also choose the `Always` option when prompted to always allow sourcing the .env file
|
||||
in that directory. See the next section for more details.
|
||||
|
||||
### ZSH_DOTENV_ALLOWED_LIST
|
||||
|
||||
The default behavior of the plugin is to always ask whether to source a dotenv file. There's
|
||||
a **Y**es, **N**o, and **A**lways option. If you choose Always, the directory of the .env file
|
||||
will be added to an allowed list. If a directory is found in this list, the plugin won't ask
|
||||
for confirmation and will instead source the .env file directly.
|
||||
|
||||
This allowed list is saved by default in `$ZSH_CACHE_DIR/dotenv-allowed.list`. If you want
|
||||
to change that location, change the `$ZSH_DOTENV_ALLOWED_LIST` variable, like so:
|
||||
|
||||
```zsh
|
||||
# in ~/.zshrc, before Oh My Zsh is sourced:
|
||||
ZSH_DOTENV_ALLOWED_LIST=/path/to/dotenv/allowed/list
|
||||
```
|
||||
|
||||
This file is just a list of directories allowed, separated by a newline character. If you want
|
||||
to disallow a directory, just edit this file and remove the line for the directory you want to
|
||||
disallow.
|
||||
|
||||
## Version Control
|
||||
|
||||
**It's strongly recommended to add `.env` file to `.gitignore`**, because usually it contains sensitive information such as your credentials, secret keys, passwords etc. You don't want to commit this file, it's supposed to be local only.
|
||||
|
|
@ -52,5 +81,6 @@ ZSH_DOTENV_FILE=.dotenv
|
|||
This plugin only sources the `.env` file. Nothing less, nothing more. It doesn't do any checks. It's designed to be the fastest and simplest option. You're responsible for the `.env` file content. You can put some code (or weird symbols) there, but do it on your own risk. `dotenv` is the basic tool, yet it does the job.
|
||||
|
||||
If you need more advanced and feature-rich ENV management, check out these awesome projects:
|
||||
|
||||
* [direnv](https://github.com/direnv/direnv)
|
||||
* [zsh-autoenv](https://github.com/Tarrasch/zsh-autoenv)
|
||||
|
|
|
|||
|
|
@ -1,23 +1,46 @@
|
|||
## Settings
|
||||
|
||||
# Filename of the dotenv file to look for
|
||||
: ${ZSH_DOTENV_FILE:=.env}
|
||||
|
||||
# Path to the file containing allowed paths
|
||||
: ${ZSH_DOTENV_ALLOWED_LIST:="${ZSH_CACHE_DIR:-$ZSH/cache}/dotenv-allowed.list"}
|
||||
|
||||
|
||||
## Functions
|
||||
|
||||
source_env() {
|
||||
if [[ -f $ZSH_DOTENV_FILE ]]; then
|
||||
if [[ "$ZSH_DOTENV_PROMPT" != false ]]; then
|
||||
local confirmation dirpath="${PWD:A}"
|
||||
|
||||
# make sure there is an allowed file
|
||||
touch "$ZSH_DOTENV_ALLOWED_LIST"
|
||||
|
||||
# check if current directory's .env file is allowed or ask for confirmation
|
||||
if ! grep -q "$dirpath" "$ZSH_DOTENV_ALLOWED_LIST" &>/dev/null; then
|
||||
# print same-line prompt and output newline character if necessary
|
||||
echo -n "dotenv: found '$ZSH_DOTENV_FILE' file. Source it? ([Y]es/[n]o/[a]lways) "
|
||||
read -k 1 confirmation; [[ "$confirmation" != $'\n' ]] && echo
|
||||
|
||||
# check input
|
||||
case "$confirmation" in
|
||||
[nN]) return ;;
|
||||
[aA]) echo "$dirpath" >> "$ZSH_DOTENV_ALLOWED_LIST" ;;
|
||||
*) ;; # interpret anything else as a yes
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
|
||||
# test .env syntax
|
||||
zsh -fn $ZSH_DOTENV_FILE || echo "dotenv: error when sourcing '$ZSH_DOTENV_FILE' file" >&2
|
||||
|
||||
if [[ -o a ]]; then
|
||||
source $ZSH_DOTENV_FILE
|
||||
else
|
||||
set -a
|
||||
source $ZSH_DOTENV_FILE
|
||||
set +a
|
||||
fi
|
||||
setopt localoptions allexport
|
||||
source $ZSH_DOTENV_FILE
|
||||
fi
|
||||
}
|
||||
|
||||
autoload -U add-zsh-hook
|
||||
add-zsh-hook chpwd source_env
|
||||
|
||||
if [[ -z $ZSH_DOTENV_FILE ]]; then
|
||||
ZSH_DOTENV_FILE=.env
|
||||
fi
|
||||
|
||||
source_env
|
||||
|
|
|
|||
23
plugins/dotnet/README.md
Normal file
23
plugins/dotnet/README.md
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# .NET Core CLI plugin
|
||||
|
||||
This plugin provides completion and useful aliases for [.NET Core CLI](https://dotnet.microsoft.com/).
|
||||
|
||||
To use it, add `dotnet` to the plugins array in your zshrc file.
|
||||
|
||||
```
|
||||
plugins=(... dotnet)
|
||||
```
|
||||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command | Description |
|
||||
|-------|------------------|-------------------------------------------------------------------|
|
||||
| dn | dotnet new | Create a new .NET project or file. |
|
||||
| dr | dotnet run | Build and run a .NET project output. |
|
||||
| dt | dotnet test | Run unit tests using the test runner specified in a .NET project. |
|
||||
| dw | dotnet watch | Watch for source file changes and restart the dotnet command. |
|
||||
| dwr | dotnet watch run | Watch for source file changes and restart the `run` command. |
|
||||
| ds | dotnet sln | Modify Visual Studio solution files. |
|
||||
| da | dotnet add | Add a package or reference to a .NET project. |
|
||||
| dp | dotnet pack | Create a NuGet package. |
|
||||
| dng | dotnet nuget | Provides additional NuGet commands. |
|
||||
32
plugins/dotnet/dotnet.plugin.zsh
Normal file
32
plugins/dotnet/dotnet.plugin.zsh
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# This scripts is copied from (MIT License):
|
||||
# https://github.com/dotnet/toolset/blob/master/scripts/register-completions.zsh
|
||||
|
||||
_dotnet_zsh_complete()
|
||||
{
|
||||
local completions=("$(dotnet complete "$words")")
|
||||
|
||||
# If the completion list is empty, just continue with filename selection
|
||||
if [ -z "$completions" ]
|
||||
then
|
||||
_arguments '*::arguments: _normal'
|
||||
return
|
||||
fi
|
||||
|
||||
# This is not a variable assigment, don't remove spaces!
|
||||
_values = "${(ps:\n:)completions}"
|
||||
}
|
||||
|
||||
compdef _dotnet_zsh_complete dotnet
|
||||
|
||||
# Aliases bellow are here for backwards compatibility
|
||||
# added by Shaun Tabone (https://github.com/xontab)
|
||||
|
||||
alias dn='dotnet new'
|
||||
alias dr='dotnet run'
|
||||
alias dt='dotnet test'
|
||||
alias dw='dotnet watch'
|
||||
alias dwr='dotnet watch run'
|
||||
alias ds='dotnet sln'
|
||||
alias da='dotnet add'
|
||||
alias dp='dotnet pack'
|
||||
alias dng='dotnet nuget'
|
||||
|
|
@ -20,7 +20,8 @@ _emacsfun()
|
|||
# tempfile. (first argument will be `--no-wait` passed in by the plugin.zsh)
|
||||
if [ "$#" -ge "2" -a "$2" = "-" ]
|
||||
then
|
||||
tempfile="$(mktemp emacs-stdin-$USER.XXXXXXX --tmpdir)"
|
||||
tempfile="$(mktemp --tmpdir emacs-stdin-$USER.XXXXXXX 2>/dev/null \
|
||||
|| mktemp -t emacs-stdin-$USER)" # support BSD mktemp
|
||||
cat - > "$tempfile"
|
||||
_emacsfun --no-wait $tempfile
|
||||
else
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
# FILE: emoji-clock.plugin.zsh
|
||||
# DESCRIPTION: The current time with half hour accuracy as an emoji symbol.
|
||||
# Inspired by Andre Torrez' "Put A Burger In Your Shell"
|
||||
# http://notes.torrez.org/2013/04/put-a-burger-in-your-shell.html
|
||||
# https://notes.torrez.org/2013/04/put-a-burger-in-your-shell.html
|
||||
# AUTHOR: Alexis Hildebrandt (afh[at]surryhill.net)
|
||||
# VERSION: 1.0.0
|
||||
# -----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ To use it, add emotty to the plugins array in your zshrc file:
|
|||
plugins=(... emotty)
|
||||
```
|
||||
|
||||
**NOTE:** it requires the [emoji plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/emoji).
|
||||
**NOTE:** it requires the [emoji plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/emoji).
|
||||
|
||||
## Usage
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
# encode64
|
||||
|
||||
Alias plugin for encoding or decoding using `base64` command
|
||||
Alias plugin for encoding or decoding using `base64` command.
|
||||
|
||||
To use it, add `encode64` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... encode64)
|
||||
```
|
||||
|
||||
## Functions and Aliases
|
||||
|
||||
|
|
@ -9,23 +15,6 @@ Alias plugin for encoding or decoding using `base64` command
|
|||
| `encode64` | `e64` | Encodes given data to base64 |
|
||||
| `decode64` | `d64` | Decodes given data from base64 |
|
||||
|
||||
## Enabling plugin
|
||||
|
||||
1. Edit your `.zshrc` file and add `encode64` to the list of plugins:
|
||||
|
||||
```sh
|
||||
plugins=(
|
||||
# ...other enabled plugins
|
||||
encode64
|
||||
)
|
||||
```
|
||||
|
||||
2. Restart your terminal session or reload configuration by running:
|
||||
|
||||
```sh
|
||||
source ~/.zshrc
|
||||
```
|
||||
|
||||
## Usage and examples
|
||||
|
||||
### Encoding
|
||||
|
|
|
|||
|
|
@ -25,23 +25,32 @@ plugins=(... extract)
|
|||
| `gz` | Gzip file |
|
||||
| `ipsw` | iOS firmware file |
|
||||
| `jar` | Java Archive |
|
||||
| `lrz` | LRZ archive |
|
||||
| `lz4` | LZ4 archive |
|
||||
| `lzma` | LZMA archive |
|
||||
| `rar` | WinRAR archive |
|
||||
| `rpm` | RPM package |
|
||||
| `sublime-package` | Sublime Text package |
|
||||
| `tar` | Tarball |
|
||||
| `tar.bz2` | Tarball with bzip2 compression |
|
||||
| `tar.gz` | Tarball with gzip compression |
|
||||
| `tar.lrz` | Tarball with lrzip compression |
|
||||
| `tar.lz` | Tarball with lzip compression |
|
||||
| `tar.lz4` | Tarball with lz4 compression |
|
||||
| `tar.xz` | Tarball with lzma2 compression |
|
||||
| `tar.zma` | Tarball with lzma compression |
|
||||
| `tar.zst` | Tarball with zstd compression |
|
||||
| `tbz` | Tarball with bzip compression |
|
||||
| `tbz2` | Tarball with bzip2 compression |
|
||||
| `tgz` | Tarball with gzip compression |
|
||||
| `tlz` | Tarball with lzma compression |
|
||||
| `txz` | Tarball with lzma2 compression |
|
||||
| `tzst` | Tarball with zstd compression |
|
||||
| `war` | Web Application archive (Java-based) |
|
||||
| `xpi` | Mozilla XPI module file |
|
||||
| `xz` | LZMA2 archive |
|
||||
| `zip` | Zip archive |
|
||||
| `zst` | Zstandard file (zstd) |
|
||||
|
||||
See [list of archive formats](https://en.wikipedia.org/wiki/List_of_archive_formats) for
|
||||
more information regarding archive formats.
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@
|
|||
|
||||
_arguments \
|
||||
'(-r --remove)'{-r,--remove}'[Remove archive.]' \
|
||||
"*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|sublime-package|tar|tar.bz2|tar.gz|tar.xz|tar.zma|tbz|tbz2|tgz|tlz|txz|war|whl|xpi|xz|zip)(-.)'" \
|
||||
"*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lrz|lz4|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.lz4|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \
|
||||
&& return 0
|
||||
|
|
|
|||
|
|
@ -40,14 +40,24 @@ extract() {
|
|||
tar --lzma --help &> /dev/null \
|
||||
&& tar --lzma -xvf "$1" \
|
||||
|| lzcat "$1" | tar xvf - ;;
|
||||
(*.tar.zst|*.tzst)
|
||||
tar --zstd --help &> /dev/null \
|
||||
&& tar --zstd -xvf "$1" \
|
||||
|| zstdcat "$1" | tar xvf - ;;
|
||||
(*.tar) tar xvf "$1" ;;
|
||||
(*.gz) (( $+commands[pigz] )) && pigz -d "$1" || gunzip "$1" ;;
|
||||
(*.tar.lz) (( $+commands[lzip] )) && tar xvf "$1" ;;
|
||||
(*.tar.lz4) lz4 -c -d "$1" | tar xvf - ;;
|
||||
(*.tar.lrz) (( $+commands[lrzuntar] )) && lrzuntar "$1" ;;
|
||||
(*.gz) (( $+commands[pigz] )) && pigz -dk "$1" || gunzip -k "$1" ;;
|
||||
(*.bz2) bunzip2 "$1" ;;
|
||||
(*.xz) unxz "$1" ;;
|
||||
(*.lrz) (( $+commands[lrunzip] )) && lrunzip "$1" ;;
|
||||
(*.lz4) lz4 -d "$1" ;;
|
||||
(*.lzma) unlzma "$1" ;;
|
||||
(*.z) uncompress "$1" ;;
|
||||
(*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;;
|
||||
(*.rar) unrar x -ad "$1" ;;
|
||||
(*.rpm) mkdir "$extract_dir" && cd "$extract_dir" && rpm2cpio "../$1" | cpio --quiet -id && cd .. ;;
|
||||
(*.7z) 7za x "$1" ;;
|
||||
(*.deb)
|
||||
mkdir -p "$extract_dir/control"
|
||||
|
|
@ -58,6 +68,7 @@ extract() {
|
|||
cd ..; rm *.tar.* debian-binary
|
||||
cd ..
|
||||
;;
|
||||
(*.zst) unzstd "$1" ;;
|
||||
(*)
|
||||
echo "extract: '$1' cannot be extracted" >&2
|
||||
success=1
|
||||
|
|
|
|||
|
|
@ -4,6 +4,6 @@ This plugin provides completion for [Fabric](https://www.fabfile.org/).
|
|||
|
||||
To use it add fabric to the plugins array in your zshrc file.
|
||||
|
||||
```bash
|
||||
```zsh
|
||||
plugins=(... fabric)
|
||||
```
|
||||
|
|
|
|||
|
|
@ -4,10 +4,19 @@
|
|||
local curcontext=$curcontext state line
|
||||
declare -A opt_args
|
||||
|
||||
declare target_list
|
||||
target_list=(`fab --shortlist 2>/dev/null || fab --complete 2>/dev/null`)
|
||||
declare -a target_list
|
||||
target_list=("${(@f)$(fab -l 2>/dev/null | awk '{
|
||||
if (NF == 0 || NR == 1) next
|
||||
if (NF < 2) print $1
|
||||
else {
|
||||
docstring=substr($0, index($0,$2))
|
||||
gsub(":", "\\:", docstring)
|
||||
print $1":"docstring
|
||||
}
|
||||
}')}")
|
||||
|
||||
_targets() {
|
||||
_fab_targets() {
|
||||
[[ -n "$target_list" ]] || return
|
||||
_describe -t commands "fabric targets" target_list
|
||||
}
|
||||
|
||||
|
|
@ -28,7 +37,7 @@ _arguments -w -S -C \
|
|||
'(-)--shortlist[print non-verbose list of possible commands and exit]: :->noargs' \
|
||||
'(--reject-unknown-hosts)--reject-unknown-hosts[reject unknown hosts]' \
|
||||
'(--no-pty)--no-pty[do not use pseudo-terminal in run/sudo]' \
|
||||
"(-d+ --display=-)"{-d+,--display=-}"[print detailed info about a given command]: :_targets" \
|
||||
"(-d+ --display=-)"{-d+,--display=-}"[print detailed info about a given command]: :_fab_targets" \
|
||||
'(-D --disable-known-hosts)'{-D,--disable-known-hosts}'[do not load user known_hosts file]' \
|
||||
'(-r --reject-unknown-hosts)'{-r,--reject-unknown-hosts}'[reject unknown hosts]' \
|
||||
'(-u+ --user=-)'{-u+,--user=-}'[username to use when connecting to remote hosts]: :' \
|
||||
|
|
@ -53,7 +62,7 @@ if [[ CURRENT -ge 1 ]]; then
|
|||
levels)
|
||||
_describe -t commands "output levels" output_levels;;
|
||||
*)
|
||||
_targets;;
|
||||
_fab_targets;;
|
||||
esac
|
||||
|
||||
return
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
fancy-ctrl-z () {
|
||||
if [[ $#BUFFER -eq 0 ]]; then
|
||||
BUFFER="fg"
|
||||
zle accept-line
|
||||
zle accept-line -w
|
||||
else
|
||||
zle push-input
|
||||
zle clear-screen
|
||||
zle push-input -w
|
||||
zle clear-screen -w
|
||||
fi
|
||||
}
|
||||
zle -N fancy-ctrl-z
|
||||
|
|
|
|||
21
plugins/fasd/README.md
Normal file
21
plugins/fasd/README.md
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# fasd
|
||||
|
||||
[`Fasd`](https://github.com/clvv/fasd) (pronounced similar to "fast") is a command-line productivity booster. Fasd offers quick access to files and directories for POSIX shells.
|
||||
|
||||
To use it, add `fasd` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... fasd)
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
Please find detailed installation guide [`here`](https://github.com/clvv/fasd#install)
|
||||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command | Description |
|
||||
|-------|-------------------------------------------|-------------------------------------------------------------|
|
||||
| v | `fasd -f -e "$EDITOR"` | List frequent/recent files matching the given filename. |
|
||||
| o | `fasd -a -e xdg-open` | List frequent/recent files and directories matching. |
|
||||
| j | `fasd_cd -d -i` | cd with interactive selection |
|
||||
|
|
@ -1,12 +1,16 @@
|
|||
if [ $commands[fasd] ]; then # check if fasd is installed
|
||||
fasd_cache="${ZSH_CACHE_DIR}/fasd-init-cache"
|
||||
if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then
|
||||
fasd --init auto >| "$fasd_cache"
|
||||
fi
|
||||
source "$fasd_cache"
|
||||
unset fasd_cache
|
||||
|
||||
alias v='f -e "$EDITOR"'
|
||||
alias o='a -e xdg-open'
|
||||
alias j='zz'
|
||||
# check if fasd is installed
|
||||
if (( ! ${+commands[fasd]} )); then
|
||||
return
|
||||
fi
|
||||
|
||||
fasd_cache="${ZSH_CACHE_DIR}/fasd-init-cache"
|
||||
if [[ "$commands[fasd]" -nt "$fasd_cache" || ! -s "$fasd_cache" ]]; then
|
||||
fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install \
|
||||
zsh-wcomp zsh-wcomp-install >| "$fasd_cache"
|
||||
fi
|
||||
source "$fasd_cache"
|
||||
unset fasd_cache
|
||||
|
||||
alias v='f -e "$EDITOR"'
|
||||
alias o='a -e xdg-open'
|
||||
alias j='zz'
|
||||
|
|
|
|||
84
plugins/fastfile/README.md
Normal file
84
plugins/fastfile/README.md
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
# Fastfile plugin
|
||||
|
||||
This plugin adds a way to reference certain files or folders used frequently using
|
||||
a global alias or shortcut.
|
||||
|
||||
To use it, add `fastfile` to the plugins array in your zshrc file:
|
||||
```zsh
|
||||
plugins=(... fastfile)
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Example: you access folder `/code/project/backend/database` very frequently.
|
||||
|
||||
First, generate a shortcut with the name `pjdb`:
|
||||
```zsh
|
||||
$ fastfile pjdb /code/project/backend/database
|
||||
```
|
||||
|
||||
Next time you want to access it, use `§pjdb`. For example:
|
||||
```zsh
|
||||
$ cd §pjdb
|
||||
$ subl §pjdb
|
||||
```
|
||||
where § is the fastfile prefix (see [below](#options) for how to change).
|
||||
|
||||
**Note:** shortcuts with spaces in the name are assigned a global alias
|
||||
where the spaces have been substituted with underscores (`_`). For example:
|
||||
a shortcut named `"hello world"` corresponds with `§hello_world`.
|
||||
|
||||
|
||||
## Functions
|
||||
|
||||
- `fastfile <shortcut_name> <path/to/file/or/folder>`: generate a shortcut.
|
||||
|
||||
- `fastfile_print <shortcut_name>`: prints a shortcut, with the format
|
||||
`<prefix><shortcut_name> -> <shortcut_path>`.
|
||||
|
||||
- `fastfile_ls`: lists all shortcuts.
|
||||
|
||||
- `fastfile_rm <shortcut_name> `: remove a shortcut.
|
||||
|
||||
- `fastfile_sync`: generates the global aliases for the shortcuts.
|
||||
|
||||
|
||||
### Internal functions
|
||||
|
||||
- `fastfile_resolv <shortcut_name>`: resolves the location of the shortcut
|
||||
file, i.e., the file in the fastfile directory where the shortcut path
|
||||
is stored.
|
||||
|
||||
- `fastfile_get <shortcut_name>`: get the real path of the shortcut.
|
||||
|
||||
|
||||
## Aliases
|
||||
|
||||
| Alias | Function |
|
||||
|--------|------------------|
|
||||
| ff | `fastfile` |
|
||||
| ffp | `fastfile_print` |
|
||||
| ffrm | `fastfile_rm` |
|
||||
| ffls | `fastfile_ls` |
|
||||
| ffsync | `fastfile_sync` |
|
||||
|
||||
|
||||
## Options
|
||||
|
||||
These are options you can set to change certain parts of the plugin. To change
|
||||
them, add `<variable>=<value>` to your zshrc file, before Oh My Zsh is sourced.
|
||||
For example: `fastfile_var_prefix='@'`.
|
||||
|
||||
- `fastfile_var_prefix`: prefix for the global aliases created. Controls the prefix of the
|
||||
created global aliases.
|
||||
**Default:** `§` (section sign), easy to type in a german keyboard via the combination
|
||||
[`⇧ Shift`+`3`](https://en.wikipedia.org/wiki/German_keyboard_layout#/media/File:KB_Germany.svg),
|
||||
or using `⌥ Option`+`6` in macOS.
|
||||
|
||||
- `fastfile_dir`: directory where the fastfile shortcuts are stored. Needs to end
|
||||
with a trailing slash.
|
||||
**Default:** `$HOME/.fastfile/`.
|
||||
|
||||
## Author
|
||||
|
||||
- [Karolin Varner](https://github.com/koraa)
|
||||
|
|
@ -1,21 +1,11 @@
|
|||
################################################################################
|
||||
# FILE: fastfile.plugin.zsh
|
||||
# DESCRIPTION: oh-my-zsh plugin file.
|
||||
# AUTHOR: Michael Varner (musikmichael@web.de)
|
||||
# VERSION: 1.0.0
|
||||
#
|
||||
# This plugin adds the ability to on the fly generate and access file shortcuts.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
###########################
|
||||
# Settings
|
||||
# Settings
|
||||
|
||||
# These can be overwritten any time.
|
||||
# If they are not set yet, they will be
|
||||
# overwritten with their default values
|
||||
|
||||
default fastfile_dir "${HOME}/.fastfile/"
|
||||
default fastfile_dir "${HOME}/.fastfile"
|
||||
default fastfile_var_prefix "§"
|
||||
|
||||
###########################
|
||||
|
|
@ -33,7 +23,7 @@ default fastfile_var_prefix "§"
|
|||
function fastfile() {
|
||||
test "$2" || 2="."
|
||||
file=$(readlink -f "$2")
|
||||
|
||||
|
||||
test "$1" || 1="$(basename "$file")"
|
||||
name=$(echo "$1" | tr " " "_")
|
||||
|
||||
|
|
@ -51,7 +41,7 @@ function fastfile() {
|
|||
# Arguments:
|
||||
# 1. name - The name of the shortcut
|
||||
# STDOUT:
|
||||
# The path
|
||||
# The path to the shortcut file
|
||||
#
|
||||
function fastfile_resolv() {
|
||||
echo "${fastfile_dir}${1}"
|
||||
|
|
@ -88,12 +78,12 @@ function fastfile_print() {
|
|||
# (=> fastfle_print) for each shortcut
|
||||
#
|
||||
function fastfile_ls() {
|
||||
for f in "${fastfile_dir}"/*; do
|
||||
file=`basename "$f"` # To enable simpler handeling of spaces in file names
|
||||
varkey=`echo "$file" | tr " " "_"`
|
||||
for f in "${fastfile_dir}"/*(NF); do
|
||||
file=`basename "$f"` # To enable simpler handeling of spaces in file names
|
||||
varkey=`echo "$file" | tr " " "_"`
|
||||
|
||||
# Special format for colums
|
||||
echo "${fastfile_var_prefix}${varkey}|->|$(fastfile_get "$file")"
|
||||
# Special format for colums
|
||||
echo "${fastfile_var_prefix}${varkey}|->|$(fastfile_get "$file")"
|
||||
done | column -t -s "|"
|
||||
}
|
||||
|
||||
|
|
@ -102,7 +92,6 @@ function fastfile_ls() {
|
|||
#
|
||||
# Arguments:
|
||||
# 1. name - The name of the shortcut (default: name of the file)
|
||||
# 2. file - The file or directory to make the shortcut for
|
||||
# STDOUT:
|
||||
# => fastfle_print
|
||||
#
|
||||
|
|
@ -115,11 +104,11 @@ function fastfile_rm() {
|
|||
# Generate the aliases for the shortcuts
|
||||
#
|
||||
function fastfile_sync() {
|
||||
for f in "${fastfile_dir}"/*; do
|
||||
file=`basename "$f"` # To enable simpler handeling of spaces in file names
|
||||
varkey=`echo "$file" | tr " " "_"`
|
||||
for f in "${fastfile_dir}"/*(NF); do
|
||||
file=`basename "$f"` # To enable simpler handeling of spaces in file names
|
||||
varkey=`echo "$file" | tr " " "_"`
|
||||
|
||||
alias -g "${fastfile_var_prefix}${varkey}"="'$(fastfile_get "$file")'"
|
||||
alias -g "${fastfile_var_prefix}${varkey}"="'$(fastfile_get "$file")'"
|
||||
done
|
||||
}
|
||||
|
||||
|
|
@ -133,6 +122,6 @@ alias ffls=fastfile_ls
|
|||
alias ffsync=fastfile_sync
|
||||
|
||||
##################################
|
||||
# Init
|
||||
# Init
|
||||
|
||||
fastfile_sync
|
||||
fastfile_sync
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
This plugin automatically starts [fbterm](https://github.com/zhangyuanwei/fbterm)
|
||||
if on a real TTY (`/dev/tty*`).
|
||||
|
||||
To use it, add fbterm to the plugins array of your zshrc file:
|
||||
```
|
||||
To use it, add `fbterm` to the plugins array of your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... fbterm)
|
||||
```
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
The fedora plugin is deprecated. Use the [dnf plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/dnf) instead.
|
||||
The fedora plugin is deprecated. Use the [dnf plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/dnf) instead.
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
../dnf/dnf.plugin.zsh
|
||||
3
plugins/fedora/fedora.plugin.zsh
Normal file
3
plugins/fedora/fedora.plugin.zsh
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
print -P "%F{yellow}The 'fedora' plugin is deprecated. Use the '%Udnf%u' plugin instead.%f"
|
||||
|
||||
source "$ZSH/plugins/dnf/dnf.plugin.zsh"
|
||||
|
|
@ -1,15 +1,23 @@
|
|||
## forklift
|
||||
# forklift
|
||||
|
||||
Plugin for ForkLift, an FTP application for OS X.
|
||||
|
||||
### Requirements
|
||||
To use it, add `forklift` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... forklift)
|
||||
```
|
||||
|
||||
## Requirements
|
||||
|
||||
* [ForkLift](https://binarynights.com/)
|
||||
|
||||
### Usage
|
||||
## Usage
|
||||
|
||||
<code>fl [*file_or_folder*]</code>
|
||||
`fl [<file_or_folder>]`
|
||||
|
||||
* If `fl` is called without arguments then the current folder is opened in ForkLift. This is equivalent to `fl .`.
|
||||
|
||||
* If `fl` is called with a directory as the argument, then that directory is opened in ForkLift. If called with a non-directory file as the argument, then the file's parent directory is opened.
|
||||
* If `fl` is called with a directory as the argument, then that directory is opened in ForkLift
|
||||
|
||||
* If `fl` is called with a non-directory file as the argument, then the file's parent directory is opened.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
# Open folder in ForkLift.app or ForkLift2.app from console
|
||||
# Author: Adam Strzelecki nanoant.com, modified by Bodo Tasche bitboxer.de
|
||||
# Updated to support ForkLift 2 and ForkLift 3 by Johan Kaving
|
||||
# Updated to support ForkLift from Setapp by Paul Rudkin
|
||||
#
|
||||
# Usage:
|
||||
# fl [<folder>]
|
||||
|
|
@ -24,6 +25,13 @@ function fl {
|
|||
fi
|
||||
osascript 2>&1 1>/dev/null <<END
|
||||
|
||||
try
|
||||
tell application "Finder"
|
||||
set forkLiftSetapp to name of application file id "com.binarynights.forklift-setapp"
|
||||
end tell
|
||||
on error err_msg number err_num
|
||||
set forkLiftSetapp to null
|
||||
end try
|
||||
try
|
||||
tell application "Finder"
|
||||
set forkLift3 to name of application file id "com.binarynights.ForkLift-3"
|
||||
|
|
@ -46,7 +54,12 @@ function fl {
|
|||
set forkLift to null
|
||||
end try
|
||||
|
||||
if forkLift3 is not null and application forkLift3 is running then
|
||||
if forkLiftSetapp is not null and application forkLiftSetapp is running then
|
||||
tell application forkLiftSetapp
|
||||
activate
|
||||
set forkLiftVersion to version
|
||||
end tell
|
||||
else if forkLift3 is not null and application forkLift3 is running then
|
||||
tell application forkLift3
|
||||
activate
|
||||
set forkLiftVersion to version
|
||||
|
|
@ -62,7 +75,9 @@ function fl {
|
|||
set forkLiftVersion to version
|
||||
end tell
|
||||
else
|
||||
if forkLift3 is not null then
|
||||
if forkLiftSetapp is not null then
|
||||
set appName to forkLiftSetapp
|
||||
else if forkLift3 is not null then
|
||||
set appName to forkLift3
|
||||
else if forkLift2 is not null then
|
||||
set appName to forkLift2
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ Available search contexts are:
|
|||
| mdn | `https://developer.mozilla.org/search?q=` |
|
||||
| nodejs | `https://www.google.com/search?as_sitesearch=nodejs.org/en/docs/&as_q=` |
|
||||
| npmjs | `https://www.npmjs.com/search?q=` |
|
||||
| packagephobia | `https://packagephobia.now.sh/result?p=` |
|
||||
| qunit | `https://api.qunitjs.com/?s=` |
|
||||
| reactjs | `https://google.com/search?as_sitesearch=facebook.github.io/react&as_q=` |
|
||||
| smacss | `https://google.com/search?as_sitesearch=smacss.com&as_q=` |
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ function _frontend() {
|
|||
'mdn: Search in MDN website'
|
||||
'nodejs: Search in NodeJS website'
|
||||
'npmjs: Search in NPMJS website'
|
||||
'packagephobia: Search in Packagephobia website'
|
||||
'qunit: Search in Qunit website'
|
||||
'reactjs: Search in React website'
|
||||
'smacss: Search in SMACSS website'
|
||||
|
|
@ -124,6 +125,9 @@ function _frontend() {
|
|||
bundlephobia)
|
||||
_describe -t points "Warp points" frontend_points && ret=0
|
||||
;;
|
||||
packagephobia)
|
||||
_describe -t points "Warp points" frontend_points && ret=0
|
||||
;;
|
||||
flowtype)
|
||||
_describe -t points "Warp points" frontend_points && ret=0
|
||||
;;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ alias lodash='frontend lodash'
|
|||
alias mdn='frontend mdn'
|
||||
alias nodejs='frontend nodejs'
|
||||
alias npmjs='frontend npmjs'
|
||||
alias packagephobia='frontend packagephobia'
|
||||
alias qunit='frontend qunit'
|
||||
alias reactjs='frontend reactjs'
|
||||
alias smacss='frontend smacss'
|
||||
|
|
@ -65,6 +66,7 @@ function frontend() {
|
|||
mdn 'https://developer.mozilla.org/search?q='
|
||||
nodejs $(_frontend_fallback 'nodejs.org/en/docs/')
|
||||
npmjs 'https://www.npmjs.com/search?q='
|
||||
packagephobia 'https://packagephobia.now.sh/result?p='
|
||||
qunit 'https://api.qunitjs.com/?s='
|
||||
reactjs $(_frontend_fallback 'reactjs.org/')
|
||||
smacss $(_frontend_fallback 'smacss.com')
|
||||
|
|
@ -82,7 +84,7 @@ function frontend() {
|
|||
print -P "%Uterm%u and what follows is what will be searched for in the %Ucontext%u website,"
|
||||
print -P "and %Ucontext%u is one of the following:"
|
||||
print -P ""
|
||||
print -P " angular, angularjs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow,"
|
||||
print -P " angular, angularjs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow, packagephobia"
|
||||
print -P " dartlang, emberjs, fontello, flowtype, github, html5please, jestjs, jquery, lodash,"
|
||||
print -P " mdn, npmjs, nodejs, qunit, reactjs, smacss, stackoverflow, unheap, vuejs, bundlephobia"
|
||||
print -P ""
|
||||
|
|
@ -98,7 +100,7 @@ function frontend() {
|
|||
echo ""
|
||||
echo "Valid contexts are:"
|
||||
echo ""
|
||||
echo " angular, angularjs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow,"
|
||||
echo " angular, angularjs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow, packagephobia"
|
||||
echo " dartlang, emberjs, fontello, github, html5please, jest, jquery, lodash,"
|
||||
echo " mdn, npmjs, nodejs, qunit, reactjs, smacss, stackoverflow, unheap, vuejs, bundlephobia"
|
||||
echo ""
|
||||
|
|
|
|||
|
|
@ -10,8 +10,10 @@ function setup_using_base_dir() {
|
|||
if [[ -z "${fzf_base}" ]]; then
|
||||
fzfdirs=(
|
||||
"${HOME}/.fzf"
|
||||
"${HOME}/.nix-profile/share/fzf"
|
||||
"/usr/local/opt/fzf"
|
||||
"/usr/share/fzf"
|
||||
"/usr/local/share/examples/fzf"
|
||||
)
|
||||
for dir in ${fzfdirs}; do
|
||||
if [[ -d "${dir}" ]]; then
|
||||
|
|
@ -30,8 +32,8 @@ function setup_using_base_dir() {
|
|||
fi
|
||||
|
||||
if [[ -d "${fzf_base}" ]]; then
|
||||
# Fix fzf shell directory for Archlinux package
|
||||
if [[ ! -d "${fzf_base}/shell" ]] && [[ -f /etc/arch-release ]]; then
|
||||
# Fix fzf shell directory for Arch Linux, NixOS or Void Linux packages
|
||||
if [[ ! -d "${fzf_base}/shell" ]]; then
|
||||
fzf_shell="${fzf_base}"
|
||||
else
|
||||
fzf_shell="${fzf_base}/shell"
|
||||
|
|
@ -67,7 +69,10 @@ function setup_using_debian_package() {
|
|||
# NOTE: There is no need to configure PATH for debian package, all binaries
|
||||
# are installed to /usr/bin by default
|
||||
|
||||
local completions="/usr/share/zsh/vendor-completions/_fzf"
|
||||
# Determine completion file path: first bullseye/sid, then buster/stretch
|
||||
local completions="/usr/share/doc/fzf/examples/completion.zsh"
|
||||
[[ -f "$completions" ]] || completions="/usr/share/zsh/vendor-completions/_fzf"
|
||||
|
||||
local key_bindings="/usr/share/doc/fzf/examples/key-bindings.zsh"
|
||||
|
||||
# Auto-completion
|
||||
|
|
|
|||
10
plugins/gas/README.md
Normal file
10
plugins/gas/README.md
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# Gas plugin
|
||||
|
||||
This plugin adds autocompletion for the [gas](http://walle.github.com/gas) command,
|
||||
a utility to manage Git authors.
|
||||
|
||||
To use it, add `gas` to the plugins array of your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... gas)
|
||||
```
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
## ZSH-Geeknote
|
||||
# Geeknote plugin
|
||||
|
||||
[Geeknote](https://github.com/VitaliyRodnenko/geeknote) plugin for oh-my-zsh.
|
||||
This plugin provides autocompletion for [Geeknote](https://github.com/VitaliyRodnenko/geeknote)
|
||||
and an alias for `geeknote` called `gn`.
|
||||
|
||||
Plugins provides:
|
||||
To use it, add `geeknote` to the plugins array in your zshrc file:
|
||||
|
||||
- auto completion of commands and their options
|
||||
- alias `gn`
|
||||
|
||||
You can find information how to install Geeknote and it's available commands on the [project website](http://www.geeknote.me/).
|
||||
|
||||
Maintainer : Ján Koščo ([@s7anley](https://twitter.com/s7anley))
|
||||
```zsh
|
||||
plugins=( ... geeknote ...)
|
||||
```
|
||||
|
|
|
|||
|
|
@ -1,136 +1,157 @@
|
|||
#compdef geeknote
|
||||
# --------------- ------------------------------------------------------------
|
||||
# Name : _geeknote
|
||||
# Synopsis : zsh completion for geeknote
|
||||
# Author : Ján Koščo <3k.stanley@gmail.com>
|
||||
# HomePage : http://www.geeknote.me
|
||||
# Version : 0.1
|
||||
# Tag : [ shell, zsh, completion, evernote ]
|
||||
# Copyright : © 2014 by Ján Koščo,
|
||||
# Released under current GPL license.
|
||||
# --------------- ------------------------------------------------------------
|
||||
|
||||
# Geeknote Autocomplete plugin for Zsh
|
||||
# Requires: Geeknote installed
|
||||
# Author : Ján Koščo (@s7anley)
|
||||
|
||||
__login() {
|
||||
# no arguments
|
||||
}
|
||||
|
||||
__logout() {
|
||||
_arguments \
|
||||
'--force[Do not ask about logging out.]'
|
||||
}
|
||||
|
||||
__settings() {
|
||||
_arguments \
|
||||
"--editor+[Set the editor, which use to edit and create notes.]::"
|
||||
}
|
||||
|
||||
__create() {
|
||||
_arguments \
|
||||
'--title+[The note title.]::' \
|
||||
'--content+[The note content.]::' \
|
||||
'--tags+[One tag or the list of tags which will be added to the note.]::' \
|
||||
'--notebook+[Set the notebook where to save note.]::' \
|
||||
'--resource+[Add a resource to the note.]::'
|
||||
}
|
||||
|
||||
__edit() {
|
||||
_arguments \
|
||||
'--note+[The name or ID from the previous search of a note to edit.]::' \
|
||||
'--title+[Set new title of the note.]::' \
|
||||
'--content+[Set new content of the note.]::' \
|
||||
'--tags+[Set new list o tags for the note.]::' \
|
||||
'--notebook+[Assign new notebook for the note.]::' \
|
||||
'--resource+[Add a resource to the note.]::'
|
||||
}
|
||||
|
||||
__find() {
|
||||
_arguments \
|
||||
'--search+[Text to search.]::' \
|
||||
'--tags+[Notes with which tag/tags to search.]::' \
|
||||
'--notebook+[In which notebook search the note.]::' \
|
||||
'--date+[Set date in format dd.mm.yyyy or date range dd.mm.yyyy-dd.mm.yyyy.]::' \
|
||||
'--count+[How many notes show in the result list.]::' \
|
||||
'--with-url[Add direct url of each note in results to Evernote web-version.]' \
|
||||
'--content-search[Search by content, not by title.]' \
|
||||
'--exact-entry[Search for exact entry of the request.]'
|
||||
}
|
||||
|
||||
__show() {
|
||||
_arguments \
|
||||
'--note+[The name or ID from the previous search of a note to show.]::' \
|
||||
'--raw[Show the raw note body.]'
|
||||
}
|
||||
|
||||
__remove() {
|
||||
_arguments \
|
||||
'--note+[The name or ID from the previous search of a note to remove.]::' \
|
||||
'--force[Do not ask about removing.]'
|
||||
}
|
||||
|
||||
__notebook-list() {
|
||||
# no arguments
|
||||
}
|
||||
|
||||
__notebook-create() {
|
||||
_arguments \
|
||||
'--title+[Set the title of new notebook.]::'
|
||||
}
|
||||
|
||||
__notebook-edit() {
|
||||
_arguments \
|
||||
'--title+[Set the title of new notebook.]::' \
|
||||
'--notebook+[The name of a notebook to rename.]::'
|
||||
}
|
||||
|
||||
__tag-list() {
|
||||
# no arguments
|
||||
}
|
||||
|
||||
__tag-create() {
|
||||
_arguments \
|
||||
'--title+[Set the title of new tag.]::'
|
||||
}
|
||||
|
||||
__tag-edit() {
|
||||
_arguments \
|
||||
'--tagname+[The name of a tag to rename.]::' \
|
||||
'--title+[Set the new name of tag.]::'
|
||||
}
|
||||
|
||||
__user() {
|
||||
_arguments \
|
||||
'--full[Show full information.]'
|
||||
}
|
||||
|
||||
local -a _1st_arguments
|
||||
_1st_arguments=(
|
||||
'login'
|
||||
'logout'
|
||||
'settings'
|
||||
'create'
|
||||
'edit'
|
||||
'find'
|
||||
'show'
|
||||
'remove'
|
||||
'notebook-list'
|
||||
'notebook-create'
|
||||
'notebook-edit'
|
||||
'tag-list'
|
||||
'tag-create'
|
||||
'tag-edit'
|
||||
'tag-remove'
|
||||
'gnsync'
|
||||
'user'
|
||||
'login':'Authorize in Evernote.'
|
||||
'logout':'Logout from Evernote.'
|
||||
'settings':'Show and edit current settings.'
|
||||
'create':'Create note in Evernote.'
|
||||
'edit':'Edit note in Evernote.'
|
||||
'find':'Search notes in Evernote.'
|
||||
'show':'Output note in the terminal.'
|
||||
'remove':'Remove note from Evernote.'
|
||||
'notebook-list':'Show the list of existing notebooks in your Evernote.'
|
||||
'notebook-create':'Create new notebook.'
|
||||
'notebook-edit':'Edit/rename notebook.'
|
||||
'tag-list':'Show the list of existing tags in your Evernote.'
|
||||
'tag-create':'Create new tag.'
|
||||
'tag-edit':'Edit/rename tag.'
|
||||
'user':'Show information about active user.'
|
||||
)
|
||||
|
||||
_arguments '*:: :->command'
|
||||
|
||||
if (( CURRENT == 1 )); then
|
||||
_describe -t commands "geeknote command" _1st_arguments
|
||||
return
|
||||
_describe -t commands "geeknote command" _1st_arguments
|
||||
return
|
||||
fi
|
||||
|
||||
local -a _command_args
|
||||
case "$words[1]" in
|
||||
user)
|
||||
_command_args=(
|
||||
'(--full)--full' \
|
||||
)
|
||||
;;
|
||||
logout)
|
||||
_command_args=(
|
||||
'(--force)--force' \
|
||||
)
|
||||
;;
|
||||
settings)
|
||||
_command_args=(
|
||||
'(--editor)--editor' \
|
||||
)
|
||||
;;
|
||||
create)
|
||||
_command_args=(
|
||||
'(-t|--title)'{-t,--title}'[note title]' \
|
||||
'(-c|--content)'{-c,--content}'[note content]' \
|
||||
'(-tg|--tags)'{-tg,--tags}'[one tag or the list of tags which will be added to the note]' \
|
||||
'(-nb|--notebook)'{-nb,--notebook}'[name of notebook where to save note]' \
|
||||
)
|
||||
;;
|
||||
edit)
|
||||
_command_args=(
|
||||
'(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \
|
||||
'(-t|--title)'{-t,--title}'[note title]' \
|
||||
'(-c|--content)'{-c,--content}'[note content]' \
|
||||
'(-tg|--tags)'{-tg,--tags}'[one tag or the list of tags which will be added to the note]' \
|
||||
'(-nb|--notebook)'{-nb,--notebook}'[name of notebook where to save note]' \
|
||||
)
|
||||
;;
|
||||
remove)
|
||||
_command_args=(
|
||||
'(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \
|
||||
'(--force)--force' \
|
||||
)
|
||||
;;
|
||||
show)
|
||||
_command_args=(
|
||||
'(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \
|
||||
)
|
||||
;;
|
||||
find)
|
||||
_command_args=(
|
||||
'(-s|--search)'{-s,--search}'[text to search]' \
|
||||
'(-tg|--tags)'{-tg,--tags}'[notes with which tag/tags to search]' \
|
||||
'(-nb|--notebook)'{-nb,--notebook}'[in which notebook search the note]' \
|
||||
'(-d|--date)'{-d,--date}'[date in format dd.mm.yyyy or date range dd.mm.yyyy-dd.mm.yyyy]' \
|
||||
'(-cn|--count)'{-cn,--count}'[how many notes show in the result list]' \
|
||||
'(-uo|--url-only)'{-uo,--url-only}'[add direct url of each note in results to Evernote web-version]' \
|
||||
'(-ee|--exact-entry)'{-ee,--exact-entry}'[search for exact entry of the request]' \
|
||||
'(-cs|--content-search)'{-cs,--content-search}'[search by content, not by title]' \
|
||||
)
|
||||
;;
|
||||
notebook-create)
|
||||
_command_args=(
|
||||
'(-t|--title)'{-t,--title}'[notebook title]' \
|
||||
)
|
||||
;;
|
||||
notebook-edit)
|
||||
_command_args=(
|
||||
'(-nb|--notebook)'{-nb,--notebook}'[name of notebook to rename]' \
|
||||
'(-t|--title)'{-t,--title}'[new notebook title]' \
|
||||
)
|
||||
;;
|
||||
notebook-remove)
|
||||
_command_args=(
|
||||
'(-nb|--notebook)'{-nb,--notebook}'[name of notebook to remove]' \
|
||||
'(--force)--force' \
|
||||
)
|
||||
;;
|
||||
tag-create)
|
||||
_command_args=(
|
||||
'(-t|--title)'{-t,--title}'[title of tag]' \
|
||||
)
|
||||
;;
|
||||
tag-edit)
|
||||
_command_args=(
|
||||
'(-tgn|--tagname)'{-tgn,--tagname}'[tag to edit]' \
|
||||
'(-t|--title)'{-t,--title}'[new tag name]' \
|
||||
)
|
||||
;;
|
||||
tag-remove)
|
||||
_command_args=(
|
||||
'(-tgn|--tagname)'{-tgn,--tagname}'[tag to remove]' \
|
||||
'(--force)--force' \
|
||||
)
|
||||
;;
|
||||
esac
|
||||
|
||||
_arguments \
|
||||
$_command_args \
|
||||
&& return 0
|
||||
login)
|
||||
__login ;;
|
||||
logout)
|
||||
__logout ;;
|
||||
settings)
|
||||
__settings ;;
|
||||
create)
|
||||
__create ;;
|
||||
edit)
|
||||
__edit ;;
|
||||
find)
|
||||
__find ;;
|
||||
show)
|
||||
__show ;;
|
||||
remove)
|
||||
__remove ;;
|
||||
notebook-list)
|
||||
__notebook-list ;;
|
||||
notebook-create)
|
||||
__notebook-create ;;
|
||||
notebook-edit)
|
||||
__notebook-edit ;;
|
||||
tag-list)
|
||||
__tag-list ;;
|
||||
tag-create)
|
||||
__tag-create ;;
|
||||
tag-edit)
|
||||
__tag-edit ;;
|
||||
user)
|
||||
__user ;;
|
||||
esac
|
||||
|
|
|
|||
|
|
@ -1,16 +1,17 @@
|
|||
GIT_AUTO_FETCH_INTERVAL=${GIT_AUTO_FETCH_INTERVAL:=60}
|
||||
|
||||
function git-fetch-all {
|
||||
(`git rev-parse --is-inside-work-tree 2>/dev/null` &&
|
||||
dir=`git rev-parse --git-dir` &&
|
||||
(`command git rev-parse --is-inside-work-tree 2>/dev/null` &&
|
||||
dir=`command git rev-parse --git-dir` &&
|
||||
[[ ! -f $dir/NO_AUTO_FETCH ]] &&
|
||||
(( `date +%s` - `date -r $dir/FETCH_LOG +%s 2>/dev/null || echo 0` > $GIT_AUTO_FETCH_INTERVAL )) &&
|
||||
git fetch --all 2>/dev/null &>! $dir/FETCH_LOG &)
|
||||
GIT_SSH_COMMAND="command ssh -o BatchMode=yes" \
|
||||
command git fetch --all 2>/dev/null &>! $dir/FETCH_LOG &)
|
||||
}
|
||||
|
||||
function git-auto-fetch {
|
||||
`git rev-parse --is-inside-work-tree 2>/dev/null` || return
|
||||
guard="`git rev-parse --git-dir`/NO_AUTO_FETCH"
|
||||
`command git rev-parse --is-inside-work-tree 2>/dev/null` || return
|
||||
guard="`command git rev-parse --git-dir`/NO_AUTO_FETCH"
|
||||
|
||||
(rm $guard 2>/dev/null &&
|
||||
echo "${fg_bold[green]}enabled${reset_color}") ||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,16 @@
|
|||
|
||||
This plugin provides completion definitions for some of the commands defined by [git-extras](https://github.com/tj/git-extras).
|
||||
|
||||
## Setup notes
|
||||
To use it, add `git-extras` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... 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.
|
||||
**NOTE:** this no longer works on current Homebrew distributions of git. ~~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,18 +1,15 @@
|
|||
# Git-Flow plugin
|
||||
|
||||
This plugin adds completion and aliases for the `git-flow` command. More information
|
||||
at https://github.com/nvie/gitflow.
|
||||
This plugin adds completion and aliases for the [`git-flow` command](https://github.com/nvie/gitflow).
|
||||
|
||||
Enable git-flow plugin in your zshrc file:
|
||||
```
|
||||
To use it, add `git-flow` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... git-flow)
|
||||
```
|
||||
|
||||
## Aliases
|
||||
|
||||
More information about `git-flow` commands:
|
||||
https://github.com/nvie/gitflow/wiki/Command-Line-Arguments
|
||||
|
||||
| Alias | Command | Description |
|
||||
|---------|----------------------------|----------------------------------------|
|
||||
| `gfl` | `git flow` | Git-Flow command |
|
||||
|
|
@ -30,3 +27,5 @@ https://github.com/nvie/gitflow/wiki/Command-Line-Arguments
|
|||
| `gflfp` | `git flow feature publish` | Publish feature: `gflfp <name>` |
|
||||
| `gflhf` | `git flow hotfix finish` | Finish hotfix: `gflhf <version>` |
|
||||
| `gflrf` | `git flow release finish` | Finish release: `gflrf <version>` |
|
||||
|
||||
[More information about `git-flow` commands](https://github.com/nvie/gitflow/wiki/Command-Line-Arguments).
|
||||
|
|
|
|||
|
|
@ -20,9 +20,10 @@ function precmd_update_git_vars() {
|
|||
fi
|
||||
}
|
||||
|
||||
chpwd_functions+=(chpwd_update_git_vars)
|
||||
precmd_functions+=(precmd_update_git_vars)
|
||||
preexec_functions+=(preexec_update_git_vars)
|
||||
autoload -U add-zsh-hook
|
||||
add-zsh-hook chpwd chpwd_update_git_vars
|
||||
add-zsh-hook precmd precmd_update_git_vars
|
||||
add-zsh-hook preexec preexec_update_git_vars
|
||||
|
||||
|
||||
## Function definitions
|
||||
|
|
|
|||
|
|
@ -4,26 +4,21 @@ from __future__ import print_function
|
|||
import os
|
||||
import sys
|
||||
import re
|
||||
import shlex
|
||||
from subprocess import Popen, PIPE, check_output
|
||||
|
||||
|
||||
def get_tagname_or_hash():
|
||||
"""return tagname if exists else hash"""
|
||||
cmd = 'git log -1 --format="%h%d"'
|
||||
output = check_output(shlex.split(cmd)).decode('utf-8').strip()
|
||||
hash_, tagname = None, None
|
||||
# get hash
|
||||
m = re.search('\(.*\)$', output)
|
||||
if m:
|
||||
hash_ = output[:m.start()-1]
|
||||
# get tagname
|
||||
m = re.search('tag: .*[,\)]', output)
|
||||
if m:
|
||||
tagname = 'tags/' + output[m.start()+len('tag: '): m.end()-1]
|
||||
hash_cmd = ['git', 'rev-parse', '--short', 'HEAD']
|
||||
hash_ = check_output(hash_cmd).strip()
|
||||
|
||||
if tagname:
|
||||
return tagname.replace(' ', '')
|
||||
# get tagname
|
||||
tags_cmd = ['git', 'for-each-ref', '--points-at=HEAD', '--count=2', '--sort=-version:refname', '--format=%(refname:short)', 'refs/tags']
|
||||
tags = check_output(tags_cmd).split()
|
||||
|
||||
if tags:
|
||||
return tags[0] + ('+' if len(tags) > 1 else '')
|
||||
elif hash_:
|
||||
return hash_
|
||||
return None
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
# git-remote-branch plugin
|
||||
|
||||
This plugin adds completion for [`grb`](https://github.com/webmat/git_remote_branch),
|
||||
or `git_remote_branch`.
|
||||
|
||||
To use it, add `git-remote-branch` to the plugins array of your `.zshrc` file:
|
||||
```
|
||||
plugins=(... git-remote-branch)
|
||||
```
|
||||
|
||||
## Deprecation
|
||||
|
||||
[git_remote_branch was archived in 2018](https://github.com/webmat/git_remote_branch#archived),
|
||||
meaning it's not actively maintained anymore. Use at your own risk.
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
_git_remote_branch() {
|
||||
ref=$(git symbolic-ref HEAD 2> /dev/null)
|
||||
if [[ -n $ref ]]; then
|
||||
if (( CURRENT == 2 )); then
|
||||
# first arg: operation
|
||||
compadd create publish rename delete track
|
||||
elif (( CURRENT == 3 )); then
|
||||
# second arg: remote branch name
|
||||
remotes=`git remote | tr '\n' '|' | sed "s/\|$//g"`
|
||||
compadd `git branch -r | grep -v HEAD | sed "s/$remotes\///" | sed "s/ //g"`
|
||||
elif (( CURRENT == 4 )); then
|
||||
# third arg: remote name
|
||||
compadd `git remote`
|
||||
fi
|
||||
else;
|
||||
_files
|
||||
fi
|
||||
}
|
||||
compdef _git_remote_branch grb
|
||||
|
|
@ -10,194 +10,203 @@ plugins=(... git)
|
|||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command |
|
||||
|:---------------------|:------------------------------------------------------------------------------------------------------------------------------|
|
||||
| g | git |
|
||||
| ga | git add |
|
||||
| gaa | git add --all |
|
||||
| gapa | git add --patch |
|
||||
| gau | git add --update |
|
||||
| gav | git add --verbose |
|
||||
| gap | git apply |
|
||||
| gb | git branch |
|
||||
| gba | git branch -a |
|
||||
| gbd | git branch -d |
|
||||
| gbda | git branch --no-color --merged \| command grep -vE "^(\+|\*\|\s*(master\|develop\|dev)\s*$)" \| command xargs -n 1 git branch -d |
|
||||
| gbD | git branch -D |
|
||||
| gbl | git blame -b -w |
|
||||
| gbnm | git branch --no-merged |
|
||||
| gbr | git branch --remote |
|
||||
| gbs | git bisect |
|
||||
| gbsb | git bisect bad |
|
||||
| gbsg | git bisect good |
|
||||
| gbsr | git bisect reset |
|
||||
| gbss | git bisect start |
|
||||
| gc | git commit -v |
|
||||
| gc! | git commit -v --amend |
|
||||
| gcn! | git commit -v --no-edit --amend |
|
||||
| gca | git commit -v -a |
|
||||
| gca! | git commit -v -a --amend |
|
||||
| gcan! | git commit -v -a --no-edit --amend |
|
||||
| gcans! | git commit -v -a -s --no-edit --amend |
|
||||
| gcam | git commit -a -m |
|
||||
| gcsm | git commit -s -m |
|
||||
| gcb | git checkout -b |
|
||||
| gcf | git config --list |
|
||||
| gcl | git clone --recurse-submodules |
|
||||
| gclean | git clean -id |
|
||||
| gpristine | git reset --hard && git clean -dfx |
|
||||
| gcm | git checkout master |
|
||||
| gcd | git checkout develop |
|
||||
| gcmsg | git commit -m |
|
||||
| gco | git checkout |
|
||||
| gcount | git shortlog -sn |
|
||||
| gcp | git cherry-pick |
|
||||
| gcpa | git cherry-pick --abort |
|
||||
| gcpc | git cherry-pick --continue |
|
||||
| gcs | git commit -S |
|
||||
| gd | git diff |
|
||||
| gdca | git diff --cached |
|
||||
| gdcw | git diff --cached --word-diff |
|
||||
| gdct | git describe --tags $(git rev-list --tags --max-count=1) |
|
||||
| gds | git diff --staged |
|
||||
| gdt | git diff-tree --no-commit-id --name-only -r |
|
||||
| gdv | git diff -w $@ \| view - |
|
||||
| gdw | git diff --word-diff |
|
||||
| gf | git fetch |
|
||||
| gfa | git fetch --all --prune |
|
||||
| gfg | git ls-files \| grep |
|
||||
| gfo | git fetch origin |
|
||||
| gg | git gui citool |
|
||||
| gga | git gui citool --amend |
|
||||
| ggf | git push --force origin $(current_branch) |
|
||||
| ggfl | git push --force-with-lease origin $(current_branch) |
|
||||
| ggl | git pull origin $(current_branch) |
|
||||
| ggp | git push origin $(current_branch) |
|
||||
| ggpnp | ggl && ggp |
|
||||
| ggpull | git pull origin "$(git_current_branch)" |
|
||||
| ggpur | ggu |
|
||||
| ggpush | git push origin "$(git_current_branch)" |
|
||||
| ggsup | git branch --set-upstream-to=origin/$(git_current_branch) |
|
||||
| ggu | git pull --rebase origin $(current_branch) |
|
||||
| gpsup | git push --set-upstream origin $(git_current_branch) |
|
||||
| ghh | git help |
|
||||
| gignore | git update-index --assume-unchanged |
|
||||
| gignored | git ls-files -v \| grep "^[[:lower:]]" |
|
||||
| git-svn-dcommit-push | git svn dcommit && git push github master:svntrunk |
|
||||
| gk | gitk --all --branches |
|
||||
| gke | gitk --all $(git log -g --pretty=%h) |
|
||||
| gl | git pull |
|
||||
| glg | git log --stat |
|
||||
| glgp | git log --stat -p |
|
||||
| glgg | git log --graph |
|
||||
| glgga | git log --graph --decorate --all |
|
||||
| glgm | git log --graph --max-count=10 |
|
||||
| glo | git log --oneline --decorate |
|
||||
| glol | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' |
|
||||
| glols | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --stat |
|
||||
| glod | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' |
|
||||
| glods | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short |
|
||||
| glola | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --all |
|
||||
| glog | git log --oneline --decorate --graph |
|
||||
| gloga | git log --oneline --decorate --graph --all |
|
||||
| glp | `_git_log_prettily` |
|
||||
| gm | git merge |
|
||||
| gmom | git merge origin/master |
|
||||
| gmt | git mergetool --no-prompt |
|
||||
| gmtvim | git mergetool --no-prompt --tool=vimdiff |
|
||||
| gmum | git merge upstream/master |
|
||||
| gma | git merge --abort |
|
||||
| gp | git push |
|
||||
| gpd | git push --dry-run |
|
||||
| gpf | git push --force-with-lease |
|
||||
| gpf! | git push --force |
|
||||
| gpoat | git push origin --all && git push origin --tags |
|
||||
| gpu | git push upstream |
|
||||
| gpv | git push -v |
|
||||
| gr | git remote |
|
||||
| gra | git remote add |
|
||||
| grb | git rebase |
|
||||
| grba | git rebase --abort |
|
||||
| grbc | git rebase --continue |
|
||||
| grbd | git rebase develop |
|
||||
| grbi | git rebase -i |
|
||||
| grbm | git rebase master |
|
||||
| grbs | git rebase --skip |
|
||||
| grev | git revert |
|
||||
| grh | git reset |
|
||||
| grhh | git reset --hard |
|
||||
| groh | git reset origin/$(git_current_branch) --hard |
|
||||
| grm | git rm |
|
||||
| grmc | git rm --cached |
|
||||
| grmv | git remote rename |
|
||||
| grrm | git remote remove |
|
||||
| grs | git restore |
|
||||
| grset | git remote set-url |
|
||||
| grss | git restore --source |
|
||||
| grt | cd "$(git rev-parse --show-toplevel \|\| echo .)" |
|
||||
| gru | git reset -- |
|
||||
| grup | git remote update |
|
||||
| grv | git remote -v |
|
||||
| gsb | git status -sb |
|
||||
| gsd | git svn dcommit |
|
||||
| gsh | git show |
|
||||
| gsi | git submodule init |
|
||||
| gsps | git show --pretty=short --show-signature |
|
||||
| gsr | git svn rebase |
|
||||
| gss | git status -s |
|
||||
| gst | git status |
|
||||
| gsta | git stash push |
|
||||
| gsta | git stash save |
|
||||
| gstaa | git stash apply |
|
||||
| gstc | git stash clear |
|
||||
| gstd | git stash drop |
|
||||
| gstl | git stash list |
|
||||
| gstp | git stash pop |
|
||||
| gsts | git stash show --text |
|
||||
| gstall | git stash --all |
|
||||
| gsu | git submodule update |
|
||||
| gsw | git switch |
|
||||
| gswc | git switch -c |
|
||||
| gts | git tag -s |
|
||||
| gtv | git tag \| sort -V |
|
||||
| gtl | gtl(){ git tag --sort=-v:refname -n -l ${1}* }; noglob gtl |
|
||||
| gunignore | git update-index --no-assume-unchanged |
|
||||
| gunwip | git log -n 1 \| grep -q -c "\-\-wip\-\-" && git reset HEAD~1 |
|
||||
| gup | git pull --rebase |
|
||||
| gupv | git pull --rebase -v |
|
||||
| gupa | git pull --rebase --autostash |
|
||||
| gupav | git pull --rebase --autostash -v |
|
||||
| glum | git pull upstream master |
|
||||
| gwch | git whatchanged -p --abbrev-commit --pretty=medium |
|
||||
| gwip | git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]" |
|
||||
| Alias | Command |
|
||||
|:---------------------|:---------------------------------------------------------------------------------------------------------------------------------|
|
||||
| g | git |
|
||||
| ga | git add |
|
||||
| gaa | git add --all |
|
||||
| gapa | git add --patch |
|
||||
| gau | git add --update |
|
||||
| gav | git add --verbose |
|
||||
| gap | git apply |
|
||||
| gapt | git apply --3way |
|
||||
| gb | git branch |
|
||||
| gba | git branch -a |
|
||||
| gbd | git branch -d |
|
||||
| gbda | git branch --no-color --merged \| command grep -vE "^(\+\|\*\|\s*(master\|development\|develop\|devel\|dev)\s*$)" \| command xargs -n 1 git branch -d |
|
||||
| gbD | git branch -D |
|
||||
| gbl | git blame -b -w |
|
||||
| gbnm | git branch --no-merged |
|
||||
| gbr | git branch --remote |
|
||||
| gbs | git bisect |
|
||||
| gbsb | git bisect bad |
|
||||
| gbsg | git bisect good |
|
||||
| gbsr | git bisect reset |
|
||||
| gbss | git bisect start |
|
||||
| gc | git commit -v |
|
||||
| gc! | git commit -v --amend |
|
||||
| gcn! | git commit -v --no-edit --amend |
|
||||
| gca | git commit -v -a |
|
||||
| gca! | git commit -v -a --amend |
|
||||
| gcan! | git commit -v -a --no-edit --amend |
|
||||
| gcans! | git commit -v -a -s --no-edit --amend |
|
||||
| gcam | git commit -a -m |
|
||||
| gcsm | git commit -s -m |
|
||||
| gcb | git checkout -b |
|
||||
| gcf | git config --list |
|
||||
| gcl | git clone --recurse-submodules |
|
||||
| gclean | git clean -id |
|
||||
| gpristine | git reset --hard && git clean -dffx |
|
||||
| gcm | git checkout master |
|
||||
| gcd | git checkout develop |
|
||||
| gcmsg | git commit -m |
|
||||
| gco | git checkout |
|
||||
| gcount | git shortlog -sn |
|
||||
| gcp | git cherry-pick |
|
||||
| gcpa | git cherry-pick --abort |
|
||||
| gcpc | git cherry-pick --continue |
|
||||
| gcs | git commit -S |
|
||||
| gd | git diff |
|
||||
| gdca | git diff --cached |
|
||||
| gdcw | git diff --cached --word-diff |
|
||||
| gdct | git describe --tags $(git rev-list --tags --max-count=1) |
|
||||
| gds | git diff --staged |
|
||||
| gdt | git diff-tree --no-commit-id --name-only -r |
|
||||
| gdnolock | git diff $@ ":(exclude)package-lock.json" ":(exclude)*.lock" |
|
||||
| gdv | git diff -w $@ \| view - |
|
||||
| gdw | git diff --word-diff |
|
||||
| gf | git fetch |
|
||||
| gfa | git fetch --all --prune |
|
||||
| gfg | git ls-files \| grep |
|
||||
| gfo | git fetch origin |
|
||||
| gg | git gui citool |
|
||||
| gga | git gui citool --amend |
|
||||
| ggf | git push --force origin $(current_branch) |
|
||||
| ggfl | git push --force-with-lease origin $(current_branch) |
|
||||
| ggl | git pull origin $(current_branch) |
|
||||
| ggp | git push origin $(current_branch) |
|
||||
| ggpnp | ggl && ggp |
|
||||
| ggpull | git pull origin "$(git_current_branch)" |
|
||||
| ggpur | ggu |
|
||||
| ggpush | git push origin "$(git_current_branch)" |
|
||||
| ggsup | git branch --set-upstream-to=origin/$(git_current_branch) |
|
||||
| ggu | git pull --rebase origin $(current_branch) |
|
||||
| gpsup | git push --set-upstream origin $(git_current_branch) |
|
||||
| ghh | git help |
|
||||
| gignore | git update-index --assume-unchanged |
|
||||
| gignored | git ls-files -v \| grep "^[[:lower:]]" |
|
||||
| git-svn-dcommit-push | git svn dcommit && git push github master:svntrunk |
|
||||
| gk | gitk --all --branches |
|
||||
| gke | gitk --all $(git log -g --pretty=%h) |
|
||||
| gl | git pull |
|
||||
| glg | git log --stat |
|
||||
| glgp | git log --stat -p |
|
||||
| glgg | git log --graph |
|
||||
| glgga | git log --graph --decorate --all |
|
||||
| glgm | git log --graph --max-count=10 |
|
||||
| glo | git log --oneline --decorate |
|
||||
| glol | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' |
|
||||
| glols | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --stat |
|
||||
| glod | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' |
|
||||
| glods | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short |
|
||||
| glola | git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --all |
|
||||
| glog | git log --oneline --decorate --graph |
|
||||
| gloga | git log --oneline --decorate --graph --all |
|
||||
| glp | git log --pretty=\<format\> |
|
||||
| gm | git merge |
|
||||
| gmom | git merge origin/master |
|
||||
| gmt | git mergetool --no-prompt |
|
||||
| gmtvim | git mergetool --no-prompt --tool=vimdiff |
|
||||
| gmum | git merge upstream/master |
|
||||
| gma | git merge --abort |
|
||||
| gp | git push |
|
||||
| gpd | git push --dry-run |
|
||||
| gpf | git push --force-with-lease |
|
||||
| gpf! | git push --force |
|
||||
| gpoat | git push origin --all && git push origin --tags |
|
||||
| gpu | git push upstream |
|
||||
| gpv | git push -v |
|
||||
| gr | git remote |
|
||||
| gra | git remote add |
|
||||
| grb | git rebase |
|
||||
| grba | git rebase --abort |
|
||||
| grbc | git rebase --continue |
|
||||
| grbd | git rebase develop |
|
||||
| grbi | git rebase -i |
|
||||
| grbm | git rebase master |
|
||||
| grbs | git rebase --skip |
|
||||
| grev | git revert |
|
||||
| grh | git reset |
|
||||
| grhh | git reset --hard |
|
||||
| groh | git reset origin/$(git_current_branch) --hard |
|
||||
| grm | git rm |
|
||||
| grmc | git rm --cached |
|
||||
| grmv | git remote rename |
|
||||
| grrm | git remote remove |
|
||||
| grs | git restore |
|
||||
| grset | git remote set-url |
|
||||
| grss | git restore --source |
|
||||
| grt | cd "$(git rev-parse --show-toplevel \|\| echo .)" |
|
||||
| gru | git reset -- |
|
||||
| grup | git remote update |
|
||||
| grv | git remote -v |
|
||||
| gsb | git status -sb |
|
||||
| gsd | git svn dcommit |
|
||||
| gsh | git show |
|
||||
| gsi | git submodule init |
|
||||
| gsps | git show --pretty=short --show-signature |
|
||||
| gsr | git svn rebase |
|
||||
| gss | git status -s |
|
||||
| gst | git status |
|
||||
| gsta | git stash push |
|
||||
| gsta | git stash save |
|
||||
| gstaa | git stash apply |
|
||||
| gstc | git stash clear |
|
||||
| gstd | git stash drop |
|
||||
| gstl | git stash list |
|
||||
| gstp | git stash pop |
|
||||
| gsts | git stash show --text |
|
||||
| gstu | git stash --include-untracked |
|
||||
| gstall | git stash --all |
|
||||
| gsu | git submodule update |
|
||||
| gsw | git switch |
|
||||
| gswc | git switch -c |
|
||||
| gts | git tag -s |
|
||||
| gtv | git tag \| sort -V |
|
||||
| gtl | gtl(){ git tag --sort=-v:refname -n -l ${1}* }; noglob gtl |
|
||||
| gunignore | git update-index --no-assume-unchanged |
|
||||
| gunwip | git log -n 1 \| grep -q -c "\-\-wip\-\-" && git reset HEAD~1 |
|
||||
| gup | git pull --rebase |
|
||||
| gupv | git pull --rebase -v |
|
||||
| gupa | git pull --rebase --autostash |
|
||||
| gupav | git pull --rebase --autostash -v |
|
||||
| glum | git pull upstream master |
|
||||
| gwch | git whatchanged -p --abbrev-commit --pretty=medium |
|
||||
| gwip | git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]" |
|
||||
| gam | git am |
|
||||
| gamc | git am --continue |
|
||||
| gams | git am --skip |
|
||||
| gama | git am --abort |
|
||||
| gamscp | git am --show-current-patch |
|
||||
|
||||
### Deprecated
|
||||
### Deprecated aliases
|
||||
|
||||
These are aliases that have been removed, renamed, or otherwise modified in a way that may, or may not, receive further support.
|
||||
|
||||
| Alias | Command | Modification |
|
||||
| :----- | :----------------------------------------------------------------------------------| --------------------------------------------------------------------------------------------------- |
|
||||
| gap | git add --patch | new alias `gapa` |
|
||||
| gcl | git config --list | new alias `gcf` |
|
||||
| gdc | git diff --cached | new alias `gdca` |
|
||||
| gdt | git difftool | no replacement |
|
||||
| ggpull | git pull origin $(current_branch) | new alias `ggl` (`ggpull` still exists for now though) |
|
||||
| ggpur | git pull --rebase origin $(current_branch) | new alias `ggu` (`ggpur` still exists for now though) |
|
||||
| ggpush | git push origin $(current_branch) | new alias `ggp` (`ggpush` still exists for now though) |
|
||||
| gk | gitk --all --branches | now aliased to `gitk --all --branches` |
|
||||
| glg | git log --stat --max-count = 10 | now aliased to `git log --stat --color` |
|
||||
| glgg | git log --graph --max-count = 10 | now aliased to `git log --graph --color` |
|
||||
| gwc | git whatchanged -p --abbrev-commit --pretty = medium | new alias `gwch` |
|
||||
| Alias | Command | Modification |
|
||||
| :----- | :----------------------------------------------------- | :----------------------------------------------------- |
|
||||
| gap | `git add --patch` | new alias `gapa` |
|
||||
| gcl | `git config --list` | new alias `gcf` |
|
||||
| gdc | `git diff --cached` | new alias `gdca` |
|
||||
| gdt | `git difftool` | no replacement |
|
||||
| ggpull | `git pull origin $(current_branch)` | new alias `ggl` (`ggpull` still exists for now though) |
|
||||
| ggpur | `git pull --rebase origin $(current_branch)` | new alias `ggu` (`ggpur` still exists for now though) |
|
||||
| ggpush | `git push origin $(current_branch)` | new alias `ggp` (`ggpush` still exists for now though) |
|
||||
| gk | `gitk --all --branches` | now aliased to `gitk --all --branches` |
|
||||
| glg | `git log --stat --max-count = 10` | now aliased to `git log --stat --color` |
|
||||
| glgg | `git log --graph --max-count = 10` | now aliased to `git log --graph --color` |
|
||||
| gwc | `git whatchanged -p --abbrev-commit --pretty = medium` | new alias `gwch` |
|
||||
|
||||
## Functions
|
||||
|
||||
### Current
|
||||
|
||||
| Command | Description |
|
||||
|:-----------------------|:----------------------------------------|
|
||||
| current_branch | Return the name of the current branch |
|
||||
| git_current_user_name | Returns the `user.name` config value |
|
||||
| git_current_user_email | Returns the `user.email` config value |
|
||||
| Command | Description |
|
||||
|:-----------------------|:---------------------------------------------------------|
|
||||
| `grename <old> <new>` | Rename `old` branch to `new`, including in origin remote |
|
||||
| current_branch | Return the name of the current branch |
|
||||
| git_current_user_name | Returns the `user.name` config value |
|
||||
| git_current_user_email | Returns the `user.email` config value |
|
||||
|
||||
### Work in Progress (WIP)
|
||||
|
||||
|
|
@ -209,7 +218,7 @@ These features allow to pause a branch development and switch to another one (_"
|
|||
| gwip | Commit wip branch |
|
||||
| gunwip | Uncommit wip branch |
|
||||
|
||||
### Deprecated
|
||||
### Deprecated functions
|
||||
|
||||
| Command | Description | Reason |
|
||||
|:-----------------------|:----------------------------------------|:----------------------------------------------------------------|
|
||||
|
|
|
|||
|
|
@ -38,11 +38,12 @@ alias gapa='git add --patch'
|
|||
alias gau='git add --update'
|
||||
alias gav='git add --verbose'
|
||||
alias gap='git apply'
|
||||
alias gapt='git apply --3way'
|
||||
|
||||
alias gb='git branch'
|
||||
alias gba='git branch -a'
|
||||
alias gbd='git branch -d'
|
||||
alias gbda='git branch --no-color --merged | command grep -vE "^(\+|\*|\s*(master|develop|dev)\s*$)" | command xargs -n 1 git branch -d'
|
||||
alias gbda='git branch --no-color --merged | command grep -vE "^(\+|\*|\s*(master|development|develop|devel|dev)\s*$)" | command xargs -n 1 git branch -d'
|
||||
alias gbD='git branch -D'
|
||||
alias gbl='git blame -b -w'
|
||||
alias gbnm='git branch --no-merged'
|
||||
|
|
@ -66,7 +67,7 @@ alias gcb='git checkout -b'
|
|||
alias gcf='git config --list'
|
||||
alias gcl='git clone --recurse-submodules'
|
||||
alias gclean='git clean -id'
|
||||
alias gpristine='git reset --hard && git clean -dfx'
|
||||
alias gpristine='git reset --hard && git clean -dffx'
|
||||
alias gcm='git checkout master'
|
||||
alias gcd='git checkout develop'
|
||||
alias gcmsg='git commit -m'
|
||||
|
|
@ -85,6 +86,11 @@ alias gds='git diff --staged'
|
|||
alias gdt='git diff-tree --no-commit-id --name-only -r'
|
||||
alias gdw='git diff --word-diff'
|
||||
|
||||
function gdnolock() {
|
||||
git diff "$@" ":(exclude)package-lock.json" ":(exclude)*.lock"
|
||||
}
|
||||
compdef _git gdnolock=git-diff
|
||||
|
||||
function gdv() { git diff -w "$@" | view - }
|
||||
compdef _git gdv=git-diff
|
||||
|
||||
|
|
@ -236,6 +242,7 @@ alias gstd='git stash drop'
|
|||
alias gstl='git stash list'
|
||||
alias gstp='git stash pop'
|
||||
alias gsts='git stash show --text'
|
||||
alias gstu='git stash --include-untracked'
|
||||
alias gstall='git stash --all'
|
||||
alias gsu='git submodule update'
|
||||
alias gsw='git switch'
|
||||
|
|
@ -255,3 +262,23 @@ alias glum='git pull upstream master'
|
|||
|
||||
alias gwch='git whatchanged -p --abbrev-commit --pretty=medium'
|
||||
alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]"'
|
||||
|
||||
alias gam='git am'
|
||||
alias gamc='git am --continue'
|
||||
alias gams='git am --skip'
|
||||
alias gama='git am --abort'
|
||||
alias gamscp='git am --show-current-patch'
|
||||
|
||||
function grename() {
|
||||
if [[ -z "$1" || -z "$2" ]]; then
|
||||
echo "Usage: $0 old_branch new_branch"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Rename branch locally
|
||||
git branch -m "$1" "$2"
|
||||
# Rename branch in origin remote
|
||||
if git push origin :"$1"; then
|
||||
git push --set-upstream origin "$2"
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Gitfast plugin
|
||||
|
||||
This plugin adds completion for Git, using the zsh completion from git.git folks, which is much faster than the official one from zsh. A lot of zsh-specific features are not supported, like descriptions for every argument, but everything the bash completion has, this one does too (as it is using it behind the scenes). Not only is it faster, it should be more robust, and updated regularly to the latest git upstream version..
|
||||
This plugin adds completion for Git, using the zsh completion from git.git folks, which is much faster than the official one from zsh. A lot of zsh-specific features are not supported, like descriptions for every argument, but everything the bash completion has, this one does too (as it is using it behind the scenes). Not only is it faster, it should be more robust, and updated regularly to the latest git upstream version.
|
||||
|
||||
To use it, add `gitfast` to the plugins array in your zshrc file:
|
||||
|
||||
|
|
@ -11,5 +11,5 @@ plugins=(... gitfast)
|
|||
## Aliases
|
||||
|
||||
An earlier version of the plugin also loaded the git plugin. If you want to keep those
|
||||
aliases enable the [git plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/git)
|
||||
aliases enable the [git plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git)
|
||||
as well.
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ if [ -z "$script" ]; then
|
|||
local -a locations
|
||||
local e
|
||||
locations=(
|
||||
$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
|
||||
"$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash"
|
||||
'/etc/bash_completion.d/git' # fedora, old debian
|
||||
'/usr/share/bash-completion/completions/git' # arch, ubuntu, new debian
|
||||
'/usr/share/bash-completion/git' # gentoo
|
||||
|
|
@ -39,7 +39,7 @@ if [ -z "$script" ]; then
|
|||
test -f $e && script="$e" && break
|
||||
done
|
||||
fi
|
||||
GIT_SOURCING_ZSH_COMPLETION=y . "$script"
|
||||
ZSH_VERSION='' . "$script"
|
||||
|
||||
__gitcomp ()
|
||||
{
|
||||
|
|
@ -93,22 +93,13 @@ __gitcomp_nl_append ()
|
|||
compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0
|
||||
}
|
||||
|
||||
__gitcomp_file_direct ()
|
||||
{
|
||||
emulate -L zsh
|
||||
|
||||
local IFS=$'\n'
|
||||
compset -P '*[=:]'
|
||||
compadd -f -- ${=1} && _ret=0
|
||||
}
|
||||
|
||||
__gitcomp_file ()
|
||||
{
|
||||
emulate -L zsh
|
||||
|
||||
local IFS=$'\n'
|
||||
compset -P '*[=:]'
|
||||
compadd -p "${2-}" -f -- ${=1} && _ret=0
|
||||
compadd -Q -p "${2-}" -f -- ${=1} && _ret=0
|
||||
}
|
||||
|
||||
__git_zsh_bash_func ()
|
||||
|
|
@ -232,8 +223,10 @@ _git ()
|
|||
|
||||
if (( $+functions[__${service}_zsh_main] )); then
|
||||
__${service}_zsh_main
|
||||
else
|
||||
elif (( $+functions[__${service}_main] )); then
|
||||
emulate ksh -c __${service}_main
|
||||
elif (( $+functions[_${service}] )); then
|
||||
emulate ksh -c _${service}
|
||||
fi
|
||||
|
||||
let _ret && _default && _ret=0
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -219,7 +219,7 @@ __git_ps1_show_upstream ()
|
|||
if [[ -n "$count" && -n "$name" ]]; then
|
||||
__git_ps1_upstream_name=$(git rev-parse \
|
||||
--abbrev-ref "$upstream" 2>/dev/null)
|
||||
if [ "$pcmode" = yes ] && [ "$ps1_expanded" = yes ]; then
|
||||
if [ $pcmode = yes ] && [ $ps1_expanded = yes ]; then
|
||||
p="$p \${__git_ps1_upstream_name}"
|
||||
else
|
||||
p="$p ${__git_ps1_upstream_name}"
|
||||
|
|
@ -237,7 +237,7 @@ __git_ps1_show_upstream ()
|
|||
# to build a gitstring.
|
||||
__git_ps1_colorize_gitstring ()
|
||||
{
|
||||
if [[ -n "${ZSH_VERSION-}" ]]; then
|
||||
if [[ -n ${ZSH_VERSION-} ]]; then
|
||||
local c_red='%F{red}'
|
||||
local c_green='%F{green}'
|
||||
local c_lblue='%F{blue}'
|
||||
|
|
@ -255,7 +255,7 @@ __git_ps1_colorize_gitstring ()
|
|||
local flags_color="$c_lblue"
|
||||
|
||||
local branch_color=""
|
||||
if [ "$detached" = no ]; then
|
||||
if [ $detached = no ]; then
|
||||
branch_color="$ok_color"
|
||||
else
|
||||
branch_color="$bad_color"
|
||||
|
|
@ -508,13 +508,13 @@ __git_ps1 ()
|
|||
|
||||
# NO color option unless in PROMPT_COMMAND mode or it's Zsh
|
||||
if [ -n "${GIT_PS1_SHOWCOLORHINTS-}" ]; then
|
||||
if [ "$pcmode" = yes ] || [ -n "${ZSH_VERSION-}" ]; then
|
||||
if [ $pcmode = yes ] || [ -n "${ZSH_VERSION-}" ]; then
|
||||
__git_ps1_colorize_gitstring
|
||||
fi
|
||||
fi
|
||||
|
||||
b=${b##refs/heads/}
|
||||
if [ "$pcmode" = yes ] && [ "$ps1_expanded" = yes ]; then
|
||||
if [ $pcmode = yes ] && [ $ps1_expanded = yes ]; then
|
||||
__git_ps1_branch_name=$b
|
||||
b="\${__git_ps1_branch_name}"
|
||||
fi
|
||||
|
|
@ -522,7 +522,7 @@ __git_ps1 ()
|
|||
local f="$w$i$s$u"
|
||||
local gitstring="$c$b${f:+$z$f}$r$p"
|
||||
|
||||
if [ "$pcmode" = yes ]; then
|
||||
if [ $pcmode = yes ]; then
|
||||
if [ "${__git_printf_supports_v-}" != yes ]; then
|
||||
gitstring=$(printf -- "$printf_format" "$gitstring")
|
||||
else
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# github
|
||||
# github plugin
|
||||
|
||||
This plugin supports working with GitHub from the command line. It provides a few things:
|
||||
|
||||
|
|
@ -6,7 +6,7 @@ This plugin supports working with GitHub from the command line. It provides a fe
|
|||
* Completion for the `github` Ruby gem.
|
||||
* Convenience functions for working with repos and URLs.
|
||||
|
||||
### Functions
|
||||
### Functions
|
||||
|
||||
* `empty_gh` - Creates a new empty repo (with a `README.md`) and pushes it to GitHub
|
||||
* `new_gh` - Initializes an existing directory as a repo and pushes it to GitHub
|
||||
|
|
@ -14,13 +14,13 @@ This plugin supports working with GitHub from the command line. It provides a fe
|
|||
* `git.io` - Shortens a URL using [git.io](https://git.io)
|
||||
|
||||
|
||||
## Installation
|
||||
## Installation
|
||||
|
||||
[Hub](https://github.com/github/hub) needs to be installed if you want to use it. On OS X with Homebrew, this can be done with `brew install hub`. The `hub` completion definition needs to be added to your `$FPATH` before initializing OMZ.
|
||||
|
||||
The [`github` Ruby gem](https://github.com/defunkt/github-gem) needs to be installed if you want to use it.
|
||||
|
||||
### Configuration
|
||||
### Configuration
|
||||
|
||||
These settings affect `github`'s behavior.
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ These settings affect `github`'s behavior.
|
|||
|
||||
See `man hub` for more details.
|
||||
|
||||
### Homebrew installation note
|
||||
### Homebrew installation note
|
||||
|
||||
If you have installed `hub` using Homebrew, its completions may not be on your `$FPATH` if you are using the system `zsh`. Homebrew installs `zsh` completion definitions to `/usr/local/share/zsh/site-functions`, which will be on `$FPATH` for the Homebrew-installed `zsh`, but not for the system `zsh`. If you want it to work with the system `zsh`, add this to your `~/.zshrc` before it sources `oh-my-zsh.sh`.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
function gi() { curl -fL https://www.gitignore.io/api/${(j:,:)@} }
|
||||
function gi() { curl -fLw '\n' https://www.gitignore.io/api/"${(j:,:)@}" }
|
||||
|
||||
_gitignoreio_get_command_list() {
|
||||
curl -sfL https://www.gitignore.io/api/list | tr "," "\n"
|
||||
|
|
|
|||
9
plugins/glassfish/README.md
Normal file
9
plugins/glassfish/README.md
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# glassfish
|
||||
|
||||
The glassfish plugin adds completion for the `asadmin` utility, a command to manage
|
||||
[Oracle GlassFish](https://docs.oracle.com/cd/E18930_01/html/821-2416/giobi.html) servers.
|
||||
|
||||
To use it, add `glassfish` to the plugins array in your zshrc file:
|
||||
```zsh
|
||||
plugins=(... glassfish)
|
||||
```
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue