Skip to main content
Module

x/denops_std/option/mod.ts>backupext

📚 Standard module for denops.vim
Go to Latest
variable backupext
import { backupext } from "https://deno.land/x/denops_std@v4.1.4/option/mod.ts";

String which is appended to a file name to make the name of the backup file. The default is quite unusual, because this avoids accidentally overwriting existing files with a backup file. You might prefer using ".bak", but make sure that you don't have files with ".bak" that you want to keep. Only normal file name characters can be used; "/*?[|<>" are illegal.

If you like to keep a lot of backups, you could use a BufWritePre autocommand to change 'backupext' just before writing the file to include a timestamp. > :au BufWritePre * let &bex = '-' .. strftime("%Y%b%d%X") .. '~' < Use 'backupdir' to put the backup in a different directory.

type

{ get(denops: Denops): Promise<string>; set(denops: Denops, value: string): Promise<void>; reset(denops: Denops): Promise<void>; getGlobal(denops: Denops): Promise<string>; setGlobal(denops: Denops, value: string): Promise<void>; resetGlobal(denops: Denops): Promise<void>; }