Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

On all my machines ~/.vimrc and friends are symlinked out from my Dropbox folder.


This is what I do as well. To make thinks simpler, I use this script to automatically create the symlinks (if they are not already existant). If you put it in your `.zshrc`, you can run the command `dropbox-update-dotfiles` to make or update the symlinks. Not that this makes use of `zsh` extensions, so it requires adaptation to use with bash.

  dropbox-update-dotfiles () {
    src="$HOME/Dropbox/dotfiles"
    dst="$HOME"
  
    if [[ ! -d "$src" ]]; then
      print "Directory $src not found."
    fi
  
    for f in "$src"/*~*(.swp|~|.pyc)(D); do
      if [[ -h "$dst/${f:t}" ]]; then
        # exists as symlink
      elif [[ -e "$dst/${f:t}" ]]; then
        print "WARNING: ${f:t} exists, but is not a symlink."
      else
        ln -sv "$f" "$dst"
      fi
    done
  }


I use zsh too, but did something similar that should also work in bash: http://naleid.com/blog/2011/10/03/using-dropbox-to-share-you...

I link my dot files as well as Documents, Pictures, Music, and Desktop directories that are also normally controlled by OSX. Having those shared across multiple computers is awesome. Sit down at a computer, and it's there.

I also have my zsh files checked in to bitbucket (https://bitbucket.org/tednaleid/shared-zshrc/) so even if the computer doesn't have dropbox (like many of the linux servers I have access to), as long as it has mercurial, I can clone the repo and be ready to go.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: