/dotphiles

A community driven framework of dotfiles.

Primary LanguagePerl

dotphiles

A community driven framework of dotfiles, for the usual terminal apps and shells, designed to work across multiple platforms and degrade for older versions of software or O/S, allowing you to use the same settings on all your machines.

  • Backup, restore, and sync the prefs and settings for your toolbox. Your dotfiles might be the most important files on your machine.
  • Learn from the community. Discover new tools for your toolbox and new tricks for the ones you already use.
  • Share what you've learned with the rest of us.

Installation

  1. Sign up for an account on github and fork the project.

  2. Clone your fork.

    git clone --recursive git@github.com:username/dotphiles.git ~/.dotfiles

  3. Setup your terminal and the dotfiles you want to use, see below.

  4. Edit dotsyncrc and enable dotfiles to use.

  5. Run dotsync ./.dotfiles/dotsync/bin/dotsync -L

  6. Start a new login shell.

Configuration

Dotfiles

These are the minimum files you'll need to edit

  • dotsyncrc settings for dotsync
  • zsh/zshrc settings for dotzsh
  • vim/vimrc settings for dotvim
  • git/gitconfig add your name, email and gpg keyid
  • ssh/authorized_keys add your public ssh key
  • ssh/config add your settings and hosts

Terminal

dotphiles uses the solarized color theme by default, install the colour scheme for your terminal.

vim-powerline requires patched fonts for the 'fancy fonts' options, you can find links to them to install here and configure your terminal to use one, Menlo works great.

  • deploy/osx setup osx and install ports & brews (only use one)
  • deploy/linux setup linux and install packages
    • packages/macports add ports to be installed by osx (select one)
    • packages/homebrew add brews to be installed by osx (select one)
    • packages/apt add packagess to be installed by linux on apt based systems

Dotsync

See the documentation for dotsync for more information.

  • dotsyncrc

    Add dotfiles to dotsyncrc like

    [files]
    ...
    dotfile
    dir
    dir/dotfile
    ...
    [endfiles]
    

    dotsync will look for

     ~/$DOTFILES/dotfile.d/localhost
     ~/$DOTFILES/dotfile.d/$HOSTNAME
     ~/$DOTFILES/dotfile.d/$DOMAIN
     ~/$DOTFILES/dotfile
    

And link the first one it finds instead of the standard dotfile. The localhost dotfile will be excluded from your repo.

  • Usage

    Dotsync can be used to link your dotfiles into place

    • dotsync -L symlink dotfiles into place
    • dotsync -U update from github

    And update remote machines

    • dotsync -I -H hostname initialise hostname with the set of dotfiles
    • dotsync -U -H hostname update dotfiles on hostname from github
    • dotsync -I -H hostname -r initialise hostname with the set of dotfiles with rsync
    • dotsync -U -H hostname -r update dotfiles on hostname with rsync
    • dotsync -A update dotfiles on all hosts
  • Backups

    Any existing ~/.dotfiles will be backed up into ~/.backup/dotfiles/ if found

Editing

When you edit your dotfiles, you should commit the changes to git with

git commit -a

And periodically push the changes to github

git push

Updating

To keep your fork upto date with additions to the dotphiles repo, do the following

cd ~/.dotfiles
git remote add upstream https://github.com/dotphiles/dotphiles
git fetch upstream
git merge upstream/master

Contribute

This project would not exist without all of its users and contributors.

Lots of ideas and code stolen from around the interwebs such as skwp/dotfiles, sorin-ionescu/oh-myzsh, robby-russell/oh-my-myzsh, holman/dotfiles, mathiasbynens/dotfiles, spf13 and numerous other snippets of code copied and pasted over the years.

If you have ideas on how to make the configuration easier to maintain or improve its performance, do not hesitate to fork and send pull requests.

If you want to contribute to the project, check out the list of open issues

You can:

  • raise an issue
  • suggest a feature

If you would like to contribute code to the project:

  1. Fork the repository
  2. Create a feature branch to easily amend a pull request later, if necessary.
  3. Make some changes to the code base, write good commit messages.
  4. Squash commits on the topic branch before opening a pull request.
  5. Open a pull request that relates to but one subject with a clear title and description in gramatically correct, complete sentences.

Git Flow

We use the Git Flow branching model, first described by nvie, so dotphiles's master branch moves on only at specific points, when we're really sure we want to promote something to production.

Use of Git Flow is not required for contributing to dotphiles, particularly if you're submitting a bug-fix or small feature. Its use is recommended for larger changes where develop might move on whilst you're completing your work.

Configuring Git Flow

There is a set of helper scripts that will work on both Unix-based operating systems and Windows. Follow the appropriate installation instructions for your operating system, and configure your working copy repository for use with Git Flow by typing git flow init. Accept all the default options to the questions that it asks you.

Using Git Flow

Pick a feature or bug to work on and create a new branch for that work by typing git flow feature start <featurename>. This will create you a new feature branch for your work called feature/<featurename>, and you can use git as usual from this point.

Once your feature is finished, type git flow feature publish <featurename>. This will copy the feature branch to your origin repository on GitHub and you will then be able to submit a pull request to have it merged into dotphiles own develop branch.

Note: do not use git flow feature finish <featurename>!

This will automatically merge your feature branch back into develop and delete the feature branch, making it harder for you to submit your pull request.

If you wish to update your published feature branch after the initial publish, use a regular git push origin feature/<featurename>. This will also update your pull request if you have one open for that branch.

If you find dotphiles develop branch has moved on, and you need/want to take advantage of the changes made there, you can update your feature branch as follows:

  1. Ensure you have a remote configured for the upstream repository.

    git remote add upstream git://github.com/dotphiles/dotphiles.git

  2. Update your local repository with the upstream refs.

    git pull upstream develop:develop`

  3. Rebase your feature branch on top of the new develop.

    git flow feature rebase

There is a lot of help available for Git Flow, which can be accessed by typing git flow feature help.

License

Copyright (c) 2012 Ben O'Hara bohara@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.