Home Explore Blog CI



neovim

3rd chunk of `runtime/doc/vimfn.txt`
e7fd2db9fa2a816f338e124176965feb37168cd8d91a91750000000100000fb8
 list.  See |arglist|.
		Returns -1 if the arguments are invalid.

		Without arguments use the current window.
		With {winnr} only use this window in the current tab page.
		With {winnr} and {tabnr} use the window in the specified tab
		page.
		{winnr} can be the window number or the |window-ID|.

                Parameters: ~
                  • {winnr} (`integer?`)
                  • {tabnr} (`integer?`)

                Return: ~
                  (`integer`)

argv([{nr} [, {winid}]])                                                *argv()*
		The result is the {nr}th file in the argument list.  See
		|arglist|.  "argv(0)" is the first one.  Example: >vim
			let i = 0
			while i < argc()
			  let f = escape(fnameescape(argv(i)), '.')
			  exe 'amenu Arg.' .. f .. ' :e ' .. f .. '<CR>'
			  let i = i + 1
			endwhile
<		Without the {nr} argument, or when {nr} is -1, a |List| with
		the whole |arglist| is returned.

		The {winid} argument specifies the window ID, see |argc()|.
		For the Vim command line arguments see |v:argv|.

		Returns an empty string if {nr}th argument is not present in
		the argument list.  Returns an empty List if the {winid}
		argument is invalid.

                Parameters: ~
                  • {nr} (`integer?`)
                  • {winid} (`integer?`)

                Return: ~
                  (`string|string[]`)

asin({expr})                                                            *asin()*
		Return the arc sine of {expr} measured in radians, as a |Float|
		in the range of [-pi/2, pi/2].
		{expr} must evaluate to a |Float| or a |Number| in the range
		[-1, 1].
		Returns NaN if {expr} is outside the range [-1, 1].  Returns
		0.0 if {expr} is not a |Float| or a |Number|.
		Examples: >vim
			echo asin(0.8)
<			0.927295 >vim
			echo asin(-0.5)
<			-0.523599

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

                Return: ~
                  (`number`)

assert_beeps({cmd})                                             *assert_beeps()*
		Run {cmd} and add an error message to |v:errors| if it does
		NOT produce a beep or visual bell.
		Also see |assert_fails()|, |assert_nobeep()| and
		|assert-return|.

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

                Return: ~
                  (`0|1`)

assert_equal({expected}, {actual} [, {msg}])                    *assert_equal()*
		When {expected} and {actual} are not equal an error message is
		added to |v:errors| and 1 is returned.  Otherwise zero is
		returned. |assert-return|
		The error is in the form "Expected {expected} but got
		{actual}".  When {msg} is present it is prefixed to that,
		along with the location of the assert when run from a script.

		There is no automatic conversion, the String "4" is different
		from the Number 4.  And the number 4 is different from the
		Float 4.0.  The value of 'ignorecase' is not used here, case
		always matters.
		Example: >vim
			call assert_equal('foo', 'bar', 'baz')
<		Will add the following to |v:errors|:
			test.vim line 12: baz: Expected 'foo' but got 'bar' ~

                Parameters: ~
                  • {expected} (`any`)
                  • {actual} (`any`)
                  • {msg} (`any?`)

                Return: ~
                  (`0|1`)

assert_equalfile({fname_one}, {fname_two})                  *assert_equalfile()*
		When the files {fname_one} and {fname_two} do not contain
		exactly the same text an error message is added to |v:errors|.
		Also see |assert-return|.
		When {fname_one} or {fname_two} does not exist the error will
		mention that.

                Parameters: ~
                  • {fname_one} (`string`)
                  • {fname_two} (`string`)

                Return: ~
                  (`0|1`)

assert_exception({error} [, {msg}])                         *assert_exception()*
		When v:exception does not contain the string {error} an error
		message is added to |v:errors|.  Also see |assert-return|.
		This can be used to assert

Title: Vimscript Built-in Functions: `argv()`, `asin()`, and `assert` functions
Summary
This section details more Vimscript built-in functions. `argv()` returns a specific file from the argument list or the entire list if no argument is given. `asin()` returns the arcsine of a number. `assert_beeps()` checks if a command produces a beep or visual bell. `assert_equal()` compares two values and adds an error if they are not equal. `assert_equalfile()` compares two files and adds an error if they are not identical. Each function's syntax, parameters, return values, and usage examples are provided.