Home Explore Blog CI



neovim

7th chunk of `runtime/doc/vimfn.txt`
a9c239ecc68f5b26e11dd94e7c01b13a536e87cff37797a70000000100000fb4
	blob2list(0z)		" returns []
<		Returns an empty List on error.  |list2blob()| does the
		opposite.

                Parameters: ~
                  • {blob} (`any`)

                Return: ~
                  (`any[]`)

browse({save}, {title}, {initdir}, {default})                         *browse()*
		Put up a file requester.  This only works when "has("browse")"
		returns |TRUE| (only in some GUI versions).
		The input fields are:
		    {save}	when |TRUE|, select file to write
		    {title}	title for the requester
		    {initdir}	directory to start browsing in
		    {default}	default file name
		An empty string is returned when the "Cancel" button is hit,
		something went wrong, or browsing is not possible.

                Parameters: ~
                  • {save} (`any`)
                  • {title} (`string`)
                  • {initdir} (`string`)
                  • {default} (`string`)

                Return: ~
                  (`0|1`)

browsedir({title}, {initdir})                                      *browsedir()*
		Put up a directory requester.  This only works when
		"has("browse")" returns |TRUE| (only in some GUI versions).
		On systems where a directory browser is not supported a file
		browser is used.  In that case: select a file in the directory
		to be used.
		The input fields are:
		    {title}	title for the requester
		    {initdir}	directory to start browsing in
		When the "Cancel" button is hit, something went wrong, or
		browsing is not possible, an empty string is returned.

                Parameters: ~
                  • {title} (`string`)
                  • {initdir} (`string`)

                Return: ~
                  (`0|1`)

bufadd({name})                                                        *bufadd()*
		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: >vim
			let bufnr = bufadd('someName')
			call bufload(bufnr)
			call setbufline(bufnr, 1, ['some', 'text'])
<		Returns 0 on error.

                Parameters: ~
                  • {name} (`string`)

                Return: ~
                  (`integer`)

bufexists({buf})                                                   *bufexists()*
		The result is a Number, which is |TRUE| if a buffer called
		{buf} exists.
		If the {buf} argument is a number, buffer numbers are used.
		Number zero is the alternate buffer for the current window.

		If the {buf} argument is a string it must match a buffer name
		exactly.  The name can be:
		- Relative to the current directory.
		- A full path.
		- The name of a buffer with 'buftype' set to "nofile".
		- A URL name.
		Unlisted buffers will be found.
		Note that help files are listed by their short name in the
		output of |:buffers|, but bufexists() requires using their
		long name to be able to find them.
		bufexists() may report a buffer exists, but to use the name
		with a |:buffer| command you may need to use |expand()|.  Esp
		for MS-Windows 8.3 names in the form "c:\DOCUME~1"
		Use "bufexists(0)" to test for the existence of an alternate
		file name.

                Parameters: ~
                  • {buf} (`any`)

                Return: ~
                  (`0|1`)

buflisted({buf})                                                   *buflisted()*
		The result is a Number, which is |TRUE| if a buffer called
		{buf} exists and is listed (has the 'buflisted' option set).
		The {buf} argument is used like with |bufexists()|.

                Parameters: ~
                  • {buf} (`any`)

                Return: ~
                  (`0|1`)

bufload({buf})                                                       *bufload()*
		Ensure the buffer {buf} is loaded.  When

Title: Vimscript Built-in Functions: Blob Conversion, File/Directory Browsing, and Buffer Manipulation
Summary
This section details the `blob2list()`, `browse()`, `browsedir()`, `bufadd()`, `bufexists()`, `buflisted()`, and `bufload()` Vimscript functions. It explains the parameters and return values of each. `blob2list()` converts a Blob to a List of byte values. `browse()` and `browsedir()` provide file and directory selection dialogs respectively. `bufadd()` adds a buffer to the buffer list. `bufexists()` checks if a buffer exists. `buflisted()` checks if a buffer exists and is listed. `bufload()` ensures a buffer is loaded.