From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 14873 invoked from network); 31 Aug 2021 08:27:39 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 31 Aug 2021 08:27:39 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1630398459; b=qRhprZ9+5whpgo1OKhtg19Cbd0QJCWAGoUQO+z5bN+bWffPjT6j5xzCL3j9ruWSHmFKe63KMH5 YblrFBcIMg+aJeXPiO2y6Ai+wJ801jMkucV+WnFUplBzONSeQfqZLyq8gxgn4INSwtu/FmLmDb zQ5IPWpxEOkAUv7XPN2m9eBOWSNLlBaqF926Zrujr3e1HIHWOpx9zuLk2O/iNdkDGuWO+W5O6o K4k6SSN6TTn8xIxBgQm261/H0XImaKRVsH1vGzjgXDkqM8s7snSN9LIPS9GIHDIaXkxcbH7+vF G88X5809mvNIbbpQlESLvo3DkZiTDYgJEH7G8ryGwztC7Q==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-qt1-f171.google.com) smtp.remote-ip=209.85.160.171; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1630398459; bh=UTlTbgWd8boSV/xZg9GhXvKh1c36S6OTa1Q7wkYZEzY=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=l7RZtffLbvnb4yiZWps4iQu+KQef3MxfzhBGIyMU+5ZHIuiZn+/nQLcXxyGd2DBqs+m0da+Nx6 vkchIiuw7BOT2MdM8q4HlMZDfVTJ4xkVCmJib7KdKjvidoVNugagiYiUlaUoTp6v+zDUmEoOm2 /AM7Fz0FbkLXiNHY8EkukgwpJ+Azt8Jr6BX5nNpDzn2OyAVDxOt1mayFf578nuS1iwCxM76w3Z BbXswHqPGiKuCgol+qsG0x9ZA5W4P7DYUeVkVEwoi3vw5BAVUH3PeIp/kS+SIlErnQ0K04vUTh jZEZyVy96lUugdznTmckW94Y2VxsJ/oP+uib+QWHl8Tm/w==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=YkTrdsUGoH7Fuhr/GwIZG1yzgrrddm8DOsxwBH2b9HI=; b=O557o8LnxvySB3uBFkBMHYPW3b cizHiBugaKwuql1Pp/tg52g+IdguYtUNDB4oCJH2I/4L25lsxNGmiVqWoZ2qJbke/WA0TYs//nVZ8 dHka5jItbZ4g7vmkIV19sWLiGeDNTq2rGBGX0Tk+HlFN7iDyszSL/khmyXdH6qW2dSGiAHH7IH8zY GT6cveXdE7CVbGe3VkRPUURpfisa2qfUEekVcnxXmkrS2o12ao4eWfdfvQrpNAkU9aWMshYPuKZ/z r2o7GW5jDWyycxrVP7VO86Tc2PB3nKoFFYsn8jnV+DurcazjD6AnFUaWpLF8r+6EphW25+O6b2TxO Fo4K5TPw==; Received: from authenticated user by zero.zsh.org with local id 1mKz7L-000MA0-8o; Tue, 31 Aug 2021 08:27:39 +0000 Authentication-Results: zsh.org; iprev=pass (mail-qt1-f171.google.com) smtp.remote-ip=209.85.160.171; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-qt1-f171.google.com ([209.85.160.171]:35561) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mKz6m-000LTd-P3; Tue, 31 Aug 2021 08:27:05 +0000 Received: by mail-qt1-f171.google.com with SMTP id t9so13932122qtp.2 for ; Tue, 31 Aug 2021 01:27:04 -0700 (PDT) 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=YkTrdsUGoH7Fuhr/GwIZG1yzgrrddm8DOsxwBH2b9HI=; b=nf2hYv4lzQEs+wHgI9JXHZ98LpZ5Kh0bxEirmjPQLpEI1RyJs8drPw8IZlqLyfaJ0j UasbdTRoBacFFScXNWYMmuoOIPfJYO+B8XTFoxS7HdiajCNaBf7Pb5nbGTDHmUnM9iXT W31LJh2nFE9RIUlLwAOPO+CdLbxY/CnmN5FLG/stEFV2eWpDiLYGHvJc+2Ew1Vue0r4G uaX9BC8jA9anRngWpJiaEP89btqEZMfEuMNW3eN9XFBDdqNWxMBWkA8AmABrq3StZF0d MYgbfpxjKKYGs0X8jBM7p/cdgeNcoFTDquUGgtxKQkcHtnxVyAwmGlmHEYhtx9YFeZY8 phpw== 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=YkTrdsUGoH7Fuhr/GwIZG1yzgrrddm8DOsxwBH2b9HI=; b=ZeiNVWp7SH8ROqfI6uQN6yjIEI2vcGL7tWnTtzs/vUT9WPDVUvN7+70GG/ArF1IxZW faxIYsObknTWMBDJVsFEC7ymKM7tqef8WF3n7sevpBu1rd0RNj5EgxpM7ZlSZuXcQ/z1 AXfXGw1s3JoYtwCTm8Oh/xbR70GhGor5lvY3JtTeBO7drJmlXkliL9Y1ECYW6Hb3pf3W m3nDyjnnHTUB+ERBzARabPHn0mKKW5xNkjBUrRx1NJ2Q+yuBeotm1ee6r1jDWA1ObLSk lXLlsXH7WIHBFDyLb5A/3oR+Q07ZRt7/W5yeqJARLDPi4vZVPR2L6ND84mr+8TzuxCE6 zOhQ== X-Gm-Message-State: AOAM532IwiwAgoNsrGzNqe6+bnQm+Ifr5TAiUKN493TOg4Ew6Dru2itx MHbJ11p2XrUmlELq+OrwQUiestx75PHEIwIhf3D74q+eoY4= X-Google-Smtp-Source: ABdhPJySCgfYkP051S0HNM8WBh4qD7GynrhsGbjdMnO5luYjud+a3j7fBgqFBvpHi8b3NOrXkiCKZVGPS2a7c7cbst4= X-Received: by 2002:a05:622a:1:: with SMTP id x1mr1616715qtw.198.1630398423582; Tue, 31 Aug 2021 01:27:03 -0700 (PDT) MIME-Version: 1.0 References: <41fa241f119fdb9b8598293aad345823@dondley.com> <776abe09c579095258b2eef28a7ad5ca@dondley.com> In-Reply-To: <776abe09c579095258b2eef28a7ad5ca@dondley.com> From: Roman Perepelitsa Date: Tue, 31 Aug 2021 10:26:52 +0200 Message-ID: Subject: Re: Best practices for managing aliases in ohmyzsh? To: Steve Dondley Cc: Ray Andrews , Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 27012 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Tue, Aug 31, 2021 at 1:23 AM Steve Dondley wrote: > > Now you've got me wondering. While I was bumbling around today, I > noticed I had an ~/.oh-my-zsh/.zshrc file. This is unexpected. Oh My Zsh installer does not create this file. > I'm only using the ~/.zshrc file, though. It has just one line: > ZSH_THEME="powerlevel9k/powerlevel9k". I'm guessing that's the > default because I don't remember editing it. The default theme in Oh My Zsh is "robbyrussell". powerlevel9k is not included in Oh My Zsh. The fact that you are using it means you've installed it separately (or copied a config from someone else who did). Note that development of powerlevel9k has been discontinued and the project has been archived. On Tue, Aug 31, 2021 at 3:30 AM Steve Dondley wrote: > > Right. I had hunted around for an ohmyzsh list but didn't find one (but > if you know of one, let me know). Oh My Zsh uses Discord for questions and discussions of this kind. You can find a link at https://ohmyz.sh/. > > In general, zsh will not run bash code 100% correctly unless it is > > written *extremely* portably. Your old functions almost certainly > > need to be tweaked to one degree or another. > > My functions are very simple so I haven't run into any problems yet. But > I will definitely keep this in mind going forward. This suggests that all or at least most of your functions could be scripts instead. Place each one in a separate executable file in a directory in your PATH (~/bin is a common choice), slap a shebang on each and you are good to go. This way you can use your utilities from any shell and won't have to port them whenever you switch shells. Since these utilities are proven to work in bash, use `#!/usr/bin/env bash` as shebang. You *can* also make them auto-loadable functions in zsh but you probably shouldn't. The only advantage would be that they'll execute faster but that matters only in rare special cases. The disadvantage is that you would have to port your scripts to zsh, make sure they can run with various shell options, don't pollute interactive shell environment, etc, Roman.