What is use-package anyway?
Simply put, it’s a macro for easier package management within Emacs. I’ve used this for a while, and for me this is much more manageable than the default package declaration.
How to use it?
First we’ll need to activate it, from your Emacs init.el
file:
|
|
And since we’ll mostly use this for external package, also add:
|
|
After that, use-package
is ready to use. For example, installing which-key is simply by:
|
|
If you don’t enable the variable use-package-always-ensure
, then we’ll need to also use the keyword :ensure
, to make sure the package is downloaded.
|
|
Useful external packages
Which-key
Just like our example earlier, which-key
is my most needed external packages. It display the keybinding following our incomplete command (or in Emacs term: a prefix). For example, in default Emacs when we want to open file we use the C-x C-f
chord. When we input C-x
and pause, nothing really shown.
There’s only C-x
displayed in the echo area (in the bottom), but with which-key-mode
activated:
Further which-key customization
|
|
This is the setup I used for which-key
.