mydot


Namemydot JSON
Version 0.7.1 PyPI version JSON
download
home_pagehttps://github.com/gikeymarcia/mydot
SummaryManage and edit $HOME dotfiles using Python + git = <3
upload_time2023-09-07 03:52:03
maintainer
docs_urlNone
authorMikey Garcia
requires_python
licenseGPL-3.0
keywords
VCS
bugtrack_url
requirements pydymenu rich
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # mydot -- A Python module for managing dotfiles

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

## Quick Start

1. **Install dependencies:**

    ```bash
    sudo apt install fzf git    # Ubuntu/Debian
    brew install fzf git        # MacOS/Homebrew
    ```
1. **Configure shell:** At the bottom of your `~/.bashrc` or `~/.zshhrc` add:

    ```bash
    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

2. **Initialize dotfiles repository:**

    ```bash
    # reload shell configu
    source ~/.bashrc            # if using bash
    source ~/.zshrcc            # if using zsh

    mkdir -pv $DOTFILES         # create directory
    git init --bare $DOTFILES   # initialize --bare git repository
    ```

3. **Install** `mydot` and disable viewing of untracked files

    ```bash
    pip install --user mydot    # if using pip
    pipx install mydot          # if using pipx
    mydot git config --local status.showUntrackedFiles no
    ```

3. **Add files** to your dotfiles repo

    ```bash
    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`

4. **Feel the power** with `mydot` (and the pre-installed alias `d.`)

    ```bash
    d. -e           # modify tracked files in your $EDITOR (tab in fzf for multiselect)
    d. -a           # choose which modified files to stage for commit
    d. git commit   # commit changes

    d. -g "EDITOR"  # find all files with lines containing the string EDITOR
                    # works with regex too! e.g, EDITOR$ something.*var ^$

    d. -r           # run any executable script in your dotfiles repo
    d. -s           # see the state of your repo
    d. -l           # 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.              # see the help message detailing available commands
    ```

## Going Deeper

### Useful aliases

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

If you ever run into an issue where the `mydot` CLI is reading flags meant for 
`mydot git` you can fallback to the `config` alias from step 1 which acts as a 
special git command that only applies for the dotfiles repo.

For example `mydot git rm -r ~/.tmux` would see the `-r` flag and try to run an
executable in your dotfiles. Instead use `config rm -r ~/.tmux` and the files
in the directory will be removed recursively.

### Source of Truth

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

[github]: <https://github.com/gikeymarcia/mydot>
"Follow and Contribute on GitHub"
[gitlab]: <https://gitlab.com/gikeymarcia/mydot>
"Follow and Contribute on GitLab"
[pypi]: <https://pypi.org/project/mydot/>
"mydot project homepage on PyPi.org"
[atlassian]: <https://www.atlassian.com/git/tutorials/dotfiles>
"The best way to store your dotfiles: A bare Git repository"
[fzf]: <https://github.com/junegunn/fzf>
"A command-line fuzzy finder"
[template]: <https://github.com/gikeymarcia/super-python-project-template>
"Super Python Project Template @ GitHub"

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/gikeymarcia/mydot",
    "name": "mydot",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Mikey Garcia",
    "author_email": "gikeymarcia@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/42/1e/74d28d0d0eaaf8e7297a5e12f26dda17fe9228a23b7f7aab1a4eefddb77e/mydot-0.7.1.tar.gz",
    "platform": null,
    "description": "# mydot -- A Python module for managing dotfiles\n\nSuper-charged version of the [Atlassian][atlassian] approach to managing\ndotfiles using a bare git repo + [`fzf`][fzf] magic! Quickly edit files, add\nchanges, run scripts, grep through dotfiles, or discard work-tree changes with\nease.\n\n## Quick Start\n\n1. **Install dependencies:**\n\n    ```bash\n    sudo apt install fzf git    # Ubuntu/Debian\n    brew install fzf git        # MacOS/Homebrew\n    ```\n1. **Configure shell:** At the bottom of your `~/.bashrc` or `~/.zshhrc` add:\n\n    ```bash\n    export DOTFILES=\"$HOME/.config/dotfiles\"\n    alias config='/usr/bin/git --git-dir=$DOTFILES --work-tree=$HOME'\n    ```\n\n    _what and why?_:\n\n    - `DOTFILES`: variable pointing to your local `--bare` dotfiles repository\n    - `config`: git alias to directly address the `--bare` dotfiles repository\n\n2. **Initialize dotfiles repository:**\n\n    ```bash\n    # reload shell configu\n    source ~/.bashrc            # if using bash\n    source ~/.zshrcc            # if using zsh\n\n    mkdir -pv $DOTFILES         # create directory\n    git init --bare $DOTFILES   # initialize --bare git repository\n    ```\n\n3. **Install** `mydot` and disable viewing of untracked files\n\n    ```bash\n    pip install --user mydot    # if using pip\n    pipx install mydot          # if using pipx\n    mydot git config --local status.showUntrackedFiles no\n    ```\n\n3. **Add files** to your dotfiles repo\n\n    ```bash\n    mydot git add ~/.vimrc ~/.tmux.conf ~/.bashrc ~/.bash_aliases ~/.zshrc\n    mydot git commit -m \"the journey of a thousand miles begins with one step\"\n    ```\n\n    _protip:_ You can use all your regular git commands, including aliases, when\n    calling `mydot git`\n\n4. **Feel the power** with `mydot` (and the pre-installed alias `d.`)\n\n    ```bash\n    d. -e           # modify tracked files in your $EDITOR (tab in fzf for multiselect)\n    d. -a           # choose which modified files to stage for commit\n    d. git commit   # commit changes\n\n    d. -g \"EDITOR\"  # find all files with lines containing the string EDITOR\n                    # works with regex too! e.g, EDITOR$ something.*var ^$\n\n    d. -r           # run any executable script in your dotfiles repo\n    d. -s           # see the state of your repo\n    d. -l           # list all files under version control\n\n    d. --export     # make a tarball of your dotfiles + bare git repo\n    d. --clip       # put file paths into the clipboard\n\n    d. --restore    # remove files from staging area\n    d. --discard    # discard unstaged changes from work tree\n\n    d.              # see the help message detailing available commands\n    ```\n\n## Going Deeper\n\n### Useful aliases\n\n```bash\nalias es=\"mydot --edit\"     # quick select a file to edit\nalias rs=\"mydot --run\"      # quick select a script to run\n```\n\nIf you ever run into an issue where the `mydot` CLI is reading flags meant for \n`mydot git` you can fallback to the `config` alias from step 1 which acts as a \nspecial git command that only applies for the dotfiles repo.\n\nFor example `mydot git rm -r ~/.tmux` would see the `-r` flag and try to run an\nexecutable in your dotfiles. Instead use `config rm -r ~/.tmux` and the files\nin the directory will be removed recursively.\n\n### Source of Truth\n\nThis project is available on [GitHub][github] and [GitLab][gitlab]. Each push\nto `master` automatically goes to both so choose whichever platform you prefer.\nAll releases are published to [PyPi][pypi]\n\n[github]: <https://github.com/gikeymarcia/mydot>\n\"Follow and Contribute on GitHub\"\n[gitlab]: <https://gitlab.com/gikeymarcia/mydot>\n\"Follow and Contribute on GitLab\"\n[pypi]: <https://pypi.org/project/mydot/>\n\"mydot project homepage on PyPi.org\"\n[atlassian]: <https://www.atlassian.com/git/tutorials/dotfiles>\n\"The best way to store your dotfiles: A bare Git repository\"\n[fzf]: <https://github.com/junegunn/fzf>\n\"A command-line fuzzy finder\"\n[template]: <https://github.com/gikeymarcia/super-python-project-template>\n\"Super Python Project Template @ GitHub\"\n",
    "bugtrack_url": null,
    "license": "GPL-3.0",
    "summary": "Manage and edit $HOME dotfiles using Python + git = <3",
    "version": "0.7.1",
    "project_urls": {
        "Homepage": "https://github.com/gikeymarcia/mydot"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c4c1e4b16b53a470963a88480259de2fdfc00cc80d52400d17fdbb9d7f1cb7f3",
                "md5": "bdfd8a7e90fd3f7f81154aa4f4761e3f",
                "sha256": "0c9be59da3dfc6c3b1179aea4e4b6578dfe05a488e7270edcda1da725f61d8c2"
            },
            "downloads": -1,
            "filename": "mydot-0.7.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bdfd8a7e90fd3f7f81154aa4f4761e3f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 16336,
            "upload_time": "2023-09-07T03:52:02",
            "upload_time_iso_8601": "2023-09-07T03:52:02.208301Z",
            "url": "https://files.pythonhosted.org/packages/c4/c1/e4b16b53a470963a88480259de2fdfc00cc80d52400d17fdbb9d7f1cb7f3/mydot-0.7.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "421e74d28d0d0eaaf8e7297a5e12f26dda17fe9228a23b7f7aab1a4eefddb77e",
                "md5": "36186ae7bbad3c21ad7b37fc5fa80b9b",
                "sha256": "2faed5988fcf19fa6010c3c339616f7196544f94222c638213695a9aec78d8df"
            },
            "downloads": -1,
            "filename": "mydot-0.7.1.tar.gz",
            "has_sig": false,
            "md5_digest": "36186ae7bbad3c21ad7b37fc5fa80b9b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 17731,
            "upload_time": "2023-09-07T03:52:03",
            "upload_time_iso_8601": "2023-09-07T03:52:03.934875Z",
            "url": "https://files.pythonhosted.org/packages/42/1e/74d28d0d0eaaf8e7297a5e12f26dda17fe9228a23b7f7aab1a4eefddb77e/mydot-0.7.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-07 03:52:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gikeymarcia",
    "github_project": "mydot",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "pydymenu",
            "specs": [
                [
                    ">=",
                    "0.4.0"
                ]
            ]
        },
        {
            "name": "rich",
            "specs": []
        }
    ],
    "lcname": "mydot"
}
        
Elapsed time: 0.11685s