plugins.hydra.settings

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

Type: attribute set of anything

Default: { }

Example:

{
  buffer = true;
  color = "red";
  desc = null;
  exit = false;
  foreign_keys = "run";
  hint = false;
  invoke_on_body = false;
  on_enter = ''
    function()
      print('hello')
    end
  '';
  timeout = 5000;
}

Declared by:

plugins.hydra.settings.buffer

Define a hydra for the given buffer, pass true for current buf.

Type: null or value true (singular enum) or (unsigned integer, meaning >=0)

Default: null

Plugin default: null

Declared by:

plugins.hydra.settings.color

See :h hydra-colors. "red" | "amaranth" | "teal" | "pink"

Type: null or string or raw lua code

Default: null

Plugin default: "red"

Declared by:

plugins.hydra.settings.debug

Whether to enable debug mode.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by:

plugins.hydra.settings.desc

Description used for the body keymap when invoke_on_body is true. When nil, “[Hydra] … name” is used.

Type: null or string or raw lua code

Default: null

Plugin default: null

Declared by:

plugins.hydra.settings.exit

Set the default exit value for each head in the hydra.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by:

plugins.hydra.settings.foreign_keys

Decides what to do when a key which doesn’t belong to any head is pressed

  • null: hydra exits and foreign key behaves normally, as if the hydra wasn’t active
  • "warn": hydra stays active, issues a warning and doesn’t run the foreign key
  • "run": hydra stays active, runs the foreign key

Type: null or one of “warn”, “run” or raw lua code

Default: null

Plugin default: null

Declared by:

plugins.hydra.settings.invoke_on_body

When true, summon the hydra after pressing only the body keys. Normally a head is required.

Type: null or boolean or raw lua code

Default: null

Plugin default: false

Declared by:

plugins.hydra.settings.on_enter

Called when the hydra is activated.

Type: null or lua code string

Default: null

Declared by:

plugins.hydra.settings.on_exit

Called before the hydra is deactivated.

Type: null or lua code string

Default: null

Declared by:

plugins.hydra.settings.on_key

Called after every hydra head.

Type: null or lua code string

Default: null

Declared by:

plugins.hydra.settings.timeout

Timeout after which the hydra is automatically disabled. Calling any head will refresh the timeout

  • true: timeout set to value of timeoutlen (:h timeoutlen)
  • 5000: set to desired number of milliseconds

By default hydras wait forever (false).

Type: null or boolean or (unsigned integer, meaning >=0)

Default: null

Plugin default: false

Declared by: