Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Is it worthwhile to use oh-my-zsh?
- X-seq: zsh-users 24239
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: Is it worthwhile to use oh-my-zsh?
- Date: Sat, 7 Sep 2019 17:33:15 -0700
- Cc: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>, Peng Yu <pengyu.ut@xxxxxxxxx>, zsh-users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jtopAFRbedMuqj1Ofbb7xI+r79af9N7btp/oB/nKvwE=; b=fIIAUsyBsn0bPG50PCMh7W3YXwaQIGYOQ7R0dmRA+T9H1I01O6+eEAfJ4TNc4I4wZf KX3WesKzDj3ydNmyLxCCy8k2N/cD808eCMprw2CIbXq4mGGYKMXs+2DD0tY05lRyJ0lq W+kIfBM460hXvwMoo4SRyPdI3BEEpZvuCF4NgXLFw2uxTx7+nwkgaXXcrEWqog9iOibG fguEWvci/tWuRM+TDu4IOizbILqwTpCa0Mc5W2T29Bwp57t8XG8O3u3Ita/kQupvuSUd BSsnCSMM9ArZ6taPhCW82NWwCiuqfjgKBTSAO+Y26BXdyTtOkx0v5wTnQ1msN8F+qUpS 3aNg==
- In-reply-to: <87woejhnct.fsf@ft.bewatermyfriend.org>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CABrM6wn5sfs-PBT3Bt8f4u6u7k6PEv+U0jjdDg3O=Fa66zixMA@mail.gmail.com> <CAN=4vMpL1Mo=sfdVzhnyc-VxK=m7Ku8WMG-M6gvKsFa-LeBT+g@mail.gmail.com> <87woejhnct.fsf@ft.bewatermyfriend.org>
On Sat, Sep 7, 2019 at 1:19 PM Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx> wrote:
>
> Roman Perepelitsa wrote:
> > Note that vcs_info is likely to make your prompt noticeably sluggish.
>
> Depends on configuration. The defaults avoid most features that are
> particularly expensive.
I've been using the following lately ... note that I am pathologically
allergic to "setopt prompt_subst":
###
autoload -Uz add-zsh-hook
autoload -Uz vcs_info
vcs-info-v() { vcs_info; RPS1=${vcs_info_msg_0_% } }
add-zsh-hook precmd vcs-info-v
zstyle ':vcs_info:*' enable git cvs
zstyle ':vcs_info:*' actionformats \
'%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
zstyle ':vcs_info:*' formats \
'%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{5}]%f '
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
# Add up/down arrows after branch name, if there are changes to pull/to push
# Credit Danial Shahaf, edited to remove hardwired Unicode arrows
zstyle ':vcs_info:git+post-backend:*' hooks git-post-backend-updown
+vi-git-post-backend-updown() {
git rev-parse @{upstream} >/dev/null 2>&1 || return
local -a x; x=( $(git rev-list --left-right --count HEAD...@{upstream} ) )
hook_com[branch]+="%f" # end coloring
# Edit if terminal supports Unicode arrows
(( x[2] )) && hook_com[branch]+='<' # $'\u2193'
(( x[1] )) && hook_com[branch]+='>' # $'\u2191'
return 0
}
PS1='%# '
autoload promptinit
promptinit
prompt bart green white yellow
git-chpwd () {
prompt_bart_ps1
local remote=$(git config --get remote.origin.url)
# Hack PS1 from bart theme to insert git origin in place of current directory
# This tells me which repository the "master" branch belongs to
PS1=${PS1:s/%8~/${remote:-%8~}}
}
add-zsh-hook chpwd git-chpwd
###
Regarding oh-my-zsh, if I were going to start using a plugin system,
I'd probably use the one Sebastian has been working on instead.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author