Home Explore Blog CI



neovim

15th chunk of `runtime/doc/options.txt`
cddd70e9414bb856b34617685816f9bc4a8a9a95f12e92a70000000100000fa5
 >vim
	    set bdir=c:\\tmp,\ dir\\,with\\,commas,\\\ dir\ with\ spaces
<
	See also 'backup' and 'writebackup' options.
	If you want to hide your backup files on Unix, consider this value: >vim
		set backupdir=./.backup,~/.backup,.,/tmp
<	You must create a ".backup" directory in each directory and in your
	home directory for this to work properly.
	The use of |:set+=| and |:set-=| is preferred when adding or removing
	directories from the list.  This avoids problems when a future version
	uses another default.
	This option cannot be set from a |modeline| or in the |sandbox|, for
	security reasons.

					*'backupext'* *'bex'* *E589*
'backupext' 'bex'	string	(default "~")
			global
	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. >vim
		au BufWritePre * let &bex = '-' .. strftime("%Y%b%d%X") .. '~'
<	Use 'backupdir' to put the backup in a different directory.

						*'backupskip'* *'bsk'*
'backupskip' 'bsk'	string	(default "$TMPDIR/*,$TMP/*,$TEMP/*"
                                 Unix: "/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*"
                                 Mac: "/private/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*")
			global
	A list of file patterns.  When one of the patterns matches with the
	name of the file which is written, no backup file is created.  Both
	the specified file name and the full path name of the file are used.
	The pattern is used like with |:autocmd|, see |autocmd-pattern|.
	Watch out for special characters, see |option-backslash|.
	When $TMPDIR, $TMP or $TEMP is not defined, it is not used for the
	default value.  "/tmp/*" is only used for Unix.

	WARNING: Not having a backup file means that when Vim fails to write
	your buffer correctly and then, for whatever reason, Vim exits, you
	lose both the original file and what you were writing.  Only disable
	backups if you don't care about losing the file.

	Note that environment variables are not expanded.  If you want to use
	$HOME you must expand it explicitly, e.g.: >vim
		let &backupskip = escape(expand('$HOME'), '\') .. '/tmp/*'

<	Note that the default also makes sure that "crontab -e" works (when a
	backup would be made by renaming the original file crontab won't see
	the newly created file).  Also see 'backupcopy' and |crontab|.

						*'belloff'* *'bo'*
'belloff' 'bo'		string	(default "all")
			global
	Specifies for which events the bell will not be rung. It is a comma-
	separated list of items. For each item that is present, the bell
	will be silenced. This is most useful to specify specific events in
	insert mode to be silenced.
	You can also make it flash by using 'visualbell'.

	item	    meaning when present	~
	all	    All events.
	backspace   When hitting <BS> or <Del> and deleting results in an
		    error.
	cursor	    Fail to move around using the cursor keys or
		    <PageUp>/<PageDown> in |Insert-mode|.
	complete    Error occurred when using |i_CTRL-X_CTRL-K| or
		    |i_CTRL-X_CTRL-T|.
	copy	    Cannot copy char from insert mode using |i_CTRL-Y| or
		    |i_CTRL-E|.
	ctrlg	    Unknown Char after <C-G> in Insert mode.
	error	    Other Error occurred (e.g. try to join last line)
		    (mostly used in |Normal-mode| or |Cmdline-mode|).
	esc	    hitting <Esc> in |Normal-mode|.
	hangul	    Ignored.
	lang	    Calling the beep module for Lua/Mzscheme/TCL.
	mess	    No output available for |g<|.
	showmatch   Error occurred for 'showmatch' function.
	operator    Empty region error |cpo-E|.
	register    Unknown register after <C-R> in |Insert-mode|.
	shell	    Bell from shell output |:!|.
	spell	    Error

Title: Vim Options: backupext, backupskip, and belloff
Summary
This section describes the 'backupext' option, which defines the extension for backup files and suggests using timestamps for multiple backups. It then covers the 'backupskip' option, a list of file patterns that, when matched, prevent backup file creation, warning about potential data loss. Finally, it explains the 'belloff' option, which allows disabling the bell sound for specific events in Vim, especially useful for insert mode.