5

I'm doing a new setup so that I can have an init.el on my dropbox as a one stop shop for my configuration. So far so good but I'm stuck on the theme.

When I setup the code using load-path it all works like it should, all the colors and the modeline. My question is how can I do the same but using the use-package approach?

(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")

(setq molokai-theme-kit t)
(load-theme 'molokai t)

Is something like this possible?

(use-package molokai-theme 
  :ensure t
  :init
  (setq molokai-theme-kit t)
  (load-theme 'molokai t)
  )

4 Answers 4

5

My user-emacs-directory points to a folder on my Dropbox. Apparently use-package :load-path points to the user-emacs-directory by default, I just had to put "themes" and the necessary files inside it.

It's now working like a charm.

(use-package molokai-theme 
  :ensure t
  :load-path "themes"
  :init
  (setq molokai-theme-kit t)
  :config
  (load-theme 'molokai t)
  )
0

Try a :defer t in the use-package declaration too.

1
  • 1
    Thanks for answering but that didn't work. Commented Nov 22, 2016 at 16:17
0

Yes you can add this to your init.el but I recomend you to create a init.el in your home directory, and make this file to load the one you have in dropbox. So yo create a file wich have the following content:

(load-file "<your-path-to-dropbox>/yourdropboxinit.el")

I think this is the better solution for you.

-2

I would suggest you keep your init.el under version control either publicly in Github or privately in BitBucket.

Also, have you considered using the community-driven Emacs distribution called Spacemacs?

Adjusting themes is particularly easy in Spacemacs, and there is a vast vast number of themes to choose from.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.