Home Explore Blog CI



neovim

85th chunk of `runtime/doc/vimfn.txt`
fcfeae53f34a388c0d8d448458ee09cb850bffba9cc977420000000100000fa8
 min([apples, pears, oranges])

<		{expr} can be a |List| or a |Dictionary|.  For a Dictionary,
		it returns the minimum of all values in the Dictionary.
		If {expr} is neither a List nor a Dictionary, or one of the
		items in {expr} cannot be used as a Number this results in
		an error.  An empty |List| or |Dictionary| results in zero.

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

                Return: ~
                  (`number`)

mkdir({name} [, {flags} [, {prot}]])                              *mkdir()* *E739*
		Create directory {name}.

		When {flags} is present it must be a string.  An empty string
		has no effect.

		{flags} can contain these character flags:
		 "p"	intermediate directories will be created as necessary
		 "D"	{name} will be deleted at the end of the current
			function, but not recursively |:defer|
		 "R"	{name} will be deleted recursively at the end of the
			current function |:defer|

		Note that when {name} has more than one part and "p" is used
		some directories may already exist.  Only the first one that
		is created and what it contains is scheduled to be deleted.
		E.g. when using: >vim
			call mkdir('subdir/tmp/autoload', 'pR')
<		and "subdir" already exists then "subdir/tmp" will be
		scheduled for deletion, like with: >vim
			defer delete('subdir/tmp', 'rf')
<
		If {prot} is given it is used to set the protection bits of
		the new directory.  The default is 0o755 (rwxr-xr-x: r/w for
		the user, readable for others).  Use 0o700 to make it
		unreadable for others.  This is used for the newly created
		directories.  Note: umask is applied to {prot} (on Unix).
		Example: >vim
			call mkdir($HOME .. "/tmp/foo/bar", "p", 0o700)

<		This function is not available in the |sandbox|.

		If you try to create an existing directory with {flags} set to
		"p" mkdir() will silently exit.

		The function result is a Number, which is TRUE if the call was
		successful or FALSE if the directory creation failed or partly
		failed.

                Parameters: ~
                  • {name} (`string`)
                  • {flags} (`string?`)
                  • {prot} (`string?`)

                Return: ~
                  (`integer`)

mode([{expr}])                                                          *mode()*
		Return a string that indicates the current mode.
		If {expr} is supplied and it evaluates to a non-zero Number or
		a non-empty String (|non-zero-arg|), then the full mode is
		returned, otherwise only the first letter is returned.
		Also see |state()|.

		   n	    Normal
		   no	    Operator-pending
		   nov	    Operator-pending (forced charwise |o_v|)
		   noV	    Operator-pending (forced linewise |o_V|)
		   noCTRL-V Operator-pending (forced blockwise |o_CTRL-V|)
				CTRL-V is one character
		   niI	    Normal using |i_CTRL-O| in |Insert-mode|
		   niR	    Normal using |i_CTRL-O| in |Replace-mode|
		   niV	    Normal using |i_CTRL-O| in |Virtual-Replace-mode|
		   nt	    Normal in |terminal-emulator| (insert goes to
				Terminal mode)
		   ntT	    Normal using |t_CTRL-\_CTRL-O| in |Terminal-mode|
		   v	    Visual by character
		   vs	    Visual by character using |v_CTRL-O| in Select mode
		   V	    Visual by line
		   Vs	    Visual by line using |v_CTRL-O| in Select mode
		   CTRL-V   Visual blockwise
		   CTRL-Vs  Visual blockwise using |v_CTRL-O| in Select mode
		   s	    Select by character
		   S	    Select by line
		   CTRL-S   Select blockwise
		   i	    Insert
		   ic	    Insert mode completion |compl-generic|
		   ix	    Insert mode |i_CTRL-X| completion
		   R	    Replace |R|
		   Rc	    Replace mode completion |compl-generic|
		   Rx	    Replace mode |i_CTRL-X| completion
		   Rv	    Virtual Replace |gR|
		   Rvc	    Virtual Replace mode completion |compl-generic|
		   Rvx	    Virtual Replace mode |i_CTRL-X| completion
		   c	    Command-line editing
		   cr	    Command-line editing overstrike mode |c_<Insert>|
		   cv	    Vim Ex mode |gQ|
		   cvr	    Vim Ex mode

Title: Vim Function Documentation: mkdir() and mode()
Summary
This section details the `mkdir()` function in Vim, used to create directories, with options for creating intermediate directories, setting permissions, and using `:defer` for deletion. It outlines the parameters, flags, and return values, also mentioning sandbox restrictions. Finally, it describes the `mode()` function, which returns a string indicating the current editor mode, either as a single character or the full mode description based on an argument's presence.