commit
d92738b310
40 changed files with 148 additions and 109 deletions
CONTRIBUTING.md
modules
README.md
autosuggestions
command-not-found
fasd
git
node
osx
perl
prompt/functions
python
rsync
ruby
tmux
utility
runcoms
|
@ -32,7 +32,7 @@ there are a number of additional things to keep in mind.
|
||||||
- Prefer `zstyle` over environment variables for configuration.
|
- Prefer `zstyle` over environment variables for configuration.
|
||||||
- Prefer (( ... )) over [[ ... ]] for arithmetic expression.
|
- Prefer (( ... )) over [[ ... ]] for arithmetic expression.
|
||||||
- Use the function keyword to define functions.
|
- Use the function keyword to define functions.
|
||||||
- The 80 character hard limit can be waved for readability.
|
- The 80 character hard limit can be waived for readability.
|
||||||
|
|
||||||
#### Using an Alternative zprezto Directory
|
#### Using an Alternative zprezto Directory
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ Integrates zsh-autosuggestions into Prezto.
|
||||||
Command-Not-Found
|
Command-Not-Found
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
Loads the command-not-found tool on Debian-based distributions.
|
Loads the command-not-found tool on macOS or Debian-based distributions.
|
||||||
|
|
||||||
Completion
|
Completion
|
||||||
----------
|
----------
|
||||||
|
@ -122,7 +122,7 @@ Initializes OCaml package management.
|
||||||
OSX
|
OSX
|
||||||
---
|
---
|
||||||
|
|
||||||
Defines Mac OS X aliases and functions.
|
Defines macOS aliases and functions.
|
||||||
|
|
||||||
Pacman
|
Pacman
|
||||||
------
|
------
|
||||||
|
@ -132,7 +132,7 @@ Provides aliases and functions for the Pacman package manager and frontends.
|
||||||
Perl
|
Perl
|
||||||
----
|
----
|
||||||
|
|
||||||
Enables local Perl module installation on Mac OS X and defines alises.
|
Enables local Perl module installation on macOS and defines alises.
|
||||||
|
|
||||||
Prompt
|
Prompt
|
||||||
------
|
------
|
||||||
|
|
|
@ -46,6 +46,14 @@ To set the query found color, add the following line to *zpreztorc*:
|
||||||
zstyle ':prezto:module:autosuggestions:color' found ''
|
zstyle ':prezto:module:autosuggestions:color' found ''
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Troubleshooting
|
||||||
|
---------------
|
||||||
|
|
||||||
|
### Autosuggestions from previous sessions don't show up
|
||||||
|
|
||||||
|
For autosuggestions from previous shell sessions to work, please make sure you
|
||||||
|
also have the `history` module enabled.
|
||||||
|
|
||||||
Authors
|
Authors
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,9 @@ if [[ -s '/etc/zsh_command_not_found' ]]; then
|
||||||
# Load command-not-found on Arch Linux-based distributions.
|
# Load command-not-found on Arch Linux-based distributions.
|
||||||
elif [[ -s '/usr/share/doc/pkgfile/command-not-found.zsh' ]]; then
|
elif [[ -s '/usr/share/doc/pkgfile/command-not-found.zsh' ]]; then
|
||||||
source '/usr/share/doc/pkgfile/command-not-found.zsh'
|
source '/usr/share/doc/pkgfile/command-not-found.zsh'
|
||||||
# Load command-not-found on Mac OS X when homebrew tap is configured.
|
# Load command-not-found on macOS when homebrew tap is configured.
|
||||||
elif (( $+commands[brew] )) && brew command command-not-found-init > /dev/null 2>&1; then
|
elif [[ -s '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh' ]]; then
|
||||||
eval "$(brew command-not-found-init)"
|
source '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh'
|
||||||
# Return if requirements are not found.
|
# Return if requirements are not found.
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
|
|
|
@ -20,7 +20,9 @@ fi
|
||||||
#
|
#
|
||||||
|
|
||||||
cache_file="${TMPDIR:-/tmp}/prezto-fasd-cache.$UID.zsh"
|
cache_file="${TMPDIR:-/tmp}/prezto-fasd-cache.$UID.zsh"
|
||||||
if [[ "${commands[fasd]}" -nt "$cache_file" || ! -s "$cache_file" ]]; then
|
if [[ "${commands[fasd]}" -nt "$cache_file" \
|
||||||
|
|| "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \
|
||||||
|
|| ! -s "$cache_file" ]]; then
|
||||||
# Set the base init arguments.
|
# Set the base init arguments.
|
||||||
init_args=(zsh-hook)
|
init_args=(zsh-hook)
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,8 @@ zstyle ':prezto:module:git:alias' skip 'yes'
|
||||||
- `gcR` removes the *HEAD* commit.
|
- `gcR` removes the *HEAD* commit.
|
||||||
- `gcs` displays various types of objects.
|
- `gcs` displays various types of objects.
|
||||||
- `gcl` lists lost commits.
|
- `gcl` lists lost commits.
|
||||||
|
- `gcy` displays commits yet to be applied to upstream in the short format.
|
||||||
|
- `gcY` displays commits yet to be applied to upstream.
|
||||||
|
|
||||||
### Conflict
|
### Conflict
|
||||||
|
|
||||||
|
@ -231,7 +233,8 @@ zstyle ':prezto:module:git:alias' skip 'yes'
|
||||||
### Push
|
### Push
|
||||||
|
|
||||||
- `gp` updates remote refs along with associated objects.
|
- `gp` updates remote refs along with associated objects.
|
||||||
- `gpf` forcefully updates remote refs along with associated objects.
|
- `gpf` forcefully updates remote refs along with associated objects using the safer `--force-with-lease` option.
|
||||||
|
- `gpF` forcefully updates remote refs along with associated objects using the riskier `--force` option.
|
||||||
- `gpa` updates remote branches along with associated objects.
|
- `gpa` updates remote branches along with associated objects.
|
||||||
- `gpA` updates remote branches and tags along with associated objects.
|
- `gpA` updates remote branches and tags along with associated objects.
|
||||||
- `gpt` updates remote tags along with associated objects.
|
- `gpt` updates remote tags along with associated objects.
|
||||||
|
@ -288,6 +291,11 @@ zstyle ':prezto:module:git:alias' skip 'yes'
|
||||||
- `gSu` fetches and merges the latest changes for all submodule.
|
- `gSu` fetches and merges the latest changes for all submodule.
|
||||||
- `gSx` removes a submodule.
|
- `gSx` removes a submodule.
|
||||||
|
|
||||||
|
### Tag
|
||||||
|
|
||||||
|
- `gt` lists tags or creates tag.
|
||||||
|
- `gtl` lists tags matching pattern.
|
||||||
|
|
||||||
### Working directory
|
### Working directory
|
||||||
|
|
||||||
- `gws` displays working-tree status in the short format.
|
- `gws` displays working-tree status in the short format.
|
||||||
|
@ -307,9 +315,10 @@ zstyle ':prezto:module:git:alias' skip 'yes'
|
||||||
|
|
||||||
The following aliases may shadow system commands:
|
The following aliases may shadow system commands:
|
||||||
|
|
||||||
- `gpt` shadows the [GUID partition table maintenance utility][4].
|
|
||||||
- `gs` shadows the [Ghostscript][5].
|
|
||||||
- `gb` shadows the [GB][9].
|
- `gb` shadows the [GB][9].
|
||||||
|
- `gm` shadows the [Graphics Magick image processor][11].
|
||||||
|
- `gpt` shadows the [GUID partition table maintenance utility][4].
|
||||||
|
- `gs` shadows the [Ghostscript interpreter and previewer][5].
|
||||||
|
|
||||||
If you frequently use the above commands, you may wish to remove said aliases
|
If you frequently use the above commands, you may wish to remove said aliases
|
||||||
from this module or to disable them at the bottom of the zshrc with `unalias`.
|
from this module or to disable them at the bottom of the zshrc with `unalias`.
|
||||||
|
@ -434,9 +443,10 @@ Authors
|
||||||
[2]: https://github.com/defunkt/hub
|
[2]: https://github.com/defunkt/hub
|
||||||
[3]: https://www.github.com
|
[3]: https://www.github.com
|
||||||
[4]: http://www.manpagez.com/man/8/gpt/
|
[4]: http://www.manpagez.com/man/8/gpt/
|
||||||
[5]: http://linux.die.net/man/1/gs
|
[5]: http://www.manpagez.com/man/1/gs/
|
||||||
[6]: https://github.com/sorin-ionescu/prezto/issues
|
[6]: https://github.com/sorin-ionescu/prezto/issues
|
||||||
[7]: https://github.com/sorin-ionescu/prezto/issues/219
|
[7]: https://github.com/sorin-ionescu/prezto/issues/219
|
||||||
[8]: http://www.kernel.org/pub/software/scm/git/docs/git-log.html
|
[8]: http://www.kernel.org/pub/software/scm/git/docs/git-log.html
|
||||||
[9]: https://getgb.io/
|
[9]: https://getgb.io/
|
||||||
[10]: https://github.com/blog/985-git-io-github-url-shortener
|
[10]: https://github.com/blog/985-git-io-github-url-shortener
|
||||||
|
[11]: http://www.manpagez.com/man/1/gm/
|
||||||
|
|
|
@ -69,6 +69,8 @@ if ! zstyle -t ':prezto:module:git:alias' skip 'yes'; then
|
||||||
alias gcR='git reset "HEAD^"'
|
alias gcR='git reset "HEAD^"'
|
||||||
alias gcs='git show'
|
alias gcs='git show'
|
||||||
alias gcl='git-commit-lost'
|
alias gcl='git-commit-lost'
|
||||||
|
alias gcy='git cherry -v --abbrev'
|
||||||
|
alias gcY='git cherry -v'
|
||||||
|
|
||||||
# Conflict (C)
|
# Conflict (C)
|
||||||
alias gCl='git --no-pager diff --name-only --diff-filter=U'
|
alias gCl='git --no-pager diff --name-only --diff-filter=U'
|
||||||
|
@ -250,6 +252,10 @@ if ! zstyle -t ':prezto:module:git:alias' skip 'yes'; then
|
||||||
alias gSu='git submodule foreach git pull origin master'
|
alias gSu='git submodule foreach git pull origin master'
|
||||||
alias gSx='git-submodule-remove'
|
alias gSx='git-submodule-remove'
|
||||||
|
|
||||||
|
# Tag (t)
|
||||||
|
alias gt='git tag'
|
||||||
|
alias gtl='git tag -l'
|
||||||
|
|
||||||
# Working Copy (w)
|
# Working Copy (w)
|
||||||
alias gws='git status --ignore-submodules=${_git_status_ignore_submodules} --short'
|
alias gws='git status --ignore-submodules=${_git_status_ignore_submodules} --short'
|
||||||
alias gwS='git status --ignore-submodules=${_git_status_ignore_submodules}'
|
alias gwS='git status --ignore-submodules=${_git_status_ignore_submodules}'
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||||
#
|
#
|
||||||
|
|
||||||
if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ _arguments -C -s -S \
|
||||||
|
|
||||||
case "$state" in
|
case "$state" in
|
||||||
(remote)
|
(remote)
|
||||||
remotes=($(git config --get-regexp 'remote.*.url' | cut -d. -f2))
|
remotes=($(command git config --get-regexp 'remote.*.url' | cut -d. -f2))
|
||||||
|
|
||||||
_describe -t branch 'remotes' remotes && ret=0
|
_describe -t branch 'remotes' remotes && ret=0
|
||||||
;;
|
;;
|
||||||
|
@ -29,7 +29,7 @@ case "$state" in
|
||||||
remote="$words[(($CURRENT - 1))]"
|
remote="$words[(($CURRENT - 1))]"
|
||||||
|
|
||||||
branches_or_tags=($(
|
branches_or_tags=($(
|
||||||
git ls-remote --heads --tags "$remote" 2> /dev/null | cut -f2
|
command git ls-remote --heads --tags "$remote" 2> /dev/null | cut -f2
|
||||||
))
|
))
|
||||||
|
|
||||||
branches=(HEAD ${${(M)branches_or_tags[@]##refs/heads/?##}##refs/heads/})
|
branches=(HEAD ${${(M)branches_or_tags[@]##refs/heads/?##}##refs/heads/})
|
||||||
|
@ -39,7 +39,7 @@ case "$state" in
|
||||||
_describe -t tag 'tags' tags && ret=0
|
_describe -t tag 'tags' tags && ret=0
|
||||||
;;
|
;;
|
||||||
(file)
|
(file)
|
||||||
files=(${(0)"$(_call_program files git ls-files -z --exclude-standard 2> /dev/null)"})
|
files=(${(0)"$(_call_program files command git ls-files -z --exclude-standard 2> /dev/null)"})
|
||||||
_wanted file expl 'file' _multi_parts - / files && ret=0
|
_wanted file expl 'file' _multi_parts - / files && ret=0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||||
#
|
#
|
||||||
|
|
||||||
if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||||
#
|
#
|
||||||
|
|
||||||
if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ case "$state" in
|
||||||
while IFS=$'\n' read submodule; do
|
while IFS=$'\n' read submodule; do
|
||||||
submodules+=("$submodule")
|
submodules+=("$submodule")
|
||||||
done < <(
|
done < <(
|
||||||
git config --file "$(git-root)/.gitmodules" --list \
|
command git config --file "$(git-root)/.gitmodules" --list \
|
||||||
| grep '.path=' \
|
| grep '.path=' \
|
||||||
| cut -d= -f2-
|
| cut -d= -f2-
|
||||||
)
|
)
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||||
#
|
#
|
||||||
|
|
||||||
if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ local submodule
|
||||||
while IFS=$'\n' read submodule; do
|
while IFS=$'\n' read submodule; do
|
||||||
submodules+=("$submodule")
|
submodules+=("$submodule")
|
||||||
done < <(
|
done < <(
|
||||||
git config --file "$(git-root)/.gitmodules" --list \
|
command git config --file "$(git-root)/.gitmodules" --list \
|
||||||
| grep '.path=' \
|
| grep '.path=' \
|
||||||
| cut -d= -f2-
|
| cut -d= -f2-
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,12 +7,12 @@
|
||||||
|
|
||||||
# function git-branch-current {
|
# function git-branch-current {
|
||||||
|
|
||||||
if ! git rev-parse 2> /dev/null; then
|
if ! command git rev-parse 2> /dev/null; then
|
||||||
print "$0: not a repository: $PWD" >&2
|
print "$0: not a repository: $PWD" >&2
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local ref="$(git symbolic-ref HEAD 2> /dev/null)"
|
local ref="$(command git symbolic-ref HEAD 2> /dev/null)"
|
||||||
|
|
||||||
if [[ -n "$ref" ]]; then
|
if [[ -n "$ref" ]]; then
|
||||||
print "${ref#refs/heads/}"
|
print "${ref#refs/heads/}"
|
||||||
|
|
|
@ -7,15 +7,15 @@
|
||||||
|
|
||||||
# function git-commit-lost {
|
# function git-commit-lost {
|
||||||
|
|
||||||
if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
||||||
print "$0: not a repository work tree: $PWD" >&2
|
print "$0: not a repository work tree: $PWD" >&2
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git fsck 2> /dev/null \
|
command git fsck 2> /dev/null \
|
||||||
| grep "^dangling commit" \
|
| grep "^dangling commit" \
|
||||||
| awk '{print $3}' \
|
| awk '{print $3}' \
|
||||||
| git log \
|
| command git log \
|
||||||
--date-order \
|
--date-order \
|
||||||
--no-walk \
|
--no-walk \
|
||||||
--stdin \
|
--stdin \
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
# function git-dir {
|
# function git-dir {
|
||||||
|
|
||||||
local git_dir="${$(git rev-parse --git-dir):A}"
|
local git_dir="${$(command git rev-parse --git-dir):A}"
|
||||||
|
|
||||||
if [[ -n "$git_dir" ]]; then
|
if [[ -n "$git_dir" ]]; then
|
||||||
print "$git_dir"
|
print "$git_dir"
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
# function git-hub-browse {
|
# function git-hub-browse {
|
||||||
|
|
||||||
if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
||||||
print "$0: not a repository work tree: $PWD" >&2
|
print "$0: not a repository work tree: $PWD" >&2
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
@ -15,7 +15,7 @@ fi
|
||||||
local remotes remote references reference file url
|
local remotes remote references reference file url
|
||||||
|
|
||||||
remote="${1:-origin}"
|
remote="${1:-origin}"
|
||||||
remotes=($(git config --get-regexp 'remote.*.url' | cut -d. -f2))
|
remotes=($(command git config --get-regexp 'remote.*.url' | cut -d. -f2))
|
||||||
|
|
||||||
if (( $remotes[(i)$remote] == $#remotes + 1 )); then
|
if (( $remotes[(i)$remote] == $#remotes + 1 )); then
|
||||||
print "$0: remote not found: $remote" >&2
|
print "$0: remote not found: $remote" >&2
|
||||||
|
@ -23,14 +23,14 @@ if (( $remotes[(i)$remote] == $#remotes + 1 )); then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
url=$(
|
url=$(
|
||||||
git config --get "remote.${remote}.url" \
|
command git config --get "remote.${remote}.url" \
|
||||||
| sed -En "s/(git|https?)(@|:\/\/)github.com(:|\/)(.+)\/(.+).git/https:\/\/github.com\/\4\/\5/p"
|
| sed -En "s/(git|https?)(@|:\/\/)github.com(:|\/)(.+)\/(.+).git/https:\/\/github.com\/\4\/\5/p"
|
||||||
)
|
)
|
||||||
|
|
||||||
reference="${${2:-$(git-branch-current)}:-HEAD}"
|
reference="${${2:-$(git-branch-current)}:-HEAD}"
|
||||||
references=(
|
references=(
|
||||||
HEAD
|
HEAD
|
||||||
${$(git ls-remote --heads --tags "$remote" | awk '{print $2}')##refs/(heads|tags)/}
|
${$(command git ls-remote --heads --tags "$remote" | awk '{print $2}')##refs/(heads|tags)/}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (( $references[(i)$reference] == $#references + 1 )); then
|
if (( $references[(i)$reference] == $#references + 1 )); then
|
||||||
|
@ -39,7 +39,7 @@ if (( $references[(i)$reference] == $#references + 1 )); then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$reference" == 'HEAD' ]]; then
|
if [[ "$reference" == 'HEAD' ]]; then
|
||||||
reference="$(git rev-parse HEAD 2> /dev/null)"
|
reference="$(command git rev-parse HEAD 2> /dev/null)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
file="$3"
|
file="$3"
|
||||||
|
|
|
@ -178,15 +178,15 @@ function git-info {
|
||||||
typeset -gA git_info
|
typeset -gA git_info
|
||||||
|
|
||||||
# Return if not inside a Git repository work tree.
|
# Return if not inside a Git repository work tree.
|
||||||
if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( $# > 0 )); then
|
if (( $# > 0 )); then
|
||||||
if [[ "$1" == [Oo][Nn] ]]; then
|
if [[ "$1" == [Oo][Nn] ]]; then
|
||||||
git config --bool prompt.showinfo true
|
command git config --bool prompt.showinfo true
|
||||||
elif [[ "$1" == [Oo][Ff][Ff] ]]; then
|
elif [[ "$1" == [Oo][Ff][Ff] ]]; then
|
||||||
git config --bool prompt.showinfo false
|
command git config --bool prompt.showinfo false
|
||||||
else
|
else
|
||||||
print "usage: $0 [ on | off ]" >&2
|
print "usage: $0 [ on | off ]" >&2
|
||||||
fi
|
fi
|
||||||
|
@ -194,7 +194,7 @@ function git-info {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Return if git-info is disabled.
|
# Return if git-info is disabled.
|
||||||
if ! is-true "${$(git config --bool prompt.showinfo):-true}"; then
|
if ! is-true "${$(command git config --bool prompt.showinfo):-true}"; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -204,7 +204,7 @@ function git-info {
|
||||||
# Format commit.
|
# Format commit.
|
||||||
zstyle -s ':prezto:module:git:info:commit' format 'commit_format'
|
zstyle -s ':prezto:module:git:info:commit' format 'commit_format'
|
||||||
if [[ -n "$commit_format" ]]; then
|
if [[ -n "$commit_format" ]]; then
|
||||||
commit="$(git rev-parse HEAD 2> /dev/null)"
|
commit="$(command git rev-parse HEAD 2> /dev/null)"
|
||||||
if [[ -n "$commit" ]]; then
|
if [[ -n "$commit" ]]; then
|
||||||
zformat -f commit_formatted "$commit_format" "c:$commit"
|
zformat -f commit_formatted "$commit_format" "c:$commit"
|
||||||
fi
|
fi
|
||||||
|
@ -213,7 +213,7 @@ function git-info {
|
||||||
# Format stashed.
|
# Format stashed.
|
||||||
zstyle -s ':prezto:module:git:info:stashed' format 'stashed_format'
|
zstyle -s ':prezto:module:git:info:stashed' format 'stashed_format'
|
||||||
if [[ -n "$stashed_format" && -f "$(git-dir)/refs/stash" ]]; then
|
if [[ -n "$stashed_format" && -f "$(git-dir)/refs/stash" ]]; then
|
||||||
stashed="$(git stash list 2> /dev/null | wc -l | awk '{print $1}')"
|
stashed="$(command git stash list 2> /dev/null | wc -l | awk '{print $1}')"
|
||||||
if [[ -n "$stashed" ]]; then
|
if [[ -n "$stashed" ]]; then
|
||||||
zformat -f stashed_formatted "$stashed_format" "S:$stashed"
|
zformat -f stashed_formatted "$stashed_format" "S:$stashed"
|
||||||
fi
|
fi
|
||||||
|
@ -229,7 +229,7 @@ function git-info {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get the branch.
|
# Get the branch.
|
||||||
branch="${$(git symbolic-ref HEAD 2> /dev/null)#refs/heads/}"
|
branch="${$(command git symbolic-ref HEAD 2> /dev/null)#refs/heads/}"
|
||||||
|
|
||||||
# Format branch.
|
# Format branch.
|
||||||
zstyle -s ':prezto:module:git:info:branch' format 'branch_format'
|
zstyle -s ':prezto:module:git:info:branch' format 'branch_format'
|
||||||
|
@ -240,7 +240,7 @@ function git-info {
|
||||||
# Format position.
|
# Format position.
|
||||||
zstyle -s ':prezto:module:git:info:position' format 'position_format'
|
zstyle -s ':prezto:module:git:info:position' format 'position_format'
|
||||||
if [[ -z "$branch" && -n "$position_format" ]]; then
|
if [[ -z "$branch" && -n "$position_format" ]]; then
|
||||||
position="$(git describe --contains --all HEAD 2> /dev/null)"
|
position="$(command git describe --contains --all HEAD 2> /dev/null)"
|
||||||
if [[ -n "$position" ]]; then
|
if [[ -n "$position" ]]; then
|
||||||
zformat -f position_formatted "$position_format" "p:$position"
|
zformat -f position_formatted "$position_format" "p:$position"
|
||||||
fi
|
fi
|
||||||
|
@ -250,7 +250,7 @@ function git-info {
|
||||||
zstyle -s ':prezto:module:git:info:remote' format 'remote_format'
|
zstyle -s ':prezto:module:git:info:remote' format 'remote_format'
|
||||||
if [[ -n "$branch" && -n "$remote_format" ]]; then
|
if [[ -n "$branch" && -n "$remote_format" ]]; then
|
||||||
# Gets the remote name.
|
# Gets the remote name.
|
||||||
remote_cmd='git rev-parse --symbolic-full-name --verify HEAD@{upstream}'
|
remote_cmd='command git rev-parse --symbolic-full-name --verify HEAD@{upstream}'
|
||||||
remote="${$(${(z)remote_cmd} 2> /dev/null)##refs/remotes/}"
|
remote="${$(${(z)remote_cmd} 2> /dev/null)##refs/remotes/}"
|
||||||
if [[ -n "$remote" ]]; then
|
if [[ -n "$remote" ]]; then
|
||||||
zformat -f remote_formatted "$remote_format" "R:$remote"
|
zformat -f remote_formatted "$remote_format" "R:$remote"
|
||||||
|
@ -261,7 +261,7 @@ function git-info {
|
||||||
zstyle -s ':prezto:module:git:info:behind' format 'behind_format'
|
zstyle -s ':prezto:module:git:info:behind' format 'behind_format'
|
||||||
if [[ -n "$branch" && ( -n "$ahead_format" || -n "$behind_format" ) ]]; then
|
if [[ -n "$branch" && ( -n "$ahead_format" || -n "$behind_format" ) ]]; then
|
||||||
# Gets the commit difference counts between local and remote.
|
# Gets the commit difference counts between local and remote.
|
||||||
ahead_and_behind_cmd='git rev-list --count --left-right HEAD...@{upstream}'
|
ahead_and_behind_cmd='command git rev-list --count --left-right HEAD...@{upstream}'
|
||||||
|
|
||||||
# Get ahead and behind counts.
|
# Get ahead and behind counts.
|
||||||
ahead_and_behind="$(${(z)ahead_and_behind_cmd} 2> /dev/null)"
|
ahead_and_behind="$(${(z)ahead_and_behind_cmd} 2> /dev/null)"
|
||||||
|
@ -290,7 +290,7 @@ function git-info {
|
||||||
if [[ -n "$indexed_format" ]]; then
|
if [[ -n "$indexed_format" ]]; then
|
||||||
((
|
((
|
||||||
indexed+=$(
|
indexed+=$(
|
||||||
git diff-index \
|
command git diff-index \
|
||||||
--no-ext-diff \
|
--no-ext-diff \
|
||||||
--name-only \
|
--name-only \
|
||||||
--cached \
|
--cached \
|
||||||
|
@ -310,7 +310,7 @@ function git-info {
|
||||||
if [[ -n "$unindexed_format" ]]; then
|
if [[ -n "$unindexed_format" ]]; then
|
||||||
((
|
((
|
||||||
unindexed+=$(
|
unindexed+=$(
|
||||||
git diff-files \
|
command git diff-files \
|
||||||
--no-ext-diff \
|
--no-ext-diff \
|
||||||
--name-only \
|
--name-only \
|
||||||
--ignore-submodules=${ignore_submodules:-none} \
|
--ignore-submodules=${ignore_submodules:-none} \
|
||||||
|
@ -328,7 +328,7 @@ function git-info {
|
||||||
if [[ -n "$untracked_format" ]]; then
|
if [[ -n "$untracked_format" ]]; then
|
||||||
((
|
((
|
||||||
untracked+=$(
|
untracked+=$(
|
||||||
git ls-files \
|
command git ls-files \
|
||||||
--other \
|
--other \
|
||||||
--exclude-standard \
|
--exclude-standard \
|
||||||
2> /dev/null \
|
2> /dev/null \
|
||||||
|
@ -343,7 +343,7 @@ function git-info {
|
||||||
(( dirty = indexed + unindexed + untracked ))
|
(( dirty = indexed + unindexed + untracked ))
|
||||||
else
|
else
|
||||||
# Use porcelain status for easy parsing.
|
# Use porcelain status for easy parsing.
|
||||||
status_cmd="git status --porcelain --ignore-submodules=${ignore_submodules:-none}"
|
status_cmd="command git status --porcelain --ignore-submodules=${ignore_submodules:-none}"
|
||||||
|
|
||||||
# Get current status.
|
# Get current status.
|
||||||
while IFS=$'\n' read line; do
|
while IFS=$'\n' read line; do
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
# function git-root {
|
# function git-root {
|
||||||
|
|
||||||
local root="$(git rev-parse --show-toplevel 2> /dev/null)"
|
local root="$(command git rev-parse --show-toplevel 2> /dev/null)"
|
||||||
|
|
||||||
if [[ -n "$root" ]]; then
|
if [[ -n "$root" ]]; then
|
||||||
print "$root"
|
print "$root"
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
# function git-stash-clear-interactive {
|
# function git-stash-clear-interactive {
|
||||||
|
|
||||||
if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
||||||
print "$0: not a repository work tree: $PWD" >&2
|
print "$0: not a repository work tree: $PWD" >&2
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
@ -15,10 +15,10 @@ fi
|
||||||
local stashed
|
local stashed
|
||||||
|
|
||||||
if [[ -f "$(git-dir)/refs/stash" ]]; then
|
if [[ -f "$(git-dir)/refs/stash" ]]; then
|
||||||
stashed="$(git stash list 2> /dev/null | wc -l | awk '{print $1}')"
|
stashed="$(command git stash list 2> /dev/null | wc -l | awk '{print $1}')"
|
||||||
if (( $stashed > 0 )); then
|
if (( $stashed > 0 )); then
|
||||||
if read -q "?Clear $stashed stashed state(s) [y/N]? "; then
|
if read -q "?Clear $stashed stashed state(s) [y/N]? "; then
|
||||||
git stash clear
|
command git stash clear
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -7,15 +7,15 @@
|
||||||
|
|
||||||
# function git-stash-dropped {
|
# function git-stash-dropped {
|
||||||
|
|
||||||
if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
||||||
print "$0: not a repository work tree: $PWD" >&2
|
print "$0: not a repository work tree: $PWD" >&2
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git fsck --unreachable 2> /dev/null \
|
command git fsck --unreachable 2> /dev/null \
|
||||||
| grep 'commit' \
|
| grep 'commit' \
|
||||||
| awk '{print $3}' \
|
| awk '{print $3}' \
|
||||||
| git log \
|
| command git log \
|
||||||
--pretty=format:${_git_log_oneline_format} \
|
--pretty=format:${_git_log_oneline_format} \
|
||||||
--extended-regexp \
|
--extended-regexp \
|
||||||
--grep="${1:-(WIP )?[Oo]n [^:]+:}" \
|
--grep="${1:-(WIP )?[Oo]n [^:]+:}" \
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
# function git-stash-recover {
|
# function git-stash-recover {
|
||||||
|
|
||||||
if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
||||||
print "$0: not a repository work tree: $PWD" >&2
|
print "$0: not a repository work tree: $PWD" >&2
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
@ -15,8 +15,8 @@ fi
|
||||||
local commit
|
local commit
|
||||||
|
|
||||||
for commit in "$@"; do
|
for commit in "$@"; do
|
||||||
git update-ref \
|
command git update-ref \
|
||||||
-m "$(git log -1 --pretty="format:%s" "$commit")" refs/stash "$commit"
|
-m "$(command git log -1 --pretty="format:%s" "$commit")" refs/stash "$commit"
|
||||||
done
|
done
|
||||||
|
|
||||||
# }
|
# }
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
# function git-submodule-move {
|
# function git-submodule-move {
|
||||||
|
|
||||||
if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
||||||
print "$0: not a repository work tree: $PWD" >&2
|
print "$0: not a repository work tree: $PWD" >&2
|
||||||
return 1
|
return 1
|
||||||
elif [[ "$PWD" != "$(git-root)" ]]; then
|
elif [[ "$PWD" != "$(git-root)" ]]; then
|
||||||
|
@ -19,7 +19,7 @@ local src="$1"
|
||||||
local dst="$2"
|
local dst="$2"
|
||||||
local url
|
local url
|
||||||
|
|
||||||
url="$(git config --file "$(git-root)/.gitmodules" --get "submodule.${src}.url")"
|
url="$(command git config --file "$(git-root)/.gitmodules" --get "submodule.${src}.url")"
|
||||||
|
|
||||||
if [[ -z "$url" ]]; then
|
if [[ -z "$url" ]]; then
|
||||||
print "$0: submodule not found: $src" >&2
|
print "$0: submodule not found: $src" >&2
|
||||||
|
@ -29,7 +29,7 @@ fi
|
||||||
mkdir -p "${dst:h}"
|
mkdir -p "${dst:h}"
|
||||||
|
|
||||||
git-submodule-remove "$src"
|
git-submodule-remove "$src"
|
||||||
git submodule add "$url" "$dst"
|
command git submodule add "$url" "$dst"
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
|
@ -7,22 +7,22 @@
|
||||||
|
|
||||||
# function git-submodule-remove {
|
# function git-submodule-remove {
|
||||||
|
|
||||||
if ! is-true "$(git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then
|
||||||
print "$0: not a repository work tree: $PWD" >&2
|
print "$0: not a repository work tree: $PWD" >&2
|
||||||
return 1
|
return 1
|
||||||
elif [[ "$PWD" != "$(git-root)" ]]; then
|
elif [[ "$PWD" != "$(git-root)" ]]; then
|
||||||
print "$0: must be run from the root of the work tree" >&2
|
print "$0: must be run from the root of the work tree" >&2
|
||||||
return 1
|
return 1
|
||||||
elif ! git config --file .gitmodules --get "submodule.${1}.path" &>/dev/null; then
|
elif ! command git config --file .gitmodules --get "submodule.${1}.path" &> /dev/null; then
|
||||||
print "$0: submodule not found: $1" >&2
|
print "$0: submodule not found: $1" >&2
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git config --file "$(git-dir)/config" --remove-section "submodule.${1}" &>/dev/null
|
command git config --file "$(git-dir)/config" --remove-section "submodule.${1}" &> /dev/null
|
||||||
git config --file "$(git-root)/.gitmodules" --remove-section "submodule.${1}" &>/dev/null
|
command git config --file "$(git-root)/.gitmodules" --remove-section "submodule.${1}" &> /dev/null
|
||||||
git add .gitmodules
|
command git add .gitmodules
|
||||||
|
|
||||||
git rm --cached -rf "${1}"
|
command git rm --cached -rf "${1}"
|
||||||
rm -rf "${1}"
|
rm -rf "${1}"
|
||||||
rm -rf "$(git-dir)/modules/${1}"
|
rm -rf "$(git-dir)/modules/${1}"
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,9 @@ fi
|
||||||
if (( $+commands[npm] )); then
|
if (( $+commands[npm] )); then
|
||||||
cache_file="${TMPDIR:-/tmp}/prezto-node-cache.$UID.zsh"
|
cache_file="${TMPDIR:-/tmp}/prezto-node-cache.$UID.zsh"
|
||||||
|
|
||||||
if [[ "$commands[npm]" -nt "$cache_file" || ! -s "$cache_file" ]]; then
|
if [[ "$commands[npm]" -nt "$cache_file" \
|
||||||
|
|| "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \
|
||||||
|
|| ! -s "$cache_file" ]]; then
|
||||||
# npm is slow; cache its output.
|
# npm is slow; cache its output.
|
||||||
npm completion >! "$cache_file" 2> /dev/null
|
npm completion >! "$cache_file" 2> /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
OSX
|
OSX
|
||||||
===
|
===
|
||||||
|
|
||||||
Defines [Mac OS X][1] aliases and functions.
|
Defines [macOS][1] aliases and functions.
|
||||||
|
|
||||||
Settings
|
Settings
|
||||||
--------
|
--------
|
||||||
|
@ -34,8 +34,8 @@ Functions
|
||||||
- `tab` creates a new tab (works in both _Terminal_ and [_iTerm_][3]).
|
- `tab` creates a new tab (works in both _Terminal_ and [_iTerm_][3]).
|
||||||
- `ql` previews files in Quick Look.
|
- `ql` previews files in Quick Look.
|
||||||
- `osx-rm-dir-metadata` deletes .DS\_Store, \_\_MACOSX cruft.
|
- `osx-rm-dir-metadata` deletes .DS\_Store, \_\_MACOSX cruft.
|
||||||
- `osx-ls-download-history` displays the Mac OS X download history.
|
- `osx-ls-download-history` displays the macOS download history.
|
||||||
- `osx-rm-download-history` deletes the Mac OS X download history.
|
- `osx-rm-download-history` deletes the macOS download history.
|
||||||
|
|
||||||
Authors
|
Authors
|
||||||
-------
|
-------
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Displays the Mac OS X download history.
|
# Displays the macOS download history.
|
||||||
#
|
#
|
||||||
# Authors:
|
# Authors:
|
||||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Deletes the Mac OS X download history.
|
# Deletes the macOS download history.
|
||||||
#
|
#
|
||||||
# Authors:
|
# Authors:
|
||||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Defines Mac OS X aliases and functions.
|
# Defines macOS aliases and functions.
|
||||||
#
|
#
|
||||||
# Authors:
|
# Authors:
|
||||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
Perl
|
Perl
|
||||||
====
|
====
|
||||||
|
|
||||||
Enables local [Perl][1] module installation on Mac OS X and defines aliases.
|
Enables local [Perl][1] module installation on macOS and defines aliases.
|
||||||
|
|
||||||
Local Module Installation
|
Local Module Installation
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
Perl versions older than 5.14 do not support the local installation of Perl
|
Perl versions older than 5.14 do not support the local installation of Perl
|
||||||
modules natively. This module allows for local installation of Perl modules on
|
modules natively. This module allows for local installation of Perl modules on
|
||||||
Mac OS X in *~/Library/Perl/5.12* by altering the environment.
|
macOS in *~/Library/Perl/5.12* by altering the environment.
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Enables local Perl module installation on Mac OS X and defines aliases.
|
# Enables local Perl module installation on macOS and defines aliases.
|
||||||
#
|
#
|
||||||
# Authors:
|
# Authors:
|
||||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||||
|
@ -43,7 +43,7 @@ if [[ "$OSTYPE" == darwin* ]]; then
|
||||||
perl_path="$HOME/Library/Perl/5.12"
|
perl_path="$HOME/Library/Perl/5.12"
|
||||||
|
|
||||||
if [[ -f "$perl_path/lib/perl5/local/lib.pm" ]]; then
|
if [[ -f "$perl_path/lib/perl5/local/lib.pm" ]]; then
|
||||||
if [[ ! -s "$cache_file" ]]; then
|
if [[ "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" || ! -s "$cache_file" ]]; then
|
||||||
perl -I$perl_path/lib/perl5 -Mlocal::lib=$perl_path >! "$cache_file"
|
perl -I$perl_path/lib/perl5 -Mlocal::lib=$perl_path >! "$cache_file"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ function prompt_smiley_precmd {
|
||||||
|
|
||||||
function prompt_smiley_setup {
|
function prompt_smiley_setup {
|
||||||
unsetopt XTRACE KSH_ARRAYS
|
unsetopt XTRACE KSH_ARRAYS
|
||||||
prompt_opts=(percent subst)
|
prompt_opts=(cr percent sp subst)
|
||||||
|
|
||||||
# Add hook for calling git-info before each command.
|
# Add hook for calling git-info before each command.
|
||||||
add-zsh-hook precmd prompt_smiley_precmd
|
add-zsh-hook precmd prompt_smiley_precmd
|
||||||
|
|
|
@ -19,7 +19,7 @@ elif (( $+commands[pyenv] )); then
|
||||||
eval "$(pyenv init -)"
|
eval "$(pyenv init -)"
|
||||||
|
|
||||||
# Prepend PEP 370 per user site packages directory, which defaults to
|
# Prepend PEP 370 per user site packages directory, which defaults to
|
||||||
# ~/Library/Python on Mac OS X and ~/.local elsewhere, to PATH. The
|
# ~/Library/Python on macOS and ~/.local elsewhere, to PATH. The
|
||||||
# path can be overridden using PYTHONUSERBASE.
|
# path can be overridden using PYTHONUSERBASE.
|
||||||
else
|
else
|
||||||
if [[ -n "$PYTHONUSERBASE" ]]; then
|
if [[ -n "$PYTHONUSERBASE" ]]; then
|
||||||
|
@ -82,6 +82,7 @@ function _python-workon-cwd {
|
||||||
# Load auto workon cwd hook
|
# Load auto workon cwd hook
|
||||||
if zstyle -t ':prezto:module:python:virtualenv' auto-switch 'yes'; then
|
if zstyle -t ':prezto:module:python:virtualenv' auto-switch 'yes'; then
|
||||||
# Auto workon when changing directory
|
# Auto workon when changing directory
|
||||||
|
autoload -Uz add-zsh-hook
|
||||||
add-zsh-hook chpwd _python-workon-cwd
|
add-zsh-hook chpwd _python-workon-cwd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -93,7 +94,7 @@ if (( $+VIRTUALENVWRAPPER_VIRTUALENV || $+commands[virtualenv] )) && \
|
||||||
export WORKON_HOME="${WORKON_HOME:-$HOME/.virtualenvs}"
|
export WORKON_HOME="${WORKON_HOME:-$HOME/.virtualenvs}"
|
||||||
|
|
||||||
# Disable the virtualenv prompt.
|
# Disable the virtualenv prompt.
|
||||||
VIRTUAL_ENV_DISABLE_PROMPT=1
|
export VIRTUAL_ENV_DISABLE_PROMPT=1
|
||||||
|
|
||||||
# Create a sorted array of available virtualenv related 'pyenv' commands to
|
# Create a sorted array of available virtualenv related 'pyenv' commands to
|
||||||
# look for plugins of interest. Scanning shell '$path' isn't enough as they
|
# look for plugins of interest. Scanning shell '$path' isn't enough as they
|
||||||
|
@ -148,7 +149,9 @@ if (( $#commands[(i)pip(|[23])] )); then
|
||||||
# Detect and use one available from among 'pip', 'pip2', 'pip3' variants
|
# Detect and use one available from among 'pip', 'pip2', 'pip3' variants
|
||||||
pip_command="$commands[(i)pip(|[23])]"
|
pip_command="$commands[(i)pip(|[23])]"
|
||||||
|
|
||||||
if [[ "$pip_command" -nt "$cache_file" || ! -s "$cache_file" ]]; then
|
if [[ "$pip_command" -nt "$cache_file" \
|
||||||
|
|| "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \
|
||||||
|
|| ! -s "$cache_file" ]]; then
|
||||||
# pip is slow; cache its output. And also support 'pip2', 'pip3' variants
|
# pip is slow; cache its output. And also support 'pip2', 'pip3' variants
|
||||||
$pip_command completion --zsh \
|
$pip_command completion --zsh \
|
||||||
| sed -e "s|compctl -K [-_[:alnum:]]* pip|& pip2 pip3|" >! "$cache_file" 2> /dev/null
|
| sed -e "s|compctl -K [-_[:alnum:]]* pip|& pip2 pip3|" >! "$cache_file" 2> /dev/null
|
||||||
|
|
|
@ -3,7 +3,7 @@ Rsync
|
||||||
|
|
||||||
Defines [rsync][1] aliases.
|
Defines [rsync][1] aliases.
|
||||||
|
|
||||||
Mac OS X users are encouraged to use [Bombich's rsync][2], which has HFS+
|
macOS users are encouraged to use [Bombich's rsync][2], which has HFS+
|
||||||
enhancements.
|
enhancements.
|
||||||
|
|
||||||
Aliases
|
Aliases
|
||||||
|
|
|
@ -20,7 +20,7 @@ if grep -q 'xattrs' <(rsync --help 2>&1); then
|
||||||
_rsync_cmd="${_rsync_cmd} --acls --xattrs"
|
_rsync_cmd="${_rsync_cmd} --acls --xattrs"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Mac OS X and HFS+ Enhancements
|
# macOS and HFS+ Enhancements
|
||||||
# http://help.bombich.com/kb/overview/credits#opensource
|
# http://help.bombich.com/kb/overview/credits#opensource
|
||||||
if [[ "$OSTYPE" == darwin* ]] && grep -q 'file-flags' <(rsync --help 2>&1); then
|
if [[ "$OSTYPE" == darwin* ]] && grep -q 'file-flags' <(rsync --help 2>&1); then
|
||||||
_rsync_cmd="${_rsync_cmd} --crtimes --fileflags --protect-decmpfs --force-change"
|
_rsync_cmd="${_rsync_cmd} --crtimes --fileflags --protect-decmpfs --force-change"
|
||||||
|
|
|
@ -25,9 +25,14 @@ elif (( $+commands[rbenv] )); then
|
||||||
|
|
||||||
# Load package manager installed chruby into the shell session.
|
# Load package manager installed chruby into the shell session.
|
||||||
elif (( $+commands[chruby-exec] )); then
|
elif (( $+commands[chruby-exec] )); then
|
||||||
source "${commands[chruby-exec]:h:h}/share/chruby/chruby.sh"
|
if (( ! $+functions[chruby] )); then
|
||||||
|
source "${commands[chruby-exec]:h:h}/share/chruby/chruby.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
if zstyle -t ':prezto:module:ruby:chruby' auto-switch; then
|
if zstyle -t ':prezto:module:ruby:chruby' auto-switch; then
|
||||||
source "${commands[chruby-exec]:h:h}/share/chruby/auto.sh"
|
if (( ! $+functions[chruby_auto] )); then
|
||||||
|
source "${commands[chruby-exec]:h:h}/share/chruby/auto.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
# If a default Ruby is set, switch to it.
|
# If a default Ruby is set, switch to it.
|
||||||
chruby_auto
|
chruby_auto
|
||||||
|
|
|
@ -62,7 +62,7 @@ Aliases
|
||||||
Caveats
|
Caveats
|
||||||
-------
|
-------
|
||||||
|
|
||||||
On Mac OS X, launching tmux can cause the error **launch_msg(...): Socket is not
|
On macOS, launching tmux can cause the error **launch_msg(...): Socket is not
|
||||||
connected** to be displayed, which can be fixed by installing
|
connected** to be displayed, which can be fixed by installing
|
||||||
[reattach-to-user-namespace][3], available in [Homebrew][4], and adding the
|
[reattach-to-user-namespace][3], available in [Homebrew][4], and adding the
|
||||||
following to *tmux.conf*:
|
following to *tmux.conf*:
|
||||||
|
@ -71,7 +71,7 @@ following to *tmux.conf*:
|
||||||
set-option -g default-command "reattach-to-user-namespace -l $SHELL -l"
|
set-option -g default-command "reattach-to-user-namespace -l $SHELL -l"
|
||||||
```
|
```
|
||||||
|
|
||||||
Furthermore, tmux is known to cause **kernel panics** on Mac OS X. A discussion
|
Furthermore, tmux is known to cause **kernel panics** on macOS. A discussion
|
||||||
about this and Prezto has already been [opened][2].
|
about this and Prezto has already been [opened][2].
|
||||||
|
|
||||||
Authors
|
Authors
|
||||||
|
|
|
@ -23,7 +23,7 @@ if ([[ "$TERM_PROGRAM" = 'iTerm.app' ]] && \
|
||||||
_tmux_iterm_integration='-CC'
|
_tmux_iterm_integration='-CC'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" && -z "$INSIDE_EMACS" ]] && ( \
|
if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" && -z "$INSIDE_EMACS" && -z "$VSCODE_PID" ]] && ( \
|
||||||
( [[ -n "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' remote ) ||
|
( [[ -n "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' remote ) ||
|
||||||
( [[ -z "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' local ) \
|
( [[ -z "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' local ) \
|
||||||
); then
|
); then
|
||||||
|
|
|
@ -17,7 +17,7 @@ function wdiff {
|
||||||
"$@" \
|
"$@" \
|
||||||
| sed 's/^\(@@\( [+-][[:digit:]]*,[[:digit:]]*\)\{2\} @@\)$/;5;6m\10m/g'
|
| sed 's/^\(@@\( [+-][[:digit:]]*,[[:digit:]]*\)\{2\} @@\)$/;5;6m\10m/g'
|
||||||
elif (( $+commands[git] )); then
|
elif (( $+commands[git] )); then
|
||||||
git --no-pager diff --color=auto --no-ext-diff --no-index --color-words "$@"
|
command git --no-pager diff --color=auto --no-ext-diff --no-index --color-words "$@"
|
||||||
else
|
else
|
||||||
command wdiff "$@"
|
command wdiff "$@"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -76,10 +76,13 @@ if is-callable 'dircolors'; then
|
||||||
alias ls='ls --group-directories-first'
|
alias ls='ls --group-directories-first'
|
||||||
|
|
||||||
if zstyle -t ':prezto:module:utility:ls' color; then
|
if zstyle -t ':prezto:module:utility:ls' color; then
|
||||||
if [[ -s "$HOME/.dir_colors" ]]; then
|
# Call dircolors to define colors if they're missing
|
||||||
eval "$(dircolors --sh "$HOME/.dir_colors")"
|
if [[ -z "$LS_COLORS" ]]; then
|
||||||
else
|
if [[ -s "$HOME/.dir_colors" ]]; then
|
||||||
eval "$(dircolors --sh)"
|
eval "$(dircolors --sh "$HOME/.dir_colors")"
|
||||||
|
else
|
||||||
|
eval "$(dircolors --sh)"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
alias ls="${aliases[ls]:-ls} --color=auto"
|
alias ls="${aliases[ls]:-ls} --color=auto"
|
||||||
|
@ -89,11 +92,15 @@ if is-callable 'dircolors'; then
|
||||||
else
|
else
|
||||||
# BSD Core Utilities
|
# BSD Core Utilities
|
||||||
if zstyle -t ':prezto:module:utility:ls' color; then
|
if zstyle -t ':prezto:module:utility:ls' color; then
|
||||||
# Define colors for BSD ls.
|
# Define colors for BSD ls if they're not already defined
|
||||||
export LSCOLORS='exfxcxdxbxGxDxabagacad'
|
if [[ -z "$LSCOLORS" ]]; then
|
||||||
|
export LSCOLORS='exfxcxdxbxGxDxabagacad'
|
||||||
|
fi
|
||||||
|
|
||||||
# Define colors for the completion system.
|
# Define colors for the completion system if they're not already defined
|
||||||
export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=36;01:cd=33;01:su=31;40;07:sg=36;40;07:tw=32;40;07:ow=33;40;07:'
|
if [[ -z "$LS_COLORS" ]]; then
|
||||||
|
export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=36;01:cd=33;01:su=31;40;07:sg=36;40;07:tw=32;40;07:ow=33;40;07:'
|
||||||
|
fi
|
||||||
|
|
||||||
alias ls="${aliases[ls]:-ls} -G"
|
alias ls="${aliases[ls]:-ls} -G"
|
||||||
else
|
else
|
||||||
|
@ -121,7 +128,7 @@ if zstyle -t ':prezto:module:utility:grep' color; then
|
||||||
alias grep="${aliases[grep]:-grep} --color=auto"
|
alias grep="${aliases[grep]:-grep} --color=auto"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Mac OS X Everywhere
|
# macOS Everywhere
|
||||||
if [[ "$OSTYPE" == darwin* ]]; then
|
if [[ "$OSTYPE" == darwin* ]]; then
|
||||||
alias o='open'
|
alias o='open'
|
||||||
elif [[ "$OSTYPE" == cygwin* ]]; then
|
elif [[ "$OSTYPE" == cygwin* ]]; then
|
||||||
|
@ -151,12 +158,7 @@ elif (( $+commands[wget] )); then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Resource Usage
|
# Resource Usage
|
||||||
if (( $+commands[pydf] )); then
|
alias df='df -kh'
|
||||||
alias df=pydf
|
|
||||||
else
|
|
||||||
alias df='df -kh'
|
|
||||||
fi
|
|
||||||
|
|
||||||
alias du='du -kh'
|
alias du='du -kh'
|
||||||
|
|
||||||
if [[ "$OSTYPE" == (darwin*|*bsd*) ]]; then
|
if [[ "$OSTYPE" == (darwin*|*bsd*) ]]; then
|
||||||
|
|
|
@ -8,11 +8,12 @@
|
||||||
# Execute code only if STDERR is bound to a TTY.
|
# Execute code only if STDERR is bound to a TTY.
|
||||||
[[ -o INTERACTIVE && -t 2 ]] && {
|
[[ -o INTERACTIVE && -t 2 ]] && {
|
||||||
|
|
||||||
# Print the message.
|
SAYINGS=(
|
||||||
cat <<-EOF
|
"So long and thanks for all the fish.\n -- Douglas Adams"
|
||||||
|
"Good morning! And in case I don't see ya, good afternoon, good evening and goodnight.\n --Truman Burbank"
|
||||||
|
)
|
||||||
|
|
||||||
Thank you. Come again!
|
# Print a randomly-chosen message:
|
||||||
-- Dr. Apu Nahasapeemapetilon
|
echo $SAYINGS[$(($RANDOM % ${#SAYINGS} + 1))]
|
||||||
EOF
|
|
||||||
|
|
||||||
} >&2
|
} >&2
|
||||||
|
|
|
@ -97,7 +97,7 @@ zstyle ':prezto:module:editor' key-bindings 'vi'
|
||||||
# zstyle ':prezto:module:history-substring-search' globbing-flags ''
|
# zstyle ':prezto:module:history-substring-search' globbing-flags ''
|
||||||
|
|
||||||
#
|
#
|
||||||
# OS X
|
# macOS
|
||||||
#
|
#
|
||||||
|
|
||||||
# Set the keyword used by `mand` to open man pages in Dash.app
|
# Set the keyword used by `mand` to open man pages in Dash.app
|
||||||
|
|
Loading…
Add table
Reference in a new issue