From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24552 invoked by alias); 13 Aug 2018 13:49:45 -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: 23570 Received: (qmail 19514 invoked by uid 1010); 13 Aug 2018 13:49:45 -0000 X-Qmail-Scanner-Diagnostics: from mail-wr1-f43.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.221.43):SA:0(-1.9/5.0):. Processed in 1.659221 secs); 13 Aug 2018 13:49:45 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: luomat@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=4+Az+/mh2mUmEf3wXauIcaC/TVNRvfikMl8XN0w3Wnw=; b=ry/tLQ7GHO4o3fjWWEHz+BEUI18fg7/y43vOU/Gw+b0UGSl8a6PYzbviX7LtTS8sMw g4bWLNZkQ7qwhw1pL3nk+jtla0V9pgi0X2PE2jtDHSRpHPpV9B2M7rn8LR2nRUuuSCdV QQuglkzsrk358vIrYTBzCZZQEEkqjZ9LMLtpHQuFY3Uy6PMDLJRevRXpN1HLopihvmnR ZgMGU2SYA8L38sEo80viDozXd2AlBWNTiCrjDgSWpvstQ5Peu1zEcztzyUWFXpokaL2y yihN5wOXHSUnJ93LxMrll+yZgq6d5vsVtOyujgXsmlfcO0g27BeO6NGuYJ6Iqyc6+lFs 31PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=4+Az+/mh2mUmEf3wXauIcaC/TVNRvfikMl8XN0w3Wnw=; b=KX2QKV5UD6shJm3Gv8nKg+RZpNdtR2ABMn4N+WvdK+3e1eMMDLJMOjv156+EQUwUb6 ZKMoVUGefz1/HRI0anHZu4M390hEY1g3mOFfs8s4Dbp4EIKlsprxcdPpwhqsueMBlBmT VbKyhZtBhPU9hpVPnrkKEEKjInS9abWAZd0uC0nib13jyqZMMKfDY1+vw1recOq5xVhr qo0iatmGzZxPUx7v3ZvfQr9kWz7W8S8pQly935wa2mhzaDz/nHXhMDSNAf7lJaDSyu8i Yw8wj0L7pcgaqYkNU/ZbgJR4fasQjTeYdI46dLrGK6IQk8nPLbgVgHUeGc7e9mu8FCOO Y9YA== X-Gm-Message-State: AOUpUlE4ij5ShoalV56eh384qvY6OoQdJ2CYgPw1Q+97va4/WLrq2iDZ Ck9bWuIAkYAVdn8LNjOYH4ZKgvZjC9hKVuEVeOWnsCiF X-Google-Smtp-Source: AA+uWPwk504Qng+88w/UpH6zpP4FZhf9OvU3s7DIRdkOMAEhveL8efkJ0/h53CIDVrgH/T6AeYBAk5PfAfMx2S8TpTs= X-Received: by 2002:a5d:4a07:: with SMTP id m7-v6mr10787266wrq.8.1534168179005; Mon, 13 Aug 2018 06:49:39 -0700 (PDT) MIME-Version: 1.0 From: TJ Luoma Date: Mon, 13 Aug 2018 09:49:02 -0400 Message-ID: Subject: separating functions, fpath, and autoload To: Zsh-Users List Content-Type: multipart/alternative; boundary="00000000000055dea70573515d76" --00000000000055dea70573515d76 Content-Type: text/plain; charset="UTF-8" I'm in the midst of an effort to try to learn some of zsh's more powerful features, since I've been using zsh forever and feel like I only use 1% of what it can do. One of the things that I've wanted to do for awhile is separate out some of my more complex functions to remove them from my .zshrc file and put them into their own files. This should make them easier to track/change/etc and it makes things a lot easier to read and debug. Unfortunately, I can't seem to get it to work right. I'm sure I'm doing something wrong because I don't really know what I'm doing, so I'll explain what I've tried, and hopefully someone can explain where I've gone wrong. I added this to my .zshrc if [ -d "$ZDOTDIR/functions" ] then fpath=($ZDOTDIR/functions $fpath) fi The goal there was to add '$ZDOTDIR/functions' to the functions list, which I think is the right way to do this. I can verify that works, I think, by using 'echo $fpath': $ echo $fpath /Users/luomat/Dropbox/dotfiles/zsh/completion /Users/luomat/Dropbox/dotfiles/zsh/functions /usr/local/share/zsh/site-functions /usr/share/zsh/site-functions /usr/share/zsh/5.3/functions /Users/luomat/Dropbox/dotfiles is my $ZDOTDIR The first file in '/Users/luomat/Dropbox/dotfiles/zsh/functions' is called 'msg'. For simplicity's sake, let's assume the contents of 'msg' is simply this: function msg { echo "$@" } (It's actually more complicated than that, but that's the overall idea.) I tried that, and then I tried autoload msg and I didn't get an error, but when I check 'which msg' I get this: msg () { # undefined builtin autoload -X } so I've messed up something along the line. Any help would be appreciated. Thanks! Tj -- TJ Luoma TJ @ MacStories Personal Website: luo.ma (aka RhymesWithDiploma.com ) Twitter: @tjluoma --00000000000055dea70573515d76--