To setup Flycheck properly, you do not need to require
Flycheck. Instead, just enable Global Flycheck Mode:
(add-hook 'after-init-hook #'global-flycheck-mode)
This will enable Flycheck for all supported languages.
To make (require 'flycheck)
work in your init.el
, you need to add (package-initialize)
at the very beginning of your init.el
.
(package-initialize)
sets up Emacs' built-in package system, which includes adding all packages to the load-path
. Emacs calls this automatically, but only after your init.el
has been processed, hence the use of after-init-hook
to enable Flycheck.
If you added a message
call to your init.el
without calling (package-initialize)
first, you'll hence see the standard load-path
without any of your packages.
To make your packages available in your init.el
right away, you need to call (package-initialize)
manually, at the beginning of your init.el
.