Method: Neovim::Plugin::DSL#command

Defined in:
lib/neovim/plugin/dsl.rb

#command(name, options = {}, &block) ⇒ Object

Register an nvim command. See :h command.

Parameters:

  • name (String)

    The name of the command.

  • options (Hash) (defaults to: {})

    Command options.

  • &block (Proc, nil)

    The body of the command.

Options Hash (options):

  • :nargs (Integer)

    The number of arguments to accept. See :h command-nargs.

  • :range (String, Boolean)

    The range argument. See :h command-range.

  • :count (Integer)

    The default count argument. See :h command-count.

  • :bang (Boolean)

    Whether the command can take a ! modifier. See :h command-bang.

  • :register (Boolean)

    Whether the command can accept a register name. See :h command-register.

  • :complete (String)

    Set the completion attributes of the command. See :h command-completion.

  • :eval (String)

    An nvim expression. Gets evaluated and passed as an argument to the block.

  • :sync (Boolean) — default: false

    Whether nvim should receive the return value of the block.



35
36
37
# File 'lib/neovim/plugin/dsl.rb', line 35

def command(name, options={}, &block)
  register_handler(:command, name, options, block)
end