Skip to main content
Module

x/denops_std/function/mod.ts>getcharsearch

📚 Standard module for denops.vim
Go to Latest
function getcharsearch
import { getcharsearch } from "https://deno.land/x/denops_std@v6.4.0/function/mod.ts";

Return the current character search information as a {dict} with the following entries:

char        character previously used for a character
            search (`t`, `f`, `T`, or `F`); empty string
            if no character search has been performed
forward     direction of character search; 1 for forward,
            0 for backward
until       type of character search; 1 for a `t` or `T`
            character search, 0 for an `f` or `F`
            character search

This can be useful to always have ; and , search forward/backward regardless of the direction of the previous character search:

:nnoremap <expr> ; getcharsearch().forward ? ';' : ','
:nnoremap <expr> , getcharsearch().forward ? ',' : ';'

Also see setcharsearch().

Returns

Promise<Record<string, unknown>>