Commit graph

112 commits

Author SHA1 Message Date
George Harker
cb568af539 use indent.X syntax for captures and properties of set directives
update CONTRIBUTING.md

adjust indents for bass

fix doc capture comment
2023-03-24 13:07:53 -04:00
George Harker
d1333dd7e5 refactor(indent)!: Rework indent, aligned indent
indents now use @indent.X style captures, and indent.PROP for properties to set on those captures, as documented in the help.

Captures are:

indent.auto
indent.begin
indent.end
indent.dedent
indent.branch
indent.ignore
indent.align
indent.zero

Properties are:

indent.immediate
indent.start_at_same_line
indent.open_delimiter
indent.close_delimiter
indent.increment
indent.avoid_last_matching_next

Multiple opening delims on one line and multiple closing on a line are collapsed so as not to over indent,

The final line of @indent.align blocks which must in some cases be treated specially to avoid clashing with the next line is treated the same regardless of whether the @indent.align capture actually uses aligned indentation or just normal indentation. The indent.avoid_last_matching_next property controls this.

Adjust python to use these.

List, set, dict and tuple all use @indent.align which permits both hanging and aligned styles.

Finally, try: on it’s own will indent when typing live but make no guaranteeds about whole-file formatting.

Includes lucario387:fix-align-indent
2023-03-24 13:07:53 -04:00
Zhizhen He
a1df50a79f docs: fix typo 2023-03-21 02:23:52 -04:00
Nat Williams
20a8f30ace use positive option "allow_duplicates" instead of negative "dedupe" 2023-02-24 14:55:30 -08:00
Nat Williams
3fab7abf6f add statusline option to dedupe or not 2023-02-24 14:55:30 -08:00
Nat Williams
34adfe8e95 update docs for transform_fn
to reflect additional node argument
2023-02-24 14:55:30 -08:00
Kiyoon Kim
7eb5f1a2e3 properly replace deprecated tsutils functions 2023-02-12 14:26:14 -08:00
Christian Clason
42ab95d5e1 feat!: remove obsolete TS* highlight groups 2022-10-16 15:50:55 +02:00
lfenzo
77675b6706 Correct previously edited docs file 2022-08-03 12:05:30 -07:00
lfenzo
8665a99a0f Updated nvim-tresitter.txt doc 2022-08-03 12:05:30 -07:00
adrian5
ba806c2480
doc: fix typos (#3163) 2022-07-11 08:12:32 +02:00
Jonas Strittmatter
365f0eb75f
feat: add option to auto-install missing parsers (#3130) 2022-07-08 07:36:54 +00:00
Duncan McDougall
901ffe1a36
Add support for custom parser install locations #2959 (#3031) 2022-06-20 22:50:07 +02:00
Stephan Seitz
c3848e713a chore: deprecate ts_utils.get_node_text 2022-04-18 14:17:51 +02:00
Christian Clason
acd01551a3 chore!: deprecate ensure_installed=maintained
BREAKING CHANGE: specify explicit list or use `ensure_installed='all'`
(not recommended)
2022-04-10 13:24:57 +02:00
kiyan
7141393f12 fix(modules): enabling disabling per buffer and globally
When a module is disabled by default in the config, running
TSBufEnable will not enable the module because the is_enabled
function will always return false, thus the module not being enabled.
Also, disabling/enabling the buffers is flaky.

This commit adds per buffer check when the module is not disabled. It
also makes the enable and disable more indempotent.

i've also renamed TS*All to TS*.

Fixes #2754
2022-04-10 11:10:12 +02:00
Gregory Anders
e2b2d2357b Add capture groups for remaining builtin highlight groups
Some builtin highlight groups (see `:h group-name`) do not yet have
associated capture groups, so add them.
2022-03-30 22:14:23 +02:00
kiyan
560e8fb450 refacto: expose a function to set custom capture for the higlighter
BREAKING: deprecate custom_captures from highlight config.
This allows plugin authors to extend the map. It also avoids settings
user configuration specific values during the highlighter
initialization (SOC).
Not sure how much value this brings, and might potentially break a lot
of people configurations. This is questionable.
2022-02-19 18:26:51 +01:00
kiyan
cf21576b0c chore: update init.vim refs to init.lua 2022-02-11 10:42:03 +01:00
kiyan
2e67eace75 chore: remove lua heredocs in documentation and readme 2022-02-11 10:42:03 +01:00
monkoose
500f58f5ac docs: add missing vim table in the example 2022-01-22 11:09:39 +01:00
Santos Gallegos
4aa9f6b7f7 Make example config more easy to read
Ref https://github.com/nvim-treesitter/nvim-treesitter/issues/2095#issuecomment-992759818
2021-12-18 14:50:48 +01:00
patrick96
d2174f1d29 Fix docs 2021-11-28 00:31:02 +01:00
patrick96
e8bde2fe61 Completely remove condition from documentation 2021-11-28 00:31:02 +01:00
patrick96
d24a1c63d4 Make disable accept a function
Replaces the condition setting (though it does the exact inverse)
2021-11-28 00:31:02 +01:00
patrick96
76673d61c3 Rename cond to condition 2021-11-28 00:31:02 +01:00
patrick96
be1c93f848 Add documentation for cond setting
Ref: #1994
2021-11-28 00:31:02 +01:00
Dundar Göc
83efae51bf docs: move description to the first line
This will make the description of nvim-treesitter show up in the LOCAL
ADDITIONS section of the help text. So this

|nvim-treesitter|

instead becomes

|nvim-treesitter|  Treesitter configurations and abstraction layer for Neovim.
2021-11-05 18:32:19 -05:00
Dundar Göc
6a4fdb317d chore: fix typos 2021-11-02 23:47:48 +01:00
Sergio Alejandro Vargas
1d8dd9665c docs: Update nvim-treesitter-highlights
- Fix misspellings, missing punctuation and capitalization.
- Clarify whether highlights apply to identifiers (e.g. `TSConstant`)
  or to literal values (e.g. `TSConstBuiltin`).
- Extend examples.

See #1767
2021-09-14 21:15:20 +02:00
lmlorca
fb5d6e04a8 add @tag.attribute for html like attributes 2021-07-14 10:13:13 +02:00
Stephan Seitz
29113e6892
doc: be more explicit about additional_vim_regex_highlighting (#1561) 2021-07-13 18:08:57 -05:00
Santos Gallegos
647268183f
Highlights: define string.special (#1551)
* Highlights: define string.special

This was in our CONTRIBUTING.md file,
but wasn't defined.

Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/1405

* Use string.escape
2021-07-11 15:59:53 -05:00
Munif Tanjim
97761acaff Folds: support 'foldminlines' 2021-07-08 21:42:02 +02:00
Santos Gallegos
3413581b58 Docs: mention that indentation is still experimental 2021-07-05 19:26:35 +02:00
Santos Gallegos
f3d0bdcf6f Docs: document additional_vim_regex_highlighting option 2021-07-05 19:24:05 +02:00
antonk52
90f15d9bf7 feat(keywords) merge return and yield into keyword.return group 2021-07-04 21:49:17 +02:00
antonk52
bd9095e969 feat(keywords) add keyword.return & keyword.yield 2021-07-04 21:49:17 +02:00
Shane Hird
a8d64922fa Re-introduce prompting for installation 2021-07-04 14:59:13 +02:00
Shane Hird
76ea2b8871 TSUpdate does not install if up to date 2021-07-04 14:59:13 +02:00
kmarius
8adb2e0352 fix typo: Enviroment -> Environment 2021-06-22 07:27:00 +02:00
Munif Tanjim
4a80228220 docs: update nvim-treesitter-highlights 2021-04-24 16:52:37 +02:00
Thomas Vigouroux
a74484a8ac docs: Update vimdoc file
Adds the new maintainers (that were actually added a long time ago),
fix inconsistent formatting, and unneeded or old/wrong docs.
2021-04-22 18:25:41 +02:00
Stephan Seitz
4df2667303 feat: Add TSEditQueryUserAfter 2021-04-14 16:23:21 +02:00
Stephan Seitz
4598f90f34 docs: Add documentation for :TSEditQuery 2021-04-14 16:23:21 +02:00
Marco Hinz
06c9ef8104 TSModuleInfo: change doc 2021-04-06 21:32:46 +02:00
Steven Sojka
6863f79118
refactor(all): language tree adaption (#1105) 2021-03-30 08:18:24 -05:00
Steven Sojka
7984975a2f
feat(install): allow ignore list when installing parsers (#1098) 2021-03-24 09:12:03 -05:00
Santos Gallegos
e4083fc8e1
Add comment parser to highlight comment tags (#893)
Closes #236
2021-03-12 11:21:46 -05:00
Dennis B
aca33c0aca [highlights] Add TSSymbol highlight group
Addresses issue #892

Ruby and Dart literal symbols will now be highlighted by the new
TSSymbol highlight group, which itself will, by default, link to the Vim
Identifier highlight group. Vim theme authors can then set their
TSSymbol colors.

Symbol highlighting can apply to a number of languages as noted in the
following Wikipedia page: https://en.wikipedia.org/wiki/Symbol_(programming)

Not just for Ruby and Dart.
2021-03-04 06:19:40 +01:00