Module buffer-closer.modules.options

This module is provides the default options for the plugin and functions to wok with the options.

Functions

apply_user_options (user_opts) Applies the user options to the default options.
validate_opts (opts:) Validates the plugin options.

Tables

DEFAULT_EVENTS Default events for the buffer-closer option events.
DEFAULT_OPTIONS Default options for the buffer-closer plugin.


Functions

apply_user_options (user_opts)
Applies the user options to the default options.

This function replaces the user options with the default options and returns the resulting options table.

Parameters:

  • user_opts table : The user options to apply.

Returns:

    table : The resulting options table.

See also:

validate_opts (opts:)
Validates the plugin options.

This function validates the given options table against a schema and returns the validated options. If the options are not valid, an error is thrown.

Parameters:

  • opts: table The options table to validate.

Returns:

    table or nil : The validated options table if the options are valid, otherwise nil.

Tables

DEFAULT_EVENTS
Default events for the buffer-closer option events.

Fields:

  • BufAdd
  • FocusLost
  • FocusGained
DEFAULT_OPTIONS
Default options for the buffer-closer plugin.

Fields:

  • min_remaining_buffers number : The minimum number of buffers to keep open.
  • retirement_minutes number : The number of minutes after which a buffer is considered retired.
  • events table : A table of events to trigger the buffer-closer.
  • timed_check : A table of options for automatically checking for retired buffers after a given number of minutes.
    • enabled boolean : Whether to automatically check for retired buffers after a given number of minutes.
    • interval_minutes number : The number of minutes after which to automatically check for retired buffers.
  • excluded : A table of excluded filetypes, buffer types, and filenames.
    • filetypes table : A table of excluded filetypes.
    • buftypes table : A table of excluded buffer types.
    • filenames table : A table of excluded filenames.
  • ignore_working_windows boolean : Whether to ignore buffers open in windows.
generated by LDoc 1.5.0 Last updated 2023-10-02 08:50:00