Home Explore Blog CI



neovim

98th chunk of `runtime/doc/vimfn.txt`
973bc455060652099b34a16df11a2da928fe448f26d6b97e0000000100000fb2
	Returns the single letter name of the register being executed.
		Returns an empty string when no register is being executed.
		See |@|.

                Return: ~
                  (`any`)

reg_recorded()                                                  *reg_recorded()*
		Returns the single letter name of the last recorded register.
		Returns an empty string when nothing was recorded yet.
		See |q| and |Q|.

                Return: ~
                  (`any`)

reg_recording()                                                *reg_recording()*
		Returns the single letter name of the register being recorded.
		Returns an empty string when not recording.  See |q|.

                Return: ~
                  (`any`)

reltime()                                                            *reltime()*
reltime({start})
reltime({start}, {end})
		Return an item that represents a time value.  The item is a
		list with items that depend on the system.
		The item can be passed to |reltimestr()| to convert it to a
		string or |reltimefloat()| to convert to a Float.

		Without an argument it returns the current "relative time", an
		implementation-defined value meaningful only when used as an
		argument to |reltime()|, |reltimestr()| and |reltimefloat()|.

		With one argument it returns the time passed since the time
		specified in the argument.
		With two arguments it returns the time passed between {start}
		and {end}.

		The {start} and {end} arguments must be values returned by
		reltime().  Returns zero on error.

		Note: |localtime()| returns the current (non-relative) time.

                Parameters: ~
                  • {start} (`any?`)
                  • {end} (`any?`)

                Return: ~
                  (`any`)

reltimefloat({time})                                            *reltimefloat()*
		Return a Float that represents the time value of {time}.
		Unit of time is seconds.
		Example:
			let start = reltime()
			call MyFunction()
			let seconds = reltimefloat(reltime(start))
		See the note of reltimestr() about overhead.
		Also see |profiling|.
		If there is an error an empty string is returned

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

                Return: ~
                  (`any`)

reltimestr({time})                                                *reltimestr()*
		Return a String that represents the time value of {time}.
		This is the number of seconds, a dot and the number of
		microseconds.  Example: >vim
			let start = reltime()
			call MyFunction()
			echo reltimestr(reltime(start))
<		Note that overhead for the commands will be added to the time.
		Leading spaces are used to make the string align nicely.  You
		can use split() to remove it. >vim
			echo split(reltimestr(reltime(start)))[0]
<		Also see |profiling|.
		If there is an error an empty string is returned

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

                Return: ~
                  (`any`)

remove({list}, {idx})                                                 *remove()*
remove({list}, {idx}, {end})
		Without {end}: Remove the item at {idx} from |List| {list} and
		return the item.
		With {end}: Remove items from {idx} to {end} (inclusive) and
		return a |List| with these items.  When {idx} points to the same
		item as {end} a list with one item is returned.  When {end}
		points to an item before {idx} this is an error.
		See |list-index| for possible values of {idx} and {end}.
		Returns zero on error.
		Example: >vim
			echo "last item: " .. remove(mylist, -1)
			call remove(mylist, 0, 9)
<
		Use |delete()| to remove a file.

                Parameters: ~
                  • {list} (`any[]`)
                  • {idx} (`integer`)
                  • {end} (`integer?`)

                Return: ~
                  (`any`)

remove({blob}, {idx})
remove({blob}, {idx}, {end})
		Without {end}: Remove the byte at {idx} from |Blob| {blob} and
		return the byte.
		With {end}: Remove bytes from {idx} to {end}

Title: Register Functions, Time Measurement, and List/Blob Item Removal
Summary
This section details functions for interacting with registers, measuring relative time, and removing elements from Lists and Blobs. `reg_executing()`, `reg_recorded()`, and `reg_recording()` return information about registers. `reltime()` returns a time value, which can be converted to a string or float using `reltimestr()` and `reltimefloat()`. The `remove()` function removes items from a List or bytes from a Blob based on index.