From 5a245850f079cd48e867670412d10f3d213a957e Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Sun, 30 Dec 2012 18:15:43 -0500 Subject: [PATCH 01/16] [Fix #355] Do not set launchd environment variables Setting environment variables for launchd processes is unreliable. Finder and all Finder launched programs have to be restarted for the new environment variables to take effect. --- modules/perl/init.zsh | 6 ------ runcoms/zlogin | 7 ------- 2 files changed, 13 deletions(-) diff --git a/modules/perl/init.zsh b/modules/perl/init.zsh index 62701283ac..8ba873d70c 100644 --- a/modules/perl/init.zsh +++ b/modules/perl/init.zsh @@ -31,12 +31,6 @@ if [[ "$OSTYPE" == darwin* ]]; then unset perl_path unset cache_file - - # Set environment variables for launchd processes. - for env_var in PERL_LOCAL_LIB_ROOT PERL_MB_OPT PERL_MM_OPT PERL5LIB; do - launchctl setenv "$env_var" "${(P)env_var}" &! - done - unset env_var fi # diff --git a/runcoms/zlogin b/runcoms/zlogin index e27e233299..32f28cfb1f 100644 --- a/runcoms/zlogin +++ b/runcoms/zlogin @@ -12,13 +12,6 @@ if [[ -s "$zcompdump" && (! -s "${zcompdump}.zwc" || "$zcompdump" -nt "${zcompdump}.zwc") ]]; then zcompile "$zcompdump" fi - - # Set environment variables for launchd processes. - if [[ "$OSTYPE" == darwin* ]]; then - for env_var in PATH MANPATH; do - launchctl setenv "$env_var" "${(P)env_var}" - done - fi } &! # Print a random, hopefully interesting, adage. From 1d0b0e2e9bfb7702c307c5e95b50f5b43d7ac380 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Thu, 3 Jan 2013 13:13:03 -0500 Subject: [PATCH 02/16] [Fix #357] Set alias gcO to check out hunks interactively --- modules/git/README.md | 2 +- modules/git/alias.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/git/README.md b/modules/git/README.md index 6eeb3216be..3d877485f7 100644 --- a/modules/git/README.md +++ b/modules/git/README.md @@ -53,7 +53,7 @@ Aliases - `gca` stages all modified and deleted files. - `gcm` records changes to the repository with the given message. - `gco` checks out a branch or paths to work tree. - - `gcO` checks out paths to work tree using the *HEAD* commit. + - `gcO` checks out hunks from the index or the tree interactively. - `gcf` amends the tip of the current branch using the same log message as *HEAD*. - `gcF` amends the tip of the current branch. diff --git a/modules/git/alias.zsh b/modules/git/alias.zsh index 9af1c8a755..f152bb8573 100644 --- a/modules/git/alias.zsh +++ b/modules/git/alias.zsh @@ -46,7 +46,7 @@ alias gc='git commit' alias gca='git commit --all' alias gcm='git commit --message' alias gco='git checkout' -alias gcO='git checkout HEAD --' +alias gcO='git checkout --patch' alias gcf='git commit --amend --reuse-message HEAD' alias gcF='git commit --amend' alias gcp='git cherry-pick --ff' From bb6b59091948e647dc32f2f4e2ca07c9e049caf8 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Sat, 12 Jan 2013 11:25:06 -0500 Subject: [PATCH 03/16] [Fix #360] Set alias giR to reset the index interactively --- modules/git/README.md | 4 ++-- modules/git/alias.zsh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/git/README.md b/modules/git/README.md index 3d877485f7..717f42bb14 100644 --- a/modules/git/README.md +++ b/modules/git/README.md @@ -98,8 +98,8 @@ Aliases - `giu` adds file contents to the index (updates only known files). - `gid` displays changes between the index and a named commit (diff). - `giD` displays changes between the index and a named commit (word diff). - - `gir` resets current HEAD to the specified state. - - `giR` resets current index to the specified state. + - `gir` resets the current HEAD to the specified state. + - `giR` resets the current index interactively. - `gix` removes files/directories from the index (recursively). - `giX` removes files/directories from the index (recursively and forced). diff --git a/modules/git/alias.zsh b/modules/git/alias.zsh index f152bb8573..027db67fff 100644 --- a/modules/git/alias.zsh +++ b/modules/git/alias.zsh @@ -86,7 +86,7 @@ alias giu='git add --update' alias gid='git diff --no-ext-diff --cached' alias giD='git diff --no-ext-diff --cached --word-diff' alias gir='git reset' -alias giR='git reset --keep' +alias giR='git reset --patch' alias gix='git rm -r --cached' alias giX='git rm -rf --cached' From 14da4951937b7942cebef6c86002a8b0c26c6d76 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Sat, 12 Jan 2013 11:28:33 -0500 Subject: [PATCH 04/16] [Fix #349] Display diff when committing --- modules/git/alias.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/git/alias.zsh b/modules/git/alias.zsh index 027db67fff..4cb10dc2ce 100644 --- a/modules/git/alias.zsh +++ b/modules/git/alias.zsh @@ -42,13 +42,13 @@ alias gbs='git show-branch' alias gbS='git show-branch -a' # Commit (c) -alias gc='git commit' -alias gca='git commit --all' +alias gc='git commit --verbose' +alias gca='git commit --verbose --all' alias gcm='git commit --message' alias gco='git checkout' alias gcO='git checkout --patch' alias gcf='git commit --amend --reuse-message HEAD' -alias gcF='git commit --amend' +alias gcF='git commit --verbose --amend' alias gcp='git cherry-pick --ff' alias gcP='git cherry-pick --no-commit' alias gcr='git revert' From 455cc0c6e57756847b9b4c7c176630f7cd8788ee Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Sat, 12 Jan 2013 11:31:29 -0500 Subject: [PATCH 05/16] Export $MANPATH and $INFOPATH --- runcoms/zshenv | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/runcoms/zshenv b/runcoms/zshenv index 5e6c58b43d..596c7196e6 100644 --- a/runcoms/zshenv +++ b/runcoms/zshenv @@ -47,8 +47,9 @@ fi # Paths # -typeset -gU cdpath fpath mailpath manpath path -typeset -gUT INFOPATH infopath +typeset -gU cdpath fpath mailpath path +typeset -gxU MANPATH +typeset -gxUT INFOPATH infopath # Set the the list of directories that cd searches. # cdpath=( From b531191e2c8dcc5903060f48cb0d012efc76fe2f Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Mon, 14 Jan 2013 15:52:32 -0500 Subject: [PATCH 06/16] [Fix #366] Distinct position with red --- modules/prompt/functions/prompt_sorin_setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/prompt/functions/prompt_sorin_setup b/modules/prompt/functions/prompt_sorin_setup index 3c2c55f5b3..796da78f38 100644 --- a/modules/prompt/functions/prompt_sorin_setup +++ b/modules/prompt/functions/prompt_sorin_setup @@ -58,7 +58,7 @@ function prompt_sorin_setup { zstyle ':prezto:module:git:info:commit' format ':%F{green}%.7c%f' zstyle ':prezto:module:git:info:deleted' format ' %%B%F{red}✖%f%%b' zstyle ':prezto:module:git:info:modified' format ' %%B%F{blue}✱%f%%b' - zstyle ':prezto:module:git:info:position' format ':%F{green}%p%f' + zstyle ':prezto:module:git:info:position' format ':%F{red}%p%f' zstyle ':prezto:module:git:info:renamed' format ' %%B%F{magenta}➜%f%%b' zstyle ':prezto:module:git:info:stashed' format ' %%B%F{cyan}✭%f%%b' zstyle ':prezto:module:git:info:unmerged' format ' %%B%F{yellow}═%f%%b' From 39795d3e5e6abf3bfacb2de29e23fcb4adc24da3 Mon Sep 17 00:00:00 2001 From: Georges Discry Date: Wed, 23 Jan 2013 16:46:06 +0100 Subject: [PATCH 07/16] Fix lesspipe.sh detection in custom PATH The detection of lesspipe.sh has to be done after setting PATH as it could be installed in a non-standard bin directory. For example, Homebrew installs lesspipe in /usr/local. --- runcoms/zshenv | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/runcoms/zshenv b/runcoms/zshenv index 596c7196e6..0adef03b15 100644 --- a/runcoms/zshenv +++ b/runcoms/zshenv @@ -29,20 +29,6 @@ if [[ -z "$LANG" ]]; then eval "$(locale)" fi -# -# Less -# - -# Set the default Less options. -# Mouse-wheel scrolling has been disabled by -X (disable screen clearing). -# Remove -X and -F (exit if the content fits on one screen) to enable it. -export LESS='-F -g -i -M -R -S -w -X -z-4' - -# Set the Less input preprocessor. -if (( $+commands[lesspipe.sh] )); then - export LESSOPEN='| /usr/bin/env lesspipe.sh %s 2>&-' -fi - # # Paths # @@ -88,6 +74,20 @@ for path_file in /etc/paths.d/*(.N); do done unset path_file +# +# Less +# + +# Set the default Less options. +# Mouse-wheel scrolling has been disabled by -X (disable screen clearing). +# Remove -X and -F (exit if the content fits on one screen) to enable it. +export LESS='-F -g -i -M -R -S -w -X -z-4' + +# Set the Less input preprocessor. +if (( $+commands[lesspipe.sh] )); then + export LESSOPEN='| /usr/bin/env lesspipe.sh %s 2>&-' +fi + # # Temporary Files # From e5de3051578ac4f48e50262265965bd45402e066 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Mon, 28 Jan 2013 17:08:56 -0500 Subject: [PATCH 08/16] [Fix #383] Do not set $MANPATH man dynamically searches for man pages based on $PATH. --- modules/haskell/init.zsh | 4 +--- modules/macports/init.zsh | 6 ------ modules/perl/init.zsh | 2 -- modules/python/init.zsh | 4 +--- runcoms/zshenv | 13 ------------- 5 files changed, 2 insertions(+), 27 deletions(-) diff --git a/modules/haskell/init.zsh b/modules/haskell/init.zsh index 8690ce1872..c1c78ca2a0 100644 --- a/modules/haskell/init.zsh +++ b/modules/haskell/init.zsh @@ -10,11 +10,9 @@ if (( ! $+commands[ghc] )); then return 1 fi -# Prepend Cabal per user directories to PATH/MANPATH. +# Prepend Cabal per user directories to PATH. if [[ "$OSTYPE" == darwin* && -d $HOME/Library/Haskell ]]; then path=($HOME/Library/Haskell/bin(/N) $path) - manpath=($HOME/Library/Haskell/man(/N) $manpath) else path=($HOME/.cabal/bin(/N) $path) - manpath=($HOME/.cabal/man(/N) $manpath) fi diff --git a/modules/macports/init.zsh b/modules/macports/init.zsh index 4554ca1fb5..9183553352 100644 --- a/modules/macports/init.zsh +++ b/modules/macports/init.zsh @@ -21,12 +21,6 @@ infopath=( $infopath ) -# Set the list of directories that man searches for manuals. -manpath=( - /opt/local/share/man - $manpath -) - # Set the list of directories that Zsh searches for programs. path=( /opt/local/{bin,sbin} diff --git a/modules/perl/init.zsh b/modules/perl/init.zsh index 8ba873d70c..0997a4b2bf 100644 --- a/modules/perl/init.zsh +++ b/modules/perl/init.zsh @@ -20,8 +20,6 @@ if [[ "$OSTYPE" == darwin* ]]; then perl_path="$HOME/Library/Perl/5.12" if [[ -f "$perl_path/lib/perl5/local/lib.pm" ]]; then - manpath=("$perl_path/man" $manpath) - if [[ ! -s "$cache_file" ]]; then perl -I$perl_path/lib/perl5 -Mlocal::lib=$perl_path >! "$cache_file" fi diff --git a/modules/python/init.zsh b/modules/python/init.zsh index 11875612b7..a72f01f9ca 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -17,14 +17,12 @@ if (( ! $+commands[python] && ! $+commands[pythonz] )); then fi # Prepend PEP 370 per user site packages directory, which defaults to -# ~/Library/Python on Mac OS X and ~/.local elsewhere, to PATH/MANPATH. +# ~/Library/Python on Mac OS X and ~/.local elsewhere, to PATH. if [[ "$OSTYPE" == darwin* ]]; then path=($HOME/Library/Python/*/bin(N) $path) - manpath=($HOME/Library/Python/*/{,share/}man(N) $manpath) else # This is subject to change. path=($HOME/.local/bin $path) - manpath=($HOME/.local/{,share/}man(N) $manpath) fi # Load virtualenvwrapper into the shell session. diff --git a/runcoms/zshenv b/runcoms/zshenv index 0adef03b15..7ebeb35f1f 100644 --- a/runcoms/zshenv +++ b/runcoms/zshenv @@ -34,7 +34,6 @@ fi # typeset -gU cdpath fpath mailpath path -typeset -gxU MANPATH typeset -gxUT INFOPATH infopath # Set the the list of directories that cd searches. @@ -49,18 +48,6 @@ infopath=( $infopath ) -# Set the list of directories that man searches for manuals. -manpath=( - /usr/local/share/man - /usr/share/man - $manpath -) - -for path_file in /etc/manpaths.d/*(.N); do - manpath+=($(<$path_file)) -done -unset path_file - # Set the list of directories that Zsh searches for programs. path=( /usr/local/{bin,sbin} From 095863e6ae110f805725afeeb8e54977d609c797 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Mon, 28 Jan 2013 17:26:51 -0500 Subject: [PATCH 09/16] [Fix #385] Do not set $INFOPATH --- modules/macports/init.zsh | 6 ------ runcoms/zshenv | 8 -------- 2 files changed, 14 deletions(-) diff --git a/modules/macports/init.zsh b/modules/macports/init.zsh index 9183553352..5698114855 100644 --- a/modules/macports/init.zsh +++ b/modules/macports/init.zsh @@ -15,12 +15,6 @@ fi # Paths # -# Set the list of directories that info searches for manuals. -infopath=( - /opt/local/share/info - $infopath -) - # Set the list of directories that Zsh searches for programs. path=( /opt/local/{bin,sbin} diff --git a/runcoms/zshenv b/runcoms/zshenv index 7ebeb35f1f..b97aaf1997 100644 --- a/runcoms/zshenv +++ b/runcoms/zshenv @@ -34,20 +34,12 @@ fi # typeset -gU cdpath fpath mailpath path -typeset -gxUT INFOPATH infopath # Set the the list of directories that cd searches. # cdpath=( # $cdpath # ) -# Set the list of directories that info searches for manuals. -infopath=( - /usr/local/share/info - /usr/share/info - $infopath -) - # Set the list of directories that Zsh searches for programs. path=( /usr/local/{bin,sbin} From 6fd00449a67ca1c14af1b8d5d3a582945057b2cf Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Sun, 27 Jan 2013 18:58:23 -0500 Subject: [PATCH 10/16] [Fix #381] Remove the path_helper workaround --- README.md | 19 ------------------- runcoms/zshenv | 7 ------- 2 files changed, 26 deletions(-) diff --git a/README.md b/README.md index 2955fe57dd..32b3498e63 100644 --- a/README.md +++ b/README.md @@ -33,25 +33,6 @@ version is 4.3.10. 5. Open a new Zsh terminal window or tab. -### Mac OS X - -If you have administrator privileges, you must fix an Apple-introduced problem -in Mac OS X 10.5 Leopard by executing the following command, or BASH and Zsh -will have the wrong `PATH` when executed non-interactively. - - sudo chmod ugo-x /usr/libexec/path_helper - -`path_helper` is intended to make it easier for installers to add new paths to -the environment without having to edit shell configuration files by adding -a file with a path to the */etc/paths.d* directory. - -Unfortunately, `path_helper` always reads paths from */etc/paths* set by Apple -then paths from */etc/paths.d* set by third party installers, and lastly paths -from the `PATH` environment variable set by the parent process, which -ultimately is set by the user with `export PATH=...` Thus, it reorders path -priorities, and user */bin* directories meant to override system */bin* -directories end up at the tail of the array. - ### Troubleshooting If you are not able to find certain commands after switching to *Prezto*, diff --git a/runcoms/zshenv b/runcoms/zshenv index b97aaf1997..99c357cd0c 100644 --- a/runcoms/zshenv +++ b/runcoms/zshenv @@ -43,16 +43,9 @@ typeset -gU cdpath fpath mailpath path # Set the list of directories that Zsh searches for programs. path=( /usr/local/{bin,sbin} - /usr/{bin,sbin} - /{bin,sbin} $path ) -for path_file in /etc/paths.d/*(.N); do - path+=($(<$path_file)) -done -unset path_file - # # Less # From d198c08db576c025357c3fe6237487b86d73e087 Mon Sep 17 00:00:00 2001 From: neersighted Date: Mon, 21 Jan 2013 17:35:59 -0800 Subject: [PATCH 11/16] Use $GNUPGHOME in GPG agent startup Use the value of $GNUPGHOME, to facilitate moving GPG's home. This lets users who keep their GPG keyring on external devices or alternate folders use the gpg-agent autostarting, even if $HOME/.gnupg does not exist. --- modules/gpg-agent/init.zsh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/gpg-agent/init.zsh b/modules/gpg-agent/init.zsh index 6d010d2813..82bd9a2ec4 100644 --- a/modules/gpg-agent/init.zsh +++ b/modules/gpg-agent/init.zsh @@ -4,6 +4,7 @@ # Authors: # Florian Walch # Sorin Ionescu +# neersighted # # Return if requirements are not found. @@ -11,7 +12,8 @@ if (( ! $+commands[gpg-agent] )); then return 1 fi -_gpg_env="$HOME/.gnupg/gpg-agent.env" +# Make sure to use the $GNUPGHOME first. +_gpg_env="${GNUPGHOME:-$HOME/.gnupg}/gpg-agent.env" function _gpg-agent-start { local ssh_support @@ -20,7 +22,8 @@ function _gpg-agent-start { || ssh_support='' gpg-agent \ - --daemon ${ssh_support:+'--enable-ssh-support'} + --daemon \ + ${ssh_support:+'--enable-ssh-support'} \ --write-env-file "${_gpg_env}" > /dev/null chmod 600 "${_gpg_env}" @@ -41,4 +44,3 @@ export GPG_AGENT_INFO export SSH_AUTH_SOCK export SSH_AGENT_PID export GPG_TTY="$(tty)" - From 185235003e9c395b4989d7bb1d4bc191e98b1130 Mon Sep 17 00:00:00 2001 From: Zeh Rizzatti Date: Thu, 13 Dec 2012 12:10:55 -0300 Subject: [PATCH 12/16] Add support for nvm --- modules/node/README.md | 25 ++++++++++++++++++++++++- modules/node/functions/node-info | 25 +++++++++++++++++++++++++ modules/node/init.zsh | 8 +++++++- 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 modules/node/functions/node-info diff --git a/modules/node/README.md b/modules/node/README.md index 58f2b082ec..c0174ebbea 100644 --- a/modules/node/README.md +++ b/modules/node/README.md @@ -1,13 +1,34 @@ Node.js ======= -Provides utility functions for [Node.js][1] and loads [npm][2] completion. +Provides utility functions for [Node.js][1], loads the Node Version Manager, and +enables [npm][2] completion. + +nvm +--- + +[nvm][5] allows for managing multiple, isolated Node.js installations in the +home directory. Functions --------- - `node-doc` opens the Node.js online [API documentation][3] in the default browser. + - `node-info` exposes information about the Node.js environment via the + `$node_info` associative array. + +Theming +------- + +To display the version number of the current Node.js version, define the +following style inside the `prompt_name_setup` function. + + # %v - Node.js version. + zstyle ':prezto:module:node:info:version' format 'version:%v' + +Then add `$node_info[version]` to either `$PROMPT` or `$RPROMPT` and call +`node-info` in `prompt_name_preexec` hook function. Authors ------- @@ -15,9 +36,11 @@ Authors *The authors of this module should be contacted via the [issue tracker][4].* - [Sorin Ionescu](https://github.com/sorin-ionescu) + - [Zeh Rizzatti](https://github.com/zehrizzatti) [1]: http://nodejs.org [2]: http://npmjs.org [3]: http://nodejs.org/api [4]: https://github.com/sorin-ionescu/prezto/issues +[5]: https://github.com/creationix/nvm diff --git a/modules/node/functions/node-info b/modules/node/functions/node-info new file mode 100644 index 0000000000..2af5042eb0 --- /dev/null +++ b/modules/node/functions/node-info @@ -0,0 +1,25 @@ +# +# Exposes information about the Node.js environment via the $node_info +# associative array. +# +# Authors: +# Zeh Rizzatti +# + +local version +local version_format +local version_formatted + +unset node_info +typeset -gA node_info + +if (( $+functions[nvm_version] )); then + version="${$(nvm_version)#v}" +fi + +if [[ -n "$version" ]]; then + zstyle -s ':prezto:module:node:info:version' format 'version_format' + zformat -f version_formatted "$version_format" "v:$version" + node_info[version]="$version_formatted" +fi + diff --git a/modules/node/init.zsh b/modules/node/init.zsh index 16847abccb..904d24d931 100644 --- a/modules/node/init.zsh +++ b/modules/node/init.zsh @@ -1,10 +1,16 @@ # -# Completes npm. +# Loads the Node Version Manager and enables npm completion. # # Authors: # Sorin Ionescu +# Zeh Rizzatti # +# Load NVM into the shell session. +if [[ -s "$HOME/.nvm/nvm.sh" ]]; then + source "$HOME/.nvm/nvm.sh" +fi + # Return if requirements are not found. if (( ! $+commands[node] )); then return 1 From f4d9b32de94c2ead323339d4be8b3e25b7e86181 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Tue, 29 Jan 2013 14:13:14 -0500 Subject: [PATCH 13/16] [Fix #351] Set empty keys to an invalid UTF-8 sequence --- modules/editor/init.zsh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/editor/init.zsh b/modules/editor/init.zsh index ae253f25c1..d76c605719 100644 --- a/modules/editor/init.zsh +++ b/modules/editor/init.zsh @@ -90,12 +90,11 @@ key_info=( 'BackTab' "$terminfo[kcbt]" ) -# Do not bind any keys if there are empty values in $key_info. +# Set empty $key_info values to an invalid UTF-8 sequence to induce silent +# bindkey failure. for key in "${(k)key_info[@]}"; do if [[ -z "$key_info[$key]" ]]; then - print "prezto: one or more keys are non-bindable" >&2 - unset key{,_info} - return 1 + key_info["$key"]='�' fi done From 6e65349c451c7e6d8b799469179b67713d1f18e3 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Thu, 28 Feb 2013 17:01:00 -0500 Subject: [PATCH 14/16] [Fix #398] Manually set locale --- runcoms/zshenv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runcoms/zshenv b/runcoms/zshenv index 99c357cd0c..0f8738bffa 100644 --- a/runcoms/zshenv +++ b/runcoms/zshenv @@ -26,7 +26,7 @@ export PAGER='less' # if [[ -z "$LANG" ]]; then - eval "$(locale)" + export LANG='en_US.UTF-8' fi # From e2c5f2fb2c5e43d9dabcf5a367955de297234004 Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Thu, 28 Feb 2013 17:35:54 -0500 Subject: [PATCH 15/16] [Fix #396] Remove the osx trash function The trash program found at http://hasseg.org/trash is a superior implementation. --- modules/osx/README.md | 1 - modules/osx/functions/trash | 27 --------------------------- 2 files changed, 28 deletions(-) delete mode 100644 modules/osx/functions/trash diff --git a/modules/osx/README.md b/modules/osx/README.md index bb74ef5518..498ed2e506 100644 --- a/modules/osx/README.md +++ b/modules/osx/README.md @@ -20,7 +20,6 @@ Functions - `pfd` prints the current _Finder_ directory. - `pfs` prints the current _Finder_ selection. - `tab` creates a new tab (works in both _Terminal_ and [_iTerm_][3]). - - `trash` moves files and folders to _Trash_. Authors ------- diff --git a/modules/osx/functions/trash b/modules/osx/functions/trash deleted file mode 100644 index d392437311..0000000000 --- a/modules/osx/functions/trash +++ /dev/null @@ -1,27 +0,0 @@ -# -# Moves directories and files to Trash. -# -# Authors: -# Sorin Ionescu -# - -print -N "${@:a}" | xargs -0 osascript -e ' - on run theFilePaths - tell application "Finder" - set thePOSIXFiles to {} - repeat with aFilePath in theFilePaths - set aPOSIXFile to aFilePath as POSIX file - if exists aPOSIXFile - set end of thePOSIXFiles to aPOSIXFile - end if - end repeat - move every item of thePOSIXFiles to trash - end tell - end run -' &>/dev/null - -if (( $? != 0)); then - print "$0: failed to move one or more items" >&2 - return 1 -fi - From 2baa4dce0c584b719ddd31b578714567f2b7cfa1 Mon Sep 17 00:00:00 2001 From: Sebastian Wiesner Date: Sun, 3 Feb 2013 10:15:17 +0100 Subject: [PATCH 16/16] Add Emacs module Enables Emacs dependency management with Carton. --- modules/emacs/README.md | 33 +++++++++++++++++++++++++++++++++ modules/emacs/init.zsh | 15 +++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 modules/emacs/README.md create mode 100644 modules/emacs/init.zsh diff --git a/modules/emacs/README.md b/modules/emacs/README.md new file mode 100644 index 0000000000..fa9a514b39 --- /dev/null +++ b/modules/emacs/README.md @@ -0,0 +1,33 @@ +Emacs +===== + +Enables Emacs dependency management. + +Dependency management +--------------------- + +[Carton][1] installs and manages Emacs packages for Emacs package development +and Emacs configuration. + +This module prepends the Carton directory to the path variable to enable the +execution of `carton`. + +Aliases +------- + +### Carton + + - `cai` installs dependencies. + - `cau` updates dependencies. + - `caI` initializes the current directory for dependency management. + - `cae` executes a command which correct dependencies. + +Authors +------- + +*The authors of this module should be contacted via the [issue tracker][2].* + + - [Sebastian Wiesner](https://github.com/lunaryorn) + +[1]: https://github.com/rejeep/carton +[2]: https://github.com/sorin-ionescu/prezto/issues diff --git a/modules/emacs/init.zsh b/modules/emacs/init.zsh new file mode 100644 index 0000000000..c24625d1f8 --- /dev/null +++ b/modules/emacs/init.zsh @@ -0,0 +1,15 @@ +# +# Configures Emacs dependency management. +# +# Authors: Sebastian Wiesner +# + +# Enable Carton +if [[ -d "$HOME/.carton" ]]; then + path=($HOME/.carton/bin $path) + + alias cai='carton install' + alias cau='carton update' + alias caI='carton init' + alias cae='carton exec' +fi