3 ms·
I've found that using use-package in my init.el to manage, install and customize my packages helps me run a reasonably similar emacs setup across my Linux and W
by nanna 6y ago
I've found that using use-package in my init.el to manage, install and customize my packages helps me run a reasonably similar emacs setup across my Linux and Windows computers. I use git to synchronise it across systems.
(use-package wordnut
:ensure t ;; install package if it doesn't exist
:config
(global-set-key (kbd "C-c w") 'wordnut-search))
If I want a package to only load on Linux or windows, I can do it so:
(use-package xclip
:if (eq system-type 'gnu/linux)
:ensure t
:config
(xclip-mode 1))
(use-package w32-browser
:if (eq system-type 'windows-nt)
:ensure t)
- jeremyjh 6y agoI wish there were a way to pin/lock the version of dependencies. Each time I update all packages something new breaks, and I have to spend time tracking it down and fixing or reverting it. So I've just been syncing my entire .emacs.d folder.
- snicker7 6y agoIf you are using Linux, you can already do with with Guix-installed emacs packages. Otherwise, I think straight.el is adding this feature in the future.
- jeremyjh 6y agoThanks, I didn't know about straight.el. Looking into that and the Doom distribution that is built on top of it. Looks far more sane.
- TacticalCoder 6y ago> So I've just been syncing my entire .emacs.d folder. That's one solution. I've got mine under Git. It's a bit more "work" in that when I upgrade packages (which I don't do all the time) I need to commit what's been deleted/added but I can at any time go back to any past working setup. Then I just use Git across user accounts / machines to synch my Emacs setup. Others are using Nix. > Each time I update all packages something new breaks... Don't know what's the "proper" way to do it but I upgrade packages manually and never all at once. That is: I never start from an empty Emacs. There are some tradeoffs I guess but I never have to track down which package is problematic and reverting is basically checking out the last commit. I'm not saying it's the best way to do it but it just works.
- robto 6y agoIn addition to nix and guix, which have been mentioned, you can also use straight.el[0]. It's a functional package manager for emacs, so you'd use it instead of package.el. It checks out the git repo for each package and maps package name->commit hash in a nice little file, which you can then commit to git. Then, on a new machine, it will check out that specific rev for all your packages. It even has nice use-package integration, so if you're already using that you likely won't have to change all your config. [0]https://github.com/raxod502/straight.el https://github.com/raxod502/straight.el
- anaerobicover 6y agoPlus 1 to this. I've adopted straight.el a little while ago and I've been especially loving how easy it makes hacking on my installed packages. Now that they're version controlled, I can easily try things and back them out if they don't work. And more importantly I can remember the tweaks I've made, because there's a readily-available diff. With regular package.el it was nearly impossible to keep track of little changes I had made and preserve them across upgrades or transfer them to another machine.