diff --git a/modules/directory/README.md b/modules/directory/README.md index 86953a4..8603d9f 100644 --- a/modules/directory/README.md +++ b/modules/directory/README.md @@ -17,6 +17,13 @@ Sets directory options and defines directory 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. - `1 ... 9` changes the directory to the **n** previous one. diff --git a/modules/emacs/README.md b/modules/emacs/README.md index f93304a..8cf7bfc 100644 --- a/modules/emacs/README.md +++ b/modules/emacs/README.md @@ -12,6 +12,13 @@ execution of `carton`. ## 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 - `cai` installs dependencies. diff --git a/modules/fasd/README.md b/modules/fasd/README.md index 1958a73..04f9693 100644 --- a/modules/fasd/README.md +++ b/modules/fasd/README.md @@ -19,6 +19,13 @@ instead of the bundled version. ## 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. ## Completion diff --git a/modules/gnu-utility/init.zsh b/modules/gnu-utility/init.zsh index a8521f0..2cfbf2f 100644 --- a/modules/gnu-utility/init.zsh +++ b/modules/gnu-utility/init.zsh @@ -44,8 +44,7 @@ _gnu_utility_cmds=( 'libtool' 'libtoolize' # Miscellaneous - 'awk' 'egrep' 'fgrep' 'getopt' 'grep' 'indent' 'make' 'sed' 'tar' 'time' - 'units' 'which' + 'awk' 'getopt' 'grep' 'indent' 'make' 'sed' 'tar' 'time' 'units' 'which' ) # Wrap GNU utilities in functions. diff --git a/modules/history/README.md b/modules/history/README.md index 11c6d94..51e6e8c 100644 --- a/modules/history/README.md +++ b/modules/history/README.md @@ -36,6 +36,13 @@ Alternately, you can set `HISTFILE` manually to _`${ZDOTDIR:-$HOME}/.zhistory`_. ## 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 ## Settings diff --git a/modules/history/init.zsh b/modules/history/init.zsh index 3ef52ea..069dc2f 100644 --- a/modules/history/init.zsh +++ b/modules/history/init.zsh @@ -10,29 +10,28 @@ # Options # -setopt BANG_HIST # Treat the '!' character specially during expansion. -setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format. -setopt SHARE_HISTORY # Share history between all sessions. -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_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_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_VERIFY # Do not execute immediately upon history expansion. -setopt HIST_BEEP # Beep when accessing non-existent history. +setopt BANG_HIST # Treat the '!' character specially during expansion. +setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format. +setopt SHARE_HISTORY # Share history between all sessions. +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_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_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_VERIFY # Do not execute immediately upon history expansion. +setopt HIST_BEEP # Beep when accessing non-existent history. # # Variables # -zstyle -s ':prezto:module:history' histfile '_pmh_histfile' || _pmh_histfile="${HISTFILE:-${ZDOTDIR:-$HOME}/.zsh_history}" -zstyle -s ':prezto:module:history' histsize '_pmh_histsize' || _pmh_histsize=10000 -zstyle -s ':prezto:module:history' savehist '_pmh_savehist' || _pmh_savehist=${_pmh_histsize} -HISTFILE="${_pmh_histfile}" # The path to the history file. -HISTSIZE="${_pmh_histsize}" # The maximum number of events to save in the internal history. -SAVEHIST="${_pmh_savehist}" # The maximum number of events to save in the history file. -unset _pmh_{hist{file,size},savehist} +zstyle -s ':prezto:module:history' histfile 'HISTFILE' \ + || HISTFILE="${HISTFILE:-${ZDOTDIR:-$HOME}/.zsh_history}" # The path to the history file. +zstyle -s ':prezto:module:history' histsize 'HISTSIZE' \ + || HISTSIZE=10000 # The maximum number of events to save in the internal history. +zstyle -s ':prezto:module:history' savehist 'SAVEHIST' \ + || SAVEHIST=$HISTSIZE # The maximum number of events to save in the history file. # # Aliases @@ -42,28 +41,3 @@ if ! zstyle -t ':prezto:module:history:alias' skip; then # Lists the ten most used commands. alias history-stat="history 0 | awk '{print \$2}' | sort | uniq -c | sort -n -r | head" fi - -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 - < -# - -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 diff --git a/modules/python/init.zsh b/modules/python/init.zsh index 02eb52d..ce2fc69 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -50,7 +50,7 @@ fi unset local_pyenv # 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 fi @@ -136,8 +136,8 @@ if (( $+VIRTUALENVWRAPPER_VIRTUALENV || $+commands[virtualenv] )) \ if [[ $pyenv_virtualenvwrapper_plugin_found != "true" ]]; then # Fallback to standard 'virtualenvwrapper' if 'python' is available in '$path'. - if (( ! $+VIRTUALENVWRAPPER_PYTHON )) && (( $#commands[(i)python[23]#] )); then - VIRTUALENVWRAPPER_PYTHON=$commands[(i)python[23]#] + if (( ! $+VIRTUALENVWRAPPER_PYTHON )) && (( $+commands[(i)python[0-9.]#] )); then + VIRTUALENVWRAPPER_PYTHON=$commands[(i)python[0-9.]#] fi virtualenvwrapper_sources=( diff --git a/modules/rails/README.md b/modules/rails/README.md index 129627a..5e230e0 100644 --- a/modules/rails/README.md +++ b/modules/rails/README.md @@ -4,6 +4,13 @@ Defines [Ruby on Rails][1] 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`. - `rorc` starts the Rails console. - `rordc` starts the Rails console connected to the database. diff --git a/modules/ruby/README.md b/modules/ruby/README.md index 97a09f0..fa3d106 100644 --- a/modules/ruby/README.md +++ b/modules/ruby/README.md @@ -54,6 +54,13 @@ dependencies, with [Bundler][5]. ## 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 - `rb` is short for `ruby`. diff --git a/modules/screen/README.md b/modules/screen/README.md index a1775f7..b554951 100644 --- a/modules/screen/README.md +++ b/modules/screen/README.md @@ -24,6 +24,13 @@ zstyle ':prezto:module:screen:auto-start' remote 'yes' ## 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`. - `scrl` lists sessions/socket directory. - `scrn` starts a new session. diff --git a/modules/tmux/README.md b/modules/tmux/README.md index e7ae929..f6d375b 100644 --- a/modules/tmux/README.md +++ b/modules/tmux/README.md @@ -53,6 +53,13 @@ Read [iTerm2 and tmux Integration][7] for more information. ## 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. - `tmuxl` lists sessions managed by the tmux server.