Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ddu_vim/deps.ts>fn.getcharsearch

Dark deno-powered UI framework for neovim/Vim
Go to Latest
function fn.getcharsearch
import { fn } from "https://deno.land/x/ddu_vim@v4.0.0/deps.ts";
const { getcharsearch } = fn;

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