1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2025-07-01 10:29:25 +00:00

Compare commits

...

78 Commits

Author SHA1 Message Date
c92df37bf3 [aws] Use "aws configure export-credentials" instead of the external command aws-export-credentials 2025-05-01 18:21:50 +02:00
2869f01add Merge upstream/master 2025-02-03 20:13:52 +01:00
6e564503f1 general: Apply quote styling consistency
Remove redundant quotes from comparisons and
variable expansions where they are not needed.

Also add style nits to comments and code.
2025-01-10 11:09:08 -06:00
e04b99d9a5 Merge upstream/master 2024-12-27 17:45:48 +01:00
427268c64f history-substring-search: Update history-substring-search module to current master 2024-12-26 22:32:57 -06:00
61d7dc9a72 completion: Update completion module to current master 2024-12-26 22:30:38 -06:00
2388b8f873 autosuggestions: Update autosuggestions module to 0.7.1 2024-12-26 22:27:46 -06:00
9626ce2beb Add exception for VSCode env helper
Signed-off-by: msdx321 <msdx321@gmail.com>
2024-12-12 07:47:13 +05:30
13ebe2b120 [zprezto] Add EKS clusters summary to AWS module 2024-10-07 11:05:31 +02:00
c6e45e4344 Merge upstream/master 2024-06-07 18:58:55 +02:00
9195b66161 [Bump] Pure prompt to 1.23.0 2024-06-03 12:01:18 -05:00
a217f1cac0 [Bump] Syntax Highlighting to 0.8.0 2024-06-03 12:01:18 -05:00
9e28cb4861 [Bump] Completion module
Although it has tags, the release flow it is not well estabilished,
so it fall behind quite recurrently, thus why I'm updating it aginst the
master branch (it was already out of the latest tag anyway).

Ref:
https://github.com/zsh-users/zsh-completions/issues/1083
2024-06-03 12:01:18 -05:00
59e6ecbaaa Merge upstream/master 2024-04-28 20:08:05 +02:00
Jim
f5a8cb456b Removing fig from README.md
Fig is sunsetting as per https://fig.io/blog/post/fig-is-sunsetting
2024-04-15 21:36:51 -05:00
775f14d0c3 homebrew: Simplify caching brew shellenv
Avoid checking age of cache file and just test for its existence.
While this is simpler, this also avoids depending on having
`EXTENDED_GLOB` enabled.
2024-04-08 20:48:57 -05:00
005709d120 Cache brew shellenv results
This could sometimes be slow (as with any external command execution)
but the result should almost never change.
2024-04-08 20:48:57 -05:00
a79c3b4943 Remove Python module comment about completion
Local completion definition has been removed
2024-04-08 11:56:00 -05:00
f055c5070c screen module: don't try to attach to dead screens
Removes dead screens from the list of candidate screens. Fixes issue
1253, "screen:auto-start problem with dead screens".
2024-04-05 01:19:23 -05:00
085ab11646 osx: Add trash function 2024-04-05 01:18:05 -05:00
6bf4505b33 Allow overriding _ssh_agent_sock for symmetry to _ssh_agent_env 2024-04-04 22:29:15 -05:00
185733aa63 Update history-substring-search 2024-04-04 22:24:57 -05:00
5ff938dff5 Update Python virtualenvwrapper documentation 2024-04-03 07:37:49 -05:00
cc3b6e092e Allow .dir_colors to be a symlink 2024-04-03 07:37:29 -05:00
eea05c2374 Merge upstream/master 2024-03-22 20:25:59 +01:00
c667dd3ea6 fix zstyle case-insensitive completion
Signed-off-by: Cameron Wong <cam@camdar.io>
2024-03-17 09:16:58 -05:00
9584e05025 Merge upstream/master 2024-02-10 15:01:56 +01:00
d03bc03fdd prompt: update powerlevel10k submodule to v1.20.0
Release notes:

  - https://github.com/romkatv/powerlevel10k/releases/tag/v1.20.0
2024-01-26 03:21:09 -06:00
ac356c8cf6 Adjust instruction for setting custom $ZDOTDIR
Adjust instruction for setting custom `$ZDOTDIR`.

This addresses 2 potential issues:
- Check for the presence of `$XDG_CONFIG_HOME/zsh` before assigning it to `$ZDOTDIR` instead of blindly assigning
- Avoid recursion in zsh variable assignment stack that might occasionally result in messages like:
```
zsh: job table full or recursion limit exceeded
```
2024-01-18 19:13:22 -06:00
e7a12fdf06 Merge upstream/master 2023-12-05 15:28:28 +01:00
c0cdc12708 editor: Adjust subheading level in documentation 2023-11-30 14:14:18 -06:00
380b96a218 feat(editor): add zstyle configuration for WORDCHARS 2023-11-30 14:14:18 -06:00
335311ba21 Merge upstream/master 2023-11-09 19:40:11 +01:00
f04191aa8a feat: Update submodules to avoid error with using zsh 5.9 2023-11-08 13:11:49 -08:00
347441abdf remove alias sl='ls' 2023-11-06 12:44:55 -08:00
457ade4f01 python: Remove pyenv init woraround for pyenv >= 2.3.0
The startup logic and instructions have been updated for simplicity in
pyenv 2.3.0. The workaround for pyenv init is no longer necessary.

Signed-off-by: Indrajit Raychaudhuri <irc@indrajit.com>
2023-11-05 15:04:27 -06:00
371a821785 Merge upstream/master 2023-09-15 21:21:51 +02:00
5ac930d96b history-substring-search: Tweak documentation and cleanup 2023-09-12 00:08:57 -05:00
74a19fb665 docs(history-substring-search): add prefixed setting example comment
add `prefixed` setting example comment

Signed-off-by: mritd <mritd@linux.com>
2023-09-12 00:08:57 -05:00
9bf1ae66bc feat(history-substring-search): add prefixed setting
support zsh-history-substring-search `HISTORY_SUBSTRING_SEARCH_PREFIXED` env

Signed-off-by: mritd <mritd@linux.com>
2023-09-12 00:08:57 -05:00
bd180eec72 history-substring-search: add fuzzy and unique 2023-09-11 21:59:05 -05:00
1b0cc0a219 utility: Detect lsd and honor its GNU ls compatibility
lsd (LSDeluxe) is a modern GNU compatibile alternative to ls. Detect if
it is aliased to ls and honor its GNU ls compatibility.
2023-09-11 21:55:05 -05:00
64d46c407a completion: Update completion submodule to 0.35.0 2023-09-11 21:38:29 -05:00
5ac0777191 history-substring-search: Update history-substring-search submodule to 1.1.0 2023-09-11 21:38:29 -05:00
d80e4aa86c prompt: Update pure submodule to 1.22.0 2023-09-11 21:38:29 -05:00
10af109421 Update the update_script to update all directories under contrib 2023-08-26 20:28:27 +02:00
1b514f0738 Merge upstream/master 2023-07-03 19:35:51 +02:00
c9c716e9c1 prompt: update powerlevel10k submodule to v1.19.0
Release notes:

  - https://github.com/romkatv/powerlevel10k/releases/tag/v1.19.0
2023-06-22 22:53:09 -07:00
aebed776a0 Merge upstream/master 2023-06-01 10:52:36 +02:00
8d00c51900 python: Remove pip completion from prezto local
pip completion is bundled with Zsh 5.9. Remove it from prezto local to
avoid shadowing the bundled completion.
2023-05-17 21:11:58 -05:00
8ee9d1bbfe general: Documentation update for zstyle based alias skipping support
Add documentation to surface the `zstyle` based alias skipping.
2023-05-17 02:39:09 -05:00
5ca892d6af history: Reformat inline comments 2023-05-17 02:38:50 -05:00
e14fdff4cb history: Remove interim zstyle variables 2023-05-17 02:38:50 -05:00
3c002f772e prompt: update powerlevel10k submodule to v1.18.0
Release notes:

  - https://github.com/romkatv/powerlevel10k/releases/tag/v1.18.0
2023-05-04 13:51:19 -05:00
f7cb1fee1b gnu-utility: Remove now obsolete egrep and fgrep
These were marked deprecated for a while and has now been marked
obsolete since gnu-grep 3.8 [1]. They have been removed from POSIX as
well [2].

[1] https://lists.gnu.org/archive/html/info-gnu/2022-09/msg00001.html
[2] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html#tag_20_55_18
2023-04-27 19:11:59 -05:00
52bf42f887 python: Expand Python command pattern per convention
Use `(i)python[0-9.]#` as subscript for commands associative array,
following the convention [1] of detection python more exhaustively.

