Skip to content

Instantly share code, notes, and snippets.

@niosus
Last active March 19, 2023 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niosus/57ec3c2673877d9fc925fd72aa8d037e to your computer and use it in GitHub Desktop.
Save niosus/57ec3c2673877d9fc925fd72aa8d037e to your computer and use it in GitHub Desktop.
Zsh config
# Init antigen.
source "$HOME/.antigen.zsh"
# Configure antigen.
antigen use oh-my-zsh
# Plugins
antigen bundle git
antigen bundle command-not-found
antigen bundle zsh-users/zsh-completions
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle srijanshetty/zsh-pip-completion
antigen bundle MichaelAquilina/zsh-auto-notify
antigen bundle unixorn/autoupdate-antigen.zshplugin
antigen bundle iboyperson/pipenv-zsh
antigen bundle trystan2k/zsh-tab-title
antigen bundle zpm-zsh/undollar
antigen bundle mafredri/zsh-async
# Set theme
antigen theme subnixr/minimal
# Apply antigen settings.
antigen apply
# Use Python 3 by default.
alias python=python3
alias pip=pip3
# Use the fzf by default
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

This is my zsh config

To make it work, you have to be using zsh:

  • If you're on recent MacOS then you already are
  • If you're on Linux, follow these steps:

Before applying the above config, install antigen - just follow this link for that: https://github.com/zsh-users/antigen#installation

@rohitdavas
Copy link

there was an issue with zsh-async installation. fixed after installing it manually using brew.

brew install zsh-async

https://formulae.brew.sh/formula/zsh-async

issue was similar to this : Installing mafredri/zsh-async... Error! Activate logging and try again.

@niosus
Copy link
Author

niosus commented Jan 31, 2023

Hmm, that's strange. I recently installed it on a new laptop and it worked out of the box 🤔

@rohitdavas
Copy link

how do you approach finding why it happened on my system and not yours ? just curious.

my system is macbook air, M1 Chip, macos ventura, version 13.1

@mg-par019
Copy link

I have the same problem with my new mac pro m2. Even using brew install zsh-async, the terminal freezes at source .zshrc.

@niosus
Copy link
Author

niosus commented Feb 2, 2023

@rohitdavas for the software I write, I can set up the continuous integration that runs on different systems. For a script like this one, there is no way I know of to check. I'll have to dig into this if you guys keep having these issues 🤔

@mg-par019
Copy link

mg-par019 commented Feb 2, 2023

After navigating the internet, I found the solutions.
For zsh-async, mafredri/zsh-async#61 (comment)
For hanging problem with source .zshrc, it should be antigen bundle subnixr/minimal thanks to https://github.com/zsh-users/antigen/issues/675.
Now, it works perfectly for me.

@mg-par019
Copy link

I also added antigen bundle zsh-users/zsh-autosuggestions which may be useful.

@niosus
Copy link
Author

niosus commented Feb 10, 2023

Thanks for your digging @mg-par019. A more precise link to the solution is here: zsh-users/antigen#675 (comment)

What I still find weird is that this thread is from 2020, I set up my macOS M1 and M2 laptops this and last year and never encountered this issue. I wonder what makes the difference. 🤔

@rohitdavas
Copy link

I need to understand it more that how the setup is working as whole. Putting it out just for learning purpose for people who might come to this page.

After my fix above, everything was good. ( the brew installation comment above ). Now today i changed my .zshrc file so that it alias python to python3.11 . And after that the system starts running and installing the packages again. I mean it should happen only if there is dependancy on python, but the alias to python is created after the installation of packages.

So it's kind of weird that system is recognising that python alias change, and reinstalling the packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment