1
1
Fork 0
Highlight the active block under the cursor. https://hg.reactionary.software/
Go to file
Campbell Barton 95df3ea6e9 Use private naming convention for mode management functions 2022-11-29 14:51:13 +11:00
.elisp-autofmt Add .elisp-autofmt to enable auto-formatting 2020-01-18 14:10:50 +11:00
LICENSE Create LICENSE 2019-04-30 10:03:19 +10:00
hl-block-mode.el Use private naming convention for mode management functions 2022-11-29 14:51:13 +11:00
readme.rst Use a string for hl-block-bracket characters 2021-10-29 17:02:27 +11:00

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.