Skip to content

Lightweight syntax checker for Emacs, alternative of `flymake-mode'

License

Notifications You must be signed in to change notification settings

redguardtoo/lazyflymake

Repository files navigation

lazyflymake

Lightweight syntax checker for Emacs, alternative of flymake-mode.

Less CPU computing and less memory footprint.

demo.png

Since version 0.5, only Emacs 27.1+ is supported.

Install

Place *.el under Load Path. Then add (require 'lazyflymake) to your configuration.

Usage

This program is based on flymake API. So your existing configuration for flymake still works.

(add-hook 'prog-mode-hook #'lazyflymake-start)

By default, flymake-mode is turned on in lazyflymake-start.

Use lazyflymake-goto-next-error and lazyflymake-goto-prev-error to locate errors.

There is also a lightweight mode which does not use flymake-mode.

Enable it by insert extra one liner before calling flymake-start,

(setq lazyflymake-flymake-mode-on nil)

Then flymake-mode is not turned on by lazyflymake-start automatically.

The syntax check happens if and only if current buffer is saved.

The command lazyflymake-list-errors is provided in lightweight mode.

There are also other optional commands,

  • lazyflymake-stop stops the checking process and uninstall running code in after-save-hook and turn off flymake-mode.
  • lazyflymake-check-current-buffer always checks current buffer, ignoring other setup.

lazyflymake-program-extra-args contains extra arguments passed to linter cli program. It could be converted to buffer local variable.

Tips

This program also sets up flymake for Shell script, Emacs Lisp, and Lua automatically,

  • Shellcheck is required to check shell script
  • Lua executable is required to check Lua code
  • MISS_HIT is required to check octave/matlab code
  • Tidy is required to check html code
  • yamllint is required check yaml code
  • Customize lazyflymake-ignore-error-function to ignore errors extracted from linter output.

Contact me

Report bugs at https://github.com/redguardtoo/lazyflymake.

License

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.

About

Lightweight syntax checker for Emacs, alternative of `flymake-mode'

Resources

License

Stars

Watchers

Forks

Packages

No packages published