Giter VIP home page Giter VIP logo

dotly's Introduction

โšก๏ธ 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

dotly's People

Contributors

rgomezcasas avatar gtrabanco avatar javiercane avatar borjapazr avatar santakadev avatar ismanapa avatar d-asensio avatar eduardosimon avatar henrypalacios avatar rubencm avatar 3d24rd0 avatar atorfan avatar anjeludo avatar boscodomingo avatar usarral avatar rootcg avatar danieledu avatar dannegm avatar goi17 avatar josecarlosduran avatar lsfiege avatar mglezsosa avatar pablobernardo avatar inmovilizame avatar zigotica avatar skilla avatar afloresdz avatar joucogi avatar m0rtadelo avatar manuelpimentel avatar

Watchers

 avatar

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.