[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/indent-bars 6ace473d05 121/431: README: document treesi
From: |
ELPA Syncer |
Subject: |
[elpa] externals/indent-bars 6ace473d05 121/431: README: document treesitter support |
Date: |
Mon, 16 Sep 2024 12:59:20 -0400 (EDT) |
branch: externals/indent-bars
commit 6ace473d05efa7ed97d50844bd24b6783c0a7ec4
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: JD Smith <93749+jdtsmith@users.noreply.github.com>
README: document treesitter support
---
README.md | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/README.md b/README.md
index 66a864b489..cac39b74a1 100644
--- a/README.md
+++ b/README.md
@@ -15,6 +15,7 @@ This package provides vertical indentation _guide bars_, with
the following feat
- Properly handles font size changes.
- Optional zero-cost current-depth bar highlighting, permitting bar color
and/or appearance changes.
- Optional support for drawing bars on blank lines.
+- Optional tree-sitter support, for context-aware bar depth.
# FAQ's
@@ -46,6 +47,21 @@ To clone with `use-package` and `straight`:
:hook ((python-mode yaml-mode) . indent-bars-mode)) ; or whichever modes you
prefer
```
+## With tree-sitter support
+
+```elisp
+(use-package indent-bars
+ :load-path "~/code/emacs/indent-bars"
+ :custom
+
+ (indent-bars-treesit-support t)
+ (indent-bars-treesit-wrap '((python argument_list parameters
+ list list_comprehension
+ dictionary dictionary_comprehension
+ parenthesized_expression subscript)))
+ :hook ((python-base-mode yaml-mode) . indent-bars-mode))
+```
+
## Compatibility
For `indent-bars` to display fancy guide bars, your port and version of emacs
must correctly display the `:stipple` face attribute. **Most do.** It can
also be used *without stipples*, drawing a simple vertical character (like `│`)
instead. It automatically does this in non-graphical displays (terminals), but
can optionally be configured to always do so; see [Non-stipple
Display](#non-stipple-display).
@@ -83,6 +99,10 @@ The main customization variables:
- `indent-bars-prefer-character`: Use *characters* to display the vertical bar
instead of stipples. This occurs automatically on non-graphical displays
(terminals), but this variable can be used to always prefer character-based
display.
- `indent-bars-no-stipple-char`: The character to use when stipples are
unavailable or disabled. Defaults to the vertical box character `│`. Other
good options include `┃`, `┋`, and `║`.
- `indent-bars-unspecified-bg|fg-color`: Colors to use for the frame
background and default foreground when unspecified (e.g. in terminals). If you
intend to use `indent-bars` in the terminal, set to the terminal
background/foreground colors you use.
+- `indent-bars-treesit-support`: Whether to use tree-sitter (if available) to
help determine appropriate bar depth.
+- `indent-bars-treesit-wrap`: A mapping of language and wrap types, to avoid
adding extra bars (e.g. in wrapped function arguments).
+- `indent-bars-treesit-ignore-blank-lines-types`: A list of tree-sitter node
types to inhibit styling blank lines, like "module".
+- `indent-bars-no-descend-string`: Whether to inhibit increasing depth inside
of (tree-sitter determined) strings.
See the documentation of each variable for more details.
@@ -98,6 +118,12 @@ The heaviest operation (though still fairly efficient) is
**blank-line highlight
`indent-bars` only works with space-based indentation, i.e.
`indent-tabs-mode=nil`. Note that many modes enable this by default.
+## Tree-sitter
+
+`indent-bars` can optionally use tree-sitter when configured in supported
files to improve the calculation of bar depth. For example, many modes wrap
function definitions to align parameters with the opening `(`. With the help
of tree-sitter, `indent-bars` can avoid adding unwanted additional bars there.
It also can be used to identify strings, and to tweak the behavior of blank
line display. See options above.
+
+**Note**: This requires Emacs 29 built with tree-sitter support, and the
appropriate tree-sitter grammars installed for languages of interest.
+
## Display
### Stipples
- [elpa] branch externals/indent-bars created (now c4c680eb8e), ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars ba54e830a5 002/431: initial import, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars d0be9f85cb 023/431: stipple: take optional bar arguments, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 7b72bdb752 048/431: Initial README info, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars bda7039cfd 089/431: Update examples.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 085f9f7fed 081/431: Added terminal example image, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 6ace473d05 121/431: README: document treesitter support,
ELPA Syncer <=
- [elpa] externals/indent-bars a0d78b2c3d 065/431: Merge pull request #2 from BrunodaSilvaBelo/patch-1, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars e8cc5c4a77 094/431: Make default highlight bolder, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars d8ee83c12d 063/431: Fix footnote, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars acb992d370 103/431: Mention ┋, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 3a971623af 102/431: Tweak README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars a3083e769d 061/431: Merge pull request #1 from ideasman42/patch-2, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars d23ab840ec 062/431: Update README.md, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 4a7f9c7528 059/431: README: more compatibility detail, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars 25e3624ec1 108/431: initial support for treesitter + no string/comment descend, ELPA Syncer, 2024/09/16
- [elpa] externals/indent-bars b3297d6739 118/431: indent-at-node: move point (guard at top level with save-excursion), ELPA Syncer, 2024/09/16