Skip to main content
Module

x/denops_std/function/nvim/mod.ts>nvim_parse_cmd

📚 Standard module for denops.vim
Latest
function nvim_parse_cmd
import { nvim_parse_cmd } from "https://deno.land/x/denops_std@v6.5.0/function/nvim/mod.ts";

Parse command line.

Doesn't check the validity of command arguments.

Attributes: api-fast

Parameters:

  • {str} Command line string to parse. Cannot contain "\n".
  • {opts} Optional parameters. Reserved for future use.

Return: Dictionary containing command information, with these keys: - cmd: (string) Command name. - range: (array) (optional) Command range (<line1> <line2>). Omitted if command doesn't accept a range. Otherwise, has no elements if no range was specified, one element if only a single range item was specified, or two elements if both range items were specified. - count: (number) (optional) Command <count>. Omitted if command cannot take a count. - reg: (string) (optional) Command <register>. Omitted if command cannot take a register. - bang: (boolean) Whether command contains a <bang> (!) modifier. - args: (array) Command arguments. - addr: (string) Value of :command-addr. Uses short name or "line" for -addr=lines. - nargs: (string) Value of :command-nargs. - nextcmd: (string) Next command if there are multiple commands separated by a :bar. Empty if there isn't a next command. - magic: (dictionary) Which characters have special meaning in the command arguments. - file: (boolean) The command expands filenames. Which means characters such as "%", "#" and wildcards are expanded. - bar: (boolean) The "|" character is treated as a command separator and the double quote character (") is treated as the start of a comment.

- mods: (dictionary) `:command-modifiers`.
  - filter: (dictionary) `:filter`.
    - pattern: (string) Filter pattern. Empty string if there is no
      filter.
    - force: (boolean) Whether filter is inverted or not.

  - silent: (boolean) `:silent`.
  - emsg_silent: (boolean) `:silent!`.
  - unsilent: (boolean) `:unsilent`.
  - sandbox: (boolean) `:sandbox`.
  - noautocmd: (boolean) `:noautocmd`.
  - browse: (boolean) `:browse`.
  - confirm: (boolean) `:confirm`.
  - hide: (boolean) `:hide`.
  - horizontal: (boolean) `:horizontal`.
  - keepalt: (boolean) `:keepalt`.
  - keepjumps: (boolean) `:keepjumps`.
  - keepmarks: (boolean) `:keepmarks`.
  - keeppatterns: (boolean) `:keeppatterns`.
  - lockmarks: (boolean) `:lockmarks`.
  - noswapfile: (boolean) `:noswapfile`.
  - tab: (integer) `:tab`. -1 when omitted.
  - verbose: (integer) `:verbose`. -1 when omitted.
  - vertical: (boolean) `:vertical`.
  - split: (string) Split modifier string, is an empty string when
    there's no split modifier. If there is a split modifier it can be
    one of:
    - "aboveleft": `:aboveleft`.
    - "belowright": `:belowright`.
    - "topleft": `:topleft`.
    - "botright": `:botright`.

Parameters

denops: Denops
str: unknown
opts: unknown

Returns

Promise<unknown>