├── .github ├── LICENSE └── README.md ├── .gitignore ├── .zfunctions └── is-macos ├── .zsh_plugins.txt ├── .zshenv ├── .zshrc ├── .zshrc.d ├── aliases.zsh ├── brew.zsh ├── history-substring-search.zsh └── zoxide.zsh └── .zstyles /.github/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022-2023 mattmc3 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.github/README.md: -------------------------------------------------------------------------------- 1 | # zdotdir 2 | 3 | > A sample Zsh config using the antidote plugin manager 4 | 5 | ## Description 6 | 7 | This project aims to give you an example Zsh config that uses [antidote] as a plugin manager and pulls some amazing Zsh plugins together. Consider it an example configuration of how to use antidote. Feel free to borrow from it for your own config, or fork it and make it your own. 8 | 9 | ## What's included 10 | 11 | A sample antidote `.zsh_plugins.txt` file that bundles plugins with the following plugin provided features: 12 | - Better Zsh defaults 13 | - [Autosuggestions](https://github.com/zsh-users/zsh-autosuggestions) 14 | - [History substring searching](https://github.com/zsh-users/zsh-history-substring-search) 15 | - [Syntax highlighting](https://github.com/zdharma-continuum/fast-syntax-highlighting) 16 | - TAB completions 17 | - The popular [Powerlevel10k prompt](https://github.com/romkatv/powerlevel10k) 18 | - A few goodies from [Oh-My-Zsh](https://github.com/ohmyzsh/ohmyzsh) 19 | - A `functions` directory for lazy-loaded functions 20 | - Lots of [helpful plugins](https://github.com/unixorn/awesome-zsh-plugins)! 21 | - And much more, all without compromising shell speed :rocket: 22 | 23 | ## Installation 24 | 25 | Clone this project to `$ZDOTDIR`, and then make `~/.zshenv` source `$ZDOTDIR/.zshenv`. 26 | 27 | ```zsh 28 | # clone this project 29 | ZDOTDIR=~/.config/zsh 30 | git clone --branch kickstart https://github.com/getantidote/zdotdir $ZDOTDIR 31 | 32 | # source the .zshenv from ZDOTDIR 33 | [[ -f ~/.zshenv ]] && mv -f ~/.zshenv ~/.zshenv.bak 34 | echo ". $ZDOTDIR/.zshenv" > ~/.zshenv 35 | 36 | # start a new zsh session 37 | zsh 38 | ``` 39 | 40 | [antidote]: https://getantidote.github.io 41 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### .gitignore 2 | 3 | .antidote/ 4 | .zcompcache/ 5 | .zsh_sessions/ 6 | .zcompdump* 7 | .zsh_history 8 | .zsh_plugins.zsh 9 | *.bak 10 | *.local 11 | *.local.zsh 12 | *.zwc 13 | *.zwc.old 14 | ~* 15 | -------------------------------------------------------------------------------- /.zfunctions/is-macos: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | [[ $OSTYPE == *darwin* ]] 3 | -------------------------------------------------------------------------------- /.zsh_plugins.txt: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | # 3 | # .zsh_plugins.txt - antidote plugins file 4 | # 5 | 6 | # Completions 7 | mattmc3/ez-compinit 8 | zsh-users/zsh-completions kind:fpath path:src 9 | aloxaf/fzf-tab # Remove if you don't use fzf 10 | 11 | # Completion styles 12 | belak/zsh-utils path:completion/functions kind:autoload post:compstyle_zshzoo_setup 13 | 14 | # Keybindings 15 | belak/zsh-utils path:editor 16 | 17 | # History 18 | belak/zsh-utils path:history 19 | 20 | # Prompt 21 | romkatv/powerlevel10k 22 | 23 | # Utilities 24 | zshzoo/macos conditional:is-macos 25 | belak/zsh-utils path:utility 26 | romkatv/zsh-bench kind:path 27 | ohmyzsh/ohmyzsh path:plugins/extract 28 | 29 | # Other Fish-like features 30 | zdharma-continuum/fast-syntax-highlighting # Syntax highlighting 31 | zsh-users/zsh-autosuggestions # Auto-suggestions 32 | zsh-users/zsh-history-substring-search # Up/Down to search history 33 | -------------------------------------------------------------------------------- /.zshenv: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | # 3 | # .zshenv - Zsh environment file, loaded always. 4 | # 5 | 6 | # NOTE: .zshenv needs to live at ~/.zshenv, not in $ZDOTDIR! 7 | 8 | # Set ZDOTDIR if you want to re-home Zsh. 9 | export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config} 10 | export XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share} 11 | export XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache} 12 | export ZDOTDIR=${ZDOTDIR:-$XDG_CONFIG_HOME/zsh} 13 | 14 | # Ensure path arrays do not contain duplicates. 15 | typeset -gU path fpath 16 | 17 | # Set the list of directories that zsh searches for commands. 18 | path=( 19 | $HOME/{,s}bin(N) 20 | $HOME/.local/{,s}bin(N) 21 | /opt/{homebrew,local}/{,s}bin(N) 22 | /usr/local/{,s}bin(N) 23 | $path 24 | ) 25 | -------------------------------------------------------------------------------- /.zshrc: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | # 3 | # .zshrc - Zsh file loaded on interactive shell sessions. 4 | # 5 | 6 | # Enable Powerlevel10k instant prompt. Should stay close to the top of .zshrc. 7 | # Initialization code that may require console input (password prompts, [y/n] 8 | # confirmations, etc.) must go above this block; everything else may go below. 9 | if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then 10 | source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" 11 | fi 12 | 13 | # Lazy-load (autoload) Zsh function files from a directory. 14 | ZFUNCDIR=${ZDOTDIR:-$HOME}/.zfunctions 15 | fpath=($ZFUNCDIR $fpath) 16 | autoload -Uz $ZFUNCDIR/*(.:t) 17 | 18 | # Set any zstyles you might use for configuration. 19 | [[ ! -f ${ZDOTDIR:-$HOME}/.zstyles ]] || source ${ZDOTDIR:-$HOME}/.zstyles 20 | 21 | # Clone antidote if necessary. 22 | if [[ ! -d ${ZDOTDIR:-$HOME}/.antidote ]]; then 23 | git clone https://github.com/mattmc3/antidote ${ZDOTDIR:-$HOME}/.antidote 24 | fi 25 | 26 | # Create an amazing Zsh config using antidote plugins. 27 | source ${ZDOTDIR:-$HOME}/.antidote/antidote.zsh 28 | antidote load 29 | 30 | # Source anything in .zshrc.d. 31 | for _rc in ${ZDOTDIR:-$HOME}/.zshrc.d/*.zsh; do 32 | # Ignore tilde files. 33 | if [[ $_rc:t != '~'* ]]; then 34 | source "$_rc" 35 | fi 36 | done 37 | unset _rc 38 | 39 | # To customize prompt, run `p10k configure` or edit .p10k.zsh. 40 | [[ ! -f ${ZDOTDIR:-$HOME}/.p10k.zsh ]] || source ${ZDOTDIR:-$HOME}/.p10k.zsh 41 | -------------------------------------------------------------------------------- /.zshrc.d/aliases.zsh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | # 3 | # .aliases - Set whatever shell aliases you want. 4 | # 5 | 6 | # single character aliases - be sparing! 7 | alias _=sudo 8 | alias l=ls 9 | alias g=git 10 | 11 | # mask built-ins with better defaults 12 | alias vi=vim 13 | 14 | # more ways to ls 15 | alias ll='ls -lh' 16 | alias la='ls -lAh' 17 | alias ldot='ls -ld .*' 18 | 19 | # fix common typos 20 | alias quit='exit' 21 | alias cd..='cd ..' 22 | 23 | # tar 24 | alias tarls="tar -tvf" 25 | alias untar="tar -xf" 26 | 27 | # find 28 | alias fd='find . -type d -name' 29 | alias ff='find . -type f -name' 30 | 31 | # url encode/decode 32 | alias urldecode='python3 -c "import sys, urllib.parse as ul; \ 33 | print(ul.unquote_plus(sys.argv[1]))"' 34 | alias urlencode='python3 -c "import sys, urllib.parse as ul; \ 35 | print (ul.quote_plus(sys.argv[1]))"' 36 | 37 | # misc 38 | alias please=sudo 39 | alias zshrc='${EDITOR:-vim} "${ZDOTDIR:-$HOME}"/.zshrc' 40 | alias zbench='for i in {1..10}; do /usr/bin/time zsh -lic exit; done' 41 | alias zdot='cd ${ZDOTDIR:-~}' 42 | -------------------------------------------------------------------------------- /.zshrc.d/brew.zsh: -------------------------------------------------------------------------------- 1 | (( $+commands[brew] )) || return 1 2 | eval $(brew shellenv) 3 | -------------------------------------------------------------------------------- /.zshrc.d/history-substring-search.zsh: -------------------------------------------------------------------------------- 1 | [[ -v terminfo ]] || zmodload zsh/terminfo 2 | 3 | if [[ -n "$terminfo[kcuu1]" ]]; then 4 | bindkey -M emacs "$terminfo[kcuu1]" history-substring-search-up 5 | bindkey -M viins "$terminfo[kcuu1]" history-substring-search-up 6 | fi 7 | if [[ -n "$terminfo[kcud1]" ]]; then 8 | bindkey -M emacs "$terminfo[kcud1]" history-substring-search-down 9 | bindkey -M viins "$terminfo[kcud1]" history-substring-search-down 10 | fi 11 | -------------------------------------------------------------------------------- /.zshrc.d/zoxide.zsh: -------------------------------------------------------------------------------- 1 | (( $+commands[zoxide] )) || return 1 2 | eval "$(zoxide init zsh)" 3 | -------------------------------------------------------------------------------- /.zstyles: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | # 3 | # .zstyles - Set zstyle settings for plugins that need them. 4 | # 5 | 6 | # 7 | # Antidote 8 | # 9 | 10 | # zstyle ':antidote:bundle' file ${ZDOTDIR:-~}/.zplugins.txt 11 | # zstyle ':antidote:bundle' use-friendly-names 'yes' 12 | --------------------------------------------------------------------------------