Skip to content

ikirill/hl-indent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hl-indent - Highlight irregular indentation

This modes puts indentation highlights below the starting character of a line on subsequent lines, like this:

some line
|   some other line
|   | another line
|   | |                  an indented line
| fourth line
final line

This works in every mode, but is more useful in haskell, which doesn't require indentation levels to be at multiples of a specific level.

If the minor mode hl-indent-mode-blocks is on, this mode will instead highlight blocks of indentation like so (where different symbols represent different colours):

xxxxxxxxxxxxxx
  oooooooooooo
  oooooooooooo
       *******
       *******
    **********
  oooooooooooo
    **********
xxxxxxxxxxxxxx

To use

Enable hl-indent-mode.

There is also hl-indent-mode-blocks, but it is less useful because of limited color contrast, depending on face settings.

Screenshot

Screenshot

Notes:

  • You can customize faces hl-indent-face (which is fringe by default), and also hl-indent-block-face-1, from 1 to 6.
  • To easily see where hl-indent-mode puts its highlights, use the function hl-indent--debug-faces together with either hl-indent-mode or hl-indent-mode-blocks.
  • The mode will refuse to turn on in a very very large file, because right now it examines every single line once, which can take too long.
  • Indentation highlights override any non-trivial background. This is a problem for things like comments that might have a background different from the default background. It also conflicts with other highlights, like hl-line-mode.

About

Highlight irregular indentation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published