From c9c3b40b5ca6dc568186865490ba97a28ecd0e92 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Thu, 23 May 2013 15:58:55 -0400 Subject: [PATCH 01/25] [Fix #437] Always set $TMPDIR --- runcoms/zshenv | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/runcoms/zshenv b/runcoms/zshenv index 0f8738bffa..9ff39e0675 100644 --- a/runcoms/zshenv +++ b/runcoms/zshenv @@ -64,10 +64,13 @@ fi # Temporary Files # -if [[ -d "$TMPDIR" ]]; then - export TMPPREFIX="${TMPDIR%/}/zsh" - if [[ ! -d "$TMPPREFIX" ]]; then - mkdir -p "$TMPPREFIX" - fi +if [[ ! -d "$TMPDIR" ]]; then + export TMPDIR="/tmp/$USER" + mkdir -p -m 700 "$TMPDIR" +fi + +TMPPREFIX="${TMPDIR%/}/zsh" +if [[ ! -d "$TMPPREFIX" ]]; then + mkdir -p "$TMPPREFIX" fi From baf7f6184b730ffbaa631b8058f0bc65657e9816 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Thu, 23 May 2013 16:00:16 -0400 Subject: [PATCH 02/25] Do not substitute /tmp since $TMPDIR is always set --- modules/pacman/functions/pacman-list-disowned | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/pacman/functions/pacman-list-disowned b/modules/pacman/functions/pacman-list-disowned index d6b6f289b2..2cd8a92bbb 100644 --- a/modules/pacman/functions/pacman-list-disowned +++ b/modules/pacman/functions/pacman-list-disowned @@ -6,7 +6,7 @@ # Sorin Ionescu # -local tmp="${TMPDIR:-/tmp}/pacman-disowned-$UID-$$" +local tmp="$TMPDIR/pacman-disowned-$UID-$$" local db="$tmp/db" local fs="$tmp/fs" From 0c9c099ac357c23ac4308cd6ba25c4f74bdf4328 Mon Sep 17 00:00:00 2001 From: Sebastian Wiesner Date: Wed, 22 May 2013 19:38:19 +0200 Subject: [PATCH 03/25] Add the RubyGems bin directory to PATH on other Unix systems Signed-off-by: Sorin Ionescu --- modules/ruby/init.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/ruby/init.zsh b/modules/ruby/init.zsh index b287cbb2c8..0303d5a34c 100644 --- a/modules/ruby/init.zsh +++ b/modules/ruby/init.zsh @@ -28,6 +28,8 @@ else if [[ "$OSTYPE" == darwin* ]]; then export GEM_HOME="$HOME/Library/Ruby/Gems/1.8" path=("$GEM_HOME/bin" $path) + else + path=($HOME/.gem/ruby/*/bin(N) $path) fi fi @@ -58,4 +60,3 @@ if (( $+commands[bundle] )); then && print vendor/bundle >>! .gitignore \ && print vendor/cache >>! .gitignore' fi - From 20655c8b66907ff3cc879a8cbe7b82173b597e33 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Thu, 23 May 2013 19:10:21 -0400 Subject: [PATCH 04/25] [Fix #436] Remove Bombich rsync references --- modules/rsync/README.md | 8 ++------ modules/rsync/init.zsh | 1 - 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/modules/rsync/README.md b/modules/rsync/README.md index 2d2e656696..2ec211244d 100644 --- a/modules/rsync/README.md +++ b/modules/rsync/README.md @@ -3,9 +3,6 @@ Rsync Defines [rsync][1] aliases. -Mac OS X users are encouraged to use [Bombich's rsync][2], which has HFS+ -enhancements. - Aliases ------- @@ -18,11 +15,10 @@ Aliases Authors ------- -*The authors of this module should be contacted via the [issue tracker][3].* +*The authors of this module should be contacted via the [issue tracker][2].* - [Sorin Ionescu](https://github.com/sorin-ionescu) [1]: http://rsync.samba.org -[2]: http://www.bombich.com/rsync.html -[3]: https://github.com/sorin-ionescu/prezto/issues +[2]: https://github.com/sorin-ionescu/prezto/issues diff --git a/modules/rsync/init.zsh b/modules/rsync/init.zsh index c3b3b577b3..802952cd7b 100644 --- a/modules/rsync/init.zsh +++ b/modules/rsync/init.zsh @@ -17,7 +17,6 @@ fi _rsync_cmd='rsync --verbose --progress --human-readable --compress --archive --hard-links --one-file-system' # Mac OS X and HFS+ Enhancements -# http://www.bombich.com/rsync.html if [[ "$OSTYPE" == darwin* ]] && grep -q 'file-flags' <(rsync --help 2>&1); then _rsync_cmd="${_rsync_cmd} --crtimes --acls --xattrs --fileflags --protect-decmpfs --force-change" fi From 9b945e26b998086b9823ad50302d9dbe2da4ad4a Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Fri, 24 May 2013 12:29:49 -0400 Subject: [PATCH 05/25] Revert "[Fix #436] Remove Bombich rsync references" This reverts commit 20655c8b66907ff3cc879a8cbe7b82173b597e33. --- modules/rsync/README.md | 8 ++++++-- modules/rsync/init.zsh | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/rsync/README.md b/modules/rsync/README.md index 2ec211244d..2d2e656696 100644 --- a/modules/rsync/README.md +++ b/modules/rsync/README.md @@ -3,6 +3,9 @@ Rsync Defines [rsync][1] aliases. +Mac OS X users are encouraged to use [Bombich's rsync][2], which has HFS+ +enhancements. + Aliases ------- @@ -15,10 +18,11 @@ Aliases Authors ------- -*The authors of this module should be contacted via the [issue tracker][2].* +*The authors of this module should be contacted via the [issue tracker][3].* - [Sorin Ionescu](https://github.com/sorin-ionescu) [1]: http://rsync.samba.org -[2]: https://github.com/sorin-ionescu/prezto/issues +[2]: http://www.bombich.com/rsync.html +[3]: https://github.com/sorin-ionescu/prezto/issues diff --git a/modules/rsync/init.zsh b/modules/rsync/init.zsh index 802952cd7b..c3b3b577b3 100644 --- a/modules/rsync/init.zsh +++ b/modules/rsync/init.zsh @@ -17,6 +17,7 @@ fi _rsync_cmd='rsync --verbose --progress --human-readable --compress --archive --hard-links --one-file-system' # Mac OS X and HFS+ Enhancements +# http://www.bombich.com/rsync.html if [[ "$OSTYPE" == darwin* ]] && grep -q 'file-flags' <(rsync --help 2>&1); then _rsync_cmd="${_rsync_cmd} --crtimes --acls --xattrs --fileflags --protect-decmpfs --force-change" fi From f007820a14648c9caae4f1e702e2e4118199cb9b Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Fri, 24 May 2013 12:33:23 -0400 Subject: [PATCH 06/25] [Fix #436] Update link to Bombich rsync --- modules/rsync/README.md | 2 +- modules/rsync/init.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/rsync/README.md b/modules/rsync/README.md index 2d2e656696..a2b62c4f5a 100644 --- a/modules/rsync/README.md +++ b/modules/rsync/README.md @@ -23,6 +23,6 @@ Authors - [Sorin Ionescu](https://github.com/sorin-ionescu) [1]: http://rsync.samba.org -[2]: http://www.bombich.com/rsync.html +[2]: http://help.bombich.com/kb/overview/credits#opensource [3]: https://github.com/sorin-ionescu/prezto/issues diff --git a/modules/rsync/init.zsh b/modules/rsync/init.zsh index c3b3b577b3..afb9192ab7 100644 --- a/modules/rsync/init.zsh +++ b/modules/rsync/init.zsh @@ -17,7 +17,7 @@ fi _rsync_cmd='rsync --verbose --progress --human-readable --compress --archive --hard-links --one-file-system' # Mac OS X and HFS+ Enhancements -# http://www.bombich.com/rsync.html +# http://help.bombich.com/kb/overview/credits#opensource if [[ "$OSTYPE" == darwin* ]] && grep -q 'file-flags' <(rsync --help 2>&1); then _rsync_cmd="${_rsync_cmd} --crtimes --acls --xattrs --fileflags --protect-decmpfs --force-change" fi From 16aa48baeb92866a1921ce2199f2cba1099ce22c Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Sat, 25 May 2013 14:39:51 -0400 Subject: [PATCH 07/25] Rename archive module functions --- modules/README.md | 2 +- modules/archive/README.md | 6 +++--- modules/archive/functions/{_ls-archive => _lsarchive} | 4 ++-- modules/archive/functions/{_extract => _unarchive} | 4 ++-- modules/archive/functions/{ls-archive => lsarchive} | 2 +- modules/archive/functions/{extract => unarchive} | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) rename modules/archive/functions/{_ls-archive => _lsarchive} (85%) rename modules/archive/functions/{_extract => _unarchive} (85%) rename modules/archive/functions/{ls-archive => lsarchive} (95%) rename modules/archive/functions/{extract => unarchive} (97%) diff --git a/modules/README.md b/modules/README.md index 16754fcbcb..2d89b1d905 100644 --- a/modules/README.md +++ b/modules/README.md @@ -8,7 +8,7 @@ Load modules in *zpreztorc*. The order matters. Archive ------- -Provides functions to extract and list popular archive formats. +Provides functions to list and extract archives. Command-Not-Found ----------------- diff --git a/modules/archive/README.md b/modules/archive/README.md index 37dbf121ed..64b95df7aa 100644 --- a/modules/archive/README.md +++ b/modules/archive/README.md @@ -1,13 +1,13 @@ Archive ======= -Provides functions to extract and list popular archive formats. +Provides functions to list and extract archives. Functions --------- - - `extract` extracts the contents of one or more archives. - - `ls-archive` lists the contents of one or more archives. + - `lsarchive` lists the contents of one or more archives. + - `unarchive` extracts the contents of one or more archives. Supported Formats ----------------- diff --git a/modules/archive/functions/_ls-archive b/modules/archive/functions/_lsarchive similarity index 85% rename from modules/archive/functions/_ls-archive rename to modules/archive/functions/_lsarchive index 00453c4f95..516a8a3357 100644 --- a/modules/archive/functions/_ls-archive +++ b/modules/archive/functions/_lsarchive @@ -1,8 +1,8 @@ -#compdef ls-archive +#compdef lsarchive #autoload # -# Completes ls-archive. +# Completes lsarchive. # # Authors: # Sorin Ionescu diff --git a/modules/archive/functions/_extract b/modules/archive/functions/_unarchive similarity index 85% rename from modules/archive/functions/_extract rename to modules/archive/functions/_unarchive index 901a8489d5..a446cb4a3d 100644 --- a/modules/archive/functions/_extract +++ b/modules/archive/functions/_unarchive @@ -1,8 +1,8 @@ -#compdef extract +#compdef unarchive #autoload # -# Completes extract. +# Completes unarchive. # # Authors: # Sorin Ionescu diff --git a/modules/archive/functions/ls-archive b/modules/archive/functions/lsarchive similarity index 95% rename from modules/archive/functions/ls-archive rename to modules/archive/functions/lsarchive index 99ebde6e9b..bac540f884 100644 --- a/modules/archive/functions/ls-archive +++ b/modules/archive/functions/lsarchive @@ -1,5 +1,5 @@ # -# Lists the contents of popular archive formats. +# Lists the contents of archives. # # Authors: # Sorin Ionescu diff --git a/modules/archive/functions/extract b/modules/archive/functions/unarchive similarity index 97% rename from modules/archive/functions/extract rename to modules/archive/functions/unarchive index 70fac4d832..36fe85b6ff 100644 --- a/modules/archive/functions/extract +++ b/modules/archive/functions/unarchive @@ -1,5 +1,5 @@ # -# Extracts the contents of popular archive formats. +# Extracts the contents of archives. # # Authors: # Sorin Ionescu From 875ce2e56c604bca02c51ab708b87b3d6db7efca Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Sat, 18 May 2013 19:23:03 -0400 Subject: [PATCH 08/25] [Fix #434] Correct ambiguity in the use of the term keymap --- modules/editor/README.md | 6 +++--- modules/editor/init.zsh | 10 +++++----- runcoms/zpreztorc | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/editor/README.md b/modules/editor/README.md index 03bc02f236..d989e35c5d 100644 --- a/modules/editor/README.md +++ b/modules/editor/README.md @@ -8,10 +8,10 @@ Settings ### Key bindings -To enable key bindings, add the following to *zpreztorc*, and replace 'map' with -'emacs' or 'vi'. +To enable key bindings, add the following to *zpreztorc*, and replace 'bindings' +with 'emacs' or 'vi'. - zstyle ':prezto:module:editor' keymap 'map' + zstyle ':prezto:module:editor' key-bindings 'bindings' ### Dot Expansion diff --git a/modules/editor/init.zsh b/modules/editor/init.zsh index 4838ba74ad..0fe9885836 100644 --- a/modules/editor/init.zsh +++ b/modules/editor/init.zsh @@ -306,14 +306,14 @@ fi # # Set the key layout. -zstyle -s ':prezto:module:editor' keymap 'keymap' -if [[ "$keymap" == (emacs|) ]]; then +zstyle -s ':prezto:module:editor' key-bindings 'key_bindings' +if [[ "$key_bindings" == (emacs|) ]]; then bindkey -e -elif [[ "$keymap" == vi ]]; then +elif [[ "$key_bindings" == vi ]]; then bindkey -v else - print "prezto: invalid keymap: $keymap" >&2 + print "prezto: editor: invalid key bindings: $key_bindings" >&2 fi -unset key{map,} +unset key{,map,bindings} diff --git a/runcoms/zpreztorc b/runcoms/zpreztorc index 5eca1a0d35..34ad0d814e 100644 --- a/runcoms/zpreztorc +++ b/runcoms/zpreztorc @@ -39,7 +39,7 @@ zstyle ':prezto:load' pmodule \ # # Set the key mapping style to 'emacs' or 'vi'. -zstyle ':prezto:module:editor' keymap 'emacs' +zstyle ':prezto:module:editor' key-bindings 'emacs' # Auto convert .... to ../.. # zstyle ':prezto:module:editor' dot-expansion 'yes' From 9d504d2d93eede9c2783c4bfa68c4a35615c39fd Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Sun, 19 May 2013 16:24:47 -0400 Subject: [PATCH 09/25] [Fix #411] Add Homebrew module --- modules/README.md | 5 +++++ modules/homebrew/README.md | 26 ++++++++++++++++++++++++++ modules/homebrew/init.zsh | 25 +++++++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 modules/homebrew/README.md create mode 100644 modules/homebrew/init.zsh diff --git a/modules/README.md b/modules/README.md index 2d89b1d905..63484e4ca7 100644 --- a/modules/README.md +++ b/modules/README.md @@ -71,6 +71,11 @@ History Sets history options and defines history aliases. +Homebrew +-------- + +Defines Homebrew aliases. + Macports -------- diff --git a/modules/homebrew/README.md b/modules/homebrew/README.md new file mode 100644 index 0000000000..c8e6d4e2cb --- /dev/null +++ b/modules/homebrew/README.md @@ -0,0 +1,26 @@ +Homebrew +======== + +Defines Homebrew aliases. + +Aliases +------- + + - `brewc` cleans outdated brews and their cached archives. + - `brewC` cleans outdated brews, including keg-only, and their cached archives. + - `brewi` installs a formula. + - `brewl` lists installed formulae. + - `brews` searches for a formula. + - `brewU` upgrades Homebrew and outdated brews. + - `brewu` upgrades Homebrew. + - `brewx` uninstalls a formula. + +Authors +------- + +*The authors of this module should be contacted via the [issue tracker][1].* + + - [Sorin Ionescu](https://github.com/sorin-ionescu) + +[1]: https://github.com/sorin-ionescu/prezto/issues + diff --git a/modules/homebrew/init.zsh b/modules/homebrew/init.zsh new file mode 100644 index 0000000000..6f0299af99 --- /dev/null +++ b/modules/homebrew/init.zsh @@ -0,0 +1,25 @@ +# +# Defines Homebrew aliases. +# +# Authors: +# Sorin Ionescu +# + +# Return if requirements are not found. +if [[ "$OSTYPE" != darwin* ]]; then + return 1 +fi + +# +# Aliases +# + +alias brewc='brew cleanup' +alias brewC='brew cleanup --force' +alias brewi='brew install' +alias brewl='brew list' +alias brews='brew search' +alias brewu='brew upgrade' +alias brewU='brew update && brew upgrade' +alias brewx='brew remove' + From d817e80741c39cd621aadc56db29d0d23c5b3fe8 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Thu, 8 Aug 2013 20:26:34 -0400 Subject: [PATCH 10/25] [Fix #452] Squash bugs introduced in fcab2a1 --- modules/ssh/init.zsh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/ssh/init.zsh b/modules/ssh/init.zsh index 447846f56f..320f76352d 100644 --- a/modules/ssh/init.zsh +++ b/modules/ssh/init.zsh @@ -27,22 +27,22 @@ else source "$_ssh_agent_env" 2> /dev/null fi -# Load identities. -if ssh-add -l 2>&1 | grep 'The agent has no identities'; then - zstyle -a ':prezto:module:ssh:load' identities '_ssh_identities' - if (( ${#identities} > 0 )); then - ssh-add "$_ssh_dir/${^_ssh_identities[@]}" - else - ssh-add - fi -fi - # Create a persistent SSH authentication socket. if [[ -S "$SSH_AUTH_SOCK" && "$SSH_AUTH_SOCK" != "$_ssh_agent_sock" ]]; then ln -sf "$SSH_AUTH_SOCK" "$_ssh_agent_sock" export SSH_AUTH_SOCK="$_ssh_agent_sock" fi +# Load identities. +if ssh-add -l 2>&1 | grep -q 'The agent has no identities'; then + zstyle -a ':prezto:module:ssh:load' identities '_ssh_identities' + if (( ${#_ssh_identities} > 0 )); then + ssh-add "$_ssh_dir/${^_ssh_identities[@]}" 2> /dev/null + else + ssh-add 2> /dev/null + fi +fi + # Clean up. unset _ssh_{dir,identities} _ssh_agent_{env,sock} From 61f3adcdd1f8f7c1f21be96803e00f887c629190 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Fri, 9 Aug 2013 16:43:13 -0400 Subject: [PATCH 11/25] [Fix #459] Correct typos in the dpkg module --- modules/dpkg/README.md | 6 +++--- modules/dpkg/init.zsh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/dpkg/README.md b/modules/dpkg/README.md index d871f59940..98af6c386b 100644 --- a/modules/dpkg/README.md +++ b/modules/dpkg/README.md @@ -7,16 +7,16 @@ Aliases ------- - `debc` cleans the cache. -- `debf` displays a file's packake. +- `debf` displays a file's package. - `debi` installs packages from repositories. - `debI` installs packages from files. - `debq` displays package information. -- `debu` updates the packages lists. +- `debu` updates the package lists. - `debU` upgrades outdated packages. - `debx` removes packages. - `debX` removes packages, their configuration, and unneeded dependencies. - `debs` searches for packages. -- `deb-build` creates a basic .deb package. +- `deb-build` creates a basic deb package. - `deb-kclean` removes all kernel images and headers, except for the ones in use. diff --git a/modules/dpkg/init.zsh b/modules/dpkg/init.zsh index 939e9100b4..fbbc8bc5c9 100644 --- a/modules/dpkg/init.zsh +++ b/modules/dpkg/init.zsh @@ -19,7 +19,7 @@ fi # Cleans the cache. alias debc='sudo apt-get clean && sudo apt-get autoclean' -# Displays a file's packake. +# Displays a file's package. alias debf='apt-file search --regexp' # Installs packages from repositories. @@ -31,7 +31,7 @@ alias debI='sudo dpkg -i' # Displays package information. alias debq='apt-cache show' -# Updates the packages lists. +# Updates the package lists. alias debu='sudo apt-get update' # Upgrades outdated packages. @@ -50,7 +50,7 @@ else alias debs='apt-cache search' fi -# Creates a basic .deb package. +# Creates a basic deb package. alias deb-build='time dpkg-buildpackage -rfakeroot -us -uc' # Removes all kernel images and headers, except for the ones in use. From 07686fad3879ac00866c5ca333317443475fa900 Mon Sep 17 00:00:00 2001 From: Georges Discry Date: Thu, 24 Jan 2013 14:54:55 +0100 Subject: [PATCH 12/25] Increase control over multiplexer auto-start Setting the auto-start 'remote' and 'local' zstyles for the screen and tmux modules to 'true' automatically starts a session in SSH connections and in local terminals respectively. Signed-off-by: Sorin Ionescu --- modules/screen/README.md | 11 +++++++++-- modules/screen/init.zsh | 6 +++++- modules/tmux/README.md | 15 +++++++++++---- modules/tmux/init.zsh | 6 +++++- runcoms/zpreztorc | 14 ++++++++++---- 5 files changed, 40 insertions(+), 12 deletions(-) diff --git a/modules/screen/README.md b/modules/screen/README.md index 976b483a87..8e93fe2d35 100644 --- a/modules/screen/README.md +++ b/modules/screen/README.md @@ -10,9 +10,15 @@ Settings Starts a GNU Screen session automatically when Zsh is launched. -To enable this feature, add the following line to *zpreztorc*: +To enable this feature when launching Zsh in a local terminal, add the +following line to *zpreztorc*: - zstyle ':prezto:module:screen' auto-start 'yes' + zstyle ':prezto:module:screen:auto-start' local 'yes' + +To enable this feature when launching Zsh in a SSH connection, add the +following line to *zpreztorc*: + + zstyle ':prezto:module:screen:auto-start' remote 'yes' Aliases ------- @@ -28,6 +34,7 @@ Authors *The authors of this module should be contacted via the [issue tracker][2].* - [Sorin Ionescu](https://github.com/sorin-ionescu) + - [Georges Discry](https://github.com/gdiscry) [1]: http://www.gnu.org/software/screen/ [2]: https://github.com/sorin-ionescu/prezto/issues diff --git a/modules/screen/init.zsh b/modules/screen/init.zsh index 424f6584f6..f10efb735d 100644 --- a/modules/screen/init.zsh +++ b/modules/screen/init.zsh @@ -3,6 +3,7 @@ # # Authors: # Sorin Ionescu +# Georges Discry # # Return if requirements are not found. @@ -14,7 +15,10 @@ fi # Auto Start # -if [[ -z "$STY" ]] && zstyle -t ':prezto:module:screen' auto-start; then +if [[ -z "$STY" ]] && ( \ + ( [[ -n "$SSH_TTY" ]] && zstyle -t ':prezto:module:screen:auto-start' remote ) || + ( [[ -z "$SSH_TTY" ]] && zstyle -t ':prezto:module:screen:auto-start' local ) \ +); then session="$( screen -list 2> /dev/null \ | sed '1d;$d' \ diff --git a/modules/tmux/README.md b/modules/tmux/README.md index b5e1011ad3..68ba9d06a7 100644 --- a/modules/tmux/README.md +++ b/modules/tmux/README.md @@ -10,12 +10,18 @@ Settings Starts a tmux session automatically when Zsh is launched. -To enable this feature, add the following line to *zpreztorc*: +To enable this feature when launching Zsh in a local terminal, add the +following line to *zpreztorc*: - zstyle ':prezto:module:tmux' auto-start 'yes' + zstyle ':prezto:module:tmux:auto-start' local 'yes' -It will create a background session named _#Prezto_ and attach every new shell -to it. +To enable this feature when launching Zsh in a SSH connection, add the +following line to *zpreztorc*: + + zstyle ':prezto:module:tmux:auto-start' remote 'yes' + +In both cases, it will create a background session named _#Prezto_ and attach +every new shell to it. To avoid keeping open sessions, this module sets `destroy-unattached off` on the background session and `destroy-unattached on` on every other session @@ -47,6 +53,7 @@ Authors - [Sorin Ionescu](https://github.com/sorin-ionescu) - [Colin Hebert](https://github.com/ColinHebert) + - [Georges Discry](https://github.com/gdiscry) [1]: http://tmux.sourceforge.net [2]: https://github.com/sorin-ionescu/prezto/issues/62 diff --git a/modules/tmux/init.zsh b/modules/tmux/init.zsh index 017327501a..a59b259a2d 100644 --- a/modules/tmux/init.zsh +++ b/modules/tmux/init.zsh @@ -4,6 +4,7 @@ # Authors: # Sorin Ionescu # Colin Hebert +# Georges Discry # # Return if requirements are not found. @@ -15,7 +16,10 @@ fi # Auto Start # -if [[ -z "$TMUX" ]] && zstyle -t ':prezto:module:tmux' auto-start; then +if [[ -z "$TMUX" ]] && ( \ + ( [[ -n "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' remote ) || + ( [[ -z "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' local ) \ +); then tmux_session='#Prezto' if ! tmux has-session -t "$tmux_session" 2> /dev/null; then diff --git a/runcoms/zpreztorc b/runcoms/zpreztorc index 34ad0d814e..ee5aa0d33c 100644 --- a/runcoms/zpreztorc +++ b/runcoms/zpreztorc @@ -91,8 +91,11 @@ zstyle ':prezto:module:prompt' theme 'sorin' # Screen # -# Auto start a session when Zsh is launched. -# zstyle ':prezto:module:screen' auto-start 'yes' +# Auto start a session when Zsh is launched in a local terminal. +# zstyle ':prezto:module:screen:auto-start' local 'yes' + +# Auto start a session when Zsh is launched in a SSH connection. +# zstyle ':prezto:module:screen:auto-start' remote 'yes' # # SSH @@ -132,6 +135,9 @@ zstyle ':prezto:module:terminal' auto-title 'yes' # Tmux # -# Auto start a session when Zsh is launched. -# zstyle ':prezto:module:tmux' auto-start 'yes' +# Auto start a session when Zsh is launched in a local terminal. +# zstyle ':prezto:module:tmux:auto-start' local 'yes' + +# Auto start a session when Zsh is launched in a SSH connection. +# zstyle ':prezto:module:tmux:auto-start' remote 'yes' From 1ef255510033213e9c524b313a49cd29d71e3c59 Mon Sep 17 00:00:00 2001 From: Sebastian Wiesner Date: Sat, 10 Aug 2013 16:55:01 +0200 Subject: [PATCH 13/25] Move from Carton to Cask Carton was renamed to Cask to avoid a name clash with a Perl utility of that name. --- modules/emacs/init.zsh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/emacs/init.zsh b/modules/emacs/init.zsh index cce9e1e903..3acc965c27 100644 --- a/modules/emacs/init.zsh +++ b/modules/emacs/init.zsh @@ -5,21 +5,21 @@ # # Return if requirements are not found. -if [[ ! -d "$HOME/.carton" ]]; then +if [[ ! -d "$HOME/.cask" ]]; then return 1 fi -# Prepend Carton bin directory. -path=($HOME/.carton/bin $path) +# Prepend Cask bin directory. +path=($HOME/.cask/bin $path) # Load Carton completion -source "$HOME/.carton/etc/carton_completion.zsh" 2> /dev/null +source "$HOME/.cask/etc/cask_completion.zsh" 2> /dev/null # # Aliases # -alias cai='carton install' -alias cau='carton update' -alias caI='carton init' -alias cae='carton exec' +alias cai='cask install' +alias cau='cask update' +alias caI='cask init' +alias cae='cask exec' From 92c4dc0fb2882d3c6bfb01d89d1b730cb614d856 Mon Sep 17 00:00:00 2001 From: Phillip Alexander Date: Sun, 11 Aug 2013 22:20:14 -0700 Subject: [PATCH 14/25] Clarify customization instructions Explicitly state that a new user must create his own fork to commit and track changes via Github. Signed-off-by: Sorin Ionescu --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 32b3498e63..d076cc89f0 100644 --- a/README.md +++ b/README.md @@ -63,9 +63,10 @@ accompanying README files to learn of what is available. Customization ------------- -The project is managed via [Git][3]. It is highly recommend that you commit -your changes and push them to [GitHub][4] to not lose them. If you do not know -how to use Git, follow this [tutorial][5] and bookmark this [reference][6]. +The project is managed via [Git][3]. It is highly recommended that you fork this +project; so, that you can commit your changes and push them to [GitHub][4] to +not lose them. If you do not know how to use Git, follow this [tutorial][5] and +bookmark this [reference][6]. Resources --------- From 59e6e7fe8e330d94f2ecb72a261ecda49477b35d Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Mon, 12 Aug 2013 21:09:52 -0400 Subject: [PATCH 15/25] Update external completions --- modules/completion/external | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/completion/external b/modules/completion/external index 9cbd2b6762..662229f6f0 160000 --- a/modules/completion/external +++ b/modules/completion/external @@ -1 +1 @@ -Subproject commit 9cbd2b6762689cd92c194067ac51b376fcc91e1b +Subproject commit 662229f6f0ce391ef7c1a41c398e28a31e847182 From 92e688173b9060bdf1c7c772d6ee6797b6d6973b Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Mon, 12 Aug 2013 21:10:06 -0400 Subject: [PATCH 16/25] Update external history-substring-search --- modules/history-substring-search/external | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/history-substring-search/external b/modules/history-substring-search/external index 82fbef5132..d9b28ed7f9 160000 --- a/modules/history-substring-search/external +++ b/modules/history-substring-search/external @@ -1 +1 @@ -Subproject commit 82fbef5132b44c5d039e7d25972d9351c5936bc2 +Subproject commit d9b28ed7f9c62d843c6f3e599ab4f3aa0bdd37b5 From 773ca7ee5076d8a90f92ffb2cfbbe7101dac86c0 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Mon, 12 Aug 2013 21:10:15 -0400 Subject: [PATCH 17/25] Update external syntax-highlighting --- modules/syntax-highlighting/external | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/syntax-highlighting/external b/modules/syntax-highlighting/external index e5d8a50d36..dbd27cb30a 160000 --- a/modules/syntax-highlighting/external +++ b/modules/syntax-highlighting/external @@ -1 +1 @@ -Subproject commit e5d8a50d362a153a28506be6fae9cf179dbb5fd4 +Subproject commit dbd27cb30a710809dd070669c331574fdc15b397 From 459238b2bbbfd78b233209fb66906d388e1fbe0b Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Tue, 20 Aug 2013 08:21:17 -0400 Subject: [PATCH 18/25] Replace pythonz with pyenv Depending on Python to manage Python is silly. --- modules/python/README.md | 20 +++++-------------- modules/python/init.zsh | 43 ++++++++++++++++++---------------------- 2 files changed, 24 insertions(+), 39 deletions(-) diff --git a/modules/python/README.md b/modules/python/README.md index c48f4ea3e6..8e8c8f018b 100644 --- a/modules/python/README.md +++ b/modules/python/README.md @@ -6,15 +6,15 @@ Enables local Python and local Python package installation. Local Python Installation ------------------------- -[pythonz][4] builds and installs multiple Python versions locally in the home +[pyenv][4] builds and installs multiple Python versions locally in the home directory. -This module prepends the pythonz directory to the path variable to enable the -execution of `pythonz`. +This module prepends the pyenv directory to the path variable to enable the +execution of `pyenv`. ### Usage -Install Python versions with `pythonz install` into *~/.pythonz/pythons*. +Install Python versions with `pyenv install` into *~/.pyenv/versions*. Local Package Installation -------------------------- @@ -66,16 +66,6 @@ Aliases - `py` is short for `python`. -### Pythonz - - - `pyz` is short for `pythonz`. - - `pyzc` removes stale source folders and archives. - - `pyzi` installs Python versions. - - `pyzl` lists installed Python versions. - - `pyzL` lists available Python versions. - - `pyzu` updates itself to the latest version. - - `pyzx` uninstalls Python versions. - Functions --------- @@ -105,6 +95,6 @@ Authors [1]: http://www.python.org/dev/peps/pep-0370/ [2]: http://www.doughellmann.com/projects/virtualenvwrapper/ [3]: http://pypi.python.org/pypi/virtualenv -[4]: http://saghul.github.com/pythonz/ +[4]: https://github.com/yyuu/pyenv [5]: https://github.com/sorin-ionescu/prezto/issues diff --git a/modules/python/init.zsh b/modules/python/init.zsh index a72f01f9ca..fa9175e568 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -6,29 +6,35 @@ # Sebastian Wiesner # -# Load pythonz into the shell session. -if [[ -s $HOME/.pythonz/bin/pythonz ]]; then - path=($HOME/.pythonz/bin $path) -fi +# Load manually installed pyenv into the shell session. +if [[ -s "$HOME/.pyenv/bin/pyenv" ]]; then + path=("$HOME/.pyenv/bin" $path) + eval "$(pyenv init -)" -# Return if requirements are not found. -if (( ! $+commands[python] && ! $+commands[pythonz] )); then - return 1 -fi +# Load package manager installed pyenv into the shell session. +elif (( $+commands[pyenv] )); then + eval "$(pyenv init -)" # Prepend PEP 370 per user site packages directory, which defaults to # ~/Library/Python on Mac OS X and ~/.local elsewhere, to PATH. -if [[ "$OSTYPE" == darwin* ]]; then - path=($HOME/Library/Python/*/bin(N) $path) else - # This is subject to change. - path=($HOME/.local/bin $path) + if [[ "$OSTYPE" == darwin* ]]; then + path=($HOME/Library/Python/*/bin(N) $path) + else + # This is subject to change. + path=($HOME/.local/bin $path) + fi +fi + +# Return if requirements are not found. +if (( ! $+commands[python] && ! $+commands[pyenv] )); then + return 1 fi # Load virtualenvwrapper into the shell session. if (( $+commands[virtualenvwrapper_lazy.sh] )); then # Set the directory where virtual environments are stored. - export WORKON_HOME=$HOME/.virtualenvs + export WORKON_HOME="$HOME/.virtualenvs" # Disable the virtualenv prompt. VIRTUAL_ENV_DISABLE_PROMPT=1 @@ -42,14 +48,3 @@ fi alias py='python' -# pythonz -if (( $+commands[pythonz] )); then - alias pyz='pythonz' - alias pyzc='pythonz cleanup' - alias pyzi='pythonz install' - alias pyzl='pythonz list' - alias pyzL='pythonz list -a' - alias pyzu='pythonz update' - alias pyzx='pythonz uninstall' -fi - From 622e7b117b07c1e4d99cb025cc5fd07d72afa1f2 Mon Sep 17 00:00:00 2001 From: Nicholas Hutchinson Date: Sat, 3 Aug 2013 10:32:43 +0100 Subject: [PATCH 19/25] Add utility aliases for Cygwin Signed-off-by: Sorin Ionescu --- modules/utility/init.zsh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index ea31138c33..42c2675a0d 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -105,6 +105,11 @@ alias sl='ls' # I often screw this up. if [[ "$OSTYPE" == darwin* ]]; then alias o='open' alias get='curl --continue-at - --location --progress-bar --remote-name --remote-time' +elif [[ "$OSTYPE" == cygwin* ]]; then + alias o='cygstart' + alias get='wget --continue --progress=bar --timestamping' + alias pbcopy='tee > /dev/clipboard' + alias pbpaste='cat /dev/clipboard' else alias o='xdg-open' alias get='wget --continue --progress=bar --timestamping' From b769505857fd26623b2f6636feaf2fc30a0c882b Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Tue, 20 Aug 2013 08:46:37 -0400 Subject: [PATCH 20/25] Remove duplicate alias definitions --- modules/utility/init.zsh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index 42c2675a0d..d213716122 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -104,15 +104,12 @@ alias sl='ls' # I often screw this up. # Mac OS X Everywhere if [[ "$OSTYPE" == darwin* ]]; then alias o='open' - alias get='curl --continue-at - --location --progress-bar --remote-name --remote-time' elif [[ "$OSTYPE" == cygwin* ]]; then alias o='cygstart' - alias get='wget --continue --progress=bar --timestamping' alias pbcopy='tee > /dev/clipboard' alias pbpaste='cat /dev/clipboard' else alias o='xdg-open' - alias get='wget --continue --progress=bar --timestamping' if (( $+commands[xclip] )); then alias pbcopy='xclip -selection clipboard -in' @@ -128,6 +125,13 @@ fi alias pbc='pbcopy' alias pbp='pbpaste' +# File Download +if (( $+commands[curl] )); then + alias get='curl --continue-at - --location --progress-bar --remote-name --remote-time' +elif (( $+commands[wget] )); then + alias get='wget --continue --progress=bar --timestamping' +fi + # Resource Usage alias df='df -kh' alias du='du -kh' From 959887013dd520f0656d54dbedfb72a70e3263ae Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Tue, 20 Aug 2013 08:47:18 -0400 Subject: [PATCH 21/25] Simplify a conditional --- modules/utility/init.zsh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index d213716122..91c7809021 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -114,9 +114,7 @@ else if (( $+commands[xclip] )); then alias pbcopy='xclip -selection clipboard -in' alias pbpaste='xclip -selection clipboard -out' - fi - - if (( $+commands[xsel] )); then + elif (( $+commands[xsel] )); then alias pbcopy='xsel --clipboard --input' alias pbpaste='xsel --clipboard --output' fi From 8ee6634c938165567b089fc0e15fdd68fa50b1f6 Mon Sep 17 00:00:00 2001 From: Sebastian Wiesner Date: Wed, 21 Aug 2013 13:31:38 +0200 Subject: [PATCH 22/25] Do not define $GEM_HOME Defining it breaks gems for all users who neither use RVM nor rbenv, but have a different default Ruby version nonetheless. Signed-off-by: Sorin Ionescu --- modules/ruby/init.zsh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/modules/ruby/init.zsh b/modules/ruby/init.zsh index 0303d5a34c..1f748098e6 100644 --- a/modules/ruby/init.zsh +++ b/modules/ruby/init.zsh @@ -23,14 +23,9 @@ elif [[ -s "$HOME/.rbenv/bin/rbenv" ]]; then elif (( $+commands[rbenv] )); then eval "$(rbenv init - --no-rehash zsh)" -# Install local gems according to operating system conventions. +# Prepend local gems bin directories to PATH. else - if [[ "$OSTYPE" == darwin* ]]; then - export GEM_HOME="$HOME/Library/Ruby/Gems/1.8" - path=("$GEM_HOME/bin" $path) - else - path=($HOME/.gem/ruby/*/bin(N) $path) - fi + path=($HOME/.gem/ruby/*/bin(N) $path) fi # Return if requirements are not found. From e1e2c853921fac9a011e232225a2838dc36bfab6 Mon Sep 17 00:00:00 2001 From: Joseph Irwin Date: Tue, 27 Aug 2013 16:21:19 +0900 Subject: [PATCH 23/25] Use correct option for pacman search aliases --- modules/pacman/init.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/pacman/init.zsh b/modules/pacman/init.zsh index c6fdc451e3..bbbdcfb523 100644 --- a/modules/pacman/init.zsh +++ b/modules/pacman/init.zsh @@ -55,10 +55,10 @@ alias pacq='pacman --sync --info' alias pacQ='pacman --query --info' # Searches for packages in the repositories. -alias pacs='pacman --sync --recursive' +alias pacs='pacman --sync --search' # Searches for packages in the local database. -alias pacS='pacman --query --recursive' +alias pacS='pacman --query --search' # Lists orphan packages. alias pacman-list-orphans='sudo pacman --query --deps --unrequired' From a914a87aa91147709306a8ee4206928587a98dd4 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Tue, 27 Aug 2013 22:22:55 -0400 Subject: [PATCH 24/25] Stop module loading when external code fails to source --- modules/history-substring-search/init.zsh | 2 +- modules/syntax-highlighting/init.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/history-substring-search/init.zsh b/modules/history-substring-search/init.zsh index 53eb99be15..0fc191d84f 100644 --- a/modules/history-substring-search/init.zsh +++ b/modules/history-substring-search/init.zsh @@ -10,7 +10,7 @@ pmodload 'editor' # Source module files. -source "${0:h}/external/zsh-history-substring-search.zsh" +source "${0:h}/external/zsh-history-substring-search.zsh" || return 1 # # Search diff --git a/modules/syntax-highlighting/init.zsh b/modules/syntax-highlighting/init.zsh index e5c555bd12..55172b8992 100644 --- a/modules/syntax-highlighting/init.zsh +++ b/modules/syntax-highlighting/init.zsh @@ -11,7 +11,7 @@ if ! zstyle -t ':prezto:module:syntax-highlighting' color; then fi # Source module files. -source "${0:h}/external/zsh-syntax-highlighting.zsh" +source "${0:h}/external/zsh-syntax-highlighting.zsh" || return 1 # Set highlighters. zstyle -a ':prezto:module:syntax-highlighting' highlighters 'ZSH_HIGHLIGHT_HIGHLIGHTERS' From eb1a20552a9f53d5a1403be7a1f2485299d7d14b Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Tue, 27 Aug 2013 22:29:20 -0400 Subject: [PATCH 25/25] Comment an unnecessary style --- runcoms/zpreztorc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runcoms/zpreztorc b/runcoms/zpreztorc index ee5aa0d33c..8cdb163bb9 100644 --- a/runcoms/zpreztorc +++ b/runcoms/zpreztorc @@ -10,7 +10,7 @@ # # Set case-sensitivity for completion, history lookup, etc. -zstyle ':prezto:*:*' case-sensitive 'no' +# zstyle ':prezto:*:*' case-sensitive 'yes' # Color output (auto set to 'no' on dumb terminals). zstyle ':prezto:*:*' color 'yes'