mirror of
https://github.com/dcarrillo/prezto.git
synced 2025-07-01 20:59:26 +00:00
Compare commits
8 Commits
pull/599-t
...
pull/715-g
Author | SHA1 | Date | |
---|---|---|---|
72328d0eed | |||
a14b6e5c31 | |||
d020d34e59 | |||
17a6124b43 | |||
3c47c57c87 | |||
ff0cdd3ed7 | |||
b948e3630b | |||
55e4db9429 |
@ -237,6 +237,7 @@ Functions
|
||||
- `git-stash-recover` recovers given dropped stashed states.
|
||||
- `git-submodule-move` moves a submodule.
|
||||
- `git-submodule-remove` removes a submodule.
|
||||
- `git-ignore-template` get gitignore template from [gitignore.io][9]
|
||||
|
||||
Theming
|
||||
-------
|
||||
@ -332,3 +333,4 @@ Authors
|
||||
[6]: https://github.com/sorin-ionescu/prezto/issues
|
||||
[7]: https://github.com/sorin-ionescu/prezto/issues/219
|
||||
[8]: http://www.kernel.org/pub/software/scm/git/docs/git-log.html
|
||||
[9]: https://gitignore.io/
|
||||
|
@ -100,12 +100,12 @@ alias gix='git rm -r --cached'
|
||||
alias giX='git rm -rf --cached'
|
||||
|
||||
# Log (l)
|
||||
alias gl='git log --topo-order --pretty=format:${_git_log_medium_format}'
|
||||
alias gls='git log --topo-order --stat --pretty=format:${_git_log_medium_format}'
|
||||
alias gld='git log --topo-order --stat --patch --full-diff --pretty=format:${_git_log_medium_format}'
|
||||
alias glo='git log --topo-order --pretty=format:${_git_log_oneline_format}'
|
||||
alias glg='git log --topo-order --all --graph --pretty=format:${_git_log_oneline_format}'
|
||||
alias glb='git log --topo-order --pretty=format:${_git_log_brief_format}'
|
||||
alias gl='git log --topo-order --pretty=format:"${_git_log_medium_format}"'
|
||||
alias gls='git log --topo-order --stat --pretty=format:"${_git_log_medium_format}"'
|
||||
alias gld='git log --topo-order --stat --patch --full-diff --pretty=format:"${_git_log_medium_format}"'
|
||||
alias glo='git log --topo-order --pretty=format:"${_git_log_oneline_format}"'
|
||||
alias glg='git log --topo-order --all --graph --pretty=format:"${_git_log_oneline_format}"'
|
||||
alias glb='git log --topo-order --pretty=format:"${_git_log_brief_format}"'
|
||||
alias glc='git shortlog --summary --numbered'
|
||||
|
||||
# Merge (m)
|
||||
@ -179,3 +179,6 @@ alias gwc='git clean -n'
|
||||
alias gwC='git clean -f'
|
||||
alias gwx='git rm -r'
|
||||
alias gwX='git rm -rf'
|
||||
|
||||
# Ignore list (ig)
|
||||
alias gig='git-ignore-template'
|
||||
|
26
modules/git/functions/_git-ignore-template
Normal file
26
modules/git/functions/_git-ignore-template
Normal file
@ -0,0 +1,26 @@
|
||||
#compdef _gitignireio git-ignore-template
|
||||
#autoload
|
||||
|
||||
#
|
||||
# Completes git-ignore-template
|
||||
#
|
||||
# Authors:
|
||||
# Haojia Che <haojia.che@gmail.com>
|
||||
#
|
||||
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments -C \
|
||||
'1::ignore:->ignores' \
|
||||
&& ret=0
|
||||
|
||||
list=(`git-ignore-template`)
|
||||
|
||||
case "$state" in
|
||||
(ignores)
|
||||
languages=(`echo $list| tr "," "\n"`)
|
||||
_describe 'templates' languages && ret=0
|
||||
;;
|
||||
esac;
|
||||
|
||||
return 1;
|
20
modules/git/functions/git-ignore-template
Normal file
20
modules/git/functions/git-ignore-template
Normal file
@ -0,0 +1,20 @@
|
||||
#
|
||||
# Get ignore template from https://gitignore.io.
|
||||
#
|
||||
# Authors:
|
||||
# Haojia Che <haojia.che@gmail.com>
|
||||
#
|
||||
# Use `git-ignore-template` or `git-ignore-template list` to get the list
|
||||
# Uset `git-ignore-template <template name>` to get the template
|
||||
#
|
||||
# Example:
|
||||
# `git-ignore-template java` to get a gitignore template for java.
|
||||
#
|
||||
|
||||
function git-ignore-template() {
|
||||
if [ $@ ]; then
|
||||
curl -L -s https://www.gitignore.io/api/$@;
|
||||
else
|
||||
curl -L -s https://www.gitignore.io/api/list;
|
||||
fi
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
GNU Utility
|
||||
===========
|
||||
|
||||
Provides for the interactive use of GNU utilities on non-GNU systems.
|
||||
Provides for the interactive use of GNU utilities on BSD systems.
|
||||
|
||||
Installing GNU utilities on non-GNU systems in `$PATH` without a prefix, i.e.
|
||||
`ls` instead of `gls`, is not recommended since scripts that target other
|
||||
|
@ -17,7 +17,7 @@ if (( $+functions[nvm_version] )); then
|
||||
version="${$(nvm_version)#v}"
|
||||
fi
|
||||
|
||||
if [[ "$version" == (none|) ]]; then
|
||||
if [[ "$version" != (none|) ]]; then
|
||||
zstyle -s ':prezto:module:node:info:version' format 'version_format'
|
||||
zformat -f version_formatted "$version_format" "v:$version"
|
||||
node_info[version]="$version_formatted"
|
||||
|
@ -6,9 +6,13 @@
|
||||
# Zeh Rizzatti <zehrizzatti@gmail.com>
|
||||
#
|
||||
|
||||
# Load NVM into the shell session.
|
||||
# Load manually installed NVM into the shell session.
|
||||
if [[ -s "$HOME/.nvm/nvm.sh" ]]; then
|
||||
source "$HOME/.nvm/nvm.sh"
|
||||
|
||||
# Load package manager installed NVM into the shell session.
|
||||
elif (( $+commands[brew] )) && [[ -d "$(brew --prefix nvm 2>/dev/null)" ]]; then
|
||||
source $(brew --prefix nvm)/nvm.sh
|
||||
fi
|
||||
|
||||
# Return if requirements are not found.
|
||||
|
@ -1,7 +1,7 @@
|
||||
Perl
|
||||
====
|
||||
|
||||
Enables local [Perl][1] module installation on Mac OS X and defines alises.
|
||||
Enables local [Perl][1] module installation on Mac OS X and defines aliases.
|
||||
|
||||
Local Module Installation
|
||||
-------------------------
|
||||
|
@ -16,10 +16,14 @@ fi
|
||||
|
||||
_rsync_cmd='rsync --verbose --progress --human-readable --compress --archive --hard-links --one-file-system'
|
||||
|
||||
if grep -q 'xattrs' <(rsync --help 2>&1); then
|
||||
_rsync_cmd="${_rsync_cmd} --acls --xattrs"
|
||||
fi
|
||||
|
||||
# Mac OS X and HFS+ Enhancements
|
||||
# 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"
|
||||
_rsync_cmd="${_rsync_cmd} --crtimes --fileflags --protect-decmpfs --force-change"
|
||||
fi
|
||||
|
||||
alias rsync-copy="${_rsync_cmd}"
|
||||
|
@ -13,19 +13,14 @@ directory, add the following to *zpreztorc*:
|
||||
|
||||
zstyle ':prezto:module:terminal' auto-title 'yes'
|
||||
|
||||
Auto titling is disabled inside terminal multiplexers (except inside dvtm)
|
||||
since it interferes with window names defined in configuration files and
|
||||
profile managers. This can be overridden by setting it to `always`.
|
||||
|
||||
zstyle ':prezto:module:terminal' auto-title 'always'
|
||||
|
||||
### Title formats
|
||||
Auto titling is disabled inside terminal multiplexers, except inside dvtm, since
|
||||
it interferes with window names defined in configuration files and profile
|
||||
managers.
|
||||
|
||||
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: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
|
||||
executing program name.
|
||||
@ -36,8 +31,7 @@ Functions
|
||||
---------
|
||||
|
||||
- `set-tab-title` sets the terminal tab title.
|
||||
- `set-window-title` sets the terminal window title.
|
||||
- `set-multiplexer-title` sets the terminal multiplexer title.
|
||||
- `set-window-title` sets the terminal or terminal multiplexer window title.
|
||||
|
||||
Authors
|
||||
-------
|
||||
@ -45,7 +39,6 @@ Authors
|
||||
*The authors of this module should be contacted via the [issue tracker][2].*
|
||||
|
||||
- [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
|
||||
[2]: https://github.com/sorin-ionescu/prezto/issues
|
||||
|
@ -3,7 +3,6 @@
|
||||
#
|
||||
# Authors:
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
# Olaf Conradi <olaf@conradi.org>
|
||||
#
|
||||
|
||||
# Return if requirements are not found.
|
||||
@ -11,12 +10,19 @@ if [[ "$TERM" == (dumb|linux|*bsd*) ]]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Sets the terminal window title.
|
||||
# Sets the terminal or terminal multiplexer window title.
|
||||
function set-window-title {
|
||||
local title_format{,ted}
|
||||
zstyle -s ':prezto:module:terminal:window-title' format 'title_format' || title_format="%s"
|
||||
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.
|
||||
@ -24,15 +30,8 @@ function set-tab-title {
|
||||
local title_format{,ted}
|
||||
zstyle -s ':prezto:module:terminal:tab-title' format 'title_format' || title_format="%s"
|
||||
zformat -f title_formatted "$title_format" "s:$argv"
|
||||
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}"
|
||||
printf "\e]1;%s\a" ${(V%)title_formatted}
|
||||
}
|
||||
|
||||
# Sets the tab and window titles with a given command.
|
||||
@ -60,11 +59,8 @@ function _terminal-set-titles-with-command {
|
||||
local truncated_cmd="${cmd/(#m)?(#c15,)/${MATCH[1,12]}...}"
|
||||
unset MATCH
|
||||
|
||||
if [[ "$TERM" == screen* ]]; then
|
||||
set-multiplexer-title "$truncated_cmd"
|
||||
fi
|
||||
set-tab-title "$truncated_cmd"
|
||||
set-window-title "$cmd"
|
||||
set-tab-title "$truncated_cmd"
|
||||
fi
|
||||
}
|
||||
|
||||
@ -78,11 +74,8 @@ function _terminal-set-titles-with-path {
|
||||
local truncated_path="${abbreviated_path/(#m)?(#c15,)/...${MATCH[-12,-1]}}"
|
||||
unset MATCH
|
||||
|
||||
if [[ "$TERM" == screen* ]]; then
|
||||
set-multiplexer-title "$truncated_path"
|
||||
fi
|
||||
set-tab-title "$truncated_path"
|
||||
set-window-title "$abbreviated_path"
|
||||
set-tab-title "$truncated_path"
|
||||
}
|
||||
|
||||
# Do not override precmd/preexec; append to the hook array.
|
||||
@ -117,13 +110,12 @@ then
|
||||
fi
|
||||
|
||||
# Set up non-Apple terminals.
|
||||
if zstyle -t ':prezto:module:terminal' auto-title 'always' \
|
||||
|| (zstyle -t ':prezto:module:terminal' auto-title \
|
||||
&& ( ! [[ -n "$STY" || -n "$TMUX" ]] ))
|
||||
if zstyle -t ':prezto:module:terminal' auto-title \
|
||||
&& ( ! [[ -n "$STY" || -n "$TMUX" ]] )
|
||||
then
|
||||
# Sets titles before the prompt is displayed.
|
||||
# Sets the tab and window titles before the prompt is displayed.
|
||||
add-zsh-hook precmd _terminal-set-titles-with-path
|
||||
|
||||
# Sets titles before command execution.
|
||||
# Sets the tab and window titles before command execution.
|
||||
add-zsh-hook preexec _terminal-set-titles-with-command
|
||||
fi
|
||||
|
@ -143,9 +143,6 @@ zstyle ':prezto:module:prompt' theme 'sorin'
|
||||
# Set the tab title format.
|
||||
# zstyle ':prezto:module:terminal:tab-title' format '%m: %s'
|
||||
|
||||
# Set the terminal multiplexer title format.
|
||||
# zstyle ':prezto:module:terminal:multiplexer-title' format '%s'
|
||||
|
||||
#
|
||||
# Tmux
|
||||
#
|
||||
|
Reference in New Issue
Block a user