Skip to main content

Manage and edit $HOME dotfiles using Python + git = <3

Project description

mydot -- A Python Module for managing dotfiles

Super-charged version of the Atlassian approach to managing dotfiles using a bare git repo + fzf magic!

Quick Start

  1. Configure shell: At the bottom of your ~/.bashrc add:

    export DOTFILES="$HOME/.config/dotfiles"
    alias d.="python -m mydot"
    

    what and why?:

    • DOTFILES: variable pointing to your local --bare dotfiles repository
    • d. alias to invoke mydot's command line interface
  2. Initialize dotfiles repository: First open a new shell or source ~/.bashrc{.bash} then:

    mkdir -pv $DOTFILES         # create directory
    git init --bare $DOTFILES   # initialize the repository
    
  3. Install mydot, fzf, and disable viewing of untracked files

    pip install --user mydot
    sudo apt install fzf -y
    d. git config --local status.showUntrackedFiles no
    
  4. Add files to your dotfiles repo

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

    protip: d. git gives you full control and lets you do anything available from the git command.

  5. Feel the power with mydot

    d. --edit   # choose a file to open in $EDITOR
    d. --add    # add changed files to staging area
    d. --run    # select an executable file to run
    d. --grep   # grep through tracked dotfiles and pick from matches
    d. --restore # remove files from staging area
    d. --discard # discard unstaged changes from work tree
    
    d. --tar    # make a tarball of your dotfiles
    d. --status # see the state of your repo
    d. --ls     # list all files under version control
    
    d. --help   # see more detials about available commands
    

Going Deeper

Useful aliases

alias es="python -m mydot --edit" # quick select a file to edit
alias rs="python -m 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mydot-0.4.0.tar.gz (9.3 kB view hashes)

Uploaded Source

Built Distribution

mydot-0.4.0-py3-none-any.whl (11.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page