Skip to content

konrad1977/flycheck-overlay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flycheck-overlay

❤️ Please sponsor me if you like this package

A modern, aesthetic overlay display for Flycheck errors in Emacs. Flycheck by displaying errors, warnings, and information messages using customizable overlays.

Screenshot of overlay-usage for Emacs.

Features

  • 🎨 Beautiful, customizable overlays for error display
  • 🚦 Different styles for errors, warnings, and info messages
  • 🔄 Real-time overlay updates while editing
  • 💡 Smart positioning and formatting of error messages
  • 🎯 Efficient overlay management
  • 📝 Markdown-style syntax highlighting in messages

Screenshots

Screenshot of overlay-usage for Emacs. Screenshot of overlay-usage for Emacs.

Installation

Manual Installation

  1. Download flycheck-overlay.el
  2. Add to your load path:
(add-to-list 'load-path "/path/to/flycheck-overlay")
(require 'flycheck-overlay)

Configuration

Basic Setup

;; Enable flycheck-overlay-mode globally
(add-hook 'flycheck-mode-hook #'flycheck-overlay-mode)

Customizing Faces

You can customize the appearance of overlays by modifying these faces:

(custom-set-faces
 '(flycheck-overlay-error
   ((t :background "#453246"
       :foreground "#ea8faa"
       :height 0.9
       :weight normal)))
 
 '(flycheck-overlay-warning
   ((t :background "#331100"
       :foreground "#DCA561"
       :height 0.9
       :weight normal)))
 
 '(flycheck-overlay-info
   ((t :background "#374243"
       :foreground "#a8e3a9"
       :height 0.9
       :weight normal))))

Usage

Once enabled, flycheck-overlay will automatically display error messages as overlays below the corresponding line. The overlays will:

  • Show errors in red with appropriate background
  • Display warnings in yellow/orange
  • Show information messages in green
  • Highlight code snippets and symbols in messages
  • Update in real-time as you type
  • Clear automatically when errors are fixed

Optimization settings

;;; Time in seconds to wait before checking and displaying errors after a change.
(setq flycheck-overlay-debounce-interval 0.2) 

Flycheck Overlay Icons

You can customize the icons used for different types of Flycheck messages in the overlay display. These settings allow you to define custom icons for information, warning, and error messages.

Icon settings

;;; Icons
(setq flycheck-overlay-info-icon "🛈")
(setq flycheck-overlay-warning-icon "")
(setq flycheck-overlay-error-icon "")

;;; Icon padding

;;; You might want to adjust this setting if you icons are not centererd or if you more or less space.fs
(setq flycheck-overlay-icon-left-padding 0.9)
(setq flycheck-overlay-icon-right-padding 0.9)

Customizing Error Indicators

You can customize the appearance of the error indicators using various line and arrow styles through the flycheck-overlay-virtual-line-type variable:

(setq flycheck-overlay-virtual-line-type 'curved-dotted-arrow)

;;; Overide virtual-line-type with your own
(setq flycheck-overlay-virtual-line-icon "╰──") ;;; default its nil
Style Name Display Description
nil No indicator
line-no-arrow └── Straight line
curved-line-no-arrow ╰── Curved line
double-line-no-arrow ╚══ Double line
bol ┗━━ Bold line
dotted-line-no-arrow └┈┈ Dotted line
straight-arrow └──► Straight line with arrow
double-line-arrow ╚══► Double line with arrow
bold-arrow ┗━━► Bold line with arrow
dotted-arrow └┈┈► Dotted line with arrow
curved-arrow ╰──► Curved line with arrow (default)
curved-bold-arrow ╰━━► Curved bold line with arrow
curved-double-arrow ╰══► Curved double line with arrow
curved-dotted-arrow ╰┈┈► Curved dotted line with arrow

Visibility settings

;;; Hide checker name for a cleaner UI
(setq flycheck-overlay-hide-checker-name t) 

;;; show at end of the line instead.
(setq flycheck-overlay-show-at-eol t) 

;;; Hide overlay when cursor is at same line good for shot-at-eol.
(setq flycheck-overlay-hide-when-cusor-is-on-same-line t) 

;;; Show an arrow (or icon of your choice) before the error to highlight the error a bit more.
(setq flycheck-overlay-show-virtual-line t) 

Show or hide checker name

Screenshot of overlay-usage for Emacs. Screenshot of overlay-usage for Emacs.

Show under or after the faulty code

Screenshot of overlay-usage for Emacs. Screenshot of overlay-usage for Emacs.

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Acknowledgments

  • Thanks to the Flycheck team for the excellent error checking framework
  • Inspired by various overlay-based error display implementations

Author

Mikael Konradsson [email protected]

About

A beautiful inline flycheck overlay for Emacs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •