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

x/ddc_vim/deps.ts>fn.histdel

Dark deno-powered completion framework for neovim/Vim
Go to Latest
function fn.histdel
import { fn } from "https://deno.land/x/ddc_vim@v4.0.2/deps.ts";
const { histdel } = fn;

Clear {history}, i.e. delete all its entries. See hist-names for the possible values of {history}.

If the parameter {item} evaluates to a String, it is used as a regular expression. All entries matching that expression will be removed from the history (if there are any). Upper/lowercase must match, unless "\c" is used /\c. If {item} evaluates to a Number, it will be interpreted as an index, see :history-indexing. The respective entry will be removed if it exists.

The result is TRUE for a successful operation, otherwise FALSE is returned.

Examples: Clear expression register history:

:call histdel("expr")

Remove all entries starting with "*" from the search history:

:call histdel("/", '^\*')

The following three are equivalent:

:call histdel("search", histnr("search"))
:call histdel("search", -1)
:call histdel("search", '^' .. histget("search", -1) .. '$')

To delete the last search pattern and use the last-but-one for the "n" command and 'hlsearch':

:call histdel("search", -1)
:let @/ = histget("search", -1)

Can also be used as a method:

GetHistory()->histdel()

Parameters

denops: Denops
history: unknown
optional
item: unknown

Returns

Promise<number>