1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-10-16 11:40:46 +00:00

Compare commits

...

4 commits

Author SHA1 Message Date
Adrien Plazas
fd57892cc4
Merge a0fd4f4fec into 9bcafe1c27 2024-09-18 20:26:55 +02:00
Erik Teichmann
9bcafe1c27
feat(functions): add takezip (#12670) 2024-09-18 20:26:38 +02:00
Ruslan Tursunov
3151c9c1a3
fix(git): re-add accidentally removed gcn (#12681) 2024-09-18 12:58:00 +02:00
Adrien Plazas
a0fd4f4fec fix(agnoster): print white text for black segments
This makes them readable in light terminals too and not only dark ones.
2024-06-25 14:15:13 +02:00
4 changed files with 16 additions and 2 deletions

View file

@ -57,6 +57,16 @@ function takeurl() {
cd "$thedir"
}
function takezip() {
local data thedir
data="$(mktemp)"
curl -L "$1" > "$data"
unzip "$data" -d "./"
thedir="$(unzip -l "$data" | awk 'NR==4 {print $4}' | sed 's/\/.*//')"
rm "$data"
cd "$thedir"
}
function takegit() {
git clone "$1"
cd "$(basename ${1%%.git})"
@ -65,6 +75,8 @@ function takegit() {
function take() {
if [[ $1 =~ ^(https?|ftp).*\.(tar\.(gz|bz2|xz)|tgz)$ ]]; then
takeurl "$1"
elif [[ $1 =~ ^(https?|ftp).*\.(zip)$ ]]; then
takezip "$1"
elif [[ $1 =~ ^([A-Za-z0-9]\+@|https?|git|ssh|ftps?|rsync).*\.git/?$ ]]; then
takegit "$1"
else

View file

@ -73,6 +73,7 @@ plugins=(... git)
| `gcans!` | `git commit --verbose --all --signoff --no-edit --amend` |
| `gcann!` | `git commit --verbose --all --date=now --no-edit --amend` |
| `gc!` | `git commit --verbose --amend` |
| `gcn` | `git commit --verbose --no-edit` |
| `gcn!` | `git commit --verbose --no-edit --amend` |
| `gcs` | `git commit -S` |
| `gcss` | `git commit -S -s` |

View file

@ -197,6 +197,7 @@ alias gcan!='git commit --verbose --all --no-edit --amend'
alias gcans!='git commit --verbose --all --signoff --no-edit --amend'
alias gcann!='git commit --verbose --all --date=now --no-edit --amend'
alias gc!='git commit --verbose --amend'
alias gcn='git commit --verbose --no-edit'
alias gcn!='git commit --verbose --no-edit --amend'
alias gcf='git config --list'
alias gdct='git describe --tags $(git rev-list --tags --max-count=1)'

View file

@ -89,7 +89,7 @@ prompt_end() {
# Context: user@hostname (who am I and where am I)
prompt_context() {
if [[ "$USERNAME" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
prompt_segment black default "%(!.%{%F{yellow}%}.)%n@%m"
prompt_segment black white "%(!.%{%F{yellow}%}.)%n@%m"
fi
}
@ -238,7 +238,7 @@ prompt_status() {
[[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡"
[[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙"
[[ -n "$symbols" ]] && prompt_segment black default "$symbols"
[[ -n "$symbols" ]] && prompt_segment black white "$symbols"
}
#AWS Profile: