plugins.trouble.settings

Options provided to the require('trouble').setup function.

Type: attribute set of anything

Default: { }

Example:

{
  callback = {
    __raw = ''
      function()
        print('nixvim')
      end
    '';
  };
  foo_bar = 42;
  hostname = "localhost:8080";
}

Declared by:

plugins.trouble.settings.auto_close

Automatically close the list when you have no diagnostics.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by:

plugins.trouble.settings.auto_jump

Auto jump to the item when there’s only one.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by:

plugins.trouble.settings.auto_preview

Automatically preview the location of the diagnostic. <esc> to close preview and go back to last window.

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by:

plugins.trouble.settings.auto_refresh

Automatically refresh when open.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by:

plugins.trouble.settings.focus

Focus the window when opened.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by:

plugins.trouble.settings.follow

Follow the current item.

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by:

plugins.trouble.settings.icons

Define custom icons.

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

Default: null

Plugin default:

{
  folder_closed = " ";
  folder_open = " ";
  indent = {
    fold_closed = " ";
    fold_open = " ";
    last = "└╴";
    middle = "├╴";
    top = "│ ";
    ws = "  ";
  };
  kinds = {
    Array = " ";
    Boolean = "󰨙 ";
    Class = " ";
    Constant = "󰏿 ";
    Constructor = " ";
    Enum = " ";
    EnumMember = " ";
    Event = " ";
    Field = " ";
    File = " ";
    Function = "󰊕 ";
    Interface = " ";
    Key = " ";
    Method = "󰊕 ";
    Module = " ";
    Namespace = "󰦮 ";
    Null = " ";
    Number = "󰎠 ";
    Object = " ";
    Operator = " ";
    Package = " ";
    Property = " ";
    String = " ";
    Struct = "󰆼 ";
    TypeParameter = " ";
    Variable = "󰀫 ";
  };
}

Declared by:

plugins.trouble.settings.indent_guides

Add indent guides.

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by:

plugins.trouble.settings.keys

Key mappings can be set to the name of a builtin action, or you can define your own custom action.

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

Default: null

Plugin default:

{
  "<2-leftmouse>" = "jump";
  "<c-s>" = "jump_split";
  "<c-v>" = "jump_vsplit";
  "<cr>" = "jump";
  "<esc>" = "cancel";
  "?" = "help";
  P = "toggle_preview";
  R = "toggle_refresh";
  "[[" = "prev";
  "]]" = "next";
  d = {
    action = "delete";
    mode = "v";
  };
  dd = "delete";
  gb = {
    action = {
      __raw = ''
        function(view)
          view:filter({ buf = 0 }, { toggle = true })
        end
      '';
    };
    desc = "Toggle Current Buffer Filter";
  };
  i = "inspect";
  o = "jump_close";
  p = "preview";
  q = "close";
  r = "refresh";
  s = {
    action = {
      __raw = ''
        function(view)
           local f = view:get_filter("severity")
           local severity = ((f and f.filter.severity or 0) + 1) % 5
           view:filter({ severity = severity }, {
             id = "severity",
             template = "{hl:Title}Filter:{hl} {severity}",
             del = severity == 0,
           })
        end
      '';
    };
    desc = "Toggle Severity Filter";
  };
  zA = "fold_toggle_recursive";
  zC = "fold_close_recursive";
  zM = "fold_close_all";
  zN = "fold_enable";
  zO = "fold_open_recursive";
  zR = "fold_open_all";
  zX = "fold_update_all";
  za = "fold_toggle";
  zc = "fold_close";
  zi = "fold_toggle_enable";
  zm = "fold_more";
  zn = "fold_disable";
  zo = "fold_open";
  zr = "fold_reduce";
  zx = "fold_update";
  "{" = "prev";
  "}" = "next";
}

Declared by:

plugins.trouble.settings.max_items

Limit the number of items that can be displayed per section.

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

Default: null

Plugin default: 200

Declared by:

plugins.trouble.settings.modes

Customize the various builtin modes or define your own.

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

Default: null

Plugin default:

{
  lsp_base = {
    params = {
      include_current = false;
    };
  };
  lsp_references = {
    params = {
      include_declaration = true;
    };
  };
  symbols = {
    desc = "document symbols";
    filter = {
      any = {
        ft = [
          "help"
          "markdown"
        ];
        kind = [
          "Class"
          "Constructor"
          "Enum"
          "Field"
          "Function"
          "Interface"
          "Method"
          "Module"
          "Namespace"
          "Package"
          "Property"
          "Struct"
          "Trait"
        ];
      };
      not = {
        ft = "lua";
        kind = "Package";
      };
    };
    focus = false;
    mode = "lsp_document_symbols";
    win = {
      position = "right";
    };
  };
}

Declared by:

plugins.trouble.settings.multiline

Render multi-line messages.

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by:

plugins.trouble.settings.open_no_results

Open the trouble window when there are no results.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by:

plugins.trouble.settings.pinned

Whether the opened trouble window will be bound to the current buffer.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by:

plugins.trouble.settings.preview

Window options for the preview window.

See |nvim_open_win()|.

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

Default: null

Plugin default:

{
  scratch = true;
  type = "main";
}

Declared by:

plugins.trouble.settings.restore

Restores the last location in the list when opening.

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by:

plugins.trouble.settings.warn_no_results

Show a warning when there are no results.

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by:

plugins.trouble.settings.win

Window options for the results window. Can be a split or a floating window.

See |nvim_open_win()|.

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

Default: null

Plugin default: { }

Declared by: