import { fn } from "https://deno.land/x/ddc_vim@v4.0.2/deps.ts";
const { histget } = fn;
The result is a String, the entry with Number {index} from
{history}. See hist-names
for the possible values of
{history}, and :history-indexing
for {index}. If there is
no such entry, an empty String is returned. When {index} is
omitted, the most recent item from the history is used.
Examples: Redo the second last search from history.
:execute '/' .. histget("search", -2)
Define an Ex command ":H {num}" that supports re-execution of
the **{num}**th entry from the output of :history
.
:command -nargs=1 H execute histget("cmd", 0+<args>)
Can also be used as a method
:
GetHistory()->histget()