Layer

class Layer #

A visimp functionality


methods #


Layer.dependencies #


function Layer.dependencies() -> dep LayerId[]

@return dep - A list of identifiers for the dependency layers

Returns a list of dependency layers

Layer.packages #


function Layer.packages() -> dep (PackageSlug|Package)[]

@return dep - A list of repo names or full-fledged packages

Returns a list of dependency packages (i.e., (Neo)vim plugins). Each can be specified as either a simple GitH*b repository name (user/repository), or using the appropriate class.

Layer.preload #


function Layer.preload()

A handler which is called on all layers before the load method is called on any of them. This is used to modify behavior of other layers’ load methods.

Layer.load #


function Layer.load()

A handler designed to let layers apply side effects on the Neovim client. This is where plugins are enabled, the Neovim configuration is set, etcetera.

Layer.configure #


function Layer.configure(cfg: table) ->  nil

@param cfg - The settings used to extend the default layer configuration

Replaces the current configuration with the result of recursively extending the default layer configuration with the given value.

Layer.new_layer #


function Layer.new_layer(id: LayerId) -> layer Layer

@param id - The layer identifier

@return layer - The newly created layer

Returns an empty new layer for the given identifier

Layer.is_layer #


function Layer.is_layer(layer: any) -> result boolean

@param layer - The hypothetical layer to analyze

@return result - Whether the provided argument is a layer

Returns true if the given argument is a proper layer

Layer.to_vimscript_config #


function Layer.to_vimscript_config(
  vim_config_field: string,
  prefix_mode: boolean,
  layer_config_field: string?,
  blacklist: string[]?
) ->  nil

@param vim_config_field - The name of the global vimscript variable storing the plugin config, or the common prefix shared by all the plugin config fields if these are stored as individual vimscript global variables.

@param prefix_mode - True(ish) if the vim_config_field parameter should be interpreted as a prefix common to all the plugin config fields, or false(ish) if it should just be the global vimscript variable storing the plugin config.

@param layer_config_field - The field in the layer config where the plugin config is stored. If the plugin config is stored at the root of the layer config, nil should be passed instead.

@param blacklist - A list of fields that should not be copied from the layer config (as they do not belong to the plugin config). If nil, it is considered to be empty.

Exports a layer config as a vimscript plugin config (i.e., vim global variables)

fields #


Layer.identifier #


Layer.identifier : LayerId

A unique, human-readable identifier

Layer.default_config #


Layer.default_config : table

The default configuration of the layer

Layer.config #


Layer.config : table

The current user configuration for this layer

Layer.deprecated #


Layer.deprecated : boolean

Whether the layer has been deprecated

Layer.__index #


Layer.__index : Layer {
    identifier: LayerId,
    default_config: table,
    config: table,
    deprecated: boolean,
    __index: Layer,
}