Code Monkey home page Code Monkey logo

dotty's Introduction

Dotty

A dead simple dotfiles manager.

Not yet ready for public use, as it assumes you keep your dotfiles at ~/PersonalConfigs, I need to make this configurable. Use at your own risk.

How it works

Here's how I manage my dotfiles, and if you do the same, then dotty could be for you!

I keep a repo with all my dotfiles and .config folders, but it also has other bits and pieces to help get me up and running on any new machine. A subset of this looks like:

├── README.org
├── Session.vim
├── _colors+fonts
│   ├── iterm_tokyonight_storm.itermcolors
│   └── xterm-256color-italic.terminfo
├── .config
│   ├── kitty
│   │   ├── kitty.conf
│   │   └── open-actions.conf
│   └── nvim
│       ├── init.lua
│       └── lua
│           └── codethread
│               ├── keymaps.lua
│               └── lsp
│                   ├── init.lua
│                   └── settings
│                       ├── tailwindcss.lua
│                       └── tsserver.lua
├── .dottyignore
├── .gitconfig
├── .gitignore
├── .tmux.conf
├── .stylua.toml
├── .zshrc
├── Brewfile
├── README.org
└── _packages
    └── .piplist

Dotty's approach is simple, it just symlinks this entire tree, one file at a time into my HOME directory - creating folders if needs be, without disturbing any existing folders.

Not everything gets copied however, as I don't want everything cluttering my HOME, instead dotty will look for a gitignore and gitignore_global inside my dotfiles, and ignore any files listed there. It will also read from a .dottyignore file, which is a simple list of regexps, which can be used to omit any additional files. For example I have:

^.git$
^_.*
.gitignore$
README
^.stylua.toml$
^.dottyignore$

For me, a simple _ prefix helps me keep track of what files and folders are not inteded to be linked. Not all files can follow that format, e.g .stylua.toml, hence .dottyignore allows more specific controls.

If a folder is marked as ignored, dotty will not traverse it

When dotty runs, it stores a list of created files in a temporary file, and then each time it runs, it removes these files. Empty folders will be deleted as it goes, meaning you are free to move and rename files/folders in your dotfolder as you please, and when dotty next runs, your HOME directory will be left in a clean state, before all the files are symlinked back in.

Personally I like to integrate this flow with my editor, see the wiki for an example; this means dotty is run everytime I save or delete a file in my editor (and dotty is extremely fast, so there's no issue of slowdown)

Install

brew tap codethread/homebrew-dotty
brew install dotty

Usage

dotty help

Contributing

  • run
    go run main.go <cmd> ...args
    # e.g.
    go run main.go setup --dry-run
  • test
    go test ./...
  • add command
    go install github.com/spf13/cobra-cli@latest
    cobra-cli add <cmd>

Releasing

check the wiki

dotty's People

Contributors

codethread avatar

Stargazers

Michael K avatar

Watchers

 avatar

dotty's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.