Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/denops_std/buffer/mod.ts>append

๐Ÿ“š Standard module for denops.vim
Latest
function append
import { append } from "https://deno.land/x/denops_std@v6.5.1/buffer/mod.ts";

Append content under the current cursor position or given lnum of the buffer

import type { Entrypoint } from "https://deno.land/x/denops_std@v6.5.1/mod.ts";
import * as fn from "https://deno.land/x/denops_std@v6.5.1/function/mod.ts";
import { append, open } from "https://deno.land/x/denops_std@v6.5.1/buffer/mod.ts";

export const main: Entrypoint = async (denops) => {
  await open(denops, "README.md");
  const bufnr = await fn.bufnr(denops);
  // Append the content under the cursor position of the `bufnr` buffer
  await append(denops, bufnr, ["Hello", "World"]);
}

It temporary change modified, modifiable, and foldmethod options to append the content of the buffer buffer without unmodifiable error or so on.

Parameters

denops: Denops
bufnr: number
repl: string[]
optional
options: AppendOptions = [UNSUPPORTED]

Returns

Promise<void>