2

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)
  )
1

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.

  • Thanks for answering but that didn't work. – Wilson Almeida Nov 22 '16 at 16:17
0

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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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