{"id":22808179,"url":"https://github.com/sixarm/zsh-config","last_synced_at":"2025-04-13T04:10:50.630Z","repository":{"id":1356871,"uuid":"1304762","full_name":"SixArm/zsh-config","owner":"SixArm","description":"SixArm.com → Z shell → zsh configuration","archived":false,"fork":false,"pushed_at":"2023-09-15T19:31:17.000Z","size":143,"stargazers_count":212,"open_issues_count":0,"forks_count":12,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-05-02T00:54:46.070Z","etag":null,"topics":["dotfiles","etc","zsh"],"latest_commit_sha":null,"homepage":"http://sixarm.com","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SixArm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2011-01-29T00:06:39.000Z","updated_at":"2024-04-08T15:32:32.000Z","dependencies_parsed_at":"2024-04-19T15:09:01.888Z","dependency_job_id":null,"html_url":"https://github.com/SixArm/zsh-config","commit_stats":{"total_commits":170,"total_committers":6,"mean_commits":"28.333333333333332","dds":0.3176470588235294,"last_synced_commit":"83e48aeed5bb6a0b7a893fe2147fa06b324863ad"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SixArm%2Fzsh-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SixArm%2Fzsh-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SixArm%2Fzsh-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SixArm%2Fzsh-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SixArm","download_url":"https://codeload.github.com/SixArm/zsh-config/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248661704,"owners_count":21141450,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotfiles","etc","zsh"],"created_at":"2024-12-12T11:08:16.019Z","updated_at":"2025-04-13T04:10:50.609Z","avatar_url":"https://github.com/SixArm.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Z shell configuration\n\nWe use Z shell extensively, on many kinds of systems. We use Z shell configurations and conventions that can help us with compatibility, flexibility, and portability. This repo describes our configurations and conventions. This repo has our typical starter setup for Z shell aliases, functions, settings, etc. In practice this works well with other Z shell tools, such as oh-my-zsh.\n\n\n## zsh startup files\n\nThere are five startup files that zsh will read commands from in order:\n\n```zsh\nzshenv\nzprofile\nzshrc\nzlogin\nzlogout\n```\n\n\n## zsh startup files: when they load and what they do\n\n\n### zshenv\n\n`zshenv` is sourced on all invocations of the shell, unless the -f option is set.\n\nWhat goes in it:\n\n  * Set up the command search path\n\n  * Other important environment variables\n\n  * Commands to set up aliases and functions that are needed for other scripts\n\nWhat does NOT go in it:\n\n  * Commands that produce output\n\n  * Anything that assumes the shell is attached to a tty\n\n\n### zprofile\n\n`zprofile` is sourced in login shells. It is meant as an alternative to `zlogin` for `ksh` fans; the two are not intended to be used together, although this could certainly be done if desired.\n\nWhat goes in it:\n\n  * Commands that should be executed only in login shells.\n\n  * As a general rule, it should not change the shell environment at all.\n\n  * As a general rule, set the terminal type then run a series of external commands e.g. fortune, msgs, etc.\n\nWhat does NOT go in it:\n\n  * Alias definitions\n\n  * Function definitions\n\n  * Options\n\n  * Environment variable settings\n\n\n### zshrc\n\n`zshrc` is sourced in interactive shells.\n\nWhat goes in it:\n\n  * Commands to set up aliases, functions, options, key bindings, for interactive use etc.\n\n\n### zlogin\n\n`zlogin` is like `zprofile`, except sourced after zshrc.\n\n\n### zlogout\n\n`zlogout` is sourced when login shells exit.\n\n\n### extras\n\nSome zsh setups provide more files that are not read by zsh:\n\n  * `.zsh-update`: contains a timestamp of the most recent update\n\n  * `.zshrc-e`: an example file; the Z shell convention is example files end in `-e`.\n\n\n\n## zsh file locations\n\nThe default location for zsh system files:\n\n```zsh\n/etc/zshenv\n/etc/zprofile\n/etc/zshrc\n/etc/zlogin\n/etc/zlogout\n```\n\nThe default location for zsh user files:\n\n```zsh\n$HOME/.zshenv\n$HOME/.zprofile\n$HOME/.zshrc\n$HOME/.zlogin\n$HOME/.zlogout\n```\n\nThe custom location for zsh user files uses the environment variable `ZDOTDIR`:\n\n```zsh\n${ZDOTDIR:-$HOME}/.zshenv\n${ZDOTDIR:-$HOME}/.zprofile\n${ZDOTDIR:-$HOME}/.zshrc\n${ZDOTDIR:-$HOME}/.zlogin\n${ZDOTDIR:-$HOME}/.zlogout\n```\n\n\n## zsh directory locations\n\nOur location for zsh system directories:\n\n```zsh\n/etc/zshenv.d\n/etc/zprofile.d\n/etc/zshrc.d\n/etc/zlogin.d\n/etc/zlogout.d\n```\n\nOur default location for zsh user directories:\n\n```zsh\n$HOME/.config/zshenv.d\n$HOME/.config/zprofile.d\n$HOME/.config/zshrc.d\n$HOME/.config/zlogin.d\n$HOME/.config/zlogout.d\n```\n\nOur custom location for zsh user directories uses the environment variable `XDG_CONFIG_HOME`:\n\n```zsh\n${XDG_CONFIG_HOME:-$HOME/.config}/zshenv.d\n${XDG_CONFIG_HOME:-$HOME/.config}/zprofile.d\n${XDG_CONFIG_HOME:-$HOME/.config}/zshrc.d\n${XDG_CONFIG_HOME:-$HOME/.config}/zlogin.d\n${XDG_CONFIG_HOME:-$HOME/.config}/zlogout.d\n```\n\n\n## Repo files\n\nThis repo contains our Z shell conventions for subdirectories and also our files that we like to use with multiple teams.\n\nNotable subdirectories:\n\n  * `zshenv.d/functions` is for functions.\n\n  * `zshenv.d/programs` is for configuring environment programs via environment variables, such as `$EDITOR`, `$PAGER`, etc.\n\n  * `zshenv.d/settings` is for Z shell settings, such as for completion, history, etc.\n\n  * `zshrc.d/aliases` is for aliases, such as `g` for `git`, `now` for printing the current time, etc.\n\n\n### Conventions\n\nAlias conventions:\n\n  * For an alias that is a one-letter shortcut, we use a naming convention for the file: the letter, an equal sign, and the result. For example, the file `g=git.zsh` is the alias that sets `g` to run `git`.\n\n  * For an alias that is intended to launch a program, we use a convention of trying probable locations for the tool. For example, for the alias `firefox`, we look in order in `/opt` (e.g. typical for our custom installs), then on the path, then in the typical macOS location.\n\n\nEnvironment program conventions:\n\n  * `$EDITOR` for editing text files, such as `vi` or `emacs`.\n\n  * `$PAGER` for showing text files, such as `more` or `less`.\n  \n  * `$FINDER` for searching text files, such as `grep` or `rg`.\n\n  * `$CLIPPER` for copying text to a clipboard, such as `xclip` or `pbcopy`.\n  \n  * `$DATER` for showing dates and times, such as `date` or `gdate`.\n\n  * `$JUMPER` for moving among directories, such as `jump` or `jumpdir`.\n\n\nDate/time format conventions:  \n\n  * We default to nanoseconds precision (not seconds precision), because we use subsecond precision on some of our systems.\n\n  * We default to UTC timezone and the format \"+00:00\" (not \"Z\"), because this maximizes our compatibility with fintech systems and logs.\n\n\n\n### Install\n\nClone:\n\n```zsh\ngit clone https://github.com/sixarm/sixarm_zsh_config\n```\n\nMove the directories and files as you like, to wherever you want.\n\n\n### Install for one user using the way we prefer\n\nFor one user, we prefer to put files in a user's configuration directory:\n\n```zsh\nconfig=${XDG_CONFIG_HOME:-$HOME/.config}\n```\n\nMake directories:\n\n```zsh\nmkdir -p $config/{zshenv.d,zprofile.d,zshrc.d,zlogin.d,zlogout.d}\n```\n\nCopy files:\n\n```zsh\ncp -R sixarm-zsh-config/zshenv.d/* $config/zshenv.d\ncp -R sixarm-zsh-config/zprofile.d/* $config/zprofile.d\ncp -R sixarm-zsh-config/zshrc.d/* $config/zshrc.d\ncp -R sixarm-zsh-config/zlogin.d/* $config/zlogin.d\ncp -R sixarm-zsh-config/zlogout.d/* $config/zlogout.d\n```\n\nAdd this to the user file `.zshenv`:\n\n```zsh\nconfig=${XDG_CONFIG_HOME:-$HOME/.config}\nfor file in $config/zshenv.d/**/*(.N)\ndo \n    [ -x \"$file\" ] \u0026\u0026  . \"$file\"\ndone\n```\n\nAdd this to the user file `.zprofile`:\n\n```zsh\nconfig=${XDG_CONFIG_HOME:-$HOME/.config}\nfor file in $config/zprofile.d/**/*(.N)\ndo \n    [ -x \"$file\" ] \u0026\u0026  . \"$file\"\ndone\n```\n\nAdd this to the user file `.zshrc`:\n\n```zsh\nconfig=${XDG_CONFIG_HOME:-$HOME/.config}\nfor file in $config/zshrc.d/**/*(.N)\ndo \n    [ -x \"$file\" ] \u0026\u0026  . \"$file\"\ndone\n```\n\nAdd this to the user file `.zlogin`:\n\n```zsh\nconfig=${XDG_CONFIG_HOME:-$HOME/.config}\nfor file in $config/zlogin.d/**/*(.N)\ndo \n    [ -x \"$file\" ] \u0026\u0026  . \"$file\"\ndone\n```\n\nAdd this to the user file `.zlogout`:\n\n```zsh\nconfig=${XDG_CONFIG_HOME:-$HOME/.config}\nfor file in $config/zlogout.d/**/*(.N)\ndo \n    [ -x \"$file\" ] \u0026\u0026  . \"$file\"\ndone\n```\n\n\n### Install for the system using the way we prefer\n\nFor the system, we prefer to put files in the system's `/etc` directory:\n\n```zsh\nconfig=/etc\n```\n\nMake directories:\n\n```zsh\nmkdir -p $config/{zshenv.d,zprofile.d,zshrc.d,zlogin.d,zlogout.d}\n```\n\nCopy files:\n\n```zsh\ncp -R sixarm-zsh-config/zshenv.d/* $config/zshenv.d\ncp -R sixarm-zsh-config/zprofile.d/* $config/zprofile.d\ncp -R sixarm-zsh-config/zshrc.d/* $config/zshrc.d\ncp -R sixarm-zsh-config/zlogin.d/* $config/zlogin.d\ncp -R sixarm-zsh-config/zlogout.d/* $config/zlogout.d\n```\n\nAdd this to the system file `zshenv`:\n\n```zsh\nconfig=/etc\nfor file in $config/zshenv.d/**/*(.N)\ndo \n    [ -x \"$file\" ] \u0026\u0026  . \"$file\"\ndone\n```\n\nAdd this to the system file `/etc/zprofile`:\n\n```zsh\nconfig=/etc\nfor file in $config/zprofile.d/**/*(.N)\ndo \n    [ -x \"$file\" ] \u0026\u0026  . \"$file\"\ndone\n```\n\nAdd this to the system file `zshrc`:\n\n```zsh\nconfig=/etc\nfor file in $config/zshrc.d/**/*(.N)\ndo \n    [ -x \"$file\" ] \u0026\u0026  . \"$file\"\ndone\n```\n\nAdd this to the system file `zlogin`:\n\n```zsh\nconfig=/etc\nfor file in $config/zlogin.d/**/*(.N)\ndo \n    [ -x \"$file\" ] \u0026\u0026  . \"$file\"\ndone\n```\n\nAdd this to the sytem file `zlogout`:\n\n```zsh\nconfig=/etc\nfor file in $config/zlogout.d/**/*(.N)\ndo \n    [ -x \"$file\" ] \u0026\u0026  . \"$file\"\ndone\n```\n\n\n### Contribute your files\n\nIf you have zsh files that you like and that are good for many people, then send them along. We welcome additions, and also welcome pull requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsixarm%2Fzsh-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsixarm%2Fzsh-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsixarm%2Fzsh-config/lists"}