1
0
Fork 0

Merge branch 'master' of https://github.com/sorin-ionescu/prezto into sorin-ionescu-master

pull/1281/head
zephyrus 8 years ago
commit 8637d7090e

6
.gitmodules vendored

@ -1,3 +1,6 @@
[submodule "modules/autosuggestions/external"]
path = modules/autosuggestions/external
url = https://github.com/zsh-users/zsh-autosuggestions
[submodule "modules/history-substring-search/external"] [submodule "modules/history-substring-search/external"]
path = modules/history-substring-search/external path = modules/history-substring-search/external
url = https://github.com/zsh-users/zsh-history-substring-search.git url = https://github.com/zsh-users/zsh-history-substring-search.git
@ -16,6 +19,3 @@
[submodule "modules/prompt/functions/pure"] [submodule "modules/prompt/functions/pure"]
path = modules/prompt/external/pure path = modules/prompt/external/pure
url = https://github.com/sindresorhus/pure.git url = https://github.com/sindresorhus/pure.git
[submodule "modules/autosuggestions/external"]
path = modules/autosuggestions/external
url = https://github.com/tarruda/zsh-autosuggestions

@ -0,0 +1,20 @@
Copyright (c) 2009-2011 Robby Russell and contributors
Copyright (c) 2011-2017 Sorin Ionescu and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

@ -13,23 +13,25 @@ version is 4.3.17.
1. Launch Zsh: 1. Launch Zsh:
zsh `zsh`
2. Clone the repository: 2. Clone the repository:
git clone --recursive https://github.com/zephyrus/prezto.git "${ZDOTDIR:-$HOME}/.zprezto" `git clone --recursive https://github.com/zephyrus/prezto.git "${ZDOTDIR:-$HOME}/.zprezto"`
3. Create a new Zsh configuration by copying the Zsh configuration files 3. Create a new Zsh configuration by copying the Zsh configuration files
provided: provided:
```
setopt EXTENDED_GLOB setopt EXTENDED_GLOB
for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do
ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}" ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}"
done done
```
4. Set Zsh as your default shell: 4. Set Zsh as your default shell:
chsh -s /bin/zsh `chsh -s /bin/zsh`
5. Open a new Zsh terminal window or tab. 5. Open a new Zsh terminal window or tab.
@ -83,29 +85,7 @@ The [Zsh Reference Card][7] and the [zsh-lovers][8] man page are indispensable.
License License
------- -------
(The MIT License) This project is licensed under the MIT License.
Copyright (c) 2009-2011 Robby Russell and contributors.
Copyright (c) 2011-2015 Sorin Ionescu and contributors.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
[1]: http://www.zsh.org [1]: http://www.zsh.org
[2]: http://i.imgur.com/nrGV6pg.png "sorin theme" [2]: http://i.imgur.com/nrGV6pg.png "sorin theme"

