Skip to content

Commit 06c3460

Browse files
authored
Merge pull request #88 from unixorn/switch-to-zgenom
Switch to zgenom
2 parents 0d277ca + 587081c commit 06c3460

File tree

7 files changed

+90
-73
lines changed

7 files changed

+90
-73
lines changed

.circleci/config.yml

-16
This file was deleted.

.codeclimate.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
---
22
engines:
3-
pep8:
4-
enabled: true
53
duplication:
64
enabled: true
75
config:
@@ -31,9 +29,9 @@ engines:
3129
enabled: true
3230
ratings:
3331
paths:
34-
- "bin/**/*"
35-
- "**.py"
36-
- "**.md"
32+
- "bin/**/*"
33+
- "**.py"
34+
- "**.md"
3735
exclude_paths:
3836
- .bundle/
3937
- benchmarks/**/*

Readme.md

+29-22
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
1212
## Table of Contents
1313

14+
- [Announcement](#announcement)
1415
- [Installation](#installation)
1516
- [Prerequisites](#prerequisites)
1617
- [Fonts](#fonts)
1718
- [OS-specific setup](#os-specific-setup)
1819
- [macOS](#macos)
1920
- [Linux](#linux)
20-
- [Set up Zgen and the starter kit](#set-up-zgen-and-the-starter-kit)
21+
- [Set up Zgenom and the starter kit](#set-up-zgenom-and-the-starter-kit)
2122
- [Contents of the kit](#contents-of-the-kit)
2223
- [Included plugins](#included-plugins)
2324
- [Customizing the kit](#customizing-the-kit)
@@ -26,21 +27,24 @@
2627
- [I like a plugin, but the aliases it installs overwrite other commands or aliases](#i-like-a-plugin-but-the-aliases-it-installs-overwrite-other-commands-or-aliases)
2728
- [ZSH options](#zsh-options)
2829
- [Self-update Settings](#self-update-settings)
29-
- [Changing the zgen plugin list](#changing-the-zgen-plugin-list)
30+
- [Changing the plugin list](#changing-the-plugin-list)
3031
- [Disabling zmv](#disabling-zmv)
3132
- [Disabling oh-my-zsh](#disabling-oh-my-zsh)
3233
- [FAQ](#faq)
33-
- [How do I reconfigure the prompt](#how-do-i-reconfigure-the-prompt)
34+
- [How do I reconfigure the prompt?](#how-do-i-reconfigure-the-prompt)
3435
- [I added a new completion plugin and it isn't working](#i-added-a-new-completion-plugin-and-it-isnt-working)
3536
- [I get a git error when I try to update the kit](#i-get-a-git-error-when-i-try-to-update-the-kit)
36-
- [Stow complains with a warning that stowing zsh would cause conflicts](#stow-complains-with-a-warning-that-stowing-zsh-would-cause-conflicts)
37+
- [GNU stow complains with a warning that stowing zsh would cause conflicts](#gnu-stow-complains-with-a-warning-that-stowing-zsh-would-cause-conflicts)
3738
- [Other Resources](#other-resources)
3839
- [ZSH](#zsh)
3940
- [Dotfiles in general](#dotfiles-in-general)
4041
- [Vim](#vim)
4142

4243
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
4344

45+
## Announcement
46+
47+
I've switched the quickstart kit to use [zgenom](https://github.com/jandamm/zgenom.git) instead of zgen. This should be a painless update since zgenom is a superset of zgen.
4448
## Installation
4549

4650
### Prerequisites
@@ -97,13 +101,13 @@ If you still can’t see the new fonts then double-check that the font has been
97101

98102
If you get garbled branch glyphs, make sure there isn't a separate font setting for non-ASCII characters in your terminal application that you also need to set to use a Powerline-compatible font. Konsole needs to be set to use UTF-8 encoding, for example.
99103

100-
### Set up Zgen and the starter kit
104+
### Set up Zgenom and the starter kit
101105

102-
Now that your fonts and default shell have been set up, install [zgen](https://github.com/tarjoilija/zgen) and the dotfiles from this starter kit repository.
106+
Now that your fonts and default shell have been set up, install [zgenom](https://github.com/jandamm/zgenom.git) and the dotfiles from this starter kit repository.
103107

104-
1. Install [Zgen](https://github.com/tarjoilija/zgen)
108+
1. Install [Zgenom](https://github.com/jandamm/zgenom.git)
105109
1. `cd ~`
106-
2. `git clone git@github.com:tarjoilija/zgen.git`
110+
2. `git clone https://github.com/jandamm/zgenom.git`
107111
2. Install the starter kit
108112
1. `cd ~`
109113
2. `git clone [email protected]:unixorn/zsh-quickstart-kit.git`
@@ -118,15 +122,15 @@ The `.zshrc`, `.zsh_aliases` & `.zsh_functions` files included in this kit enabl
118122

119123
The zsh-quickstart-kit configures your ZSH environment so that it includes:
120124

121-
* Automatic periodic updates of both zgen and your plugins
125+
* Automatic periodic updates of both `zgenom` and your plugins
122126
* Cross-session shared history so commands typed in one terminal window can be seen and searched in all your other `zsh` sessions on the same machine.
123127
* Automatic deduplication of your command history.
124128
* Many more tab completions, courtesy of the [zsh-users/zsh-completions](https://github.com/zsh-users/zsh-completions) repository, and periodic updating to tip of master of that repository so you get updates to the extra tab completions.
125129
* Supercharged command history search with [fzf](https://github.com/junegunn/fzf).
126130
* Syntax highlighting at the command line.
127131
* Tab completion of Rakefile targets.
128-
* Enabling [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh)-compatible plugins and themes (via the [zgen](https://github.com/tarjoilija/zgen) framework).
129-
* Various helper functions for interacting with macOS's clipboard, audio volume, Spotlight and Quicklook. For your convenience, these will only load if you are on a macOS machine so you can use the same plugin list on any *NIX system.
132+
* Enabling [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh)-compatible plugins and themes (via the [zgenom](https://github.com/jandamm/zgenom.git) framework).
133+
* Various helper functions for interacting with macOS' clipboard, audio volume, Spotlight and Quicklook. For your convenience, these will only load if you are on a macOS machine so you can use the same plugin list on any *NIX system.
130134
* If you've installed iTerm2's shell integration, it will automatically be loaded during shell startup.
131135

132136
### Included plugins
@@ -152,7 +156,7 @@ The zsh-quickstart-kit configures your ZSH environment so that it includes:
152156
* [zsh-users/zsh-history-substring-search](https://github.com/zsh-users/zsh-history-substring-search) - Better history search.
153157
* [zsh-users/zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) - Syntax highlighting as you type.
154158

155-
The quickstart kit also uses `zgen` to load oh-my-zsh and these plugins:
159+
The quickstart kit also uses `zgenom` to load oh-my-zsh and these plugins:
156160

157161
* aws
158162
* brew - only loaded on macOS
@@ -183,9 +187,11 @@ Running the following commands will toggle behavior the next time you start a sh
183187

184188
### Functions and Aliases
185189

186-
The `.zshrc` included in this kit will automatically source any files it finds in `~/.zshrc.d`. This is to make it easy for you to add extra functions and aliases without having to maintain a separate fork of this repository, and also allows you to configure behavior of some of the plugins by setting environment variables.
190+
The `.zshrc` included in this kit will automatically source any files it finds in `~/.zshrc.d`.
191+
192+
This is to make it easy for you to add extra functions and aliases without having to maintain a separate fork of this repository, and also allows you to configure behavior of some of the plugins by setting environment variables.
187193

188-
The files in `.zshrc.d` will be sourced in alphanumeric order after loading all the plugins and I suggest you use a naming scheme of `001-onething`, `002-something-else` etc to ensure they're loaded in the order you expect.
194+
The files will be sourced in alphanumeric order after loading all the plugins and I suggest you use a naming scheme of `001-onething`, `002-something-else` etc to ensure they're loaded in the order you expect.
189195

190196
### I like a plugin, but the aliases it installs overwrite other commands or aliases
191197

@@ -199,29 +205,29 @@ The quickstart kit does an opinionated (i.e. my way) setup of ZSH options and ad
199205

200206
The quickstart kit will automatically check for updates every seven days. If you want to change the interval, set `QUICKSTART_KIT_REFRESH_IN_DAYS` in a file in `~/.zshrc.d`. If you want to disable self updating entirely, add `unset QUICKSTART_KIT_REFRESH_IN_DAYS` in a file in `~/.zshrc.d`.
201207

202-
### Changing the zgen plugin list
208+
### Changing the plugin list
203209

204-
I've included what I think is a good starter set of zsh plugins in this repository. However, everyone has their own preferences for their environment.
210+
I've included what I think is a good starter set of ZSH plugins in this repository. However, everyone has their own preferences for their own environment.
205211

206-
To make the list easier to customize without having to maintain a separate fork of this kit, if you create a file named `~/.zgen-local-plugins`, the `.zshrc` from this starter kit will source that **instead** of running the `load-starter-plugin-list` function defined in `~/.zgen-setup`.
212+
To make the list easier to customize without having to maintain a separate fork of the quickstart kit, if you create a file named `~/.zgen-local-plugins`, the `.zshrc` from this starter kit will source that **instead** of running the `load-starter-plugin-list` function defined in `~/.zgen-setup`.
207213

208214
**Using `~/.zgen-local-plugins` is not additive, it will _completely replace_ the kit-provided list of plugins.**
209215

210-
I know that it's a pain to create `.zgen-local-plugins` from scratch, so to make customizing your plugins easier, I've included a `.zgen-local-plugins-example` file at the root of the repository that will install the same plugin list that the kit does by default that you can use as a starting point for your own customizations.
216+
I realize that it would be a pain to create `.zgen-local-plugins` from scratch, so to make customizing your plugins easier, I've included a `.zgen-local-plugins-example` file at the root of the repository that will install the same plugin list that the kit does by default that you can use as a starting point for your own customizations.
211217

212-
Copy that to your `$HOME/.zgen-local-plugins`, change the list and the next time you start a terminal session you'll get your list instead of mine.
218+
Copy that to your `$HOME/.zgen-local-plugins`, change the list and the next time you start a terminal session you'll get your plugin list loaded instead of the kit's defaults.
213219

214220
### Disabling zmv
215221

216222
The quickstart automatically autoloads zmv. If you want to disable that, create a file named `.zsh-quickstart-no-zmv` in your home directory.
217223

218224
### Disabling oh-my-zsh
219225

220-
If you don't want zgen to load the oh-my-zsh defaults, create `.zsh-quickstart-no-omz` in your home directory.
226+
If you don't want `zgenom` to load the oh-my-zsh defaults, create `.zsh-quickstart-no-omz` in your home directory.
221227

222228
## FAQ
223229

224-
### How do I reconfigure the prompt
230+
### How do I reconfigure the prompt?
225231

226232
You may want to reconfigure your prompt after using it. The quickstart uses the [powerlevel10k](https://github.com/romkatv/powerlevel10k) theme, so you can reconfigure your prompt by running `p10k configure`.
227233

@@ -250,9 +256,10 @@ From https://github.com/unixorn/zsh-quickstart-kit
250256
Aborting
251257

252258
```
259+
253260
This happens when you edit a file provided by the quickstart kit, in this case, `.zshrc`. This is annoying, and in order to let you customize your ZSH settings without having to maintain your own fork, the kit-provided `.zshrc` will load any files it finds in `~/.zshrc.d`.
254261

255-
### Stow complains with a warning that stowing zsh would cause conflicts
262+
### GNU stow complains with a warning that stowing zsh would cause conflicts
256263

257264
You ran `stow --target=/Users/YourUsername zsh` in the top level of the repo, and stow printed the following error:
258265

zsh/.zgen-setup

+30-13
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,41 @@
1-
#!/bin/zsh
1+
#!/usr/bin/env zsh
22
#
3-
# Only including a shebang to trigger Sublime Text to use shell
3+
# Only including a shebang to trigger editors to use shell
44
# syntax highlighting.
55
#
6-
# Copyright 2006-2019 Joseph Block <[email protected]>
6+
# Copyright 2006-2021 Joseph Block <[email protected]>
77
#
88
# BSD licensed, see LICENSE.txt
99

10-
# Clone zgen if you haven't already
11-
if [[ -z "$ZGEN_PARENT_DIR" ]]; then
12-
ZGEN_PARENT_DIR=$HOME
10+
# Clone zgenom if you haven't already
11+
if [[ -z "$ZGENOM_PARENT_DIR" ]]; then
12+
ZGENOM_PARENT_DIR=$HOME
1313
fi
14-
if [[ ! -f $ZGEN_PARENT_DIR/zgen/zgen.zsh ]]; then
15-
if [[ ! -d "$ZGEN_PARENT_DIR" ]]; then
16-
mkdir -p "$ZGEN_PARENT_DIR"
14+
15+
# zgenom stores the clones plugins & themes in $ZGEN_DIR when it
16+
# is set. Otherwise it stuffs everything in the source tree, which
17+
# is unclean.
18+
ZGEN_DIR=${ZGEN_DIR:-$HOME/.zgenom}
19+
20+
# echo "ZGEN_DIR: $ZGEN_DIR"
21+
22+
if [[ ! -f $ZGENOM_PARENT_DIR/zgenom/zgenom.zsh ]]; then
23+
if [[ ! -d "$ZGENOM_PARENT_DIR" ]]; then
24+
mkdir -p "$ZGENOM_PARENT_DIR"
1725
fi
18-
pushd $ZGEN_PARENT_DIR
19-
git clone git@github.com:tarjoilija/zgen.git
26+
pushd $ZGENOM_PARENT_DIR
27+
git clone https://github.com/jandamm/zgenom.git
2028
popd
2129
fi
22-
source $ZGEN_PARENT_DIR/zgen/zgen.zsh
23-
unset ZGEN_PARENT_DIR
30+
31+
if [[ ! -f "$ZGENOM_PARENT_DIR/zgenom/zgenom.zsh" ]]; then
32+
echo "Can't find zgenom.zsh"
33+
else
34+
# echo "Loading zgenom"
35+
source "$ZGENOM_PARENT_DIR/zgenom/zgenom.zsh"
36+
fi
37+
38+
unset ZGENOM_PARENT_DIR
2439

2540
warn-about-prompt-change() {
2641
if [[ ! -f ~/.zsh-quickstart-kit-prompt-switch-warning ]]; then
@@ -235,6 +250,8 @@ if [[ -L ~/.zgen-local-plugins ]]; then
235250
REAL_ZGEN_SETUP="${HOME}/$(readlink ~/.zgen-local-plugins)"
236251
fi
237252

253+
# echo "REAL_ZGEN_ZETUP: $REAL_ZGEN_SETUP"
254+
238255
# If .zgen-setup is newer than init.zsh, regenerate init.zsh
239256
if [ $(get_file_modification_time ${REAL_ZGEN_SETUP}) -gt $(get_file_modification_time ~/.zgen/init.zsh) ]; then
240257
echo "$(basename ${REAL_ZGEN_SETUP}) updated; creating a new init.zsh from plugin list in ${REAL_ZGEN_SETUP}"

zsh/.zsh_aliases

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Only including a shebang to trigger Sublime Text to use shell syntax highlighting
44
#
5-
# Copyright 2006-2018 Joseph Block <[email protected]>
5+
# Copyright 2006-2021 Joseph Block <[email protected]>
66
#
77
# BSD licensed, see LICENSE.txt in this repository.
88

@@ -15,7 +15,7 @@ if [[ -x /usr/local/bin/subl ]]; then
1515
alias s="subl"
1616
fi
1717

18-
# yes, these tests are ugly. They do however, work.
18+
# Yes, these tests are ugly. They do however, work.
1919
if [[ "$(uname -s)" == "Darwin" ]]; then
2020
# do OS X specific things
2121

@@ -36,6 +36,7 @@ fi
3636

3737
export CVS_RSH=ssh
3838

39+
# shellcheck disable=SC2142
3940
alias historysummary="history | awk '{a[\$2]++} END{for(i in a){printf \"%5d\t%s\n\",a[i],i}}' | sort -rn | head"
4041

4142
if [ -x /bin/vim ]; then
@@ -76,6 +77,7 @@ alias external_ip="curl -s icanhazip.com"
7677
alias myip="dig +short myip.opendns.com @resolver1.opendns.com"
7778

7879
# Show laptop's IP addresses
80+
# shellcheck disable=2139
7981
alias ips="ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1'"
8082

8183
alias reattach="screen -r"
@@ -151,6 +153,7 @@ alias ...="cd ../.."
151153

152154
# Honor old .zsh_aliases.local customizations, but print depecation warning.
153155
if [ -f ~/.zsh_aliases.local ]; then
156+
# shellcheck disable=SC1090
154157
source ~/.zsh_aliases.local
155158
echo ".zsh_aliases.local is deprecated. Make entries in files in ~/.zshrc.d instead."
156159
fi

zsh/.zsh_functions

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Only including a shebang to trigger editors shell syntax highlighting
44
#
5-
# Copyright 2006-2020 Joseph Block <[email protected]>
5+
# Copyright 2006-2021 Joseph Block <[email protected]>
66
#
77
# BSD licensed, see LICENSE.txt
88
#

0 commit comments

Comments
 (0)