Skip to main content
Module

x/dpp_vim/deps.ts>fn.bufadd

Dark powered plugin manager for Vim/neovim
Latest
function fn.bufadd
import { fn } from "https://deno.land/x/dpp_vim@v0.2.0/deps.ts";
const { bufadd } = fn;

Add a buffer to the buffer list with name {name} (must be a String). If a buffer for file {name} already exists, return that buffer number. Otherwise return the buffer number of the newly created buffer. When {name} is an empty string then a new buffer is always created. The buffer will not have 'buflisted' set and not be loaded yet. To add some text to the buffer use this:

let bufnr = bufadd('someName')
call bufload(bufnr)
call setbufline(bufnr, 1, ['some', 'text'])

Returns 0 on error. Can also be used as a method:

let bufnr = 'somename'->bufadd()

Parameters

denops: Denops
name: string

Returns

Promise<number>