Hacker News new | comments | ask | show | jobs | submit login

I have set up my Emacs so that it will automatically download and install all my favourite plugins if they are not installed yet.

So to set up a new machine, I simply copy my .emacs over and start Emacs. Emacs will then fetch and install all my plugins automatically. Quite handy!

Would you mind sharing your .emacs so we can see how you have that set up?

The way people typically do this is by VCing their configurations in a "dotfiles" repository. New machine? Pull your dotfiles, and create the symlinks in your homedir.

I currently do this with my entire .emacs.d directory, but it sounds like Derbasti only pulls his .emacs, and then has code to check for installed packages and get any that are missing.

It's pretty easy using package. Here's what I just copied and pasted from my init.el

  (require 'package)
  (dolist (source '(("technomancy" .   "http://repo.technomancy.us/emacs/)
                    ("elpa" . "http://tromey.com/elpa/)))
    (add-to-list 'package-archives source t))

  (defvar my-packages '(starter-kit zenburn-theme auctex color-theme-solarized csharp-mode ecb_snap find-file-in-project flymake-css flymake-php idle-highlight ido-ubiquitous ipython python-mode magit markdown-mode paredit pastels-on-dark-theme php-mode rainbow-mode smex solarized-theme starter-kit-js zenburn-theme)
  "A list of packages to ensure are installed at launch.")

  (dolist (p my-packages)
    (when (not (package-installed-p p))
      (package-install p)))
Where you add the package name to my-packages. It's kinda cool to see it download and compile everything on a new install.

this is really neat. what would be cool is to keep the package list up to date automatically (possibly by advising package installation - https://github.com/nicferrier/emacs-package-store/blob/maste...).

Then everytime you installed a package it would get written into the list and everytime you moved your init it would all happen automatically.

That would be cool. And not hard to do either. You could just keep a customization variable of the "base packages" or something and have it saved by the standard custom stuff.

I would have posted my own setup, but it is all but identical to yours, so there you go ;-)

Applications are open for YC Summer 2019

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