Skip to main content
Module

x/dpp_vim/deps.ts>fn.getmatches

Dark powered plugin manager for Vim/neovim
Latest
function fn.getmatches
import { fn } from "https://deno.land/x/dpp_vim@v0.2.0/deps.ts";
const { getmatches } = fn;

Returns a List with all matches previously defined for the current window by matchadd() and the :match commands. getmatches() is useful in combination with setmatches(), as setmatches() can restore a list of matches saved by getmatches(). If {win} is specified, use the window with this number or window ID instead of the current window. If {win} is invalid, an empty list is returned. Example:

:echo getmatches()

    [{'group': 'MyGroup1', 'pattern': 'TODO',
    'priority': 10, 'id': 1}, {'group': 'MyGroup2',
    'pattern': 'FIXME', 'priority': 10, 'id': 2}]

        :let m = getmatches()
        :call clearmatches()
        :echo getmatches()

    []

        :call setmatches(m)
        :echo getmatches()

    [{'group': 'MyGroup1', 'pattern': 'TODO',
    'priority': 10, 'id': 1}, {'group': 'MyGroup2',
    'pattern': 'FIXME', 'priority': 10, 'id': 2}]

        :unlet m

Parameters

denops: Denops
optional
win: unknown

Returns

Promise<unknown[]>