Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to zgenom #88

Merged
merged 23 commits into from
Mar 27, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
de71ff2
Update to use zgenom instead of zgen
unixorn Nov 13, 2020
a188239
Update readme to reflect switch to zgenom
unixorn Nov 13, 2020
d687fba
TOC update after switch to zgenom
unixorn Nov 13, 2020
34c172f
Add faq for garbled prompt separators
unixorn Nov 13, 2020
1ea505d
Add superlinter github action
unixorn Nov 14, 2020
879456a
Add markdown link check github action
unixorn Nov 14, 2020
6901e04
Fix lint bugs in .codeclimate.yml
unixorn Nov 14, 2020
9ef5c7d
Disable overzealous shellcheck warnings
unixorn Nov 14, 2020
9e222a6
Clean up markdown formatting
unixorn Nov 14, 2020
d4af44b
Update toc
unixorn Nov 14, 2020
5ba2c5e
Update github checks
unixorn Nov 16, 2020
d4966a5
Remove unneeded circleci config any more
unixorn Nov 24, 2020
f33dea5
Added GH actions in another branch, make the merge less painful
unixorn Nov 26, 2020
4232b39
Merge remote-tracking branch 'origin/master' into switch-to-zgenom
unixorn Nov 26, 2020
e3f8677
Merge remote-tracking branch 'origin/master' into switch-to-zgenom
unixorn Dec 1, 2020
14dd8fe
Merge remote-tracking branch 'origin/master' into switch-to-zgenom
unixorn Dec 12, 2020
2989c91
Merge remote-tracking branch 'origin/master' into switch-to-zgenom
unixorn Dec 30, 2020
7d7cc9c
Merge remote-tracking branch 'origin/master' into switch-to-zgenom
unixorn Dec 30, 2020
e834b20
Fix bug in ssh-agent handling
unixorn Mar 27, 2021
9623a7d
Clean up readme
unixorn Mar 27, 2021
a44e049
Update copyrights
unixorn Mar 27, 2021
96f2495
Add warning about zgenom switch
unixorn Mar 27, 2021
587081c
Update toc in readme
unixorn Mar 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@
- [Contents of the kit](#contents-of-the-kit)
- [Included plugins:](#included-plugins)
- [Customizing the kit](#customizing-the-kit)
- [Behavior toggles](#behavior-toggles)
- [Functions and Aliases](#functions-and-aliases)
- [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)
- [ZSH options.](#zsh-options)
- [Self-update Settings](#self-update-settings)
- [Changing the zgen plugin list](#changing-the-zgen-plugin-list)
- [Changing the plugin list](#changing-the-plugin-list)
- [Disabling zmv](#disabling-zmv)
- [Disabling oh-my-zsh](#disabling-oh-my-zsh)
- [FAQ](#faq)
- [Stow complains with a warning that stowing zsh would cause conflicts](#stow-complains-with-a-warning-that-stowing-zsh-would-cause-conflicts)
- [I added a new completion plugin and it isn't working](#i-added-a-new-completion-plugin-and-it-isnt-working)
- [Other Resources](#other-resources)
- [ZSH](#zsh)
- [Dotfiles in general](#dotfiles-in-general)
Expand Down Expand Up @@ -95,17 +97,17 @@ If you get garbled branch glyphs, make sure there isn't a separate font setting

## Set up Zgen and the starter kit

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.
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.

1. Install [Zgen](https://github.com/tarjoilija/zgen)
1. Install [Zgenom](https://github.com/jandamm/zgenom.git)
1. `cd ~`
2. `git clone git@github.com:tarjoilija/zgen.git`
2. `git clone https://github.com/jandamm/zgenom.git`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation for list items at the same level

2. Install the starter kit
1. `cd ~`
2. `git clone [email protected]:unixorn/zsh-quickstart-kit.git`
3. Configure zsh by symlinking the `.zshrc`, `.zsh_aliases` and `.zsh-completions` from this repo into your `~`.
1. You can do this with `stow` by:
1. `cd zsh-quickstart-kit`
1. `cd /path/to/your/clone/of/the/zsh-quickstart-kit`
2. `stow --target=/Users/YourUsername zsh`. Replace `/Users/YourUsername` with `/home/YourUsername` if you're on Linux.

The `.zshrc`, `.zsh_aliases` & `.zsh_functions` files included in this kit enable the plugins listed below.
Expand All @@ -114,14 +116,14 @@ The `.zshrc`, `.zsh_aliases` & `.zsh_functions` files included in this kit enabl

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

* Automatic periodic updates of both zgen and your plugins
* Automatic periodic updates of both zgenom and your plugins
* 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.
* Automatic deduplication of your command history.
* 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.
* Supercharged command history search with [fzf](https://github.com/junegunn/fzf).
* Syntax highlighting at the command line.
* Tab completion of Rakefile targets.
* Enabling [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh)-compatible plugins and themes (via the [zgen](https://github.com/tarjoilija/zgen) framework).
* 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).
* 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.
* If you've installed iTerm2's shell integration, it will automatically be loaded during shell startup.

Expand All @@ -148,7 +150,7 @@ The zsh-quickstart-kit configures your ZSH environment so that it includes:
* [zsh-users/zsh-history-substring-search](https://github.com/zsh-users/zsh-history-substring-search) - Better history search.
* [zsh-users/zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) - Syntax highlighting as you type.

The quickstart kit also uses `zgen` to load oh-my-zsh and these plugins:
The quickstart kit also uses `zgenom` to load oh-my-zsh and these plugins:
* aws
* brew - only loaded on macOS
* chruby
Expand Down Expand Up @@ -190,11 +192,11 @@ The quickstart kit does an opinionated (i.e. my way) setup of ZSH options and ad

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`.

## Changing the zgen plugin list
## Changing the plugin list

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.
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.

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`.
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`.

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

Expand Down
45 changes: 32 additions & 13 deletions zsh/.zgen-setup
Original file line number Diff line number Diff line change
@@ -1,26 +1,43 @@
#!/bin/zsh
#!/usr/bin/env zsh
#
# Only including a shebang to trigger Sublime Text to use shell
# Only including a shebang to trigger editors to use shell
# syntax highlighting.
#
# Copyright 2006-2019 Joseph Block <[email protected]>
# Copyright 2006-2020 Joseph Block <[email protected]>
#
# BSD licensed, see LICENSE.txt

# Clone zgen if you haven't already
if [[ -z "$ZGEN_PARENT_DIR" ]]; then
ZGEN_PARENT_DIR=$HOME
# Clone zgenom if you haven't already
if [[ -z "$ZGENOM_PARENT_DIR" ]]; then
ZGENOM_PARENT_DIR=$HOME
fi
if [[ ! -f $ZGEN_PARENT_DIR/zgen/zgen.zsh ]]; then
if [[ ! -d "$ZGEN_PARENT_DIR" ]]; then
mkdir -p "$ZGEN_PARENT_DIR"

# zgenom stores the clones plugins & themes in $ZGEN_DIR when it
# is set. Otherwise it stuffs everything in the source tree, which
# is unclean.
ZGEN_DIR=${ZGEN_DIR:-$HOME/.zgenom}

# echo "ZGEN_DIR: $ZGEN_DIR"

if [[ ! -f $ZGENOM_PARENT_DIR/zgenom/zgenom.zsh ]]; then
if [[ ! -d "$ZGENOM_PARENT_DIR" ]]; then
mkdir -p "$ZGENOM_PARENT_DIR"
fi
pushd $ZGEN_PARENT_DIR
git clone git@github.com:tarjoilija/zgen.git
pushd $ZGENOM_PARENT_DIR
git clone https://github.com/jandamm/zgenom.git
popd
fi
source $ZGEN_PARENT_DIR/zgen/zgen.zsh
unset ZGEN_PARENT_DIR

# echo "zgenom path - $ZGENOM_PARENT_DIR/zgenom/zgenom.zsh"

if [[ ! -f "$ZGENOM_PARENT_DIR/zgenom/zgenom.zsh" ]]; then
echo "Can't find zgenom.zsh"
else
# echo "Loading zgenom"
source "$ZGENOM_PARENT_DIR/zgenom/zgenom.zsh"
fi

unset ZGENOM_PARENT_DIR

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

# echo "REAL_ZGEN_ZETUP: $REAL_ZGEN_SETUP"

# If .zgen-setup is newer than init.zsh, regenerate init.zsh
if [ $(get_file_modification_time ${REAL_ZGEN_SETUP}) -gt $(get_file_modification_time ~/.zgen/init.zsh) ]; then
echo "$(basename ${REAL_ZGEN_SETUP}) updated; creating a new init.zsh from plugin list in ${REAL_ZGEN_SETUP}"
Expand Down