Home Explore Blog CI



neovim

72th chunk of `runtime/doc/vimfn.txt`
18bff7fa4c6fff3e15198fb23e2ea0d46508f81144fe26800000000100000fb4
 |getline()|.
		When {lnum} is invalid, -1 is returned.

                Parameters: ~
                  • {lnum} (`integer|string`)

                Return: ~
                  (`integer`)

list2blob({list})                                                  *list2blob()*
		Return a Blob concatenating all the number values in {list}.
		Examples: >vim
			echo list2blob([1, 2, 3, 4])	" returns 0z01020304
			echo list2blob([])		" returns 0z
<		Returns an empty Blob on error.  If one of the numbers is
		negative or more than 255 error *E1239* is given.

		|blob2list()| does the opposite.

                Parameters: ~
                  • {list} (`any[]`)

                Return: ~
                  (`string`)

list2str({list} [, {utf8}])                                         *list2str()*
		Convert each number in {list} to a character string can
		concatenate them all.  Examples: >vim
			echo list2str([32])		" returns " "
			echo list2str([65, 66, 67])	" returns "ABC"
<		The same can be done (slowly) with: >vim
			echo join(map(list, {nr, val -> nr2char(val)}), '')
<		|str2list()| does the opposite.

		UTF-8 encoding is always used, {utf8} option has no effect,
		and exists only for backwards-compatibility.
		With UTF-8 composing characters work as expected: >vim
			echo list2str([97, 769])	" returns "á"
<
		Returns an empty string on error.

                Parameters: ~
                  • {list} (`any[]`)
                  • {utf8} (`boolean?`)

                Return: ~
                  (`string`)

localtime()                                                        *localtime()*
		Return the current time, measured as seconds since 1st Jan
		1970.  See also |strftime()|, |strptime()| and |getftime()|.

                Return: ~
                  (`integer`)

log({expr})                                                              *log()*
		Return the natural logarithm (base e) of {expr} as a |Float|.
		{expr} must evaluate to a |Float| or a |Number| in the range
		(0, inf].
		Returns 0.0 if {expr} is not a |Float| or a |Number|.
		Examples: >vim
			echo log(10)
<			2.302585 >vim
			echo log(exp(5))
<			5.0

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

                Return: ~
                  (`number`)

log10({expr})                                                          *log10()*
		Return the logarithm of Float {expr} to base 10 as a |Float|.
		{expr} must evaluate to a |Float| or a |Number|.
		Returns 0.0 if {expr} is not a |Float| or a |Number|.
		Examples: >vim
			echo log10(1000)
<			3.0 >vim
			echo log10(0.01)
<			-2.0

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

                Return: ~
                  (`number`)

luaeval({expr} [, {expr}])                                           *luaeval()*
		Evaluate Lua expression {expr} and return its result converted
		to Vim data structures. See |lua-eval| for details.

		See also |v:lua-call|.

                Parameters: ~
                  • {expr} (`string`)
                  • {expr1} (`any[]?`)

                Return: ~
                  (`any`)

map({expr1}, {expr2})                                                    *map()*
		{expr1} must be a |List|, |String|, |Blob| or |Dictionary|.
		When {expr1} is a |List| or |Dictionary|, replace each
		item in {expr1} with the result of evaluating {expr2}.
		For a |Blob| each byte is replaced.
		For a |String|, each character, including composing
		characters, is replaced.
		If the item type changes you may want to use |mapnew()| to
		create a new List or Dictionary.

		{expr2} must be a |String| or |Funcref|.

		If {expr2} is a |String|, inside {expr2} |v:val| has the value
		of the current item.  For a |Dictionary| |v:key| has the key
		of the current item and for a |List| |v:key| has the index of
		the current item.  For a |Blob| |v:key| has the index of the
		current byte. For a |String| |v:key| has the index of the
		current character.
		Example: >vim
			call map(mylist,

Title: Vim Function Documentation: list2str(), localtime(), log(), log10(), luaeval(), and map()
Summary
This documentation describes more Vim functions. `list2str()` converts a list of numbers to a string. `localtime()` returns the current time in seconds since Jan 1, 1970. `log()` and `log10()` return the natural logarithm and base-10 logarithm of an expression, respectively. `luaeval()` evaluates a Lua expression and returns the result converted to Vim data. `map()` replaces each item in a list, string, blob, or dictionary with the result of evaluating an expression.