From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 005c2d2e for ; Sat, 7 Sep 2019 13:59:14 +0000 (UTC) Received: (qmail 29648 invoked by alias); 7 Sep 2019 13:59:06 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24237 Received: (qmail 29726 invoked by uid 1010); 7 Sep 2019 13:59:06 -0000 X-Qmail-Scanner-Diagnostics: from mail-io1-f51.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25559. spamassassin: 3.4.2. Clear:RC:0(209.85.166.51):SA:0(-2.0/5.0):. Processed in 3.534771 secs); 07 Sep 2019 13:59:06 -0000 X-Envelope-From: roman.perepelitsa@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.166.51 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HhbvAprplRN2irY1b8/wi7wxOsv0O1pAbMEY2NKXI6w=; b=ru9TOlnKT30Ze0miOY1+BE5N5R+MajUTKLQgy0tsLBDNziguluxLaGcRIV2S6oQawG sLbVxSOkGtuGUS21tVVNGIUc7wZ+BdE1hFPhQaW+2p0CC1Ephyh+sl1Wz9av6AjHnMPo x3G/McjoL4lhBoL8ImtiAzTWVBYMN+Sb6inVNs26yBT0aQ22yCu6PgYypvYOOtpDTbeQ aWsS9Lu1WXWUQxigN8om53vAKFT3Q9c0LJ0O6Grrsfk5HmHi90pQNwaLmT6Ht3csQ+77 RT+mnefDXP1dQvp4KVLz2m3F+ZZtnst16XLZopNnbx9DBe3tg2Et4mkAAgdCVBFgJzc2 TXng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HhbvAprplRN2irY1b8/wi7wxOsv0O1pAbMEY2NKXI6w=; b=KMXItlWy4PCFSQpVxkWYtxS5ez4AE9ZAIsBcY3o6vFQLTFsw/MuORrZQrYHkYuuGiG vnxxRHUIgUnVv9irJAkfEtHNeMFjhCcVwEVbRVLA2qCZJ+QCnYSax4+/G+W+yXm/FpgA C+Q4xja7zM/KuQEOABAYVBrkvDsV6en4+lRvIcYdB1dCN6Tgdbym4XaWLau5bECp/eC5 +c2n0SCkB/b/Lu07ZTO9JqiWVFxSvOxAIiwRvFzdpKnOZKS55jbyA6In0zlhkoGq2Rm/ W0e0yyhTS+y6BRqqLoBmrj+i/eusB8UDJhC7v3rHkHeBWAZYNEb6Igu214g/VeG09SeP Ih7Q== X-Gm-Message-State: APjAAAV5zMj+3Ihkhf+mRcmG8vuohAwYfU4x9GMa3NpQC918GdMIWdhC zIrSH2OF08CAKiB+S9K/JgFp7NirdXFF1Bz4+UA= X-Google-Smtp-Source: APXvYqwvQem9sAUUKKfZp2tb167W4hIwH3/MXV8ldPzXGWiuN+1ioh4kn9NSY/9lkjuxg55fSi8ZwArHCPy8ydfTcC4= X-Received: by 2002:a5d:97cf:: with SMTP id k15mr16293461ios.151.1567864709669; Sat, 07 Sep 2019 06:58:29 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Roman Perepelitsa Date: Sat, 7 Sep 2019 15:58:18 +0200 Message-ID: Subject: Re: Is it worthwhile to use oh-my-zsh? To: Peng Yu Cc: zsh-users Content-Type: text/plain; charset="UTF-8" On Fri, Sep 6, 2019 at 8:38 PM Peng Yu wrote: > > Hi, > > I just have a vanilla ~/.zshrc. I'd like something essential things > like PS1 set to my pwd and hostname, etc. If you are asking how this can be done, see http://zsh.sourceforge.net/Intro/intro_14.html and http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html. Here's a prompt with magenta hostname, blue current directory and a prompt character. The latter is red on error, green on success; # if running with privileges, % if without. PROMPT='%F{magenta}%m %F{blue}%~ %F{%(?.green.red)}%# %f' The docs linked above should allow you to easily customize this prompt to your needs. > I saw people use things like > oh-my-zsh to make some fancy things like showing git branches, etc., > if in a git repo. But if I remember it correctly, it could cause a > little sluggish that can be sensed. ZSH files and/or functions that set PROMPT and other prompt-related parameters are usually called themes. For example, here's a theme called foobar: function prompt_foobar_setup() { PROMPT='%F{magenta}%m %F{blue}%~ %F{%(?.green.red)}%# %f' } To enable theme foobar you can call prompt_foobar_setup. If you make this function autoloadable, you'll also be able to enable it with `prompt foobar`. There is little value in defining prompt_foobar_setup as opposed to simply assigning PROMPT='...' in ~/.zshrc. ZSH comes with a few builtin themes -- that is, with a few functions similar to the above. The prompts they define are fairly simple, and they are all fast. You can access them by typing the following command: autoload promptinit promptinit prompt -h Oh My Zsh is a collection of ZSH configuration files. These files may define aliases, functions, key bindings, completion options, etc. Oh My Zsh also contains lots of themes: https://github.com/robbyrussell/oh-my-zsh/wiki/Themes. Some of them are quite sophisticated and most are slow. You can use a theme from Oh My Zsh without using any other configuration scripts from it. Likewise, you can use any theme (including one of your own making) while simultaneously using some configuration files from Oh My Zsh. On Sat, Sep 7, 2019 at 2:23 PM Daniel Shahaf wrote: > For git information, see vcs_info in zshcontrib(1), and Misc/vcs_info-examples > in the source distribution. Note that vcs_info is likely to make your prompt noticeably sluggish. Roman.