Skip to main content

mydot -- A Python module for managing dotfiles

Super-charged version of the Atlassian approach to managing dotfiles using a bare git repo + fzf magic! Quickly edit files, add changes, run scripts, grep through dotfiles, or discard work-tree changes with ease.

Quick Start

  1. Install dependencies:

    sudo apt install fzf git    # Ubuntu/Debian
    brew install fzf git        # MacOS/Homebrew
    
  2. Configure shell: At the bottom of your ~/.bashrc or ~/.zshrc add:

    export DOTFILES="$HOME/.config/dotfiles"
    alias config='/usr/bin/git --git-dir=$DOTFILES --work-tree=$HOME'
    

    what and why?:

    • DOTFILES: variable pointing to your local --bare dotfiles repository
    • config: git alias to directly address the --bare dotfiles repository
  3. Initialize dotfiles repository:

    # reload shell configuration
    source ~/.bashrc            # if using bash
    source ~/.zshrc             # if using zsh
    
    mkdir -pv $DOTFILES         # create directory
    git init --bare $DOTFILES   # initialize --bare git repository
    
  4. Install mydot and disable viewing of untracked files

    pip install --user mydot    # if using pip
    pipx install mydot          # if using pipx
    mydot git config --local status.showUntrackedFiles no
    
  5. Add files to your dotfiles repo

    mydot git add ~/.vimrc ~/.tmux.conf ~/.bashrc ~/.bash_aliases ~/.zshrc
    mydot git commit -m "the journey of a thousand miles begins with one step"
    

    protip: You can use all your regular git commands, including aliases, when calling mydot git

  6. Feel the power with mydot (and the pre-installed alias d.)

    d. edit         # modify tracked files in your $EDITOR (tab in fzf for multiselect)
    d. add          # choose which modified files to stage for commit
    d. git commit   # commit changes
    
    d. grep zfs     # find all files with lines containing the string zfs
    d. grep zfs$    # works with regex too! e.g, zfs$ something.*var ^$
    d. grep -E "zfs|ext4" # extended regexp
    
    d. run          # run any executable script in your dotfiles repo
    d. status       # see the state of your repo
    d. ls           # list all files under version control
    
    d. export       # make a tarball of your dotfiles + bare git repo
    d. clip         # put file paths into the clipboard
    
    d. restore      # remove files from staging area
    d. discard      # discard unstaged changes from work tree
    
    d. fzf          # select files and print paths to stdout (for piping)
    d. history      # browse and compare file history
    d. cd           # navigate to a dotfile's directory in a subshell
    d. watch        # lazygit-style TUI: live status, stage (s), commit (c)
                    # see docs/watch.md for full keybindings + config
    
    d.              # see the help message detailing available commands
    

Submodule Support

If your dotfiles repo contains git submodules (e.g., ~/.config/tmux), mydot will include their tracked files in edit, fzf, clip, grep, ls, cd, and export (up to 2 levels deep).

Known limitation: d. history will list submodule files but cannot show their per-file commit history. The outer repo only tracks the submodule pointer, not individual file changes within the submodule.

Going Deeper

Customizing d. cd

By default d. cd lists the directory with ls -lA --color=auto before opening the subshell. Set MYDOT_CD_CMD to use a different listing command:

export MYDOT_CD_CMD="eza -la"   # use eza
export MYDOT_CD_CMD="tree -L 2" # use tree

Useful aliases

alias es="mydot edit"     # quick select a file to edit
alias rs="mydot run"      # quick select a script to run

Source of Truth

This project is available on GitHub and GitLab. Each push to master automatically goes to both so choose whichever platform you prefer. All releases are published to PyPi

Metadata

Release files for mydot 0.13.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mydot 0.13.1
File Size Uploaded
mydot-0.13.1.tar.gz 33.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mydot 0.13.1
File Interpreter ABI Platform
mydot-0.13.1-py3-none-any.whl Python 3 none any Details

Total release size: 57.5 kB

Release files / mydot-0.13.1.tar.gz

Download URL mydot-0.13.1.tar.gz
Size 33.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d06a8d9bcff3f7cea7bb94c8ed29ee58eff85f519ce2f0ebab219a0e51fc79db
BLAKE2b-256 checksum
How to use checksums
6e07d526e15448a3dc2e2e81261c54c4913304eebdfb00869fa6addf2648db11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / mydot-0.13.1-py3-none-any.whl

Download URL mydot-0.13.1-py3-none-any.whl
Size 24.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a40b2d3cc178f2cdea5e9a0f4448442c43ef4acb1477c827a05f0ae0a87ba4c0
BLAKE2b-256 checksum
How to use checksums
2c99e3b8302bfb775268610572b6685631dd599508682d551fb4dc044d9f89e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.13.1 This release

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.2

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page