Highlight the active block under the cursor. https://hg.reactionary.software/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Campbell Barton 95df3ea6e9 Use private naming convention for mode management functions 2 months ago
.elisp-autofmt Add .elisp-autofmt to enable auto-formatting 3 years ago
LICENSE Create LICENSE 3 years ago
hl-block-mode.el Use private naming convention for mode management functions 2 months ago
readme.rst Use a string for hl-block-bracket characters 1 year ago

readme.rst


####################
Highlight Block Mode
####################

This is a minor mode for highlighting blocks by scope.

.. figure:: https://user-images.githubusercontent.com/1869379/56872098-975b5900-6a68-11e9-8907-ccca12b5608a.png

Available via `melpa <https://melpa.org/#/hl-block-mode>`__.


Options
=======

``hl-block-bracket``: ``"{"``.
(string or null) bracket to use, set to ``nil`` to match all bracket types.
``hl-block-delay``: ``0.2``
(float) delay in seconds until the drawing the block scope.
``hl-block-multi-line``: ``t``
Skip highlighting blocks that begin and end on the same line.
``hl-block-single-level``: ``nil``
Only highlight a single level of surrounding braces.
``hl-block-style``: ``'color-tint``
The draw-style used to highlight blocks.

``'color-tint``:
Apply a color tint to the background, increasing for each level.

``hl-block-color-tint``: ``"#040404"``
(color) color tint for each level.

``'bracket``:
Highlight each bracket using a custom face, without changing the background.

``hl-block-bracket-face``: ``'(t (:inverse-video t))``
The face used to highlight brackets.


Examples
========

This example shows how this package can be used to highlight only the surrounding brackets.

.. code-block:: elisp

(use-package hl-block-mode
:commands (hl-block-mode)
:config
(setq hl-block-bracket nil) ;; Match all brackets.
(setq hl-block-single-level t) ;; Only one pair of brackets.
(setq hl-block-style 'bracket) ;; Highlight only the brackets.
:hook ((prog-mode) . hl-block-mode))


TODO
====

- Optionally, update instantly (without any delay).
- Avoid updating overlays when highlights havn't moved.
- Add default brackets based on the major mode, ``()`` for lisp's, ``{}`` for C/C++ etc.