@ -25,13 +25,13 @@ unset min_zsh_version
function pmodload { function pmodload {
local -a pmodules local -a pmodules
local pmodule local pmodule
local pfunction_glob='^([_.]*|prompt_*_setup|README*)(-.N:t)' local pfunction_glob='^([_.]*|prompt_*_setup|README*|*~)(-.N:t)'
# $argv is overridden in the anonymous function. # $argv is overridden in the anonymous function.
pmodules=("$argv[@]") pmodules=("$argv[@]")
# Add functions to $fpath. # Add functions to $fpath.
fpath=(${pmodules:+${ZDOTDIR:-$HOME}/.zprezto/modules/${^pmodules}/functions(/FN)} $fpath) fpath=(${pmodules:+$ZPREZTODIR/modules/${^pmodules}/functions(/FN)} $fpath)
function { function {
local pfunction local pfunction
@ -40,7 +40,7 @@ function pmodload {
setopt LOCAL_OPTIONS EXTENDED_GLOB setopt LOCAL_OPTIONS EXTENDED_GLOB
# Load Prezto functions. # Load Prezto functions.
for pfunction in ${ZDOTDIR:-$HOME}/.zprezto/modules/${^pmodules}/functions/$~pfunction_glob; do for pfunction in $ZPREZTODIR/modules/${^pmodules}/functions/$~pfunction_glob; do
autoload -Uz "$pfunction" autoload -Uz "$pfunction"
done done
} }
@ -49,19 +49,19 @@ function pmodload {
for pmodule in "$pmodules[@]"; do for pmodule in "$pmodules[@]"; do
if zstyle -t ":prezto:module:$pmodule" loaded 'yes' 'no'; then if zstyle -t ":prezto:module:$pmodule" loaded 'yes' 'no'; then
continue continue
elif [[ ! -d "${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule" ]]; then elif [[ ! -d "$ZPREZTODIR/modules/$pmodule" ]]; then
print "$0: no such module: $pmodule" >&2 print "$0: no such module: $pmodule" >&2
continue continue
else else
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule/init.zsh" ]]; then if [[ -s "$ZPREZTODIR/modules/$pmodule/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule/init.zsh" source "$ZPREZTODIR/modules/$pmodule/init.zsh"
fi fi
if (( $? == 0 )); then if (( $? == 0 )); then
zstyle ":prezto:module:$pmodule" loaded 'yes' zstyle ":prezto:module:$pmodule" loaded 'yes'
else else
# Remove the $fpath entry. # Remove the $fpath entry.
fpath[(r)${ZDOTDIR:-$HOME}/.zprezto/modules/${pmodule}/functions]=() fpath[(r)${ZPREZTODIR}/modules/${pmodule}/functions]=()
function { function {
local pfunction local pfunction
@ -71,7 +71,7 @@ function pmodload {
setopt LOCAL_OPTIONS EXTENDED_GLOB setopt LOCAL_OPTIONS EXTENDED_GLOB
# Unload Prezto functions. # Unload Prezto functions.
for pfunction in ${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule/functions/$~pfunction_glob; do for pfunction in $ZPREZTODIR/modules/$pmodule/functions/$~pfunction_glob; do
unfunction "$pfunction" unfunction "$pfunction"
done done
} }
@ -86,6 +86,12 @@ function pmodload {
# Prezto Initialization # Prezto Initialization
# #
# This finds the directory prezto is installed to so plugin managers don't need
# to rely on dirty hacks to force prezto into a directory. Additionally, it
# needs to be done here because inside the pmodload function ${0:h} evaluates to
# the current directory of the shell rather than the prezto dir.
ZPREZTODIR=${0:h}
# Source the Prezto configuration file. # Source the Prezto configuration file.
if [[ -s "${ZDOTDIR:-$HOME}/.zpreztorc" ]]; then if [[ -s "${ZDOTDIR:-$HOME}/.zpreztorc" ]]; then
source "${ZDOTDIR:-$HOME}/.zpreztorc" source "${ZDOTDIR:-$HOME}/.zpreztorc"

@ -1 +1 @@
Subproject commit f0a745576ff69fa608421ee7214d4cd77b43e62f Subproject commit 9cfaf5d3424ceb5fedd2c7e3253f823faae74383

@ -1 +1 @@
Subproject commit 3a2bb8781d32d05d1bf05deeeb476beb651e8272 Subproject commit 72af5d08f1c07507d74103af039e98a2791fccb5

@ -54,4 +54,4 @@ fi
alias deb-build='time dpkg-buildpackage -rfakeroot -us -uc' alias deb-build='time dpkg-buildpackage -rfakeroot -us -uc'
# Removes all kernel images and headers, except for the ones in use. # Removes all kernel images and headers, except for the ones in use.
alias deb-kclean='sudo aptitude remove -P "?and(~i~nlinux-(ima|hea) ?not(~n`uname -r`))"' alias deb-kclean='sudo aptitude remove -P "?and(~i~nlinux-(ima|hea) ?not(~n$(uname -r)))"'

@ -326,4 +326,4 @@ else
print "prezto: editor: invalid key bindings: $key_bindings" >&2 print "prezto: editor: invalid key bindings: $key_bindings" >&2
fi fi
unset key{,map,bindings} unset key{,map,_bindings}

@ -29,6 +29,10 @@ This setting affects all aliases and functions that call `git-status`.
Aliases Aliases
------- -------
Aliases are enabled by default. You can disable them with:
zstyle ':prezto:module:git:alias' skip 'yes'
### Git ### Git
- `g` is short for `git`. - `g` is short for `git`.
@ -214,6 +218,7 @@ The following aliases may shadow system commands:
- `gpt` shadows the [GUID partition table maintenance utility][4]. - `gpt` shadows the [GUID partition table maintenance utility][4].
- `gs` shadows the [Ghostscript][5]. - `gs` shadows the [Ghostscript][5].
- `gb` shadows the [GB][9].
If you frequently use the above commands, you may wish to remove said aliases If you frequently use the above commands, you may wish to remove said aliases
from this module or to disable them at the bottom of the zshrc with `unalias`. from this module or to disable them at the bottom of the zshrc with `unalias`.
@ -332,3 +337,4 @@ Authors
[6]: https://github.com/sorin-ionescu/prezto/issues [6]: https://github.com/sorin-ionescu/prezto/issues
[7]: https://github.com/sorin-ionescu/prezto/issues/219 [7]: https://github.com/sorin-ionescu/prezto/issues/219
[8]: http://www.kernel.org/pub/software/scm/git/docs/git-log.html [8]: http://www.kernel.org/pub/software/scm/git/docs/git-log.html
[9]: https://getgb.io/

@ -26,6 +26,7 @@ zstyle -s ':prezto:module:git:status:ignore' submodules '_git_status_ignore_subm
# Aliases # Aliases
# #
if ! zstyle -t ':prezto:module:git:alias' skip 'yes'; then
# Git # Git
alias g='git' alias g='git'
@ -117,7 +118,8 @@ alias gmt='git mergetool'
# Push (p) # Push (p)
alias gp='git push' alias gp='git push'
alias gpf='git push --force' alias gpf='git push --force-with-lease'
alias gpF='git push --force'
alias gpa='git push --all' alias gpa='git push --all'
alias gpA='git push --all && git push --tags' alias gpA='git push --all && git push --tags'
alias gpt='git push --tags' alias gpt='git push --tags'
@ -179,3 +181,4 @@ alias gwc='git clean -n'
alias gwC='git clean -f' alias gwC='git clean -f'
alias gwx='git rm -r' alias gwx='git rm -r'
alias gwX='git rm -rf' alias gwX='git rm -rf'
fi

@ -16,7 +16,7 @@ if [[ -z "$url" ]]; then
fi fi
if (( $+commands[curl] )); then if (( $+commands[curl] )); then
curl -s -i 'http://git.io' -F "url=$url" | grep 'Location:' | sed 's/Location: //' curl -s -i 'http://git.io' -F "url=$url" | sed -n 's/^Location: //p'
else else
print "$0: command not found: curl" >&2 print "$0: command not found: curl" >&2
fi fi

@ -1 +1 @@
Subproject commit 7a4b54b708ab88e0421097614f1acaa7a973c795 Subproject commit aae3388491c2312c4efb2e86bcb999927bb2900e

@ -54,4 +54,6 @@ if [[ -n "$key_info" ]]; then
bindkey -M "$keymap" "$key_info[Up]" history-substring-search-up bindkey -M "$keymap" "$key_info[Up]" history-substring-search-up
bindkey -M "$keymap" "$key_info[Down]" history-substring-search-down bindkey -M "$keymap" "$key_info[Down]" history-substring-search-down
done done
unset keymap
fi fi

@ -20,7 +20,7 @@ alias brewC='brew cleanup --force'
alias brewi='brew install' alias brewi='brew install'
alias brewl='brew list' alias brewl='brew list'
alias brews='brew search' alias brews='brew search'
alias brewu='brew update && brew upgrade --all' alias brewu='brew update && brew upgrade'
alias brewx='brew remove' alias brewx='brew remove'
# Homebrew Cask # Homebrew Cask

@ -10,6 +10,13 @@ nvm
[nvm][5] allows for managing multiple, isolated Node.js installations in the [nvm][5] allows for managing multiple, isolated Node.js installations in the
home directory. home directory.
nodenv
------
[nodenv][6] does one thing well. nodenv is concerned solely with switching
Node versions. It's simple and predictable, Just Works, and is rock solid in
production. nodenv is forked from the popular [rbenv][7].
Functions Functions
--------- ---------
@ -43,3 +50,5 @@ Authors
[3]: http://nodejs.org/api [3]: http://nodejs.org/api
[4]: https://github.com/sorin-ionescu/prezto/issues [4]: https://github.com/sorin-ionescu/prezto/issues
[5]: https://github.com/creationix/nvm [5]: https://github.com/creationix/nvm
[6]: https://github.com/nodenv/nodenv
[7]: https://github.com/sstephenson/rbenv

@ -15,6 +15,8 @@ typeset -gA node_info
if (( $+functions[nvm_version] )); then if (( $+functions[nvm_version] )); then
version="${$(nvm_version)#v}" version="${$(nvm_version)#v}"
elif (( $+commands[nodenv] )); then
version="${${$(nodenv version)#v}[(w)0]}"
fi fi
if [[ "$version" != (none|) ]]; then if [[ "$version" != (none|) ]]; then

@ -14,6 +14,14 @@ if [[ -s "$HOME/.nvm/nvm.sh" ]]; then
elif (( $+commands[brew] )) && [[ -d "$(brew --prefix nvm 2>/dev/null)" ]]; then elif (( $+commands[brew] )) && [[ -d "$(brew --prefix nvm 2>/dev/null)" ]]; then
source $(brew --prefix nvm)/nvm.sh source $(brew --prefix nvm)/nvm.sh
# Load manually installed nodenv into the shell session.
elif [[ -s "$HOME/.nodenv/bin/nodenv" ]]; then
eval "$($HOME/.nodenv/bin/nodenv init -)"
# Load package manager installed nodenv into the shell session.
elif (( $+commands[brew] )) && [[ -d "$(brew --prefix nodenv 2>/dev/null)" ]]; then
eval "$($(brew --prefix nodenv)/bin/nodenv init -)"
# Return if requirements are not found. # Return if requirements are not found.
elif (( ! $+commands[node] )); then elif (( ! $+commands[node] )); then
return 1 return 1

@ -1 +1 @@
Subproject commit 43cb371f361eecf62e9dac7afc73a1c16edf89c7 Subproject commit f8ffdbfbe2c2d8cd1350eae1b68367802fe6df26

@ -1 +1 @@
Subproject commit 8e81152340c4beb2d941340d1feb2dc29bbcc309 Subproject commit c48e4c69ef5c368ea7cda961ed9d0e298a5ae1fc

@ -1 +1 @@
Subproject commit fb4c37dad3c5cbdebca61a8ff5545397c11d450f Subproject commit 04fa7495cf8fe3aff8ce286d4517df15066b820a

@ -52,6 +52,10 @@ function prompt_paradox_build_prompt {
prompt_paradox_start_segment green black '${(e)git_info[ref]}${(e)git_info[status]}' prompt_paradox_start_segment green black '${(e)git_info[ref]}${(e)git_info[status]}'
fi fi
if [[ -n "$python_info" ]]; then
prompt_paradox_start_segment white black '${(e)python_info[virtualenv]}'
fi
prompt_paradox_end_segment prompt_paradox_end_segment
} }
@ -103,6 +107,7 @@ function prompt_paradox_precmd {
function prompt_paradox_preexec { function prompt_paradox_preexec {
_prompt_paradox_start_time="$SECONDS" _prompt_paradox_start_time="$SECONDS"
python-info
} }
function prompt_paradox_setup { function prompt_paradox_setup {
@ -143,6 +148,9 @@ function prompt_paradox_setup {
'ref' '$(coalesce "%b" "%p" "%c")' \ 'ref' '$(coalesce "%b" "%p" "%c")' \
'status' '%s%D%A%B%S%a%d%m%r%U%u' 'status' '%s%D%A%B%S%a%d%m%r%U%u'
# %v - virtualenv name.
zstyle ':prezto:module:python:info:virtualenv' format 'virtualenv:%v'
# Define prompts. # Define prompts.
PROMPT=' PROMPT='
${(e)$(prompt_paradox_build_prompt)} ${(e)$(prompt_paradox_build_prompt)}

@ -34,10 +34,11 @@ if (( ! $+commands[python] && ! $+commands[pyenv] )); then
return 1 return 1
fi fi
# Load virtualenvwrapper into the shell session. # Load virtualenvwrapper into the shell session, unless requested not to
if (( $+commands[virtualenvwrapper.sh] )); then zstyle -t ':prezto:module:python' skip-virtualenvwrapper-init
if (( $? && $+commands[virtualenvwrapper.sh] )); then
# Set the directory where virtual environments are stored. # Set the directory where virtual environments are stored.
export WORKON_HOME="$HOME/.virtualenvs" export WORKON_HOME="${WORKON_HOME:-$HOME/.virtualenvs}"
# Disable the virtualenv prompt. # Disable the virtualenv prompt.
VIRTUAL_ENV_DISABLE_PROMPT=1 VIRTUAL_ENV_DISABLE_PROMPT=1

@ -1 +1 @@
Subproject commit 7044c1986e2f6b15eec27a03651207fccb0a2fbe Subproject commit 15d4587514a3beaa13972093e335bf685b6726a9

@ -13,14 +13,19 @@ directory, add the following to *zpreztorc*:
zstyle ':prezto:module:terminal' auto-title 'yes' zstyle ':prezto:module:terminal' auto-title 'yes'
Auto titling is disabled inside terminal multiplexers, except inside dvtm, since Auto titling is disabled inside terminal multiplexers (except inside dvtm)
it interferes with window names defined in configuration files and profile since it interferes with window names defined in configuration files and
managers. profile managers. This can be overridden by setting it to `always`.
zstyle ':prezto:module:terminal' auto-title 'always'
### Title formats
To format terminal window and tab titles, add the following to *zpreztorc*: To format terminal window and tab titles, add the following to *zpreztorc*:
zstyle ':prezto:module:terminal:window-title' format '%n@%m: %s' zstyle ':prezto:module:terminal:window-title' format '%n@%m: %s'
zstyle ':prezto:module:terminal:tab-title' format '%m: %s' zstyle ':prezto:module:terminal:tab-title' format '%m: %s'
zstyle ':prezto:module:terminal:multiplexer-title' format '%s'
`%s` will be replaced with the current working directory path or the currently `%s` will be replaced with the current working directory path or the currently
executing program name. executing program name.
@ -31,7 +36,8 @@ Functions
--------- ---------
- `set-tab-title` sets the terminal tab title. - `set-tab-title` sets the terminal tab title.
- `set-window-title` sets the terminal or terminal multiplexer window title. - `set-window-title` sets the terminal window title.
- `set-multiplexer-title` sets the terminal multiplexer title.
Authors Authors
------- -------
@ -39,6 +45,7 @@ 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][2].*
- [Sorin Ionescu](https://github.com/sorin-ionescu) - [Sorin Ionescu](https://github.com/sorin-ionescu)
- [Olaf Conradi](https://github.com/oohlaf)
[1]: http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Expansion-of-Prompt-Sequences [1]: http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Expansion-of-Prompt-Sequences
[2]: https://github.com/sorin-ionescu/prezto/issues [2]: https://github.com/sorin-ionescu/prezto/issues

@ -3,6 +3,7 @@
# #
# Authors: # Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com> # Sorin Ionescu <sorin.ionescu@gmail.com>
# Olaf Conradi <olaf@conradi.org>
# #
# Return if requirements are not found. # Return if requirements are not found.
@ -10,19 +11,12 @@ if [[ "$TERM" == (dumb|linux|*bsd*|eterm*) ]]; then
return 1 return 1
fi fi
# Sets the terminal or terminal multiplexer window title. # Sets the terminal window title.
function set-window-title { function set-window-title {
local title_format{,ted} local title_format{,ted}
zstyle -s ':prezto:module:terminal:window-title' format 'title_format' || title_format="%s" zstyle -s ':prezto:module:terminal:window-title' format 'title_format' || title_format="%s"
zformat -f title_formatted "$title_format" "s:$argv" zformat -f title_formatted "$title_format" "s:$argv"
printf '\e]2;%s\a' "${(V%)title_formatted}"
if [[ "$TERM" == screen* ]]; then
title_format="\ek%s\e\\"
else
title_format="\e]2;%s\a"
fi
printf "$title_format" "${(V%)title_formatted}"
} }
# Sets the terminal tab title. # Sets the terminal tab title.
@ -30,8 +24,15 @@ function set-tab-title {
local title_format{,ted} local title_format{,ted}
zstyle -s ':prezto:module:terminal:tab-title' format 'title_format' || title_format="%s" zstyle -s ':prezto:module:terminal:tab-title' format 'title_format' || title_format="%s"
zformat -f title_formatted "$title_format" "s:$argv" zformat -f title_formatted "$title_format" "s:$argv"
printf '\e]1;%s\a' "${(V%)title_formatted}"
}
printf "\e]1;%s\a" ${(V%)title_formatted} # Sets the terminal multiplexer tab title.
function set-multiplexer-title {
local title_format{,ted}
zstyle -s ':prezto:module:terminal:multiplexer-title' format 'title_format' || title_format="%s"
zformat -f title_formatted "$title_format" "s:$argv"
printf '\ek%s\e\\' "${(V%)title_formatted}"
} }
# Sets the tab and window titles with a given command. # Sets the tab and window titles with a given command.
@ -59,8 +60,11 @@ 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
set-window-title "$cmd" if [[ "$TERM" == screen* ]]; then
set-multiplexer-title "$truncated_cmd"
fi
set-tab-title "$truncated_cmd" set-tab-title "$truncated_cmd"
set-window-title "$cmd"
fi fi
} }
@ -74,8 +78,11 @@ 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
set-window-title "$abbreviated_path" if [[ "$TERM" == screen* ]]; then
set-multiplexer-title "$truncated_path"
fi
set-tab-title "$truncated_path" set-tab-title "$truncated_path"
set-window-title "$abbreviated_path"
} }
# Do not override precmd/preexec; append to the hook array. # Do not override precmd/preexec; append to the hook array.
@ -110,12 +117,13 @@ then
fi fi
# Set up non-Apple terminals. # Set up non-Apple terminals.
if zstyle -t ':prezto:module:terminal' auto-title \ if zstyle -t ':prezto:module:terminal' auto-title 'always' \
&& ( ! [[ -n "$STY" || -n "$TMUX" ]] ) || (zstyle -t ':prezto:module:terminal' auto-title \
&& ( ! [[ -n "$STY" || -n "$TMUX" ]] ))
then then
# Sets the tab and window titles before the prompt is displayed. # Sets titles before the prompt is displayed.
add-zsh-hook precmd _terminal-set-titles-with-path add-zsh-hook precmd _terminal-set-titles-with-path
# Sets the tab and window titles before command execution. # Sets titles before command execution.
add-zsh-hook preexec _terminal-set-titles-with-command add-zsh-hook preexec _terminal-set-titles-with-command
fi fi

@ -75,6 +75,7 @@ Aliases
- `pu` changes the directory and pushes the old directory onto the stack - `pu` changes the directory and pushes the old directory onto the stack
(`pushd`). (`pushd`).
- `rm` removes files and directories interactively. - `rm` removes files and directories interactively.
- `sa` search aliases for a word.
- `type` displays all the attribute values of a shell parameter. - `type` displays all the attribute values of a shell parameter.
### Files and Directories ### Files and Directories

@ -8,7 +8,7 @@
function diff { function diff {
if zstyle -t ':prezto:module:utility:diff' color; then if zstyle -t ':prezto:module:utility:diff' color; then
if (( $+commands[colordiff] )); then if (( $+commands[colordiff] )); then
command diff --unified "$@" | colordiff --difftype diffu command colordiff --unified "$@"
elif (( $+commands[git] )); then elif (( $+commands[git] )); then
git --no-pager diff --color=auto --no-ext-diff --no-index "$@" git --no-pager diff --color=auto --no-ext-diff --no-index "$@"
else else

@ -57,6 +57,7 @@ alias p='${(z)PAGER}'
alias po='popd' alias po='popd'
alias pu='pushd' alias pu='pushd'
# alias rm="${aliases[rm]:-rm} -i" # alias rm="${aliases[rm]:-rm} -i"
alias sa='alias | grep -i'
alias type='type -a' alias type='type -a'
# ls # ls
@ -158,7 +159,11 @@ fi
# Miscellaneous # Miscellaneous
# Serves a directory via HTTP. # Serves a directory via HTTP.
if (( $+commands[python3] )); then
alias http-serve='python3 -m http.server'
else
alias http-serve='python -m SimpleHTTPServer' alias http-serve='python -m SimpleHTTPServer'
fi
# #
# Functions # Functions

@ -153,6 +153,9 @@ zstyle ':prezto:module:prompt' theme 'sorin'
# Set the tab title format. # Set the tab title format.
# zstyle ':prezto:module:terminal:tab-title' format '%m: %s' # zstyle ':prezto:module:terminal:tab-title' format '%m: %s'
# Set the terminal multiplexer title format.
# zstyle ':prezto:module:terminal:multiplexer-title' format '%s'
# #
# Tmux # Tmux
# #

@ -67,8 +67,7 @@ fi
# #
if [[ ! -d "$TMPDIR" ]]; then if [[ ! -d "$TMPDIR" ]]; then
export TMPDIR="/tmp/$LOGNAME" export TMPDIR="$(mktemp -d)"
mkdir -p -m 700 "$TMPDIR"
fi fi
TMPPREFIX="${TMPDIR%/}/zsh" TMPPREFIX="${TMPDIR%/}/zsh"

Loading…
Cancel
Save