plugins.treesitter-context.settings

Options provided to the require('treesitter-context').setup function.

Type: attribute set of anything

Default: { }

Example:

{
  line_numbers = true;
  max_lines = 0;
  min_window_height = 0;
  mode = "topline";
  multiline_threshold = 20;
  separator = "-";
  trim_scope = "inner";
  zindex = 20;
}

Declared by:

plugins.treesitter-context.settings.enable

Enable this plugin (Can be enabled/disabled later via commands)

Plugin default: true

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.treesitter-context.settings.line_numbers

Whether to show line numbers.

Plugin default: true

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.treesitter-context.settings.max_lines

How many lines the window should span. 0 means no limit.

Plugin default: 0

Type: null or unsigned integer, meaning >=0, or raw lua code

Default: null

Declared by:

plugins.treesitter-context.settings.min_window_height

Minimum editor window height to enable context. 0 means no limit.

Plugin default: 0

Type: null or unsigned integer, meaning >=0, or raw lua code

Default: null

Declared by:

plugins.treesitter-context.settings.mode

Line used to calculate context.

Plugin default: "cursor"

Type: null or one of “cursor”, “topline” or raw lua code

Default: null

Declared by:

plugins.treesitter-context.settings.multiline_threshold

Maximum number of lines to collapse for a single context line.

Plugin default: 20

Type: null or unsigned integer, meaning >=0, or raw lua code

Default: null

Declared by:

plugins.treesitter-context.settings.on_attach

The implementation of a lua function which takes an integer buf as parameter and returns a boolean. Return false to disable attaching.

Plugin default: nil

Type: null or lua function string

Default: null

Declared by:

plugins.treesitter-context.settings.separator

Separator between context and content. Should be a single character string, like “-”. When separator is set, the context will only show up when there are at least 2 lines above cursorline.

Type: null or string

Default: null

Declared by:

plugins.treesitter-context.settings.trim_scope

Which context lines to discard if max_lines is exceeded.

Plugin default: "outer"

Type: null or one of “outer”, “inner” or raw lua code

Default: null

Declared by:

plugins.treesitter-context.settings.zindex

The Z-index of the context window.

Plugin default: 20

Type: null or unsigned integer, meaning >=0, or raw lua code

Default: null

Declared by: