Skip to content

Commit

Permalink
Document tree-sitter virtual text options re #316
Browse files Browse the repository at this point in the history
  • Loading branch information
andymass committed Aug 6, 2023
1 parent 2074184 commit 582cbc8
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions doc/matchup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,38 @@ directives.
See |matchup-feat-exclusive| and |matchup-feat-linewise| for some examples and
important special cases.

*matchup-treesitter*

Tree-sitter integration~
Note: Currently this feature is possible in neovim only. Only the latest
version of neovim and nvim-treesitter is supported.

match-up has support for language syntax provided by tree-sitter. The list
of supported languages is available here. This feature requires manual
opt-in in your init.vim and requires nvim-treesitter to be installed. >
Plug 'nvim-treesitter/nvim-treesitter'
lua <<EOF
require'nvim-treesitter.configs'.setup {
matchup = {
enable = true, -- mandatory, false will disable the whole extension
disable = { "c", "ruby" }, -- optional, list of language that will be disabled
-- [options]
},
}
<
Beside enable and disable, the following options are available, all
defaulting to false:

*disable_virtual_text*

If true, do not use virtual text to highlight the virtual end of a
block, for languages without explicit end markers (e.g., Python).

*include_match_words*

If true, additionally include traditional vim regex matches for symbols.

Highlighting matches~

To disable match highlighting at |startup|, use >
Expand Down Expand Up @@ -788,6 +820,24 @@ the function |timer_pause|, version 7.4.2180 and after.
<
Default: 0

*g:matchup_matchparen_end_sign*

(neovim only) Configure the virtual symbol shown for closeless matches in languages like
C++ and python.

if (true)
cout << "";
else
cout << ""; ◀ if

Default ◀

*MatchupVirtualText*

(neovim only) You can also configure the color and style of the virtual text.

:hi MatchupVirtualText ctermbg=blue guibg=lightblue gui=italic

Module motion~

*g:matchup_motion_override_Npercent*
Expand Down

0 comments on commit 582cbc8

Please sign in to comment.