Giter Site home page Giter Site logo

.dotfiles's Introduction

Dotfiles with the Sauce🍝

macOS Python Neovim Obsidian Sublime Text

Contents

  1. Details
  2. Dependencies
  3. First Time Setup
  4. Deploy
  5. Folder Structure
  6. Notes

Details

Dependencies

Dependency Description
git You need to download the repo
rsync If you need to override files

First Time Setup

This is the slickest setup for managing dotfiles that I've used and it lets you pick and choose what in your $HOME is synced.

First, we create a bare repo in a new folder named .dotfiles. This will hold the .git files and config.

mkdir $HOME/.dotfiles
git init --bare $HOME/.dotfiles

Next, I added an alias that I use for this repo. This is the special sauce of this setup. When calling my dotfiles git, I will now use dot. This needs to be added to your profile somewhere (like a .zshrc file.)

alias dot='/usr/local/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'

Next, don't show untracked files (because that would be a lot) and add the remote.

dot config --local status.showUntrackedFiles no
dot remote add origin [email protected]:<Username>/.dotfiles.git

Now, you can use the alias to add any file to wish you start syncing. Commit and push to see the results in your GitHub Repo.

cd $HOME
dot add .vimrc
dot commit -m "Add .vimrc"
dot push

Deploy to a new system

To setup a new machine all you need to do is clone the repo using a bare repo.

git clone --separate-git-dir=$HOME/.dotfiles [email protected]:BaDxKaRMa/.dotfiles.git ~

However, some programs create default config files, so this might fail if git finds an existing config file in your $HOME. In that case, a simple solution is to clone to a temporary directory, and then delete it once you are done.

git clone --separate-git-dir=$HOME/.dotfiles [email protected]:BaDxKaRMa/.dotfiles.git tmpdotfiles
rsync --recursive --verbose --exclude '.git' tmpdotfiles/ $HOME/
rm -r tmpdotfiles

Config Folder File Structure

  • .config: Base folder used to store user config files
  • zsh: Contains Aliases, Functions, welcome, and environment variables
  • nvim: LazyVim NeoVim setup

Notes

Useful Aliases

alias dot='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
alias dcam='dot commit -a -m'
alias dst='dot status'
alias dl='dot pull'
alias dp='dot push'
alias da='dot add'

.dotfiles's People

Contributors

badxkarma 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.