Here is the simplest @code{use-package} declaration: @verbatim ;; This is only needed once, near the top of the file (eval-when-compile ;; Following line is not needed if use-package.el is in ~/.emacs.d (add-to-list 'load-path "") (require 'use-package)) (use-package foo) @end verbatim This loads in the package @code{foo}, but only if @code{foo} is available on your system. If not, a warning is logged to the @code{*Messages*} buffer. Use the @code{:init} keyword to execute code before a package is loaded. It accepts one or more forms, up to the next keyword: @verbatim (use-package foo :init (setq foo-variable t)) @end verbatim Similarly, @code{:config} can be used to execute code after a package is loaded. In cases where loading is done lazily (see more about autoloading below), this execution is deferred until after the autoload occurs: @verbatim (use-package foo :init (setq foo-variable t) :config (foo-mode 1)) @end verbatim As you might expect, you can use @code{:init} and @code{:config} together: @verbatim (use-package color-moccur :commands (isearch-moccur isearch-all) :bind (("M-s O" . moccur) :map isearch-mode-map ("M-o" . isearch-moccur) ("M-O" . isearch-moccur-all)) :init (setq isearch-lazy-highlight t) :config (use-package moccur-edit)) @end verbatim In this case, I want to autoload the commands @code{isearch-moccur} and @code{isearch-all} from @code{color-moccur.el}, and bind keys both at the global level and within the @code{isearch-mode-map} (see next section). When the package is actually loaded (by using one of these commands), @code{moccur-edit} is also loaded, to allow editing of the @code{moccur} buffer. If you autoload no-interactive function, please use @code{:autoload}. @verbatim (use-package org-crypt :autoload org-crypt-use-before-save-magic) @end verbatim