Skip to content

CodelyTV/dotly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑️ Simple and fast dotfiles framework ⚑️

The path to increasing your productivity on macOS, Linux and WSL

codely.tv CodelyTV Courses CI pipeline status

dotly is a dotfiles framework built on top of zim, one of the fastest zsh existing frameworks. It creates an opinionated dotfiles structure to handle all your configs and scripts.

πŸš€ Installation

Using wget:

bash <(wget -qO- https://raw.githubusercontent.com/CodelyTV/dotly/HEAD/installer)

Or using curl:

bash <(curl -s https://raw.githubusercontent.com/CodelyTV/dotly/HEAD/installer)

🐳 Try it in Docker

You can safely install additional software and make any changes to the file system. Once you exit zsh the image is deleted.

Using Alpine:
docker run -e TERM -e COLORTERM -e LC_ALL=C.UTF-8 -w /root -it --rm alpine sh -uec '
  apk add curl sudo bash zsh git g++ python3
  bash -c "$(curl -fsSL https://raw.githubusercontent.com/CodelyTV/dotly/HEAD/installer)"
  zsh'
Or using Ubuntu:
docker run -e TERM -e COLORTERM -w /root -it --rm ubuntu sh -uec '
  apt-get update
  apt-get install -y curl build-essential sudo
  su -c bash -c "$(curl -fsSL https://raw.githubusercontent.com/CodelyTV/dotly/HEAD/installer)"
  su -c zsh'

Restore your Dotfiles manually

  • Install git
  • Clone your dotfiles repository git clone [your repository of dotfiles] $HOME/.dotfiles
  • Go to your dotfiles folder cd $HOME/.dotfiles
  • Install git submodules git submodule update --init --recursive modules/dotly
  • Install your dotfiles DOTFILES_PATH="$HOME/.dotfiles" DOTLY_PATH="$DOTFILES_PATH/modules/dotly" "$DOTLY_PATH/bin/dot" self install
  • Restart your terminal
  • Import your packages dot package import

Restore your Dotfiles with script

Using wget

bash <(wget -qO- https://raw.githubusercontent.com/CodelyTV/dotly/HEAD/restorer)

Using curl

bash <(curl -s https://raw.githubusercontent.com/CodelyTV/dotly/HEAD/restorer)

πŸ”’ You need to know your GitHub username, repository and install ssh key if your repository is private.

It also supports other git repos, but you need to know your git repository url.

πŸ’» Usage

🚢 First steps

Once dotly is installed, the next step is to commit and push your dotfiles. Create a new repository in your GitHub named dotfiles and then copy the url. Then go to your dotfiles (cd "$DOTFILES_PATH") and execute:

git remote add origin YOUR_DOTFILES_REPO_URL &&
git add -A &&
git commit -m "Initial commit" &&
git push origin main

⚠️ It's recommended to commit every time you add/modify a config or script.

🌚 The dot command

dot is the core command of dotly. If you execute it, you'll see all your scripts.

{β–Έ} ~ dot -h
Usage:
   dot
   dot <context>
   dot <context> <script> [<args>...]
   dot -h | --help

🌴 Understanding your dotfiles folder structure

β”œβ”€β”€ πŸ“ bin                 # External binaries/symlinks. This folder has preference in your $PATH
β”œβ”€β”€ πŸ“ doc                 # Documentation of your dotfiles
β”œβ”€β”€ πŸ“ editors             # Settings of your editors (vscode, IDEA, …)
β”œβ”€β”€ πŸ“ git                 # git config
β”œβ”€β”€ πŸ“ langs               # Config for programming languages/libraries
β”œβ”€β”€ πŸ“ os                  # Specific config of your Operative System or apps
β”œβ”€β”€ πŸ“ restoration_scripts # This will be execute when you restore your dotfiles in another computer/installation
β”œβ”€β”€ πŸ“ scripts             # Your custom scripts
β”œβ”€β”€ πŸ“ shell               # Bash/Zsh/Fish?… configuration files
└── πŸ“ symlinks            # The config of your symlinks

βš™οΈ Versioning configs

dotly allows you to version your apps' config files. Once you've found the config to version you should:

  1. Copy your config file inside your dotfiles so this will be the source of truth. E.g. cp ~/Library/Application Support/Code/User/settings.json $DOTFILES_PATH/editors/code/settings.json
  2. Symlink this file. To do this you should edit your $DOTFILES_PATH/symlinks/conf.YOUR-OS.yaml and add it. E.g. ~/Library/Application Support/Code/User/settings.json: editors/code/settings.json

🎨 Customization

dotly includes an opinionated, minimal, very fast and powerful theme by default. You can configure it using the following parameters in your shell/exports.sh:

CODELY_THEME_MINIMAL=false|true  # If true the theme will only show the prompt status
CODELY_THEME_MODE="dark"|"light" # Use dark if you use dark colors, light if light
CODELY_THEME_PROMPT_IN_NEW_LINE=false|true           # If true the prompt will be in a newline
CODELY_THEME_PWD_MODE="short"|"full"|"home_relative" # short will show the first letter of each directory, full the full path and home_relative the full path relative to the $HOME dir
CODELY_THEME_STATUS_ICON_KO="β–ͺ" # The icon to show if the previous command failed. Useful if you're color blind

πŸ’Ύ Default scripts

β”œβ”€β”€ πŸ“ dotfiles
β”‚  β”œβ”€β”€ create # Creates the dotfiles scructure
β”‚  └── import # Import an existing dotfiles
β”œβ”€β”€ πŸ“ git
β”‚  β”œβ”€β”€ amend           # Amend a commit
β”‚  β”œβ”€β”€ apply-gitignore # Exlude all commited files that are inside the project .gitignore
β”‚  β”œβ”€β”€ changed-files   # Show all changed files to main
β”‚  β”œβ”€β”€ commit          # Add all files and then commit
β”‚  β”œβ”€β”€ contributors    # List contributors with number of commits
β”‚  β”œβ”€β”€ find            # Find commits by commit message
β”‚  β”œβ”€β”€ pretty-diff     # Show a pretty git diff using fzf (and copy selected path to the clipboard)
β”‚  β”œβ”€β”€ pretty-log      # Git log filtering
β”‚  └── rm-file-history # Remove completely a file from the repo with its history
β”œβ”€β”€ πŸ“ mac
β”‚  β”œβ”€β”€ brew     # Some brew utils
β”‚  └── defaults # Some defaults utils to view your changes, import and export
β”œβ”€β”€ πŸ“ package
β”‚  β”œβ”€β”€ add        # Install a package
β”‚  β”œβ”€β”€ dump       # Dump all installed packages
β”‚  β”œβ”€β”€ import     # Import previously dumped packages
β”‚  └── update_all # Update all packages
β”œβ”€β”€ πŸ“ self # Instead of `dot self` you can use direclty `dotly` in your terminal
β”‚  β”œβ”€β”€ debug           # Debug dotly
β”‚  β”œβ”€β”€ install         # Install dotly and setup dotfiles
β”‚  β”œβ”€β”€ lint            # Lint all dotly related bash files
β”‚  β”œβ”€β”€ static_analysis # Static analysis of all dotly related bash files
β”‚  └── update          # Update dotly to the latest stable release
β”œβ”€β”€ πŸ“ shell
β”‚  └── zsh # ZSH helpers
└── πŸ“ symlinks
    └── apply # Apply all symlinks

πŸ’½ Alias

You can see the default aliases here. The most commonly used are:

  • ..: cd one directory up
  • la: ls all files/dirs with colors
  • up: Update all your package managers packages

πŸ“½οΈ Feature showcase (Spanish)

For an in-depth look at the features offered by dotly, you can take a look at this video:

Watch the video

⁉️ Troubleshooting

You can execute dot self debug in parallel with another command to see the errors output.

🀝 Contributing

  • If you want to implement a new feature/script, please, open an issue first

😊 Thanks

A lot of dotly concepts has been inspired by denisidoro/dotfiles

βš–οΈ LICENSE

MIT Β© CodelyTV