[1] 858b8de3d7/Completion/Unix/Command/_python (L1)
2023-04-27 19:11:42 -05:00
8d895a70a5 history: Remove 'HISTFILE' path relocation warning
'HISTFILE' path relocation was done 2 years ago. It's time to cleanup
the warning message.
2023-04-27 19:11:24 -05:00
e7f75d20bc prompt: Remove 'powerlevel9k' deprecation warning
'powerlevel9k' is unsupported and deprecated for 2 years now. It's time
to cleanu the deprecation warning message.
2023-04-27 19:11:24 -05:00
f5dff4fe22 prompt: Update pure submodule to 1.21.0 2023-04-26 23:29:31 -05:00
0c364cdd5e prompt: Update async submodule to 1.8.6 2023-04-26 23:29:31 -05:00
c900ea5d85 Merge upstream/master 2023-04-21 17:16:23 +02:00
da87c79b3a Add zstyle to skip aliases for additional modules 2023-04-13 09:33:48 -07:00
365499b873 Merge upstream/master 2023-02-10 19:15:16 +01:00
fc444f57e1 gnu-utility: add awk
https://www.gnu.org/software/gawk/
https://formulae.brew.sh/formula/gawk
2023-01-31 15:48:11 -08:00
8be95c9c7e Fix osx module manp function 2023-01-29 23:04:58 -08:00
fab4caffc7 Merge upstream/master 2023-01-21 19:48:05 +01:00
a4ca924310 prompt: update powerlevel10k submodule to v1.17.0
Release notes:

  - https://github.com/romkatv/powerlevel10k/releases/tag/v1.17.0
2023-01-14 14:23:04 -08:00
e50b93ca88 Fix zcompile race condition
sorin-ionescu/prezto#2028
2023-01-12 11:00:24 -08:00
047a898d5d Merge upstream/master 2022-11-01 17:21:41 +01:00
e3a9583f33 Support virtualenvwrapper with / without pyenv virtualenv-init or virtualenvwrapper plugins
The desired logic is:

