Bozhidar Batsov has a handy tip in his latest post. He, like me, organizes the package management of his init.el
around use-package
. It works well for him but he has a complaint. He almost always wants to install the packages by default but has to specify :ensure t
for each package that he wants loaded by default. He has, he says, more than 50 packages so this is a nuisance.
There is, however, an easy solution. You can simply set use-package-always-ensure
to t
and all packages except those with :ensure nil
will be loaded by default. Batsov notes that some people don’t like loading packages by default because of version issues but that this has not been an issue for him.
It hasn’t been an issue for me either. But neither has specifying :ensure t
for each package. I have, according to a quick check with keep-lines
, 70 instances of use-packages
. All of them specify :ensure t
and I’ve never considered this an irritant even though I know about use-package-always-ensure
.
Still, I understand and support the urge to make everything as simple as possible so if you’re an use-package
user and want to load all or most of your packages by default, Batsov shows a way of doing that with a little less effort.