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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31312 invoked from network); 31 Aug 2021 01:30:51 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 31 Aug 2021 01:30:51 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1630373451; b=HZc4qH9n9A0y+guynQ67eNx3DrtYwPeVSodA7HbM96suDB7zm5xI/PKkz1Mx5Tok7ZOMRA3qOq MWjOLviWWWgCmhSJa+Idk/H0OSnFsyYcnT1awkGKgIEcwvc8dv5FDNp/8CDF33JUMSgmiN7/67 zCocE0/9zFYv8qzo6nzWlPkW6SPTZQWJ6GiQlgzMgppNrg9u+goi/ZNDsrwAFMss7Zn/DBeZkQ tACPTiRQSd253ZCtq04JMtXqudFUVXCD6Y3t7IJZi6rRj2hf1qFvwc8mETrYF0q89PAK/vFlyp /Q/1iLS6EtILg47XzRLQ2d9ZlZUCcDSho9VW/ZQ0lg2nWg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (email.dondley.com) smtp.remote-ip=34.203.132.18; dkim=pass header.d=dondley.com header.s=default header.a=rsa-sha256; dmarc=pass header.from=dondley.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1630373451; bh=72vrZW4MqBo5uct1yn3blOayijOtqM4IiytxmMin0OA=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Message-ID:References: In-Reply-To:Subject:To:From:Date:MIME-Version:DKIM-Signature:DKIM-Signature; b=qpIwjgbbJ5P//PKloAeShEzBTvGje4EgCbqiFl7CTBfFH6oXApzEDcFLpGwQfRs8+qNl+S/FsW KjYeFk6JM7p3vv1TLs62oF4EsXsxChzqLZ1O1VPo1mx3jFEZoAW8hj3QwoR/PP8QOteqVfJrNh tWaacGdATkJDJaQ8Tl0bYmxDobRQrGusl29YLZa+SluG/2Tt1nfxr3jWWzRdJIQR1nrvw2sUjW xYihLjvcHX+GDr6Dkzsai990D1sI2PUcaCXLb1dec4TU/RpqbDjr/LIRarSdwya3i0Ki7UcI2T CNL+BAv69ondUHa+nn61d3DTQdMvCtpsSQtL8sAZfAKafw==; 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-Transfer-Encoding: Content-Type:Message-ID:References:In-Reply-To:Subject:To:From:Date: MIME-Version:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=p1ByQ6BOcGWmuVWoiuUhQwnKsf/SCUcM0IGMvv5EqsM=; b=GXVz6hoSfEknUWfegq1FtBfbvE 1Zyg8mim7pY5qkX1zi/RE+978oH4RHKtZlPbDz7OqXFFW3wnkaSFgAYFWOcYJvKTia87w/e4C65At q8Yqxm3vqw8/52eW/eG8228CsWso90JDQjeYpiqFI35ewIybPEKLZIt1DAF+Ri9rE5q7jg2K+pLzg vCymcdsuK4t91BHIdGQqJ2tCP2SnP8uVtVkcOLQ/pDDsQEo0SRbgwF2Do4LvINdjwPpXE4oxp2TRa reRSo9cfAJDG01DG4o8HcEPyXt3Kq+I6rr6l6r9RZQswuFthgiDOE7Tc+qXf+pqQrtW9w9C4im1mI 9C6q2Gww==; Received: from authenticated user by zero.zsh.org with local id 1mKsbx-000P7Q-Od; Tue, 31 Aug 2021 01:30:49 +0000 Authentication-Results: zsh.org; iprev=pass (email.dondley.com) smtp.remote-ip=34.203.132.18; dkim=pass header.d=dondley.com header.s=default header.a=rsa-sha256; dmarc=pass header.from=dondley.com; arc=none Received: from email.dondley.com ([34.203.132.18]:44212) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mKsb2-000OOk-Hz; Tue, 31 Aug 2021 01:29:53 +0000 Received: from email.dondley.com (email.dondley.com [34.203.132.18]) by email.dondley.com (Postfix) with ESMTPSA id C283B208BE for ; Mon, 30 Aug 2021 21:29:50 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=dondley.com; s=default; t=1630373390; bh=72vrZW4MqBo5uct1yn3blOayijOtqM4IiytxmMin0OA=; h=Date:From:To:Subject:In-Reply-To:References:From; b=j/bufOXCC6eWKxIRYZk9jZPZ98DDW1ymEuBw+eEhECN9vlIwzgWCCmG8D+coKn078 ERKU7TkSOoK33zPojIzxZP8q8hSdhb0c61KIamDAKEqV6+7YG5btJfj4EqfIJ10Dpf KN5ome5nYGl9y2ymgfDEYNbJaV+sbQnHL4FhNdDr6SVRZTXGdu1+i/X4UERQ13Dfg4 Y9OecrCk1msfEYIUlbsABdFhkSDHYIgglPOqkn4xkB6vHs2PKSy7qySXPqT7mbKjrG IS1eqdjI0V36T81Z9tCh0ErgQQbV6Z8cg7N9Azq/ecSTSdI4oX9oAtQOjaEbsukUJi kU2UDhait6k4A== MIME-Version: 1.0 Date: Mon, 30 Aug 2021 21:29:49 -0400 From: Steve Dondley To: zsh-users@zsh.org Subject: Re: Best practices for managing aliases in ohmyzsh? In-Reply-To: References: <41fa241f119fdb9b8598293aad345823@dondley.com> <776abe09c579095258b2eef28a7ad5ca@dondley.com> User-Agent: Dondley Message-ID: X-Sender: s@dondley.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Seq: 27009 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: > Note that oh-my-zsh is a separate project that is not affiliated > with this one. There might be someone on this list who is familiar > with how it works, but it's hardly a guarantee. Right. I had hunted around for an ohmyzsh list but didn't find one (but if you know of one, let me know). My original question wasn't about ohmyzsh so sorry for going off on an unrelated tangent. >> >> If not, what's everyone else doing who has a >> >> couple hundred aliases. Are you just throwing them all into .zshrc or >> >> doing something to help manage all your aliases? >> >> > I'm the least qualified guy on the list, but I can tell you that you >> > can take advantage of all the built in complexities that zsh offers or >> > you can make it as dead simple as you desire. > > I don't use any aliases, and only a couple of functions. But, as > Ray said, you can organize things however you like. One rudimentary > method is to just separate your alias definitions into their own > file and source it from $ZDOTDIR/.zshrc: > > ### $ZDOTDIR/zsh_aliases ### > alias foo='one thing' > alias bar='another thing' > > ### $ZDOTDIR/.zshrc ### > . $ZDOTDIR/zsh_aliases Yeah, this is the direction I'm leaning. > Going further, you could use multiple files, organize them in a > directory hierarchy, etc. In bash, I had a fancy system for grouping aliases by category into their own files. It was probably more trouble than it's worth. Probably easiest to have one big file for aliases and comment off the different sections. > > 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. > I don't use any zsh configuration frameworks, but in my experience > they don't love it when you work with one foot inside their black > box and the other outside of it. I mostly installed it to experiment with the different prompts the built-in themes provided and out of curiosity to see what some of the advanced capabilities of zsh might be. It's probably not the brightest idea to learn zsh through the lens of ohmyzsh. > >> So what is the "real" .zszhrc supposed to be? > > Whatever you want it to be. The distribution usually includes the > "zsh-newuser-install" function, which is intended to interactively > guide you through creating a .zshrc file. > > https://zsh.sourceforge.io/Doc/Release/User-Contributions.html#User-Configuration-Functions OK, thanks. I appreciate the time.