For the `pyenv` plugins `virtualenv-init` and `virtualenvwrapper`:
1. If either plugin is present, activate it
2. If `virtualenvwrapper` plugin is not present, then
   [fallback to standard
   `virtualenvwrapper`](https://github.com/sorin-ionescu/prezto/pull/1414#issuecomment-320306421).
3. If `virtualenvwrapper` plugin is present, then [don't fallback to
   standard `virtualenvwrapper`, regardless of whether `virtualenv-init`
   is
   present](https://github.com/sorin-ionescu/prezto/pull/1981#issue-1123766676).

Previously, if the `virtualenv` command was present but `pyenv` was
missing, then the fallback wouldn't be hit. This bug was introduced by
https://github.com/sorin-ionescu/prezto/pull/1981/ which ensured that
the `pyenv` `virtualenvwrapper` plugin was activated if present,
regardless of the presence of the `virtualenv-init` plugin.

As an optimization, the check for the `pyenv` plugins are skipped if
`pyenv` itself isn't found.

Since we only want to fallback if the `pyenv` `virtualenvwrapper` plugin
is missing, but that's buried within the `pyenv` logic and we also need
to handle when `pyenv` itself is missing, this switches to using a flag
variable.

I also renamed the `virtualenv_sources` var to
`virtualenvwrapper_sources` as `virtualenv` is distinct from
`virtualenvwrapper`, so using one name for a var that is really about
the other is confusing.

Looking at `git blame`, there's a _lot_ of prior art here around trying
to support all the permutations of `pyenv` and various plugins:
* https://github.com/sorin-ionescu/prezto/issues/1413
* https://github.com/sorin-ionescu/prezto/pull/1414
* https://github.com/sorin-ionescu/prezto/pull/1433
* https://github.com/sorin-ionescu/prezto/pull/1434

So we need to be extremely careful to continue to support all these
permutations.

Fix https://github.com/sorin-ionescu/prezto/issues/2022
2022-10-26 22:03:42 -07:00
ca9012c776 Set EXTENDED_GLOB in the python module
This is needed to find python. 

It is often already set because a user has the directory or completion module loaded before this, but that's not always true.

See extensive debugging / further explanation here: https://github.com/sorin-ionescu/prezto/issues/1949

This does not fully resolve that issue, as there's another enhancement that I'll put up as a separate PR.
2022-10-25 15:54:00 -07:00
97f36e9402 Add - alias for cd -
Taken with love from `oh-my-zsh`
2022-10-25 15:23:59 -07:00
357ce2ebbf Add exception for PyCharm terminal emulation
Do not autostart tmux if we start a terminal inside PyCharm. Should also work for other JetBrains products.
2022-10-12 16:20:42 -06:00
a39ac57061 [aws] Add funcs for ssm parameters 2022-10-05 19:37:22 +02:00
77edfff10e Merge upstream/master 2022-08-26 19:40:40 +02:00
51c4ff6de4 feat(module/ssh): add globbing for ssh-add param
fixes #2000

Signed-off-by: Shea690901 <ginny690901@hotmail.de>
2022-08-03 18:52:34 -05:00
3ea20cfbe8 utility: Make 'http-serve' handler faster for well known cases
In most systems, python2 or python3 command/soft-link would almost
always exist. In such cases, we don't need to invoke `python` to
detect the version. This should speed things up a bit as well.
2022-08-03 18:51:49 -05:00
0aef8086b5 completion: Update completion submodule to 0.34.0 2022-08-03 18:51:49 -05:00
57 changed files with 497 additions and 295 deletions

View File

@ -41,7 +41,7 @@ version is **4.3.11**.
```sh ```sh
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:=$HOME/.config}" export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:=$HOME/.config}"
export ZDOTDIR="${ZDOTDIR:=$XDG_CONFIG_HOME/zsh}" [[ -d $XDG_CONFIG_HOME/zsh ]] && export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
source "$ZDOTDIR/.zshenv" source "$ZDOTDIR/.zshenv"
``` ```
@ -73,14 +73,6 @@ version is **4.3.11**.
05. Open a new Zsh terminal window or tab. 05. Open a new Zsh terminal window or tab.
### [Fig](https://fig.io)
Fig adds apps, shortcuts, and autocomplete to your existing terminal.
Install `prezto` in just one click.
<a href="https://fig.io/plugins/other/prezto" target="_blank"><img src="https://fig.io/badges/install-with-fig.svg" /></a>
### Troubleshooting ### Troubleshooting
If you are not able to find certain commands after switching to Prezto, modify If you are not able to find certain commands after switching to Prezto, modify

View File

@ -173,7 +173,7 @@ if [[ -s "${ZDOTDIR:-$HOME}/.zpreztorc" ]]; then
fi fi
# Disable color and theme in dumb terminals. # Disable color and theme in dumb terminals.
if [[ "$TERM" == 'dumb' ]]; then if [[ $TERM == dumb ]]; then
zstyle ':prezto:*:*' color 'no' zstyle ':prezto:*:*' color 'no'
zstyle ':prezto:module:prompt' theme 'off' zstyle ':prezto:module:prompt' theme 'off'
fi fi

View File

@ -120,6 +120,20 @@ function aws_ssm_session_any {
fi fi
} }
function aws_ssm_parameters {
local profile=$(_get_aws_profile)
aws ssm describe-parameters --profile $profile --output ${_aws_output} \
--query 'Parameters[].[Name,Type]'
}
function aws_ssm_get_parameter {
local profile=$(_get_aws_profile)
local parameter=$1
aws ssm get-parameter --profile $profile --output text \
--name $parameter --with-decryption --query "Parameter.Value"
}
function aws_cf { function aws_cf {
local profile=$(_get_aws_profile) local profile=$(_get_aws_profile)
@ -134,6 +148,15 @@ function aws_cf {
| jq -r ".[] | [.id, .domain, .aliases, .status, .origin] | @csv" | tr -d '"' | column --separator="," --table | jq -r ".[] | [.id, .domain, .aliases, .status, .origin] | @csv" | tr -d '"' | column --separator="," --table
} }
function aws_eks {
local profile=$(_get_aws_profile)
for cluster in $(aws eks list-clusters --output text --query 'clusters'); do
aws eks describe-cluster --name $cluster --output ${_aws_output} \
--query "cluster.{name:name,endpoint:endpoint,access:resourcesVpcConfig.publicAccessCidrs | join(' ',@),issues:health.issues | join(' ',@)}"
done
}
# ~/.ssh/config # ~/.ssh/config
# #
# Host i-* # Host i-*
@ -167,11 +190,11 @@ function aws_switch_profile {
fi fi
if [[ ${_aws_sso} == "true" ]]; then if [[ ${_aws_sso} == "true" ]]; then
credentials=$(aws-export-credentials --env-export 2>&1) credentials=$(aws configure export-credentials --format env 2>&1)
if [[ $credentials =~ "has expired" ]]; then if [[ $credentials =~ "has expired" ]]; then
aws sso login aws sso login
credentials=$(aws-export-credentials --env-export) credentials=$(aws configure export-credentials --format env)
fi fi
eval $credentials eval $credentials

View File

@ -7,7 +7,7 @@
# #
# Return if requirements are not found. # Return if requirements are not found.
if [[ $TERM == 'dumb' ]]; then if [[ $TERM == dumb ]]; then
return 1 return 1
fi fi
@ -84,7 +84,7 @@ if zstyle -t ':prezto:module:completion:*' case-sensitive; then
zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
setopt CASE_GLOB setopt CASE_GLOB
else else
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' zstyle ':completion:*' matcher-list 'm:{[:lower:]}={[:upper:]}' 'm:{[:upper:]}={[:lower:]}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
unsetopt CASE_GLOB unsetopt CASE_GLOB
fi fi

View File

@ -17,6 +17,13 @@ Sets directory options and defines directory aliases.
## Aliases ## Aliases
Aliases are enabled by default. To disable them, add the following to
_`${ZDOTDIR:-$HOME}/.zpreztorc`_.
```sh
zstyle ':prezto:module:directory:alias' skip 'yes'
```
- `d` prints the contents of the directory stack. - `d` prints the contents of the directory stack.
- `1 ... 9` changes the directory to the **n** previous one. - `1 ... 9` changes the directory to the **n** previous one.

View File

@ -25,5 +25,8 @@ unsetopt CLOBBER # Do not overwrite existing files with > and >>.
# Aliases # Aliases
# #
alias d='dirs -v' if ! zstyle -t ':prezto:module:directory:alias' skip; then
for index ({1..9}) alias "$index"="cd +${index}"; unset index alias -- -='cd -'
alias d='dirs -v'
for index ({1..9}) alias "$index"="cd +${index}"; unset index
fi

View File

@ -12,6 +12,17 @@ Sets editor specific key bindings options and variables.
## Settings ## Settings
### Wordchars
To change what characters are considered part of a word, add the following to
_`${ZDOTDIR:-$HOME}/.zpreztorc`_.
```sh
zstyle ':prezto:module:editor' wordchars <chars>
```
Defaults to `*?_-.[]~&;!#$%^(){}<>`.
### Key bindings ### Key bindings
To enable key bindings, add the following to _`${ZDOTDIR:-$HOME}/.zpreztorc`_, To enable key bindings, add the following to _`${ZDOTDIR:-$HOME}/.zpreztorc`_,

View File

@ -21,7 +21,8 @@ setopt BEEP # Beep on error in line editor.
# #
# Treat these characters as part of a word. # Treat these characters as part of a word.
WORDCHARS='*?_-.[]~&;!#$%^(){}<>' zstyle -s ':prezto:module:editor' wordchars 'WORDCHARS' \
|| WORDCHARS='*?_-.[]~&;!#$%^(){}<>'
# Use human-friendly identifiers. # Use human-friendly identifiers.
zmodload zsh/terminfo zmodload zsh/terminfo

View File

@ -12,6 +12,13 @@ execution of `carton`.
## Aliases ## Aliases
Aliases are enabled by default. To disable them, add the following to
_`${ZDOTDIR:-$HOME}/.zpreztorc`_.
```sh
zstyle ':prezto:module:emacs:alias' skip 'yes'
```
### Carton ### Carton
- `cai` installs dependencies. - `cai` installs dependencies.

View File

@ -19,7 +19,9 @@ source "$HOME/.cask/etc/cask_completion.zsh" 2> /dev/null
# Aliases # Aliases
# #
alias cai='cask install' if ! zstyle -t ':prezto:module:emacs:alias' skip; then
alias cau='cask update' alias cai='cask install'
alias caI='cask init' alias cau='cask update'
alias cae='cask exec' alias caI='cask init'
alias cae='cask exec'
fi

View File

@ -14,7 +14,7 @@
# paste had a regression. Additionally, 5.2 added bracketed-paste-url-magic # paste had a regression. Additionally, 5.2 added bracketed-paste-url-magic
# which is generally better than url-quote-magic so we load that when possible. # which is generally better than url-quote-magic so we load that when possible.
autoload -Uz is-at-least autoload -Uz is-at-least
if [[ ${ZSH_VERSION} != 5.1.1 && ${TERM} != "dumb" ]]; then if [[ $ZSH_VERSION != 5.1.1 && $TERM != dumb ]]; then
if is-at-least 5.2; then if is-at-least 5.2; then
autoload -Uz bracketed-paste-url-magic autoload -Uz bracketed-paste-url-magic
zle -N bracketed-paste bracketed-paste-url-magic zle -N bracketed-paste bracketed-paste-url-magic
@ -34,7 +34,8 @@ setopt COMBINING_CHARS # Combine zero-length punctuation characters (accent
# with the base character. # with the base character.
setopt INTERACTIVE_COMMENTS # Enable comments in interactive shell. setopt INTERACTIVE_COMMENTS # Enable comments in interactive shell.
setopt RC_QUOTES # Allow 'Henry''s Garage' instead of 'Henry'\''s Garage'. setopt RC_QUOTES # Allow 'Henry''s Garage' instead of 'Henry'\''s Garage'.
unsetopt MAIL_WARNING # Don't print a warning message if a mail file has been accessed. unsetopt MAIL_WARNING # Don't print a warning message if a mail file has
# been accessed.
# Allow mapping Ctrl+S and Ctrl+Q shortcuts # Allow mapping Ctrl+S and Ctrl+Q shortcuts
[[ -r ${TTY:-} && -w ${TTY:-} && $+commands[stty] == 1 ]] && stty -ixon <$TTY >$TTY [[ -r ${TTY:-} && -w ${TTY:-} && $+commands[stty] == 1 ]] && stty -ixon <$TTY >$TTY
@ -43,23 +44,23 @@ unsetopt MAIL_WARNING # Don't print a warning message if a mail file has b
# Jobs # Jobs
# #
setopt LONG_LIST_JOBS # List jobs in the long format by default. setopt LONG_LIST_JOBS # List jobs in the long format by default.
setopt AUTO_RESUME # Attempt to resume existing job before creating a new process. setopt AUTO_RESUME # Attempt to resume existing job before creating a new process.
setopt NOTIFY # Report status of background jobs immediately. setopt NOTIFY # Report status of background jobs immediately.
unsetopt BG_NICE # Don't run all background jobs at a lower priority. unsetopt BG_NICE # Don't run all background jobs at a lower priority.
unsetopt HUP # Don't kill jobs on shell exit. unsetopt HUP # Don't kill jobs on shell exit.
unsetopt CHECK_JOBS # Don't report on jobs when shell exit. unsetopt CHECK_JOBS # Don't report on jobs when shell exit.
# #
# Termcap # Termcap
# #
if zstyle -t ':prezto:environment:termcap' color; then if zstyle -t ':prezto:environment:termcap' color; then
export LESS_TERMCAP_mb=$'\E[01;31m' # Begins blinking. export LESS_TERMCAP_mb=$'\E[01;31m' # Begins blinking.
export LESS_TERMCAP_md=$'\E[01;31m' # Begins bold. export LESS_TERMCAP_md=$'\E[01;31m' # Begins bold.
export LESS_TERMCAP_me=$'\E[0m' # Ends mode. export LESS_TERMCAP_me=$'\E[0m' # Ends mode.
export LESS_TERMCAP_se=$'\E[0m' # Ends standout-mode. export LESS_TERMCAP_se=$'\E[0m' # Ends standout-mode.
export LESS_TERMCAP_so=$'\E[00;47;30m' # Begins standout-mode. export LESS_TERMCAP_so=$'\E[00;47;30m' # Begins standout-mode.
export LESS_TERMCAP_ue=$'\E[0m' # Ends underline. export LESS_TERMCAP_ue=$'\E[0m' # Ends underline.
export LESS_TERMCAP_us=$'\E[01;32m' # Begins underline. export LESS_TERMCAP_us=$'\E[01;32m' # Begins underline.
fi fi

View File

@ -19,6 +19,13 @@ instead of the bundled version.
## Aliases ## Aliases
Aliases are enabled by default. To disable them, add the following to
_`${ZDOTDIR:-$HOME}/.zpreztorc`_.
```sh
zstyle ':prezto:module:fasd:alias' skip 'yes'
```
- `j` changes the current working directory interactively. - `j` changes the current working directory interactively.
## Completion ## Completion

View File

@ -53,5 +53,7 @@ function fasd_cd {
# Aliases # Aliases
# #
# Changes the current working directory interactively. if ! zstyle -t ':prezto:module:fasd:alias' skip; then
alias j='fasd_cd -i' # Changes the current working directory interactively.
alias j='fasd_cd -i'
fi

View File

@ -44,8 +44,7 @@ _gnu_utility_cmds=(
'libtool' 'libtoolize' 'libtool' 'libtoolize'
# Miscellaneous # Miscellaneous
'egrep' 'fgrep' 'getopt' 'grep' 'indent' 'make' 'sed' 'tar' 'time' 'units' 'awk' 'getopt' 'grep' 'indent' 'make' 'sed' 'tar' 'time' 'units' 'which'
'which'
) )
# Wrap GNU utilities in functions. # Wrap GNU utilities in functions.

View File

@ -65,6 +65,42 @@ _`${ZDOTDIR:-$HOME}/.zpreztorc`_:
zstyle ':prezto:module:history-substring-search' globbing-flags '' zstyle ':prezto:module:history-substring-search' globbing-flags ''
``` ```
### Case sensitive search
To set the search case-sensitivity, add the following line to
_`${ZDOTDIR:-$HOME}/.zpreztorc`_:
```sh
zstyle ':prezto:module:history-substring-search' case-sensitive 'yes'
```
### Fuzzy search
To enable search for fuzzy matches, add the following line to
_`${ZDOTDIR:-$HOME}/.zpreztorc`_:
```sh
zstyle ':prezto:module:history-substring-search' fuzzy 'yes'
```
### Unique results
To enable unique results, add the following line to
_`${ZDOTDIR:-$HOME}/.zpreztorc`_:
```sh
zstyle ':prezto:module:history-substring-search' unique 'yes'
```
### Prefixed search
To enable prefixed search matches, add the following line to
_`${ZDOTDIR:-$HOME}/.zpreztorc`_:
```sh
zstyle ':prezto:module:history-substring-search' prefixed 'yes'
```
## Authors ## Authors
_The authors of this module should be contacted via the [issue tracker][5]._ _The authors of this module should be contacted via the [issue tracker][5]._

View File

@ -38,6 +38,18 @@ if ! zstyle -t ':prezto:module:history-substring-search' color; then
unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_{FOUND,NOT_FOUND} unset HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_{FOUND,NOT_FOUND}
fi fi
if zstyle -t ':prezto:module:history-substring-search' fuzzy; then
HISTORY_SUBSTRING_SEARCH_FUZZY=1
fi
if zstyle -t ':prezto:module:history-substring-search' unique; then
HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=1
fi
if zstyle -t ':prezto:module:history-substring-search' prefixed; then
HISTORY_SUBSTRING_SEARCH_PREFIXED=1
fi
# #
# Key Bindings # Key Bindings
# #

View File

@ -36,6 +36,13 @@ Alternately, you can set `HISTFILE` manually to _`${ZDOTDIR:-$HOME}/.zhistory`_.
## Aliases ## Aliases
Aliases are enabled by default. To disable them, add the following to
_`${ZDOTDIR:-$HOME}/.zpreztorc`_.
```sh
zstyle ':prezto:module:history:alias' skip 'yes'
```
- `history-stat` lists the ten most used commands - `history-stat` lists the ten most used commands
## Settings ## Settings

View File

@ -10,58 +10,34 @@
# Options # Options
# #
setopt BANG_HIST # Treat the '!' character specially during expansion. setopt BANG_HIST # Treat the '!' character specially during expansion.
setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format. setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format.
setopt SHARE_HISTORY # Share history between all sessions. setopt SHARE_HISTORY # Share history between all sessions.
setopt HIST_EXPIRE_DUPS_FIRST # Expire a duplicate event first when trimming history. setopt HIST_EXPIRE_DUPS_FIRST # Expire a duplicate event first when trimming history.
setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again. setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again.
setopt HIST_IGNORE_ALL_DUPS # Delete an old recorded event if a new event is a duplicate. setopt HIST_IGNORE_ALL_DUPS # Delete an old recorded event if a new event is a duplicate.
setopt HIST_FIND_NO_DUPS # Do not display a previously found event. setopt HIST_FIND_NO_DUPS # Do not display a previously found event.
setopt HIST_IGNORE_SPACE # Do not record an event starting with a space. setopt HIST_IGNORE_SPACE # Do not record an event starting with a space.
setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file. setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file.
setopt HIST_VERIFY # Do not execute immediately upon history expansion. setopt HIST_VERIFY # Do not execute immediately upon history expansion.
setopt HIST_BEEP # Beep when accessing non-existent history. setopt HIST_BEEP # Beep when accessing non-existent history.
# #
# Variables # Variables
# #
zstyle -s ':prezto:module:history' histfile '_pmh_histfile' || _pmh_histfile="${HISTFILE:-${ZDOTDIR:-$HOME}/.zsh_history}" zstyle -s ':prezto:module:history' histfile 'HISTFILE' \
zstyle -s ':prezto:module:history' histsize '_pmh_histsize' || _pmh_histsize=10000 || HISTFILE="${HISTFILE:-${ZDOTDIR:-$HOME}/.zsh_history}" # The path to the history file.
zstyle -s ':prezto:module:history' savehist '_pmh_savehist' || _pmh_savehist=${_pmh_histsize} zstyle -s ':prezto:module:history' histsize 'HISTSIZE' \
HISTFILE="${_pmh_histfile}" # The path to the history file. || HISTSIZE=10000 # The maximum number of events to save in the internal history.
HISTSIZE="${_pmh_histsize}" # The maximum number of events to save in the internal history. zstyle -s ':prezto:module:history' savehist 'SAVEHIST' \
SAVEHIST="${_pmh_savehist}" # The maximum number of events to save in the history file. || SAVEHIST=$HISTSIZE # The maximum number of events to save in the history file.
unset _pmh_{hist{file,size},savehist}
# #
# Aliases # Aliases
# #
# Lists the ten most used commands. if ! zstyle -t ':prezto:module:history:alias' skip; then
alias history-stat="history 0 | awk '{print \$2}' | sort | uniq -c | sort -n -r | head" # Lists the ten most used commands.
alias history-stat="history 0 | awk '{print \$2}' | sort | uniq -c | sort -n -r | head"
if [[ -s "${OLD_HISTFILE::=${HISTFILE:h}/.zhistory}" ]]; then
# New 'HISTFILE' doesn't exist yet, rename legacy one if available and notify.
if [[ ! -s "$HISTFILE" ]]; then
<<EON
NOTICE: Default path of 'HISTFILE' has changed from '${OLD_HISTFILE/#$HOME/~}'
to '${HISTFILE/#$HOME/~}'.
Attempting to rename the existing 'HISTFILE' ...
EON
command mv -v "$OLD_HISTFILE" "$HISTFILE"
# New 'HISTFILE' does exist and is older than legacy one, just warn.
elif [[ "$OLD_HISTFILE" -nt "$HISTFILE" ]]; then
<<EOW
WARNING: Default path of 'HISTFILE' has changed from '${OLD_HISTFILE/#$HOME/~}'
to '${HISTFILE/#$HOME/~}'.
Either set 'HISTFILE' in '${${0:h}/#$HOME/~}'
or move previous history from '${OLD_HISTFILE/#$HOME/~}' to
'${HISTFILE/#$HOME/~}'.
EOW
fi
unset OLD_HISTFILE
fi fi

View File

@ -12,6 +12,13 @@ brew shellenv
## Aliases ## Aliases
Aliases are enabled by default. To disable them, add the following to
_`${ZDOTDIR:-$HOME}/.zpreztorc`_.
```sh
zstyle ':prezto:module:homebrew:alias' skip 'yes'
```
### Homebrew Core ### Homebrew Core
- `brewc` cleans outdated brews and their cached archives. - `brewc` cleans outdated brews and their cached archives.

View File

@ -21,7 +21,17 @@ fi
# Load 'HOMEBREW_' prefixed variables only. Avoid loading 'PATH' related # Load 'HOMEBREW_' prefixed variables only. Avoid loading 'PATH' related
# variables as they are already handled in standard zsh configuration. # variables as they are already handled in standard zsh configuration.
if (( $+commands[brew] )); then if (( $+commands[brew] )); then
eval "${(@M)${(f)"$(brew shellenv 2> /dev/null)"}:#export HOMEBREW*}" cache_file="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/brew-shellenv-cache.zsh"
if [[ "$commands[brew]" -nt "$cache_file" \
|| "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \
|| ! -s "$cache_file" ]]; then
mkdir -p "$cache_file:h"
# Cache the result.
echo "${(@M)${(f)"$(brew shellenv 2> /dev/null)"}:#export HOMEBREW*}" >! "$cache_file" 2> /dev/null
fi
source "$cache_file"
unset cache_file
fi fi
# #
@ -29,19 +39,21 @@ fi
# #
# Homebrew # Homebrew
alias brewc='brew cleanup' if ! zstyle -t ':prezto:module:homebrew:alias' skip; then
alias brewi='brew install' alias brewc='brew cleanup'
alias brewL='brew leaves' alias brewi='brew install'
alias brewl='brew list' alias brewL='brew leaves'
alias brewo='brew outdated' alias brewl='brew list'
alias brews='brew search' alias brewo='brew outdated'
alias brewu='brew upgrade' alias brews='brew search'
alias brewx='brew uninstall' alias brewu='brew upgrade'
alias brewx='brew uninstall'
# Homebrew Cask # Homebrew Cask
alias caski='brew install --cask' alias caski='brew install --cask'
alias caskl='brew list --cask' alias caskl='brew list --cask'
alias casko='brew outdated --cask' alias casko='brew outdated --cask'
alias casks='brew search --cask' alias casks='brew search --cask'
alias casku='brew upgrade --cask' alias casku='brew upgrade --cask'
alias caskx='brew uninstall --cask' alias caskx='brew uninstall --cask'
fi

View File

@ -4,6 +4,13 @@ Defines MacPorts aliases and adds MacPorts directories to path variables.
## Aliases ## Aliases
Aliases are enabled by default. To disable them, add the following to
_`${ZDOTDIR:-$HOME}/.zpreztorc`_.
```sh
zstyle ':prezto:module:macports:alias' skip 'yes'
```
- `portc` cleans the files used to build ports. - `portc` cleans the files used to build ports.
- `porti` installs a port. - `porti` installs a port.
- `ports` searches for a port. - `ports` searches for a port.

View File

@ -28,10 +28,12 @@ path=(
# Aliases # Aliases
# #
alias portc='sudo port clean --all installed' if ! zstyle -t ':prezto:module:macports:alias' skip; then
alias porti='sudo port install' alias portc='sudo port clean --all installed'
alias ports='port search' alias porti='sudo port install'
alias portU='sudo port selfupdate && sudo port upgrade outdated' alias ports='port search'
alias portu='sudo port upgrade' alias portU='sudo port selfupdate && sudo port upgrade outdated'
alias portX='sudo port -u uninstall' alias portu='sudo port upgrade'
alias portx='sudo port uninstall' alias portX='sudo port -u uninstall'
alias portx='sudo port uninstall'
fi

View File

@ -29,6 +29,13 @@ _`$XDG_CONFIG_HOME/nvm`_, _`~/.nvm`_, or is installed with homebrew.
## Aliases ## Aliases
Aliases are enabled by default. To disable them, add the following to
_`${ZDOTDIR:-$HOME}/.zpreztorc`_.
```sh
zstyle ':prezto:module:node:alias' skip 'yes'
```
### npm ### npm
- `npmi` install a package. - `npmi` install a package.

View File

@ -48,18 +48,20 @@ N_PREFIX="${XDG_CONFIG_HOME:-$HOME/.config}/n" # The path to 'n' cache.
# Aliases # Aliases
# #
# npm if ! zstyle -t ':prezto:module:node:alias' skip; then
alias npmi='npm install' # npm
alias npml='npm list' alias npmi='npm install'
alias npmo='npm outdated' alias npml='npm list'
alias npmp='npm publish' alias npmo='npm outdated'
alias npmP='npm prune' alias npmp='npm publish'
alias npmr='npm run' alias npmP='npm prune'
alias npms='npm search' alias npmr='npm run'
alias npmt='npm test' alias npms='npm search'
alias npmu='npm update' alias npmt='npm test'
alias npmx='npm uninstall' alias npmu='npm update'
alias npmx='npm uninstall'
alias npmci='npm ci' alias npmci='npm ci'
alias npmcit='npm cit' alias npmcit='npm cit'
alias npmit='npm it' alias npmit='npm it'
fi

View File

@ -9,7 +9,7 @@ function manp {
local page local page
if (( $# > 0 )); then if (( $# > 0 )); then
for page in "$@"; do for page in "$@"; do
man -t "$page" | open -f -a Preview mandoc -T pdf "$(/usr/bin/man -w $page)" | open -fa Preview
done done
else else
print 'What manual page do you want?' >&2 print 'What manual page do you want?' >&2

View File

@ -0,0 +1,31 @@
#
# Moves files to the macOS trash.
#
# function trash {
emulate -L zsh
setopt LOCAL_OPTIONS EXTENDED_GLOB
local file
local -a files=()
for file in $@; do
if [[ -e $file ]]; then
# ':a' gets the full path (do not use ':A', which would resolve symlinks)
files+=("the POSIX file \"${file:a}\"")
else
print "trash: No such file or directory '$file'." >&2
return 1
fi
done
if (( $#files == 0 )); then
print 'usage: trash <files...>' >&2
return 64 # Match rm's return code.
fi
# Join file list with commas, and tell Finder to trash that list.
local file_list="${(pj., .)files}"
osascript 2>&1 > /dev/null -e "tell app \"Finder\" to move { "${file_list}" } to trash"
# }

View File

@ -40,6 +40,13 @@ The subcommands of _plenv_ is similar with _rbenv_.
## Aliases ## Aliases
Aliases are enabled by default. To disable them, add the following to
_`${ZDOTDIR:-$HOME}/.zpreztorc`_.
```sh
zstyle ':prezto:module:perl:alias' skip 'yes'
```
### General ### General
- `pl` is short for `perl`. - `pl` is short for `perl`.

View File

@ -61,37 +61,39 @@ fi
# Aliases # Aliases
# #
# General if ! zstyle -t ':prezto:module:perl:alias' skip; then
alias pl='perl' # General
alias pld='perldoc' alias pl='perl'
alias ple='perl -wlne' alias pld='perldoc'
alias ple='perl -wlne'
# Perlbrew # Perlbrew
if (( $+commands[perlbrew] )); then if (( $+commands[perlbrew] )); then
alias plb='perlbrew' alias plb='perlbrew'
alias plba='perlbrew available' alias plba='perlbrew available'
alias plbi='perlbrew install' alias plbi='perlbrew install'
alias plbl='perlbrew list' alias plbl='perlbrew list'
alias plbo='perlbrew off' alias plbo='perlbrew off'
alias plbO='perlbrew switch-off' alias plbO='perlbrew switch-off'
alias plbs='perlbrew switch' alias plbs='perlbrew switch'
alias plbu='perlbrew use' alias plbu='perlbrew use'
alias plbx='perlbrew uninstall' alias plbx='perlbrew uninstall'
elif (( $+commands[plenv] )); then elif (( $+commands[plenv] )); then
alias plv='plenv' alias plv='plenv'
alias plvc='plenv commands' alias plvc='plenv commands'
alias plvl='plenv local' alias plvl='plenv local'
alias plvg='plenv global' alias plvg='plenv global'
alias plvs='plenv shell' alias plvs='plenv shell'
alias plvi='plenv install' alias plvi='plenv install'
alias plvu='plenv uninstall' alias plvu='plenv uninstall'
alias plvr='plenv rehash' alias plvr='plenv rehash'
alias plvv='plenv version' alias plvv='plenv version'
alias plvV='plenv versions' alias plvV='plenv versions'
alias plvw='plenv which' alias plvw='plenv which'
alias plvW='plenv whence' alias plvW='plenv whence'
alias plvm='plenv list-modules' alias plvm='plenv list-modules'
alias plvM='plenv migrate-modules' alias plvM='plenv migrate-modules'
alias plvI='plenv install-cpanm' alias plvI='plenv install-cpanm'
fi
fi fi

View File

@ -10,18 +10,8 @@ autoload -Uz promptinit && promptinit
# Load the prompt theme. # Load the prompt theme.
zstyle -a ':prezto:module:prompt' theme 'prompt_argv' zstyle -a ':prezto:module:prompt' theme 'prompt_argv'
if [[ "$TERM" == (dumb|linux|*bsd*) ]] || (( $#prompt_argv < 1 )); then if [[ $TERM == (dumb|linux|*bsd*) ]] || (( $#prompt_argv < 1 )); then
prompt 'off' prompt 'off'
elif [[ "$prompt_argv[1]" == 'powerlevel9k' ]] ; then
<<EOW
WARNING: Prezto does not support 'powerlevel9k' anymore as it has
been deprecated and is not supported by its author.
Consider migrating to 'powerlevel10k' instead by setting:
zstyle ':prezto:module:prompt' theme 'powerlevel10k'
in ${${ZDOTDIR:-$HOME}/#$HOME/~}/.zpreztorc.
Switching to prezto default prompt 'sorin'..."
EOW
prompt 'sorin'
else else
prompt "$prompt_argv[@]" prompt "$prompt_argv[@]"
fi fi

View File

@ -2,9 +2,6 @@
Enables local Python and local Python package installation. Enables local Python and local Python package installation.
This module must be loaded _before_ the _`completion`_ module so that the
provided completion definitions are loaded.
## Settings ## Settings
This module supports virtual environments from conda and This module supports virtual environments from conda and
@ -13,7 +10,7 @@ disable _virtualenvwrapper_, add the following to
_`${ZDOTDIR:-$HOME}/.zpreztorc`_. _`${ZDOTDIR:-$HOME}/.zpreztorc`_.
```sh ```sh
zstyle ':prezto:module:python' skip-virtualenvwrapper-init 'on' zstyle ':prezto:module:python:virtualenv' initialize 'no'
``` ```
Conda support can be enabled by adding the following to Conda support can be enabled by adding the following to
@ -124,6 +121,13 @@ zstyle ':prezto:module:python:virtualenv' initialize 'no'
## Aliases ## Aliases
Aliases are enabled by default. To disable them, add the following to
_`${ZDOTDIR:-$HOME}/.zpreztorc`_.
```sh
zstyle ':prezto:module:python:alias' skip 'yes'
```
- `py` is short for `python`. - `py` is short for `python`.
- `py2` is short for `python2`. - `py2` is short for `python2`.
- `py3` is short for `python3`. - `py3` is short for `python3`.

View File

@ -1,19 +0,0 @@
#compdef -P pip[0-9.]#
#autoload
#
# Pip completion, delegating to pip to do all the completion work.
#
# Authors:
# Indrajit Raychaudhuri <irc@indrajit.com>
#
if (( $+commands[$words[1]] )); then
function _pip_completion {
compadd -- $( COMP_WORDS="$words[*]" COMP_CWORD=$(( CURRENT - 1 )) \
PIP_AUTO_COMPLETE=1 $words[1] 2>/dev/null )
}
_pip_completion "$@"
fi

View File

@ -8,6 +8,12 @@
# Indrajit Raychaudhuri <irc@indrajit.com> # Indrajit Raychaudhuri <irc@indrajit.com>
# #
#
# Options
#
setopt EXTENDED_GLOB
# Load dependencies. # Load dependencies.
pmodload 'helper' pmodload 'helper'
@ -19,12 +25,7 @@ if [[ -s "${local_pyenv::=${PYENV_ROOT:-$HOME/.pyenv}/bin/pyenv}" ]] \
# Ensure manually installed pyenv is added to path when present. # Ensure manually installed pyenv is added to path when present.
[[ -s $local_pyenv ]] && path=($local_pyenv:h $path) [[ -s $local_pyenv ]] && path=($local_pyenv:h $path)
# pyenv 2+ requires shims to be added to path before being initialized. # Load pyenv into the shell session.
autoload -Uz is-at-least
if is-at-least 2 ${"$(pyenv --version 2>&1)"[(w)2]}; then
eval "$(pyenv init --path zsh)"
fi
eval "$(pyenv init - zsh)" eval "$(pyenv init - zsh)"
# Prepend PEP 370 per user site packages directory, which defaults to # Prepend PEP 370 per user site packages directory, which defaults to
@ -44,7 +45,7 @@ fi
unset local_pyenv unset local_pyenv
# Return if requirements are not found. # Return if requirements are not found.
if (( ! $#commands[(i)python[23]#] && ! $+functions[pyenv] && ! $+commands[conda] )); then if (( ! $+commands[(i)python[0-9.]#] && ! $+functions[pyenv] && ! $+commands[conda] )); then
return 1 return 1
fi fi
@ -110,38 +111,42 @@ if (( $+VIRTUALENVWRAPPER_VIRTUALENV || $+commands[virtualenv] )) \
# 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
# can exist in 'pyenv' synthesized paths (e.g., '~/.pyenv/plugins') instead. # can exist in 'pyenv' synthesized paths (e.g., '~/.pyenv/plugins') instead.
local -a pyenv_plugins local -a pyenv_plugins
local pyenv_virtualenvwrapper_plugin_found
if (( $+commands[pyenv] )); then if (( $+commands[pyenv] )); then
pyenv_plugins=(${(@oM)${(f)"$(pyenv commands --no-sh 2> /dev/null)"}:#virtualenv*}) pyenv_plugins=(${(@oM)${(f)"$(pyenv commands --no-sh 2> /dev/null)"}:#virtualenv*})
# Optionally activate 'virtualenv-init' plugin when available.
if (( $pyenv_plugins[(i)virtualenv-init] <= $#pyenv_plugins )); then
eval "$(pyenv virtualenv-init - zsh)"
fi
# Optionally activate 'virtualenvwrapper' plugin when available.
if (( $pyenv_plugins[(i)virtualenvwrapper(_lazy|)] <= $#pyenv_plugins )); then
pyenv "$pyenv_plugins[(R)virtualenvwrapper(_lazy|)]"
pyenv_virtualenvwrapper_plugin_found="true"
fi
unset pyenv_plugins
fi fi
# Optionally activate 'virtualenv' plugin when available. if [[ $pyenv_virtualenvwrapper_plugin_found != "true" ]]; then
if (( $pyenv_plugins[(i)virtualenv-init] <= $#pyenv_plugins )); then # Fallback to standard 'virtualenvwrapper' if 'python' is available in '$path'.
eval "$(pyenv virtualenv-init - zsh)" if (( ! $+VIRTUALENVWRAPPER_PYTHON )) && (( $+commands[(i)python[0-9.]#] )); then
VIRTUALENVWRAPPER_PYTHON=$commands[(i)python[0-9.]#]
fi
virtualenvwrapper_sources=(
${(@Ov)commands[(I)virtualenvwrapper(_lazy|).sh]}
/usr/share/virtualenvwrapper/virtualenvwrapper(_lazy|).sh(OnN)
)
if (( $#virtualenvwrapper_sources )); then
source "$virtualenvwrapper_sources[1]"
fi
unset virtualenvwrapper_sources
fi fi
# Optionally activate 'virtualenvwrapper' plugin when available. unset pyenv_virtualenvwrapper_plugin_found
if (( $pyenv_plugins[(i)virtualenvwrapper(_lazy|)] <= $#pyenv_plugins )); then
pyenv "$pyenv_plugins[(R)virtualenvwrapper(_lazy|)]"
fi
unset pyenv_plugins
else
# Fallback to 'virtualenvwrapper' without 'pyenv' wrapper if 'python' is
# available in '$path'.
if (( ! $+VIRTUALENVWRAPPER_PYTHON )) && (( $#commands[(i)python[23]#] )); then
VIRTUALENVWRAPPER_PYTHON=$commands[(i)python[23]#]
fi
virtenv_sources=(
${(@Ov)commands[(I)virtualenvwrapper(_lazy|).sh]}
/usr/share/virtualenvwrapper/virtualenvwrapper(_lazy|).sh(OnN)
)
if (( $#virtenv_sources )); then
source "$virtenv_sources[1]"
fi
unset virtenv_sources
fi fi
# Load conda into the shell session, if requested. # Load conda into the shell session, if requested.
@ -161,6 +166,8 @@ fi
# Aliases # Aliases
# #
alias py='python' if ! zstyle -t ':prezto:module:python:alias' skip; then
alias py2='python2' alias py='python'
alias py3='python3' alias py2='python2'
alias py3='python3'
fi

View File

@ -4,6 +4,13 @@ Defines [Ruby on Rails][1] aliases.
## Aliases ## Aliases
Aliases are enabled by default. To disable them, add the following to
_`${ZDOTDIR:-$HOME}/.zpreztorc`_.
```sh
zstyle ':prezto:module:rails:alias' skip 'yes'
```
- `ror` is short for `rails`. - `ror` is short for `rails`.
- `rorc` starts the Rails console. - `rorc` starts the Rails console.
- `rordc` starts the Rails console connected to the database. - `rordc` starts the Rails console connected to the database.

View File

@ -19,17 +19,19 @@ fi
# Aliases # Aliases
# #
alias ror='bundle exec rails' if ! zstyle -t ':prezto:module:rails:alias' skip; then
alias rorc='bundle exec rails console' alias ror='bundle exec rails'
alias rordc='bundle exec rails dbconsole' alias rorc='bundle exec rails console'
alias rordm='bundle exec rake db:migrate' alias rordc='bundle exec rails dbconsole'
alias rordM='bundle exec rake db:migrate db:test:clone' alias rordm='bundle exec rake db:migrate'
alias rordr='bundle exec rake db:rollback' alias rordM='bundle exec rake db:migrate db:test:clone'
alias rorg='bundle exec rails generate' alias rordr='bundle exec rake db:rollback'
alias rorl='tail -f "$(ruby-app-root)/log/development.log"' alias rorg='bundle exec rails generate'
alias rorlc='bundle exec rake log:clear' alias rorl='tail -f "$(ruby-app-root)/log/development.log"'
alias rorp='bundle exec rails plugin' alias rorlc='bundle exec rake log:clear'
alias rorr='bundle exec rails runner' alias rorp='bundle exec rails plugin'
alias rors='bundle exec rails server' alias rorr='bundle exec rails runner'
alias rorsd='bundle exec rails server --debugger' alias rors='bundle exec rails server'
alias rorx='bundle exec rails destroy' alias rorsd='bundle exec rails server --debugger'
alias rorx='bundle exec rails destroy'
fi

View File

@ -54,6 +54,13 @@ dependencies, with [Bundler][5].
## Aliases ## Aliases
Aliases are enabled by default. To disable them, add the following to
_`${ZDOTDIR:-$HOME}/.zpreztorc`_.
```sh
zstyle ':prezto:module:ruby:alias' skip 'yes'
```
### General ### General
- `rb` is short for `ruby`. - `rb` is short for `ruby`.

View File

@ -59,23 +59,25 @@ fi
# Aliases # Aliases
# #
# General if ! zstyle -t ':prezto:module:ruby:alias' skip; then
alias rb='ruby' # General
alias rb='ruby'
# Bundler # Bundler
if (( $+commands[bundle] )); then if (( $+commands[bundle] )); then
alias rbb='bundle' alias rbb='bundle'
alias rbbc='bundle clean' alias rbbc='bundle clean'
alias rbbe='bundle exec' alias rbbe='bundle exec'
alias rbbi='bundle install --path vendor/bundle' alias rbbi='bundle install --path vendor/bundle'
alias rbbl='bundle list' alias rbbl='bundle list'
alias rbbo='bundle open' alias rbbo='bundle open'
alias rbbp='bundle package' alias rbbp='bundle package'
alias rbbu='bundle update' alias rbbu='bundle update'
alias rbbI='rbbi \ alias rbbI='rbbi \
&& bundle package \ && bundle package \
&& print .bundle >>! .gitignore \ && print .bundle >>! .gitignore \
&& print vendor/assets >>! .gitignore \ && print vendor/assets >>! .gitignore \
&& print vendor/bundle >>! .gitignore \ && print vendor/bundle >>! .gitignore \
&& print vendor/cache >>! .gitignore' && print vendor/cache >>! .gitignore'
fi
fi fi

View File

@ -24,6 +24,13 @@ zstyle ':prezto:module:screen:auto-start' remote 'yes'
## Aliases ## Aliases
Aliases are enabled by default. To disable them, add the following to
_`${ZDOTDIR:-$HOME}/.zpreztorc`_.
```sh
zstyle ':prezto:module:screen:alias' skip 'yes'
```
- `scr` is short for `screen`. - `scr` is short for `screen`.
- `scrl` lists sessions/socket directory. - `scrl` lists sessions/socket directory.
- `scrn` starts a new session. - `scrn` starts a new session.

View File

@ -22,7 +22,7 @@ if [[ -z "$STY" && -z "$EMACS" && -z "$VIM" ]] && ( \
session="$( session="$(
screen -list 2> /dev/null \ screen -list 2> /dev/null \
| sed '1d;$d' \ | sed '1d;$d' \
| awk '{print $1}' \ | awk '!/Dead/ {print $1}' \
| head -1)" | head -1)"
if [[ -n "$session" ]]; then if [[ -n "$session" ]]; then
@ -36,7 +36,9 @@ fi
# Aliases # Aliases
# #
alias scr='screen' if ! zstyle -t ':prezto:module:screen:alias' skip; then
alias scrl='screen -list' alias scr='screen'
alias scrn='screen -U -S' alias scrl='screen -list'
alias scrr='screen -a -A -U -D -R' alias scrn='screen -U -S'
alias scrr='screen -a -A -U -D -R'
fi

View File

@ -7,7 +7,7 @@
# #
# Return if requirements are not found. # Return if requirements are not found.
if [[ "$TERM" == 'dumb' ]]; then if [[ $TERM == dumb ]]; then
return 1 return 1
fi fi

View File

@ -16,8 +16,8 @@ _ssh_dir="$HOME/.ssh"
# Set the path to the environment file if not set by another module. # Set the path to the environment file if not set by another module.
_ssh_agent_env="${_ssh_agent_env:-${XDG_CACHE_HOME:-$HOME/.cache}/prezto/ssh-agent.env}" _ssh_agent_env="${_ssh_agent_env:-${XDG_CACHE_HOME:-$HOME/.cache}/prezto/ssh-agent.env}"
# Set the path to the persistent authentication socket. # Set the path to the persistent authentication socket if not set by another module.
_ssh_agent_sock="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/ssh-agent.sock" _ssh_agent_sock="${_ssh_agent_sock:-${XDG_CACHE_HOME:-$HOME/.cache}/prezto/ssh-agent.sock}"
# Start ssh-agent if not started. # Start ssh-agent if not started.
if [[ ! -S "$SSH_AUTH_SOCK" ]]; then if [[ ! -S "$SSH_AUTH_SOCK" ]]; then
@ -52,9 +52,9 @@ if ssh-add -l 2>&1 | grep -q 'The agent has no identities'; then
# program specified by SSH_ASKPASS and open an X11 window to read the # program specified by SSH_ASKPASS and open an X11 window to read the
# passphrase. # passphrase.
if [[ -n "$DISPLAY" && -x "$SSH_ASKPASS" ]]; then if [[ -n "$DISPLAY" && -x "$SSH_ASKPASS" ]]; then
ssh-add ${_ssh_identities:+$_ssh_dir/${^_ssh_identities[@]}} < /dev/null 2> /dev/null ssh-add ${_ssh_identities:+$_ssh_dir/${^~_ssh_identities[@]}} < /dev/null 2> /dev/null
else else
ssh-add ${_ssh_identities:+$_ssh_dir/${^_ssh_identities[@]}} 2> /dev/null ssh-add ${_ssh_identities:+$_ssh_dir/${^~_ssh_identities[@]}} 2> /dev/null
fi fi
fi fi

View File

@ -7,7 +7,7 @@
# #
# Return if requirements are not found. # Return if requirements are not found.
if [[ "$TERM" == (dumb|linux|*bsd*|eterm*) ]]; then if [[ $TERM == (dumb|linux|*bsd*|eterm*) ]]; then
return 1 return 1
fi fi
@ -60,7 +60,7 @@ function _terminal-set-titles-with-command {
local truncated_cmd="${cmd/(#m)?(#c15,)/${MATCH[1,12]}...}" local truncated_cmd="${cmd/(#m)?(#c15,)/${MATCH[1,12]}...}"
unset MATCH unset MATCH
if [[ "$TERM" == screen* ]]; then if [[ $TERM == screen* ]]; then
set-multiplexer-title "$truncated_cmd" set-multiplexer-title "$truncated_cmd"
fi fi
set-tab-title "$truncated_cmd" set-tab-title "$truncated_cmd"
@ -78,7 +78,7 @@ function _terminal-set-titles-with-path {
local truncated_path="${abbreviated_path/(#m)?(#c15,)/...${MATCH[-12,-1]}}" local truncated_path="${abbreviated_path/(#m)?(#c15,)/...${MATCH[-12,-1]}}"
unset MATCH unset MATCH
if [[ "$TERM" == screen* ]]; then if [[ $TERM == screen* ]]; then
set-multiplexer-title "$truncated_path" set-multiplexer-title "$truncated_path"
fi fi
set-tab-title "$truncated_path" set-tab-title "$truncated_path"
@ -89,7 +89,7 @@ function _terminal-set-titles-with-path {
autoload -Uz add-zsh-hook autoload -Uz add-zsh-hook
# Set up the Apple Terminal. # Set up the Apple Terminal.
if [[ "$TERM_PROGRAM" == 'Apple_Terminal' ]] \ if [[ $TERM_PROGRAM == Apple_Terminal ]] \
&& ( ! [[ -n "$STY" || -n "$TMUX" || -n "$DVTM" ]] ) && ( ! [[ -n "$STY" || -n "$TMUX" || -n "$DVTM" ]] )
then then
# Sets the Terminal.app current working directory before the prompt is # Sets the Terminal.app current working directory before the prompt is

View File

@ -53,6 +53,13 @@ Read [iTerm2 and tmux Integration][7] for more information.
## Aliases ## Aliases
Aliases are enabled by default. To disable them, add the following to
_`${ZDOTDIR:-$HOME}/.zpreztorc`_.
```sh
zstyle ':prezto:module:tmux:alias' skip 'yes'
```
- `tmuxa` attaches or switches to a tmux session. - `tmuxa` attaches or switches to a tmux session.
- `tmuxl` lists sessions managed by the tmux server. - `tmuxl` lists sessions managed by the tmux server.

View File

@ -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" && "$TERM_PROGRAM" != "vscode" ]] && ( \ if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" && -z "$INSIDE_EMACS" && -z "$VSCODE_RESOLVING_ENVIRONMENT" && "$TERM_PROGRAM" != "vscode" && "$TERMINAL_EMULATOR" != "JetBrains-JediTerm" ]] && ( \
( [[ -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
@ -45,5 +45,7 @@ fi
# Aliases # Aliases
# #
alias tmuxa="tmux $_tmux_iterm_integration new-session -A" if ! zstyle -t ':prezto:module:tmux:alias' skip; then
alias tmuxl='tmux list-sessions' alias tmuxa="tmux $_tmux_iterm_integration new-session -A"
alias tmuxl='tmux list-sessions'
fi

View File

@ -140,7 +140,6 @@ zstyle ':prezto:module:utility' correct 'no'
- `lt` lists sorted by date, most recent last. - `lt` lists sorted by date, most recent last.
- `lc` lists sorted by date, most recent last, shows change time. - `lc` lists sorted by date, most recent last, shows change time.
- `lu` lists sorted by date, most recent last, shows access time. - `lu` lists sorted by date, most recent last, shows access time.
- `sl` lists directory contents (correction for `ls`).
### macOS Everywhere ### macOS Everywhere

View File

@ -76,7 +76,7 @@ if zstyle -T ':prezto:module:utility' safe-ops; then
fi fi
# ls # ls
if [[ ${(@M)${(f)"$(ls --version 2>&1)"}:#*GNU *} ]]; then if [[ ${(@M)${(f)"$(ls --version 2>&1)"}:#*(GNU|lsd) *} ]]; then
# GNU Core Utilities # GNU Core Utilities
if zstyle -T ':prezto:module:utility:ls' dirs-first; then if zstyle -T ':prezto:module:utility:ls' dirs-first; then
@ -88,7 +88,7 @@ if [[ ${(@M)${(f)"$(ls --version 2>&1)"}:#*GNU *} ]]; then
if (( ! $+LS_COLORS )); then if (( ! $+LS_COLORS )); then
# Try dircolors when available # Try dircolors when available
if is-callable 'dircolors'; then if is-callable 'dircolors'; then
eval "$(dircolors --sh $HOME/.dir_colors(.N))" eval "$(dircolors --sh $HOME/.dir_colors(N))"
else else
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:' 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 fi
@ -122,7 +122,6 @@ alias lk='ll -Sr' # Lists sorted by size, largest last.
alias lt='ll -tr' # Lists sorted by date, most recent last. alias lt='ll -tr' # Lists sorted by date, most recent last.
alias lc='lt -c' # Lists sorted by date, most recent last, shows change time. alias lc='lt -c' # Lists sorted by date, most recent last, shows change time.
alias lu='lt -u' # Lists sorted by date, most recent last, shows access time. alias lu='lt -u' # Lists sorted by date, most recent last, shows access time.
alias sl='ls' # Correction for common spelling error.
if [[ ${(@M)${(f)"$(ls --version 2>&1)"}:#*GNU *} ]]; then if [[ ${(@M)${(f)"$(ls --version 2>&1)"}:#*GNU *} ]]; then
alias lx='ll -XB' # Lists sorted by extension (GNU only). alias lx='ll -XB' # Lists sorted by extension (GNU only).
@ -196,12 +195,14 @@ fi
# Serves a directory via HTTP. # Serves a directory via HTTP.
if (( $#commands[(i)python(|[23])] )); then if (( $#commands[(i)python(|[23])] )); then
autoload -Uz is-at-least autoload -Uz is-at-least
if is-at-least 3 ${"$(python --version 2>&1)"[(w)2]}; then if (( $+commands[python3] )); then
alias http-serve='python -m http.server'
elif (( $+commands[python3] )); then
alias http-serve='python3 -m http.server' alias http-serve='python3 -m http.server'
elif (( $+commands[python2] )); then
alias http-serve='python2 -m SimpleHTTPServer'
elif is-at-least 3 ${"$(python --version 2>&1)"[(w)2]}; then
alias http-serve='python -m http.server'
else else
alias http-serve='$commands[(i)python(|2)] -m SimpleHTTPServer' alias http-serve='python -m SimpleHTTPServer'
fi fi
fi fi

View File

@ -10,7 +10,10 @@
# Compile the completion dump to increase startup speed. # Compile the completion dump to increase startup speed.
zcompdump="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/zcompdump" zcompdump="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/zcompdump"
if [[ -s "$zcompdump" && (! -s "${zcompdump}.zwc" || "$zcompdump" -nt "${zcompdump}.zwc") ]]; then if [[ -s "$zcompdump" && (! -s "${zcompdump}.zwc" || "$zcompdump" -nt "${zcompdump}.zwc") ]]; then
zcompile "$zcompdump" if command mkdir "${zcompdump}.zwc.lock" 2>/dev/null; then
zcompile "$zcompdump"
command rmdir "${zcompdump}.zwc.lock" 2>/dev/null
fi
fi fi
} &! } &!

View File

@ -14,6 +14,6 @@ SAYINGS=(
) )
# Print a randomly-chosen message: # Print a randomly-chosen message:
echo $SAYINGS[$(($RANDOM % ${#SAYINGS} + 1))] echo $SAYINGS[$(($RANDOM % $#SAYINGS + 1))]
} >&2 } >&2

View File

@ -60,6 +60,9 @@ zstyle ':prezto:load' pmodule \
# Editor # Editor
# #
# Set the characters that are considered to be part of a word.
# zstyle ':prezto:module:editor' wordchars '*?_-.[]~&;!#$%^(){}<>'
# Set the key mapping style to 'emacs' or 'vi'. # Set the key mapping style to 'emacs' or 'vi'.
zstyle ':prezto:module:editor' key-bindings 'emacs' zstyle ':prezto:module:editor' key-bindings 'emacs'
@ -109,6 +112,18 @@ zstyle ':prezto:module:editor' key-bindings 'emacs'
# Set the search globbing flags. # Set the search globbing flags.
# zstyle ':prezto:module:history-substring-search' globbing-flags '' # zstyle ':prezto:module:history-substring-search' globbing-flags ''
# Enable search case-sensitivity.
# zstyle ':prezto:module:history-substring-search' case-sensitive 'yes'
# Enable search for fuzzy matches.
# zstyle ':prezto:module:history-substring-search' fuzzy 'yes'
# Enable search uniqueness.
# zstyle ':prezto:module:history-substring-search' unique 'yes'
# Enable prefixed search.
# zstyle ':prezto:module:history-substring-search' prefixed 'yes'
# #
# macOS # macOS
# #

View File

@ -2,15 +2,18 @@
set -ex set -ex
OLDDIR=$PWD pushd ~/.zprezto
cd ~/.zprezto
git fetch upstream git fetch upstream
git checkout master git checkout master
git merge -m "Merge upstream/master" upstream/master git merge -m "Merge upstream/master" upstream/master
git submodule update --init --recursive git submodule update --init --recursive
cd ~/.zprezto/contrib/fzf-tab cd contrib
git pull for dir in $(fd -t directory --exact-depth=1); do
pushd $dir
git pull
popd
done
cd $OLDDIR popd