mkcd

December 31, 2025 ยท View on GitHub

A tiny zsh plugin providing mkcd, the canonical mkdir && cd helper.

Inspired by the common mkdir && cd pattern.

Usage

mkcd foo/bar
mkcd ~/projects/app

Creates the directory recursively if it does not exist, then changes into it.

Installation

Quick Install

mkdir -p ~/.local/share/zsh-plugins && curl -o ~/.local/share/zsh-plugins/mkcd.plugin.zsh https://raw.githubusercontent.com/azizoid/zsh-mkcd/main/mkcd.plugin.zsh

Add to your ~/.zshrc:

source ~/.local/share/zsh-plugins/mkcd.plugin.zsh

Restart your shell or run source ~/.zshrc.

Plugin Managers

Oh My Zsh:

mkdir -p ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/mkcd && curl -o ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/mkcd/mkcd.plugin.zsh https://raw.githubusercontent.com/azizoid/zsh-mkcd/main/mkcd.plugin.zsh

Add mkcd to your plugins array in ~/.zshrc:

plugins=(... mkcd)

Zinit:

zinit load azizoid/zsh-mkcd

Antigen:

antigen bundle azizoid/zsh-mkcd

Uninstallation

Manual Install

  1. Remove the source line from your ~/.zshrc:

    source ~/.local/share/zsh-plugins/mkcd.plugin.zsh
    
  2. Optionally delete the plugin file:

    rm ~/.local/share/zsh-plugins/mkcd.plugin.zsh
    
  3. Restart your shell.

Plugin Managers

Oh My Zsh: Remove mkcd from your plugins array in ~/.zshrc, then:

rm -rf ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/mkcd

Zinit: Remove the zinit load azizoid/zsh-mkcd line from your ~/.zshrc.

Antigen: Remove the antigen bundle azizoid/zsh-mkcd line from your ~/.zshrc.

License

MIT