Giter Site home page Giter Site logo

.dotfiles's Introduction

.dotfiles

DIY config file management on MacOS and Linux

Setup

  • Create .dotfiles directory wherever you want
  • Export $BASEPATH and $DOTFILES in your .bash_profile
    • $BASEPATH can just be $HOME if you want, I prefer to work from a non-home directory on MacOS
export BASE="dev"
export BASEPATH="${HOME}/${BASE}" 
export DOTFILES="${BASEPATH}/.dotfiles"
  • Source .bashrc in .bash_profile
if [ -f "$HOME/.bashrc" ]; then
    source "$HOME/.bashrc";
fi
  • Move your dotfiles (including .bashrc and .bash_profile) into $DOTFILES
  • Source bash dotfiles in .bashrc however you want
declare -a BASH_DOTFILE_LIST=(
    ".env"
    ".aliases"
    ".functions"
    ".prompt"
    ".secret"  # !!! ADD TO .gitignore
)
for BASH_DOTFILE in "${BASH_DOTFILE_LIST[@]}"; do
    BASH_DOTFILE_PATH="$DOTFILES/$BASH_DOTFILE"
    if [ -f "$BASH_DOTFILE_PATH" ]; then
        source "$BASH_DOTFILE_PATH"
    fi
done
  • In the end you'll have something like this
$HOME/
│
├── $BASEPATH/.dotfiles/
│   ├── .aliases
│   ├── .bash_profile
│   ├── .bashrc
│   ├── .env
│   ├── .functions
│   ├── .gitconfig
│   ├── .inputrc
│   ├── .ipython
│   ├── .prompt
│   ├── .secret  # !!! ADD TO .gitignore
│   ├── .vimrc
│   └── .README.md
│
├── ...
│
├── .aliases@
├── .bash_profile@
├── .bashrc@
├── .env@
├── .functions@
├── .gitconfig@
├── .inputrc@
├── .ipython@
├── .prompt@
├── .secret@
└── .vimrc@

To-do

  • Script to symlink automatically
  • Script to push/pull from git automatically
  • Brew script to download common apps/plugins
  • Split out vimrc into multiple files

Maybe future plans

.dotfiles/
│
├── bash/
│   ├── .aliases
│   ├── .bashrc
│   ├── .env
│   ├── .functions
│   ├── .inputrc
│   ├── .profile
│   └── .prompt
│
├── git/
│   ├── .gitconfig
│   └── .gitignore_global
│
├── vim/
│   ├── .aliases
│   ├── .autocommands
│   ├── .colorscheme
│   ├── .keymapping
│   └── .vimrc
│
├── .docker/
├── .ipython_config
├── push.sh          # Push to GH
├── install.sh       # Install everything (new laptop, etc)
└── README.md

.dotfiles's People

Contributors

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