Flycheck provides on-the-fly syntax checking for GNU Emacs 24. Essentially it's “flymake done right” with
- major-mode based checkers (instead of file name patterns),
- simple declarative checker definitions (instead of init functions),
- ready-to-use syntax checkers for a bunch of languages (instead of broken checkers using non-existing tools),
- and a clean, concise and understandable implementation (instead of a almost 2k line mess of spaghetti code).
And this is how it looks like (the color theme is solarized-light):
- Automatic syntax check after saving or insertion of new lines
- Error navigation with
- Built-in syntax checkers for:
- Emacs Lisp
- Shell scripts (Bash, Dash and Zsh)
- Easy customization (see
- Easy declarative API to define new syntax checkers
Flycheck is written and tested against GNU Emacs 24.2 and newer. It should work on Emacs 24.1, too. GNU Emacs 23 and before, and other flavors of Emacs (e.g. XEmacs) are not supported.
Most checkers have dependencies against external tools that perform the
C-c ! ? to see what a checker needs, e.g.
C-c ! ?
Once installed, enable Flycheck mode with
To enable Flycheck mode in all buffers, in which it can be used, add the
following to your
(add-hook 'after-init-hook #'global-flycheck-modes)
In Flycheck mode the buffer will automatically be checked on the fly, if a
suitable syntax checker exists. Use
C-c ! c to start a syntax check manually.
A suitable syntax checker is automatically selected from the list of registered
C-c ! s to manually select a specific
syntax checker, or configure the syntax checker per file by setting
flycheck-checker as file local variable::
# Local Variables: # flycheck-checker: python-pylint # End:
Some syntax checkers read configuration files. Use
M-x customize-group RET
flycheck-config-files to customize these. Refer to the section Configuration
in the Flycheck info manual.
Errors and warnings from the syntax checker are reported in the mode line,
highlighted in the buffer and indicated with icons in the fringe. Customize
flycheck-highlighting-mode to change the highlighting of errors.
Note: The default highlighting faces provided GNU Emacs are ill-suited to highlight errors. They are too easily overlooked. Make sure to customize these faces to add a striking background color or an underlying, or choose a color theme with reasonable Flycheck faces, for instance the excellent light or dark solarized themes.
C-c ! n and
C-c ! p to navigate between errors. If the point is on an
error, the error message is shown in the echo area or in a popup buffer after a
short delay. You may also hover the mouse over a highlighted error to get a
tooltip with the error message.
Read the complete manual with
C-c ! i or
The following people contributed to flycheck:
- Bozhidar Batsov provided valuable feedback and refinements, and brought Flycheck to a larger user base by adding it to his awesome Prelude project.
- Damon Haley helped to shape and test the PHP CodeSniffer checker.
- Krzysztof Witkowski implemented
evalsupport in Flycheck commands.
- Marian Schubert added the Perl syntax checker.
- Martin Grenfell created the awesome Vim library syntastic which inspired this project and many of its checkers.
- Peter Vasil created the XML and Lua syntax checkers, added unit tests and did valuable testing.
- Robert Zaremba added the Go syntax checker.
- steckerhalter provided the PHP CodeSniffer checker.
- Steve Purcell implemented many checkers, contributed important ideas to the design of the checker API and engaged in worthwhile discussion to shape this project.
- Yannick Roehlly added support for PEP8 naming errors to the Flake8 syntax checker.
- Victor Deryagin added the Rust syntax checker.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
See COPYING for details.