Repository: SixArm/sixarm_zsh_config
Branch: main
Commit: 8145e52bdb7a
Files: 66
Total size: 43.1 KB
Directory structure:
gitextract_pdj_rzdr/
├── CITATION.cff
├── CODEOWNERS
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── README.md
├── zlogin.d/
│ └── .keep
├── zlogout.d/
│ └── .keep
├── zprofile.d/
│ └── .keep
├── zshenv.d/
│ ├── .keep
│ ├── functions/
│ │ ├── rm-file.zsh
│ │ ├── rsync-mirror-exact.zsh
│ │ ├── rsync-mirror-progress.zsh
│ │ └── rsync-mirror.zsh
│ ├── programs/
│ │ ├── browser.zsh
│ │ ├── clipper.zsh
│ │ ├── dater.zsh
│ │ ├── editor.zsh
│ │ ├── finder.zsh
│ │ ├── jumper.zsh
│ │ └── pager.zsh
│ └── settings/
│ ├── auto-cd-on.zsh
│ ├── beep-off.zsh
│ ├── chase-links-off.zsh
│ ├── completion.zsh
│ ├── history.zsh
│ ├── io.zsh
│ ├── less.zsh
│ └── opt.zsh
└── zshrc.d/
├── .keep
├── aliases/
│ ├── aliases.zsh
│ ├── apache.zsh
│ ├── b=browser
│ ├── bundle.zsh
│ ├── c=clipper.zsh
│ ├── cargo.zsh
│ ├── cd.zsh
│ ├── chrome.zsh
│ ├── curly.zsh
│ ├── e=editor.zsh
│ ├── f=finder.zsh
│ ├── ff=find-fast.zsh
│ ├── firefox.zsh
│ ├── g=git.zsh
│ ├── j=jumper.zsh
│ ├── l=ls.zsh
│ ├── map.zsh
│ ├── now.zsh
│ ├── p=pager.zsh
│ ├── perl.zsh
│ ├── ruby.zsh
│ ├── rubymine.zsh
│ ├── sha.zsh
│ ├── shell.zsh
│ ├── timer.zsh
│ ├── tmux.zsh
│ └── vbox.zsh
├── apple-terminal.zsh
├── autoload-compinit.zsh
├── bindkey.zsh
├── brew-asdf.zsh
├── chruby.zsh
├── disable-log.zsh
├── options.zsh
├── prompts.zsh
├── rbenv.zsh
└── zstyle.zsh
================================================
FILE CONTENTS
================================================
================================================
FILE: CITATION.cff
================================================
cff-version: 1.2.0
title: Z shell configuration
message: >-
If you use this work and you want to cite it,
then you can use the metadata from this file.
type: software
authors:
- given-names: Joel Parker
family-names: Henderson
email: joel@joelparkerhenderson.com
affiliation: joelparkerhenderson.com
orcid: 'https://orcid.org/0009-0000-4681-282X'
identifiers:
- type: url
value: 'https://github.com/SixArm/zsh-config/'
description: Z shell configuration
repository-code: 'https://github.com/SixArm/zsh-config/'
abstract: >-
Z shell configuration
license: See license file
================================================
FILE: CODEOWNERS
================================================
* codeowners@sixarm.com
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[INSERT CONTACT METHOD].
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of
actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the
community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing
To contribute code, you can create a pull request, or send us email, or chat with us, whichever is easiest for you.
To contribute money, you can use PayPal to send money to sixarm@sixarm.com, or email us to ask about other ways.
================================================
FILE: README.md
================================================
# Z shell configuration
We 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.
## zsh startup files
There are five startup files that zsh will read commands from in order:
```zsh
zshenv
zprofile
zshrc
zlogin
zlogout
```
## zsh startup files: when they load and what they do
### zshenv
`zshenv` is sourced on all invocations of the shell, unless the -f option is set.
What goes in it:
* Set up the command search path
* Other important environment variables
* Commands to set up aliases and functions that are needed for other scripts
What does NOT go in it:
* Commands that produce output
* Anything that assumes the shell is attached to a tty
### zprofile
`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.
What goes in it:
* Commands that should be executed only in login shells.
* As a general rule, it should not change the shell environment at all.
* As a general rule, set the terminal type then run a series of external commands e.g. fortune, msgs, etc.
What does NOT go in it:
* Alias definitions
* Function definitions
* Options
* Environment variable settings
### zshrc
`zshrc` is sourced in interactive shells.
What goes in it:
* Commands to set up aliases, functions, options, key bindings, for interactive use etc.
### zlogin
`zlogin` is like `zprofile`, except sourced after zshrc.
### zlogout
`zlogout` is sourced when login shells exit.
### extras
Some zsh setups provide more files that are not read by zsh:
* `.zsh-update`: contains a timestamp of the most recent update
* `.zshrc-e`: an example file; the Z shell convention is example files end in `-e`.
## zsh file locations
The default location for zsh system files:
```zsh
/etc/zshenv
/etc/zprofile
/etc/zshrc
/etc/zlogin
/etc/zlogout
```
The default location for zsh user files:
```zsh
$HOME/.zshenv
$HOME/.zprofile
$HOME/.zshrc
$HOME/.zlogin
$HOME/.zlogout
```
The custom location for zsh user files uses the environment variable `ZDOTDIR`:
```zsh
${ZDOTDIR:-$HOME}/.zshenv
${ZDOTDIR:-$HOME}/.zprofile
${ZDOTDIR:-$HOME}/.zshrc
${ZDOTDIR:-$HOME}/.zlogin
${ZDOTDIR:-$HOME}/.zlogout
```
## zsh directory locations
Our location for zsh system directories:
```zsh
/etc/zshenv.d
/etc/zprofile.d
/etc/zshrc.d
/etc/zlogin.d
/etc/zlogout.d
```
Our default location for zsh user directories:
```zsh
$HOME/.config/zshenv.d
$HOME/.config/zprofile.d
$HOME/.config/zshrc.d
$HOME/.config/zlogin.d
$HOME/.config/zlogout.d
```
Our custom location for zsh user directories uses the environment variable `XDG_CONFIG_HOME`:
```zsh
${XDG_CONFIG_HOME:-$HOME/.config}/zshenv.d
${XDG_CONFIG_HOME:-$HOME/.config}/zprofile.d
${XDG_CONFIG_HOME:-$HOME/.config}/zshrc.d
${XDG_CONFIG_HOME:-$HOME/.config}/zlogin.d
${XDG_CONFIG_HOME:-$HOME/.config}/zlogout.d
```
## Repo files
This repo contains our Z shell conventions for subdirectories and also our files that we like to use with multiple teams.
Notable subdirectories:
* `zshenv.d/functions` is for functions.
* `zshenv.d/programs` is for configuring environment programs via environment variables, such as `$EDITOR`, `$PAGER`, etc.
* `zshenv.d/settings` is for Z shell settings, such as for completion, history, etc.
* `zshrc.d/aliases` is for aliases, such as `g` for `git`, `now` for printing the current time, etc.
### Conventions
Alias conventions:
* 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`.
* 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.
Environment program conventions:
* `$EDITOR` for editing text files, such as `vi` or `emacs`.
* `$PAGER` for showing text files, such as `more` or `less`.
* `$FINDER` for searching text files, such as `grep` or `rg`.
* `$CLIPPER` for copying text to a clipboard, such as `xclip` or `pbcopy`.
* `$DATER` for showing dates and times, such as `date` or `gdate`.
* `$JUMPER` for moving among directories, such as `jump` or `jumpdir`.
Date/time format conventions:
* We default to nanoseconds precision (not seconds precision), because we use subsecond precision on some of our systems.
* We default to UTC timezone and the format "+00:00" (not "Z"), because this maximizes our compatibility with fintech systems and logs.
### Install
Clone:
```zsh
git clone https://github.com/sixarm/sixarm_zsh_config
```
Move the directories and files as you like, to wherever you want.
### Install for one user using the way we prefer
For one user, we prefer to put files in a user's configuration directory:
```zsh
config=${XDG_CONFIG_HOME:-$HOME/.config}
```
Make directories:
```zsh
mkdir -p $config/{zshenv.d,zprofile.d,zshrc.d,zlogin.d,zlogout.d}
```
Copy files:
```zsh
cp -R sixarm-zsh-config/zshenv.d/* $config/zshenv.d
cp -R sixarm-zsh-config/zprofile.d/* $config/zprofile.d
cp -R sixarm-zsh-config/zshrc.d/* $config/zshrc.d
cp -R sixarm-zsh-config/zlogin.d/* $config/zlogin.d
cp -R sixarm-zsh-config/zlogout.d/* $config/zlogout.d
```
Add this to the user file `.zshenv`:
```zsh
config=${XDG_CONFIG_HOME:-$HOME/.config}
for file in $config/zshenv.d/**/*(.N)
do
[ -x "$file" ] && . "$file"
done
```
Add this to the user file `.zprofile`:
```zsh
config=${XDG_CONFIG_HOME:-$HOME/.config}
for file in $config/zprofile.d/**/*(.N)
do
[ -x "$file" ] && . "$file"
done
```
Add this to the user file `.zshrc`:
```zsh
config=${XDG_CONFIG_HOME:-$HOME/.config}
for file in $config/zshrc.d/**/*(.N)
do
[ -x "$file" ] && . "$file"
done
```
Add this to the user file `.zlogin`:
```zsh
config=${XDG_CONFIG_HOME:-$HOME/.config}
for file in $config/zlogin.d/**/*(.N)
do
[ -x "$file" ] && . "$file"
done
```
Add this to the user file `.zlogout`:
```zsh
config=${XDG_CONFIG_HOME:-$HOME/.config}
for file in $config/zlogout.d/**/*(.N)
do
[ -x "$file" ] && . "$file"
done
```
### Install for the system using the way we prefer
For the system, we prefer to put files in the system's `/etc` directory:
```zsh
config=/etc
```
Make directories:
```zsh
mkdir -p $config/{zshenv.d,zprofile.d,zshrc.d,zlogin.d,zlogout.d}
```
Copy files:
```zsh
cp -R sixarm-zsh-config/zshenv.d/* $config/zshenv.d
cp -R sixarm-zsh-config/zprofile.d/* $config/zprofile.d
cp -R sixarm-zsh-config/zshrc.d/* $config/zshrc.d
cp -R sixarm-zsh-config/zlogin.d/* $config/zlogin.d
cp -R sixarm-zsh-config/zlogout.d/* $config/zlogout.d
```
Add this to the system file `zshenv`:
```zsh
config=/etc
for file in $config/zshenv.d/**/*(.N)
do
[ -x "$file" ] && . "$file"
done
```
Add this to the system file `/etc/zprofile`:
```zsh
config=/etc
for file in $config/zprofile.d/**/*(.N)
do
[ -x "$file" ] && . "$file"
done
```
Add this to the system file `zshrc`:
```zsh
config=/etc
for file in $config/zshrc.d/**/*(.N)
do
[ -x "$file" ] && . "$file"
done
```
Add this to the system file `zlogin`:
```zsh
config=/etc
for file in $config/zlogin.d/**/*(.N)
do
[ -x "$file" ] && . "$file"
done
```
Add this to the sytem file `zlogout`:
```zsh
config=/etc
for file in $config/zlogout.d/**/*(.N)
do
[ -x "$file" ] && . "$file"
done
```
### Contribute your files
If 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.
================================================
FILE: zlogin.d/.keep
================================================
================================================
FILE: zlogout.d/.keep
================================================
================================================
FILE: zprofile.d/.keep
================================================
================================================
FILE: zshenv.d/.keep
================================================
================================================
FILE: zshenv.d/functions/rm-file.zsh
================================================
# Remove each item iff it is a normal file.
rm-file(){
for i
do
test -f "$i" && rm "$i"
done
}
================================================
FILE: zshenv.d/functions/rsync-mirror-exact.zsh
================================================
# rsync-mirror-exact => rsync-mirror then delete all extraneous dest items.
#
# Example:
#
# rsync-mirror-exact ~/foo/ ~/bar/
#
# We use --delete-after, rather than --delete-before or --delete-during,
# because we want the command to be able to copy on top of existing items
# that may link to each other, such as a website that has many pages.
#
rsync-mirror-exact(){
rsync -aHOxzvi --delete-after "$@"
}
================================================
FILE: zshenv.d/functions/rsync-mirror-progress.zsh
================================================
# rsync-mirror-progress => what rsync-mirror does,
# plus progress bar and work-in-progress partial files.
#
# Example:
#
# rsync-mirror-progress ~/foo/ ~/bar/
#
# Settings:
#
# -a, --archive archive mode; same as -rlptgoD (no -H)
# -H, --hard-links preserve hard links
# -O, --omit-dir-times omit directories when preserving times
# -x, --one-file-system don't cross filesystem boundaries
# -z, --compress compress file data during the transfer
# -v, --verbose increase verbosity
# -i, --itemize-changes output a change-summary for all updates
#
# This can be useful for interactive mirroring, when you want to watch
# the progress bar and also want to be able to resume broken transfers.
#
# Be aware that the partial flags necessitate directory write permissions.
#
rsync-mirror-progress(){
rsync -aHOxzvi --progress --partial --partial-dir=.rsync-partial-dir "$@"
}
================================================
FILE: zshenv.d/functions/rsync-mirror.zsh
================================================
# rsync-mirror => rsync with settings for typical mirroring.
#
# Example:
#
# rsync-mirror ~/foo/ ~/bar/
#
# Settings:
#
# -a, --archive archive mode; same as -rlptgoD (no -H)
# -H, --hard-links preserve hard links
# -O, --omit-dir-times omit directories when preserving times
# -x, --one-file-system don't cross filesystem boundaries
# -z, --compress compress file data during the transfer
# -v, --verbose increase verbosity
# -i, --itemize-changes output a change-summary for all updates
#
rsync-mirror(){
rsync -aHOxzvi "$@"
}
================================================
FILE: zshenv.d/programs/browser.zsh
================================================
# Browser is the shell program that launches a web browser.
#
# Example browsers:
#
# * firefox
# * chromium
# * chromium-browser
# * chrome
# * google-chrome
# * safari
# * w3m
# * lynx
#
# Example locations:
#
# * /opt/firefox/firefox
# * /Applications/Firefox.app/Contents/MacOS/firefox-bin
# * /usr/local/bin/chromium
# * /Applications/Safari.app/Contents/MacOS/Safari
#
(( ${+BROWSER} )) || export BROWSER=$( command -v /opt/firefox/firefox || command -v /Applications/Firefox.app/Contents/MacOS/firefox-bin || command -v firefox || command -v /usr/local/bin/chromium || command -v chromium || command -v chromium-browser || command -v chrome || command -v google-chrome || command -v /Applications/Safari.app/Contents/MacOS/Safari || command -v w3m || command -v lynx || "" )
================================================
FILE: zshenv.d/programs/clipper.zsh
================================================
# Clipper is the shell program that copies text to the clipboard.
#
# Example choices:
#
# * pbcopy on macOS
# * xclip on Linux
#
(( ${+CLIPPER} )) || export CLIPPER=$( command -v pbcopy || command -v xclip || "" )
================================================
FILE: zshenv.d/programs/dater.zsh
================================================
# Dater is the shell program that prints calendar date information.
#
# Example choices:
#
# * /usr/local/opt/coreutils/libexec/gnubin/date
# * gdate
# * chrome
# * google-chrome
# * w3m
# * lynx
#
# Note: the items above that use `coreutils` and `gdate` are typical of
# macOS `brew install coreutils`, which puts the GNU command `date` in
# a special location and with the name `gdate` in order to ensure the
# GNU command does not accidentally shadow the existing macOS `date`.
#
(( ${+DATER} )) || export DATER=$( command -v /usr/local/opt/coreutils/libexec/gnubin/date || command -v gdate || command -v date || "" )
================================================
FILE: zshenv.d/programs/editor.zsh
================================================
# Editor is the shell program that edits text files.
#
# Example choices:
#
# * vi
# * vim
# * emacs -nw --color=no
# * emacsclient --alternate-editor="" -c "$@"
# * nano
# * pico
#
(( ${+EDITOR} )) || export EDITOR=$( command -v vim || command -v vi || "" )
(( ${+ALTERNATE_EDITOR} )) || export ALTERNATE_EDITOR=$( command -v vim || command -v vi || "" )
(( ${+VISUAL} )) || export VISUAL=$( command -v vim || command -v vi || "" )
================================================
FILE: zshenv.d/programs/finder.zsh
================================================
# Finder is the shell program that finds text within files.
#
# Example choices:
#
# * rg (ripgrep)
# * ag (the silver searcher)
# * sift
# * ucg
# * pt
# * egrep (enhanced grep)
# * grep (typical grep)
#
(( ${+FINDER} )) || export FINDER=$( command -v rg || command -v ag || command -v sift || command -v ucg || command -v pt || command -v egrep || command -v grep || "" )
================================================
FILE: zshenv.d/programs/jumper.zsh
================================================
# Jumper is the shell program that does a directory jump.
#
# Example choices:
#
# * [jd](https://github.com/khansamad47/jumpdir)
# * [jump](https://github.com/gsamokovarov/jump)
#
(( ${+JUMPER} )) || export JUMPER=$( command -v jd || command -v jump || "" )
================================================
FILE: zshenv.d/programs/pager.zsh
================================================
# Pager is the shell program that prints text pages such as a text file.
#
# Example choices:
#
# * bat (an improved `cat` written in Rust)
# * most (an improved `more`)
# * less (an improved `more`)
# * more (the most widespread interactive pager on this list)
# * cat (the simplest on this list)
#
(( ${+PAGER} )) || export PAGER=$( command -v bat || command -v most || command -v less || command -v cat || "" )
================================================
FILE: zshenv.d/settings/auto-cd-on.zsh
================================================
# AUTO_CD: If a command is issued that can't be run as a normal command,
# and the command is the name of a directory, then cd to that directory.
# Example: when we enter `/foo` then zsh actually does a `cd /foo`
setopt AUTO_CD
================================================
FILE: zshenv.d/settings/beep-off.zsh
================================================
# No beep ever
unsetopt BEEP
================================================
FILE: zshenv.d/settings/chase-links-off.zsh
================================================
# CHASE_LINKS: Resolve symlinks to their values when changing directory.
# We unset it because symlinks are there for a reason; we want to see them.
unsetopt CHASE_LINKS
================================================
FILE: zshenv.d/settings/completion.zsh
================================================
# Tab completion moves to end of word
setopt ALWAYS_TO_END
# Automatically list choices on an ambiguous completion.
setopt AUTO_LIST
# Automatically use menu completion after the second consecutive
# request for completion, e.g. by pressing the tab key twice.
setopt AUTO_MENU
# Enable tab completion in the middle of a word
setopt COMPLETE_IN_WORD
# When listing files that are possible completions,
# show the type of each file with a trailing identifying mark.
setopt LIST_TYPES
================================================
FILE: zshenv.d/settings/history.zsh
================================================
### HISTORY ###
# location of history
(( ${+HISTFILE} )) || export HISTFILE=~/.histfile
# number of lines kept in history
(( ${+HISTSIZE} )) || export HISTSIZE=10000
# number of lines saved in the history after logout
(( ${+SAVEHIST} )) || export SAVEHIST=10000
### HISTORY SAVE ###
# APPEND_HISTORY: zsh appends new history to the old. Good for most people to use.
# The shell will make an effort not to write out lines which should be there already.
# However, this can get complicated if you have lots of zshs running at once.
#
# INC_APPEND_HISTORY means that instead of writing history when the shell exits,
# each line is added to the history in this way as it is executed; this means,
# for example, that if you start up a zsh inside the main shell its history will
# look like that of the main shell, which is quite useful. It also means the
# ordering of commands from different shells running at the same time is much
# more logical --- basically just the order they were executed --- so for 3.1.6
# and higher this option is recommended.
#
# SHARE_HISTORY takes this one stage further: as each line is added, the history
# file is checked to see if anything was written out by another shell, and if so
# it is included in the history of the current shell too. This means that zsh's
# running in different windows but on the same host (or more generally with the
# same home directory) share the same history. Note that zsh tries not to confuse
# you by having unexpected history entries pop up: if you use !-style history,
# the commands from other session don't appear in the history list until you
# explicitly type the history command to display them, so that you can be sure
# what command you are actually reexecuting.
setopt INC_APPEND_HISTORY
### HISTORY DUPS ###
# These options give ways of dealing with duplicates that appear in the history.
#
# HIST_IGNORE_DUPS is the simplest: it tells the shell not to store a history line
# if it's the same as the previous one, thus collapsing repeated commands to one;
# this is a very good option to have set. It does nothing when dups are not adjacent.
#
# HIST_IGNORE_ALL_DUPS: removes copies of lines still in the history list,
# keeping the newly added one.
#
# HIST_EXPIRE_DUPS_FIRST: preferentially removes duplicates when
# the history fills up, but does nothing until then.
#
# HIST_SAVE_NO_DUPS: whatever options are set for the current session,
# the shell is not to save duplicated lines more than once.
#
# HIST_FIND_NO_DUPS: even if duplicate lines have been saved, searches
# backwards with editor commands don't show them more than once.
setopt HIST_IGNORE_DUPS
### HISTORY IGNORE ###
# These options allow you to say that certain lines shouldn't go into the history.
#
# HIST_IGNORE_SPACE: lines which begin with a space don't go into the history;
# the idea is that you deliberately type a space, which is not otherwise
# significant to the shell, before entering any line you want to be forgotten.
# In zsh 4.0.1 this is implemented so that you can always recall the immediately
# preceding line for editing, even if it had a space; but when the next line is
# executed and entered into the history, the line with a space is forgotten.
#
# HIST_NO_STORE: skip history or fc commands.
#
# HIST_NO_FUNCTIONS: skip function definitions; these can be tiresomely long.
# These are anything beginning `function funcname {...' or `funcname () { ...'.
# NO_HIST_BEEP: if you try to scroll beyond the end of the history list,
# the shell will beep. It is on by default, so use NO_HIST_BEEP to turn it off.
setopt HIST_IGNORE_SPACE
setopt HIST_NO_STORE
setopt HIST_NO_FUNCTIONS
================================================
FILE: zshenv.d/settings/io.zsh
================================================
# HASH_CMDS: Remember the location of each command the first time it runs.
# Subsequent invocations of the same command will use the saved location,
# thus avoiding a path search, thus making it faster to start a command.
setopt HASH_CMDS
# Allow comments even in interactive shells.
setopt INTERACTIVE_COMMENTS
# Enable output output flow control via start/stop characters,
# usually assigned to ^S/^Q, in the shell's editor.
setopt FLOW_CONTROL
================================================
FILE: zshenv.d/settings/less.zsh
================================================
# Disable `less` connectors because of security risks.
# See http://seclists.org/fulldisclosure/2014/Nov/74
LESSOPEN=
LESSCLOSE=
================================================
FILE: zshenv.d/settings/opt.zsh
================================================
# Set options - customize as you like
#
# * extendedglob: Treat the ‘#’, ‘~’ and ‘^’ characters as part of
# patterns for filename generation, etc. (An initial unquoted ‘~’
# always produces named directory expansion.)
#
# * nomatch: If a pattern for filename generation has no matches, print
# an error, instead of leaving it unchanged in the argument list. This
# also applies to file expansion of an initial ‘~’ or ‘=’.
#
# * notify: Report the status of background jobs immediately, rather than
# waiting until just before printing a prompt.
setopt extendedglob nomatch notify
================================================
FILE: zshrc.d/.keep
================================================
================================================
FILE: zshrc.d/aliases/aliases.zsh
================================================
# Aliases for zsh - customize as you like
# Suggestions from zsh-lovers
# http://grml.org/zsh/zsh-lovers.html
# alias -g CA="2>&1 | cat -A"
# alias -g C='| wc -l'
# alias -g D="DISPLAY=:0.0"
# alias -g DN=/dev/null
# alias -g ED="export DISPLAY=:0.0"
# alias -g EG='|& egrep'
# alias -g EH='|& head'
# alias -g EL='|& less'
# alias -g ELS='|& less -S'
# alias -g ETL='|& tail -20'
# alias -g ET='|& tail'
# alias -g F=' | fmt -'
# alias -g G='| egrep'
# alias -g H='| head'
# alias -g HL='|& head -20'
# alias -g Sk="*~(*.bz2|*.gz|*.tgz|*.zip|*.z)"
# alias -g LL="2>&1 | less"
# alias -g L="| less"
# alias -g LS='| less -S'
# alias -g MM='| most'
# alias -g M='| more'
# alias -g NE="2> /dev/null"
# alias -g NS='| sort -n'
# alias -g NUL="> /dev/null 2>&1"
# alias -g PIPE='|'
# alias -g R=' > /c/aaa/tee.txt '
# alias -g RNS='| sort -nr'
# alias -g S='| sort'
# alias -g TL='| tail -20'
# alias -g T='| tail'
# alias -g US='| sort -u'
# alias -g VM=/var/log/messages
# alias -g X0G='| xargs -0 egrep'
# alias -g X0='| xargs -0'
# alias -g XG='| xargs egrep'
# alias -g X='| xargs'
================================================
FILE: zshrc.d/aliases/apache.zsh
================================================
# Alias for Apache webserver
if [ -e /etc/init.d/apache2 ]; then
alias apache='sudo /etc/init.d/apache2 '
elif [ -e /etc/init.d/httpd ]; then
alias apache='sudo /etc/init.d/httpd '
fi
================================================
FILE: zshrc.d/aliases/b=browser
================================================
alias b="${BROWSER}"
================================================
FILE: zshrc.d/aliases/bundle.zsh
================================================
# Bundle aliases
# bundle install, with our preferred isolation options
alias bundle-i='bundle install --path vendor/bundle --binstubs vendor/bundle/binstubs'
alias bundle-i-d='RAILS_ENV=development bundle install --path vendor/bundle --binstubs vendor/bundle/binstubs --without ""'
alias bundle-i-t='RAILS_ENV=test bundle install --path vendor/bundle --binstubs vendor/bundle/binstubs --without ""'
alias bundle-i-p='RAILS_ENV=production bundle install --path vendor/bundle --binstubs vendor/bundle/binstubs --without development test guard jasmine quality'
# bundle exec, with our preferred isolation options
alias bundle-x='bundle exec'
alias bundle-x-d='RAILS_ENV=development bundle exec'
alias bundle-x-t='RAILS_ENV=test bundle exec'
alias bundle-x-p='RAILS_ENV=production bundle exec'
================================================
FILE: zshrc.d/aliases/c=clipper.zsh
================================================
# Clipper alias
alias c="${CLIPPER}"
================================================
FILE: zshrc.d/aliases/cargo.zsh
================================================
# Cargo aliases for Rust
alias cargo-up='cargo update --aggressive && cargo build --all-targets --release && cargo test --all-targets --release'
================================================
FILE: zshrc.d/aliases/cd.zsh
================================================
## Fast jump up directories
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
alias .......='cd ../../../../../..'
alias ........='cd ../../../../../../..'
alias .........='cd ../../../../../../../..'
alias ..........='cd ../../../../../../../../..'
================================================
FILE: zshrc.d/aliases/chrome.zsh
================================================
# Alias for Chrome browser command
#
# Examples:
#
# * chromium
# * chromium-browser
# * chrome
# * google-chrome
# * /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
#
alias chrome=$( command -v chromium || command -v chromium-browser || command -v chrome || command -v google-chrome || command -v '/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome ' || "" )
================================================
FILE: zshrc.d/aliases/curly.zsh
================================================
# Alias for curl with options for typical syadamin command-line usage
alias curly='curl --silent --show-error --location'
================================================
FILE: zshrc.d/aliases/e=editor.zsh
================================================
alias e="${EDITOR}"
================================================
FILE: zshrc.d/aliases/f=finder.zsh
================================================
alias f="${FINDER}"
================================================
FILE: zshrc.d/aliases/ff=find-fast.zsh
================================================
# find fast: this command is available from http://github.com/sixarm/sixarm_unix_shell_scripts/find-fast
alias ff='find-fast'
================================================
FILE: zshrc.d/aliases/firefox.zsh
================================================
# Firefox aliases
#
# Examples:
#
# * firefox
# * /opt/firefox/firefox
# * /Applications/Firefox.app/Contents/MacOS/firefox-bin
#
alias firefox=$( command -v /opt/firefox/firefox || command -v firefox || command -v /Applications/Firefox.app/Contents/MacOS/firefox-bin || "" )
================================================
FILE: zshrc.d/aliases/g=git.zsh
================================================
alias g='${GIT}'
================================================
FILE: zshrc.d/aliases/j=jumper.zsh
================================================
j="${JUMPER}"
================================================
FILE: zshrc.d/aliases/l=ls.zsh
================================================
# list files, one per line, almost all files, with file classifier
alias l='ls -1AF'
================================================
FILE: zshrc.d/aliases/map.zsh
================================================
alias map='xargs -n1'
================================================
FILE: zshrc.d/aliases/now.zsh
================================================
# now: print the current time, using UTC time zone, and ISO format.
#
# Example:
#
# $ now
# 2019-10-17T00:22:47.765401000+00:00
#
# ## macOS issue
#
# On vanilla macOS systems, the command `date` does not provide the
# format character `N`, so will output the letter `N`.
#
# One way to get nanosecond formatting on macOS is to install the GNU
# command `date`, such as via the tool `brew`, then use the path:
#
# $ brew install coreutils
#
# The tool `brew` will install the command `gdate`, to protect you
# from accidentally shadowing the existing macOS command `date`.
#
# To prefer the GNU commands with their normal names, you can add
# a "gnubin" directory to your PATH from your bashrc like:
#
# PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
#
# The alias below will look for the brew directory and GNU command,
# and will also look for the brew install of `gdate`.
#
alias now="$( command -v /usr/local/opt/coreutils/libexec/gnubin/date || command -v gdate || command -v date ) -u \"+%Y-%m-%dT%H:%M:%S.%N+00:00\""
================================================
FILE: zshrc.d/aliases/p=pager.zsh
================================================
alias p="${PAGER}"
================================================
FILE: zshrc.d/aliases/perl.zsh
================================================
### Perl
alias pie='perl -p -i -e'
alias pies='xargs -n1 perl -p -i -e'
================================================
FILE: zshrc.d/aliases/ruby.zsh
================================================
# Ruby aliases
# Ruby On Rails Restart - Phusion Passenger in the app's top directory
alias rrr='touch tmp/restart.txt'
================================================
FILE: zshrc.d/aliases/rubymine.zsh
================================================
[ -e /opt/rubymine/bin/rubymine.sh ] && alias rubymine='/opt/rubymine/bin/rubymine.sh'
================================================
FILE: zshrc.d/aliases/sha.zsh
================================================
sha='sha512'
================================================
FILE: zshrc.d/aliases/shell.zsh
================================================
# print the current shell, e.g. bash, csh, zsh
alias shell='ps -p $$ -o comm='
================================================
FILE: zshrc.d/aliases/timer.zsh
================================================
alias timer='sudo chrt -f 99 /usr/bin/time -f "\n***\ntime: %E\switches: %c\nwaits: %w"'
================================================
FILE: zshrc.d/aliases/tmux.zsh
================================================
# tmux terminal multiplexer
# Create a tmux new session using the current directory and using its name.
alias tmux-new-session-pwd='tmux new -s $(basename $(pwd))'
# Attach to an existing sesion, which is handy because this does tab completion.
#
# * If used outside tmux, then create a new client in the current terminal.
# * If used inside tmux, switch the current client.
# * If -d is specified, then detach any other clients attached to the session.
#
alias tmux-a='tmux attach -d -t'
================================================
FILE: zshrc.d/aliases/vbox.zsh
================================================
alias vbox='vboxmanage'
================================================
FILE: zshrc.d/apple-terminal.zsh
================================================
# Correctly display UTF-8 with combining characters.
# This code seems to come from the default OSX OhMyZsh.
if [ "$TERM_PROGRAM" = "Apple_Terminal" ]; then
setopt combiningchars
fi
================================================
FILE: zshrc.d/autoload-compinit.zsh
================================================
###
#
# autoload & compinit
#
# autoload:
#
# -U Suppress the usual alias expansion during reading.
# This is recommended for the use of functions supplied
# with the zsh distribution.
#
# -z use zsh native, not ksh emulation, as if the option
# KSH_AUTOLOAD were unset or were set, respectively.
#
# compinit, i.e. man zshcompsys:
#
# For security reasons compinit checks if the completion system would
# use files not owned by root or by the current user, or files in
# directories that are world- or group-writable or that are not owned
# by root or by the current user. If such files or directories are
# found, compinit will ask if the completion system should really be
# used.
#
# -u use all the files, without asking, avoiding these tests
#
# -i ignore insecure files and directories, silently.
#
# -C skip the entire security check
#
# -d dump to cache
#
# We prefer to skip the entire security check, because our typical
# zsh setups deliberately use non-root users and non-root groups.
# For example, we use an "admin" group and group-writeable paths.
#
# This is different than what typical zsh expects i.e. the paths
# must be owned by root or the user, and must not be group write.
#
# Our opinion is zsh should not try to be responsible for path
# permissions, therefore we use compinit -C to skip checking.
#
# If you don't want compinit called here, place this line:
#
# skip_global_compinit=1
#
# in your $ZDOTDIR/.zshenv or $ZDOTDIR/.zprofile
if [[ -z "$skip_global_compinit" ]]; then
autoload -Uz compinit
compinit -C -d ~/.zcompdump
fi
================================================
FILE: zshrc.d/bindkey.zsh
================================================
# bindkey settings
# emacs style key binding
bindkey -e
# backward delete
bindkey "\e[3~" delete-char
if [[ "$TERM" != emacs ]]; then
# Bind emacs
[[ -z "$terminfo[kdch1]" ]] || bindkey -M emacs "$terminfo[kdch1]" delete-char
[[ -z "$terminfo[khome]" ]] || bindkey -M emacs "$terminfo[khome]" beginning-of-line
[[ -z "$terminfo[kend]" ]] || bindkey -M emacs "$terminfo[kend]" end-of-line
[[ -z "$terminfo[kich1]" ]] || bindkey -M emacs "$terminfo[kich1]" overwrite-mode
# Bind vicmd
[[ -z "$terminfo[kdch1]" ]] || bindkey -M vicmd "$terminfo[kdch1]" vi-delete-char
[[ -z "$terminfo[khome]" ]] || bindkey -M vicmd "$terminfo[khome]" vi-beginning-of-line
[[ -z "$terminfo[kend]" ]] || bindkey -M vicmd "$terminfo[kend]" vi-end-of-line
[[ -z "$terminfo[kich1]" ]] || bindkey -M vicmd "$terminfo[kich1]" overwrite-mode
# Bind viins
[[ -z "$terminfo[cuu1]" ]] || bindkey -M viins "$terminfo[cuu1]" vi-up-line-or-history
[[ -z "$terminfo[cuf1]" ]] || bindkey -M viins "$terminfo[cuf1]" vi-forward-char
[[ -z "$terminfo[kcuu1]" ]] || bindkey -M viins "$terminfo[kcuu1]" vi-up-line-or-history
[[ -z "$terminfo[kcud1]" ]] || bindkey -M viins "$terminfo[kcud1]" vi-down-line-or-history
[[ -z "$terminfo[kcuf1]" ]] || bindkey -M viins "$terminfo[kcuf1]" vi-forward-char
[[ -z "$terminfo[kcub1]" ]] || bindkey -M viins "$terminfo[kcub1]" vi-backward-char
# Bind viins ncurses fogyatekos
[[ "$terminfo[kcuu1]" == "O"* ]] && bindkey -M viins "${terminfo[kcuu1]/O/[}" vi-up-line-or-history
[[ "$terminfo[kcud1]" == "O"* ]] && bindkey -M viins "${terminfo[kcud1]/O/[}" vi-down-line-or-history
[[ "$terminfo[kcuf1]" == "O"* ]] && bindkey -M viins "${terminfo[kcuf1]/O/[}" vi-forward-char
[[ "$terminfo[kcub1]" == "O"* ]] && bindkey -M viins "${terminfo[kcub1]/O/[}" vi-backward-char
[[ "$terminfo[khome]" == "O"* ]] && bindkey -M viins "${terminfo[khome]/O/[}" beginning-of-line
[[ "$terminfo[kend]" == "O"* ]] && bindkey -M viins "${terminfo[kend]/O/[}" end-of-line
[[ "$terminfo[khome]" == "O"* ]] && bindkey -M emacs "${terminfo[khome]/O/[}" beginning-of-line
[[ "$terminfo[kend]" == "O"* ]] && bindkey -M emacs "${terminfo[kend]/O/[}" end-of-line
fi
================================================
FILE: zshrc.d/brew-asdf.zsh
================================================
if command -v brew >/dev/null 2>&1; then
if brew list asdf >/dev/null 2>&1; then
. $(brew --prefix asdf)/libexec/asdf.sh
fi
fi
================================================
FILE: zshrc.d/chruby.zsh
================================================
#f=/usr/local/share/chruby/chruby.sh && test -r $f && source $f
#RUBIES+=(`find /opt/ruby -depth 2 2>/dev/null | grep -v current`)
================================================
FILE: zshrc.d/disable-log.zsh
================================================
# This snippet comes from the Apple OSX OhMyZsh.
# TODO: figure out what this does. :)
disable log
================================================
FILE: zshrc.d/options.zsh
================================================
# Tab completion moves to end of word.
setopt ALWAYS_TO_END
# Auto change directories, e.g. "/foo" does a "cd /foo".
setopt AUTO_CD
# Automatically list choices on an ambiguous completion.
setopt AUTO_LIST
# Background processes run full speed
unsetopt BGNICE
# Don't chase directory dots because they exist for a reason.
unsetopt CHASE_DOTS
# Don't chase symlinks because they exist for a reason.
unsetopt CHASE_LINKS
# Report the status of background and suspended jobs before exiting a shell.
setopt CHECK_JOBS
# Enable tab completion in the middle of a word.
setopt COMPLETE_IN_WORD
# Don't correct mistakes.
unsetopt CORRECT
unsetopt CORRECT_ALL
# Place the location of each command in the hash table.
setopt HASH_CMDS
# When a command runs, hash the directory containing it and parents.
setopt HASH_DIRS
# Skip command line in the history list if it duplicates the previous line.
setopt HIST_IGNORE_DUPS
# Restart running processes on exit.
setopt HUP
# No beep ever.
setopt NO_BEEP
# Enable variable substitution in the prompt.
setopt PROMPT_SUBST
# Share history between zsh processes.
setopt SHARE_HISTORY
================================================
FILE: zshrc.d/prompts.zsh
================================================
PROMPT='$ '
================================================
FILE: zshrc.d/rbenv.zsh
================================================
if [[ -r "$HOME/.rbenv" ]]; then
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
fi
================================================
FILE: zshrc.d/zstyle.zsh
================================================
# zstyle
#
# zstyle handles styles for context-sensitive configuration information.
# zstyle is used by zsh compsys, vcs_info, and oher shell subsystems.
#
# zstyle syntax:
#
# zstyle "context-pattern" style value
#
# The system looks up the value of a style, and tries to match with pattern.
# The longer the pattern, the more specific it is, and higher the precendence.
#
# Style settings with broad context patterns are useful to set default values.
# Style setting with more-specific pattern are useful to override defaults.
#
# For example, when the zsh completion system is running, zstyle searches
# for all context patterns that starts with ":completion:".
#
# For example:
#
# zstyle ':completion:*' verbose yes
#
# In the above command, anytime the `verbose' style is looked up in compsys,
# zstyle will yield the value `yes', unless there is another setting for the
# `verbose' style that is more specific, than ":completion:*", like:
#
# zstyle ':completion:*:complete:ls:*:*' verbose no
#
# Our general preferences:
#
# * Put settings for fonts and colors in personal files, not here.
# * Use settings for our typical systems e.g. plenty of CPU and RAM.
#
# Credit:
#
# * http://zsh.sourceforge.net/Guide/zshguide06.html
# * http://www.masterzen.fr/2009/04/19/in-love-with-zsh-part-one/
# * https://github.com/andreivolt/dotfiles/blob/master/zshrc
# * http://unix.stackexchange.com/questions/2179/rebuild-auto-complete-index-or-whatever-its-called-and-binaries-in-path-cach
#
###
###
#
# Format
#
###
# zstyle can use format strings for typical output and errors:
#
# * messages
# * warnings
# * corrections
# * descriptions
#
# We prefer these global files to use format strings with plain text only,
# i.e. no font family (bold, underline, etc.), no colors, no escapes, etc.
# This is because we want maximum portability and maximum compatibility.
#
# If you prefer different format strings, please do not change these here;
# instead, set your own format strings by using your own user zshrc files.
#
# Font family format codes:
#
# %B %b Bold
# %U %u Underline
#
# Color ideas: https://wiki.archlinux.org/index.php/Color_Bash_Prompt
#
# For example to set purple messages and set red warnings:
#
# zstyle ':completion:*:messages' format $'\e[01;35m%d\e[00;00m'
# zstyle ':completion:*:warnings' format $'\e[01;31mNo match\e[00;00m'
#
# If you're doing font format strings in your own files, and want color,
# we suggest you set variables rather than using escape codes directly:
#
# $fg Use the foreground color
# $reset_color Reset the color
#
zstyle ':completion:*:messages' format '%d'
zstyle ':completion:*:warnings' format "No match: %d"
zstyle ':completion:*:corrections' format '%d (errors: %e)%b'
zstyle ':completion:*:descriptions' format '%d'
###
#
# Misc
#
###
# menu select: do menu-driven completion. If an ambiguous completion
# produces at least <NUM> possibilities, menu selection is started.
#
# You can understand this best by trying it. One of the completions in
# the list, initially the top-leftmost, is highlighted and inserted
# into the line. By moving the cursor in the obvious directions (with
# wraparound at the edges), you change both the value highlighted and
# the value inserted into the line. When you have the value you want,
# hit return, which removes the list and leaves the inserted value.
#
# Hitting ^G (the editor function send-break) aborts menu selection,
# removes the list and restores the command line.
zstyle ':completion:*' menu select
# verbose: many completion functions can generate matches in a simple
# form and a verbose form. zstyle uses the "verbose" style to decide
# which to use. We prefer always using the verbose form.
zstyle ':completion:*' verbose yes
# rehash: montinuously update completions. This tells zsh not to trust
# its cache when completing. There is a performance cost.
#
# * The cost is negligible on a typical desktop setting today.
#
# * The cost may be significant if you have $PATH on NFS,
# or you are using a system that is RAM-starved.
#
zstyle ':completion:*' rehash yes
###
#
# TODO: annotate everything below
#
###
zstyle ':completion:*' completer _complete _approximate
#TODO: manuals
zstyle ':completion:*:manuals' separate-sections true
zstyle ':completion:*:manuals.(^1*)' insert-sections true
zstyle ':completion:*:default' list-prompt '%S%M matches%s'
zstyle ':completion:*' group-name ''
zstyle -e ':completion:*:approximate:*' max-errors \
'reply=( $(( ($#PREFIX + $#SUFFIX) / 3 )) )'
zstyle ':completion:*:sudo:*' command-path \
/usr/local/sbin \
/usr/local/bin \
/usr/sbin \
/usr/bin \
/sbin \
/bin \
/usr/X11R6/bin
# Color completion for some things.
# http://linuxshellaccount.blogspot.com/2008/12/color-completion-using-zsh-modules-on.html
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' group-name ''
## faster completion
#zstyle ':completion:*' accept-exact '*(N)'
#zstyle ':completion::complete:*' use-cache on
#zstyle ':completion::complete:*' cache-path ~/.tmp/.zsh-cache
## completion Styles
## list of completers to use
#zstyle ':completion:*::::' completer _expand _complete _ignored _approximate
## allow selection from a menu
#zstyle ':completion:*' menu select=1 _complete _ignored _approximate
#zstyle -e ':completion:*' list-colors 'thingy=${PREFIX##*/} reply=( "=(#b)($thingy)(?)*=00=$color[blue]" )'
## match uppercase from lowercase, except for approximate completions
#zstyle ':completion:*:(^approximate):*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
## don't complete parent directory
#zstyle ':completion:*' ignore-parents parent pwd
##' # character that separates matches from their description
#zstyle ':completion:*' list-separator
#
## ignore completion functions for missing commands
#zstyle ':completion:*:functions' ignored-patterns '_*'
## fuzzy matching of mistyped completions
#zstyle ':completion:*' completer _complete _match _approximate
#zstyle ':completion:*:match:*' original only
## increase number of errors allowed with length of input
#zstyle -e ':completion:*:approximate:*' \
# max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3))numeric)'
#
#zstyle ':completion:*' group-name '' # group messages by group name
#zmodload zsh/complist
#zstyle ':completion:*:default' list-prompt '%S%M matches%s' # scroll long completion lists
#bindkey -M listscroll q send-break # quit pager with 'q'
#bindkey -M menuselect '\C-o' accept-and-menu-complete # in menu seletion, Ctrl-o to accept the match but remain in menu selection
#bindkey '^[[Z' reverse-menu-complete
## approximate completion
#zstyle ':completion:*:corrections' format '%B%d (errors: %e)%b'
#zstyle ':completion::::' completer _complete _approximate
#zstyle -e ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX+$#SUFFIX)/3 )) )' # allow one error for every three characters typed
## prefix completion
#setopt complete_in_word
#zstyle ':completion::*:::' completer _complete _prefix
#zstyle ':completion:*:prefix:*' add-space true
## correct mistyped prefixes
#zstyle ':completion:::::' complete _complete _approximate
#zstyle ':completion::approximate*:*' prefix-needed false
## ignore already listed files
#zstyle ':completion:*:(mv|cp|diff|vi):*' ignore-line yes
gitextract_pdj_rzdr/
├── CITATION.cff
├── CODEOWNERS
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── README.md
├── zlogin.d/
│ └── .keep
├── zlogout.d/
│ └── .keep
├── zprofile.d/
│ └── .keep
├── zshenv.d/
│ ├── .keep
│ ├── functions/
│ │ ├── rm-file.zsh
│ │ ├── rsync-mirror-exact.zsh
│ │ ├── rsync-mirror-progress.zsh
│ │ └── rsync-mirror.zsh
│ ├── programs/
│ │ ├── browser.zsh
│ │ ├── clipper.zsh
│ │ ├── dater.zsh
│ │ ├── editor.zsh
│ │ ├── finder.zsh
│ │ ├── jumper.zsh
│ │ └── pager.zsh
│ └── settings/
│ ├── auto-cd-on.zsh
│ ├── beep-off.zsh
│ ├── chase-links-off.zsh
│ ├── completion.zsh
│ ├── history.zsh
│ ├── io.zsh
│ ├── less.zsh
│ └── opt.zsh
└── zshrc.d/
├── .keep
├── aliases/
│ ├── aliases.zsh
│ ├── apache.zsh
│ ├── b=browser
│ ├── bundle.zsh
│ ├── c=clipper.zsh
│ ├── cargo.zsh
│ ├── cd.zsh
│ ├── chrome.zsh
│ ├── curly.zsh
│ ├── e=editor.zsh
│ ├── f=finder.zsh
│ ├── ff=find-fast.zsh
│ ├── firefox.zsh
│ ├── g=git.zsh
│ ├── j=jumper.zsh
│ ├── l=ls.zsh
│ ├── map.zsh
│ ├── now.zsh
│ ├── p=pager.zsh
│ ├── perl.zsh
│ ├── ruby.zsh
│ ├── rubymine.zsh
│ ├── sha.zsh
│ ├── shell.zsh
│ ├── timer.zsh
│ ├── tmux.zsh
│ └── vbox.zsh
├── apple-terminal.zsh
├── autoload-compinit.zsh
├── bindkey.zsh
├── brew-asdf.zsh
├── chruby.zsh
├── disable-log.zsh
├── options.zsh
├── prompts.zsh
├── rbenv.zsh
└── zstyle.zsh
Condensed preview — 66 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (49K chars).
[
{
"path": "CITATION.cff",
"chars": 606,
"preview": "cff-version: 1.2.0\ntitle: Z shell configuration\nmessage: >-\n If you use this work and you want to cite it,\n then you c"
},
{
"path": "CODEOWNERS",
"chars": 24,
"preview": "* codeowners@sixarm.com\n"
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 5490,
"preview": "\n# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nWe as members, contributors, and leaders pledge to make particip"
},
{
"path": "CONTRIBUTING.md",
"chars": 246,
"preview": "# Contributing\n\nTo contribute code, you can create a pull request, or send us email, or chat with us, whichever is easie"
},
{
"path": "README.md",
"chars": 8086,
"preview": "# Z shell configuration\n\nWe use Z shell extensively, on many kinds of systems. We use Z shell configurations and convent"
},
{
"path": "zlogin.d/.keep",
"chars": 0,
"preview": ""
},
{
"path": "zlogout.d/.keep",
"chars": 0,
"preview": ""
},
{
"path": "zprofile.d/.keep",
"chars": 0,
"preview": ""
},
{
"path": "zshenv.d/.keep",
"chars": 0,
"preview": ""
},
{
"path": "zshenv.d/functions/rm-file.zsh",
"chars": 114,
"preview": "# Remove each item iff it is a normal file.\nrm-file(){\n for i\n do\n test -f \"$i\" && rm \"$i\"\n done\n}\n"
},
{
"path": "zshenv.d/functions/rsync-mirror-exact.zsh",
"chars": 414,
"preview": "# rsync-mirror-exact => rsync-mirror then delete all extraneous dest items.\n#\n# Example:\n#\n# rsync-mirror-exact ~/fo"
},
{
"path": "zshenv.d/functions/rsync-mirror-progress.zsh",
"chars": 935,
"preview": "# rsync-mirror-progress => what rsync-mirror does, \n# plus progress bar and work-in-progress partial files.\n#\n# Example:"
},
{
"path": "zshenv.d/functions/rsync-mirror.zsh",
"chars": 595,
"preview": "# rsync-mirror => rsync with settings for typical mirroring.\n#\n# Example:\n#\n# rsync-mirror ~/foo/ ~/bar/\n#\n# Setting"
},
{
"path": "zshenv.d/programs/browser.zsh",
"chars": 806,
"preview": "# Browser is the shell program that launches a web browser.\n#\n# Example browsers:\n#\n# * firefox\n# * chromium\n# * c"
},
{
"path": "zshenv.d/programs/clipper.zsh",
"chars": 219,
"preview": "# Clipper is the shell program that copies text to the clipboard.\n#\n# Example choices:\n#\n# * pbcopy on macOS\n# * xcl"
},
{
"path": "zshenv.d/programs/dater.zsh",
"chars": 636,
"preview": "# Dater is the shell program that prints calendar date information.\n#\n# Example choices:\n#\n# * /usr/local/opt/coreutil"
},
{
"path": "zshenv.d/programs/editor.zsh",
"chars": 445,
"preview": "# Editor is the shell program that edits text files.\n#\n# Example choices:\n#\n# * vi\n# * vim\n# * emacs -nw --color=n"
},
{
"path": "zshenv.d/programs/finder.zsh",
"chars": 388,
"preview": "# Finder is the shell program that finds text within files.\n#\n# Example choices:\n#\n# * rg (ripgrep)\n# * ag (the silv"
},
{
"path": "zshenv.d/programs/jumper.zsh",
"chars": 263,
"preview": "# Jumper is the shell program that does a directory jump.\n#\n# Example choices:\n#\n# * [jd](https://github.com/khansamad"
},
{
"path": "zshenv.d/programs/pager.zsh",
"chars": 424,
"preview": "# Pager is the shell program that prints text pages such as a text file.\n#\n# Example choices:\n#\n# * bat (an improved `"
},
{
"path": "zshenv.d/settings/auto-cd-on.zsh",
"chars": 228,
"preview": "# AUTO_CD: If a command is issued that can't be run as a normal command,\n# and the command is the name of a directory, t"
},
{
"path": "zshenv.d/settings/beep-off.zsh",
"chars": 29,
"preview": "# No beep ever\nunsetopt BEEP\n"
},
{
"path": "zshenv.d/settings/chase-links-off.zsh",
"chars": 170,
"preview": "# CHASE_LINKS: Resolve symlinks to their values when changing directory.\n# We unset it because symlinks are there for a "
},
{
"path": "zshenv.d/settings/completion.zsh",
"chars": 489,
"preview": "# Tab completion moves to end of word\nsetopt ALWAYS_TO_END\n\n# Automatically list choices on an ambiguous completion.\nset"
},
{
"path": "zshenv.d/settings/history.zsh",
"chars": 3689,
"preview": "### HISTORY ###\n\n# location of history\n(( ${+HISTFILE} )) || export HISTFILE=~/.histfile\n\n# number of lines kept in hist"
},
{
"path": "zshenv.d/settings/io.zsh",
"chars": 449,
"preview": "# HASH_CMDS: Remember the location of each command the first time it runs.\n# Subsequent invocations of the same command "
},
{
"path": "zshenv.d/settings/less.zsh",
"chars": 129,
"preview": "# Disable `less` connectors because of security risks.\n# See http://seclists.org/fulldisclosure/2014/Nov/74\nLESSOPEN=\nLE"
},
{
"path": "zshenv.d/settings/opt.zsh",
"chars": 603,
"preview": "# Set options - customize as you like\n#\n# * extendedglob: Treat the ‘#’, ‘~’ and ‘^’ characters as part of \n# patter"
},
{
"path": "zshrc.d/.keep",
"chars": 0,
"preview": ""
},
{
"path": "zshrc.d/aliases/aliases.zsh",
"chars": 1086,
"preview": "# Aliases for zsh - customize as you like\n\n# Suggestions from zsh-lovers\n# http://grml.org/zsh/zsh-lovers.html\n\n# alias "
},
{
"path": "zshrc.d/aliases/apache.zsh",
"chars": 193,
"preview": "# Alias for Apache webserver\n\nif [ -e /etc/init.d/apache2 ]; then\n alias apache='sudo /etc/init.d/apache2 '\nelif [ -e"
},
{
"path": "zshrc.d/aliases/b=browser",
"chars": 21,
"preview": "alias b=\"${BROWSER}\"\n"
},
{
"path": "zshrc.d/aliases/bundle.zsh",
"chars": 793,
"preview": "# Bundle aliases\n\n# bundle install, with our preferred isolation options\nalias bundle-i='bundle install --path vendor/bu"
},
{
"path": "zshrc.d/aliases/c=clipper.zsh",
"chars": 38,
"preview": "# Clipper alias\n\nalias c=\"${CLIPPER}\"\n"
},
{
"path": "zshrc.d/aliases/cargo.zsh",
"chars": 146,
"preview": "# Cargo aliases for Rust\n\nalias cargo-up='cargo update --aggressive && cargo build --all-targets --release && cargo test"
},
{
"path": "zshrc.d/aliases/cd.zsh",
"chars": 324,
"preview": "## Fast jump up directories\nalias ..='cd ..'\nalias ...='cd ../..'\nalias ....='cd ../../..'\nalias .....='cd ../../../..'\n"
},
{
"path": "zshrc.d/aliases/chrome.zsh",
"chars": 397,
"preview": "# Alias for Chrome browser command\n#\n# Examples:\n#\n# * chromium\n# * chromium-browser\n# * chrome\n# * google-chrom"
},
{
"path": "zshrc.d/aliases/curly.zsh",
"chars": 122,
"preview": "# Alias for curl with options for typical syadamin command-line usage\nalias curly='curl --silent --show-error --location"
},
{
"path": "zshrc.d/aliases/e=editor.zsh",
"chars": 20,
"preview": "alias e=\"${EDITOR}\"\n"
},
{
"path": "zshrc.d/aliases/f=finder.zsh",
"chars": 20,
"preview": "alias f=\"${FINDER}\"\n"
},
{
"path": "zshrc.d/aliases/ff=find-fast.zsh",
"chars": 127,
"preview": "# find fast: this command is available from http://github.com/sixarm/sixarm_unix_shell_scripts/find-fast\n\nalias ff='find"
},
{
"path": "zshrc.d/aliases/firefox.zsh",
"chars": 282,
"preview": "# Firefox aliases\n#\n# Examples:\n#\n# * firefox\n# * /opt/firefox/firefox\n# * /Applications/Firefox.app/Contents/MacO"
},
{
"path": "zshrc.d/aliases/g=git.zsh",
"chars": 17,
"preview": "alias g='${GIT}'\n"
},
{
"path": "zshrc.d/aliases/j=jumper.zsh",
"chars": 14,
"preview": "j=\"${JUMPER}\"\n"
},
{
"path": "zshrc.d/aliases/l=ls.zsh",
"chars": 84,
"preview": "# list files, one per line, almost all files, with file classifier\nalias l='ls -1AF'"
},
{
"path": "zshrc.d/aliases/map.zsh",
"chars": 22,
"preview": "alias map='xargs -n1'\n"
},
{
"path": "zshrc.d/aliases/now.zsh",
"chars": 1051,
"preview": "# now: print the current time, using UTC time zone, and ISO format.\n#\n# Example:\n#\n# $ now\n# 2019-10-17T00:22:47"
},
{
"path": "zshrc.d/aliases/p=pager.zsh",
"chars": 19,
"preview": "alias p=\"${PAGER}\"\n"
},
{
"path": "zshrc.d/aliases/perl.zsh",
"chars": 73,
"preview": "### Perl\n\nalias pie='perl -p -i -e'\nalias pies='xargs -n1 perl -p -i -e'\n"
},
{
"path": "zshrc.d/aliases/ruby.zsh",
"chars": 120,
"preview": "# Ruby aliases\n\n# Ruby On Rails Restart - Phusion Passenger in the app's top directory\nalias rrr='touch tmp/restart.txt'"
},
{
"path": "zshrc.d/aliases/rubymine.zsh",
"chars": 86,
"preview": "[ -e /opt/rubymine/bin/rubymine.sh ] && alias rubymine='/opt/rubymine/bin/rubymine.sh'"
},
{
"path": "zshrc.d/aliases/sha.zsh",
"chars": 13,
"preview": "sha='sha512'\n"
},
{
"path": "zshrc.d/aliases/shell.zsh",
"chars": 79,
"preview": "# print the current shell, e.g. bash, csh, zsh\nalias shell='ps -p $$ -o comm='\n"
},
{
"path": "zshrc.d/aliases/timer.zsh",
"chars": 89,
"preview": "alias timer='sudo chrt -f 99 /usr/bin/time -f \"\\n***\\ntime: %E\\switches: %c\\nwaits: %w\"'\n"
},
{
"path": "zshrc.d/aliases/tmux.zsh",
"chars": 497,
"preview": "# tmux terminal multiplexer\n\n# Create a tmux new session using the current directory and using its name.\nalias tmux-new-"
},
{
"path": "zshrc.d/aliases/vbox.zsh",
"chars": 23,
"preview": "alias vbox='vboxmanage'"
},
{
"path": "zshrc.d/apple-terminal.zsh",
"chars": 184,
"preview": "# Correctly display UTF-8 with combining characters.\n# This code seems to come from the default OSX OhMyZsh.\nif [ \"$TERM"
},
{
"path": "zshrc.d/autoload-compinit.zsh",
"chars": 1596,
"preview": "###\n#\n# autoload & compinit\n#\n# autoload:\n#\n# -U Suppress the usual alias expansion during reading.\n# This is rec"
},
{
"path": "zshrc.d/bindkey.zsh",
"chars": 2153,
"preview": "# bindkey settings\n\n# emacs style key binding\nbindkey -e\n\n# backward delete\nbindkey \"\\e[3~\" delete-char\n\nif [[ \"$TERM\" !"
},
{
"path": "zshrc.d/brew-asdf.zsh",
"chars": 146,
"preview": "if command -v brew >/dev/null 2>&1; then\n if brew list asdf >/dev/null 2>&1; then\n . $(brew --prefix asdf)/lib"
},
{
"path": "zshrc.d/chruby.zsh",
"chars": 131,
"preview": "#f=/usr/local/share/chruby/chruby.sh && test -r $f && source $f\n#RUBIES+=(`find /opt/ruby -depth 2 2>/dev/null | grep -v"
},
{
"path": "zshrc.d/disable-log.zsh",
"chars": 99,
"preview": "# This snippet comes from the Apple OSX OhMyZsh.\n# TODO: figure out what this does. :)\ndisable log\n"
},
{
"path": "zshrc.d/options.zsh",
"chars": 1131,
"preview": "# Tab completion moves to end of word.\nsetopt ALWAYS_TO_END\n\n# Auto change directories, e.g. \"/foo\" does a \"cd /foo\".\nse"
},
{
"path": "zshrc.d/prompts.zsh",
"chars": 11,
"preview": "PROMPT='$ '"
},
{
"path": "zshrc.d/rbenv.zsh",
"chars": 100,
"preview": "if [[ -r \"$HOME/.rbenv\" ]]; then\n export PATH=\"$HOME/.rbenv/bin:$PATH\"\n eval \"$(rbenv init -)\"\nfi\n"
},
{
"path": "zshrc.d/zstyle.zsh",
"chars": 7328,
"preview": "# zstyle\n#\n# zstyle handles styles for context-sensitive configuration information.\n# zstyle is used by zsh compsys, vcs"
}
]
About this extraction
This page contains the full source code of the SixArm/sixarm_zsh_config GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 66 files (43.1 KB), approximately 13.8k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.