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.

Plugin default: null

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

Default: null

Declared by:

plugins.hydra.settings.color

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

Plugin default: "red"

Type: null or string or raw lua code

Default: null

Declared by:

plugins.hydra.settings.debug

Whether to enable debug mode.

Plugin default: false

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.hydra.settings.desc

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

Plugin default: null

Type: null or string or raw lua code

Default: null

Declared by:

plugins.hydra.settings.exit

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

Plugin default: false

Type: null or boolean or raw lua code

Default: null

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

Plugin default: null

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

Default: null

Declared by:

plugins.hydra.settings.hint

Configure the hint. Set to false to disable.

Plugin default:

{
  show_name = true;
  position = "bottom";
  offset = 0;
}

Type: null or value false (singular enum) or (attribute set of anything)

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.

Plugin default: false

Type: null or boolean or raw lua code

Default: null

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).

Plugin default: false

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

Default: null

Declared by: