plugins.auto-save.settings

Options provided to the require('auto-save').setup function.

Type: attribute set of anything

Default: { }

Example:

{
  condition = ''
    function(buf)
      local fn = vim.fn
      local utils = require("auto-save.utils.data")
    
      if utils.not_in(fn.getbufvar(buf, "&filetype"), {'oil'}) then
        return true
      end
      return false
    end
  '';
  debounce_delay = 1000;
  write_all_buffers = true;
}

Declared by:

plugins.auto-save.settings.enabled

Whether to start auto-save when the plugin is loaded.

Type: null or boolean or raw lua code

Default: null

Plugin default: true

Declared by:

plugins.auto-save.settings.condition

Function that determines whether to save the current buffer or not.

  • return true: if buffer is ok to be saved
  • return false: if it’s not ok to be saved

In this example, the second argument of utils.not_in(..., {}) determines which filetypes will be ignored by auto-save plugin.

Buffers that are nomodifiable are not saved by default.

Type: null or lua function string

Default: null

Plugin default: null

Example:

''
  function(buf)
    local fn = vim.fn
    local utils = require("auto-save.utils.data")
  
    if utils.not_in(fn.getbufvar(buf, "&filetype"), {}) then
      return true
    end
    return false
  end
''

Declared by:

plugins.auto-save.settings.debounce_delay

Saves the file at most every debounce_delay milliseconds.

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

Default: null

Plugin default: 1000

Declared by:

plugins.auto-save.settings.debug

Log debug messages to auto-save.log file in NeoVim cache directory.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by:

plugins.auto-save.settings.lockmarks

Lock marks when saving, see :h lockmarks for more details.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by:

plugins.auto-save.settings.noautocmd

Do not execute autocmds when saving.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by:

plugins.auto-save.settings.write_all_buffers

Write all buffers when the current one meets condition.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by: