Skip to main content
Deno 2 is finally here πŸŽ‰οΈ
Learn more
Module

x/denops_std/bufname/mod.ts>Bufname

πŸ“š Standard module for denops.vim
Latest
interface Bufname
import { type Bufname } from "https://deno.land/x/denops_std@v6.5.1/bufname/mod.ts";

Represent Vim's buffer name

The format of the buffer name assumed is like

{scheme}://{expr}[;{params}][#{fragment}]

Where

  • {scheme} is used to distinguish a buffer kind. It contains only alphabet characters.
  • {expr} is used to identify a buffer itself. Unusable characters, semicolons (;), and sharps (#) are replaced with percent-encoded characters.
  • {params} (Optional) is used to add meta information to the buffer name like query parameters of URL. Unusable characters and sharps (#) are replaced with percent-encoded characters.
  • {fragment} (Optional) is used to add a suffix to the buffer name for file type detection or so on. Unusable characters are replaced with percent-encoded characters.

For example,

denops:///Users/John Titor/test.git
β””β”€β”¬β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  scheme             expr

denops:///Users/John Titor/test.git;foo=foo&bar=bar1&bar=bar2
β””β”€β”¬β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  scheme             expr                       params

denops:///Users/John Titor/test.git#README.md
β””β”€β”¬β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”¬β”€β”€β”€β”˜
  scheme             expr               fragment

denops:///Users/John Titor/test.git;foo=foo&bar=bar1&bar=bar2#README.md
β””β”€β”¬β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”¬β”€β”€β”€β”˜
  scheme             expr                       params            fragment

Properties

scheme: string

Scheme part of a buffer name. Note that Vim supports only alphabets in scheme part.

expr: string

Expression part of a buffer name. Note that '<>|?*' are not supported in Vim on Windows.

optional
params: BufnameParams

Params part of a buffer name. While '?' is not supported, the params part are splitted by ';' instead.

optional
fragment: string

Fragment part of a buffer name. This is mainly used to regulate the suffix of the buffer name.