plugins.nvim-surround.settings.surrounds

Associates each key with a “surround”. The attribute set contains the ‘add’, ‘find’, ‘delete’, and ‘change’ keys.

Type: null or (attribute set of ((submodule) or raw lua code))

Default: null

Plugin default: See upstream default configuration

Declared by:

plugins.nvim-surround.settings.surrounds.<name>.add

A function that returns the delimiter pair to be added to the buffer. For “static” delimiter pairs it can be a list of strings representing the value of the delimiter pair.

Type: lua function string or list of string

Example:

[
  "( "
  " )"
]

plugins.nvim-surround.settings.surrounds.<name>.delete

A function that returns the pair of selections to remove from the buffer when deleting the surrounding pair. It can also be string which is interpreted as a Lua pattern whose match groups represent the left/right delimiter pair.

Type: string or raw lua code

Example: "^(. ?)().-( ?.)()$"

plugins.nvim-surround.settings.surrounds.<name>.find

A function that returns the “parent selection” for a surrounding pair. It can also be string which is interpreted as a Lua pattern that represents the selection.

Type: string or raw lua code

Example:

{
  __raw = ''
    function()
      return M.get_selection({ motion = "a(" })
    end
  '';
}