Home Explore Blog CI



neovim

19th chunk of `runtime/doc/vimfn.txt`
1f44a324194c08d4b9b25ee27fb8f3a7f1cae304e0704c280000000100000fb5
              Parameters: ~
                  • {context} (`table`)
                  • {index} (`integer?`)

                Return: ~
                  (`integer`)

ctxsize()                                                            *ctxsize()*
		Returns the size of the |context-stack|.

                Return: ~
                  (`any`)

cursor({lnum}, {col} [, {off}])                                       *cursor()*
cursor({list})
		Positions the cursor at the column (byte count) {col} in the
		line {lnum}.  The first column is one.

		When there is one argument {list} this is used as a |List|
		with two, three or four item:
			[{lnum}, {col}]
			[{lnum}, {col}, {off}]
			[{lnum}, {col}, {off}, {curswant}]
		This is like the return value of |getpos()| or |getcurpos()|,
		but without the first item.

		To position the cursor using {col} as the character count, use
		|setcursorcharpos()|.

		Does not change the jumplist.
		{lnum} is used like with |getline()|, except that if {lnum} is
		zero, the cursor will stay in the current line.
		If {lnum} is greater than the number of lines in the buffer,
		the cursor will be positioned at the last line in the buffer.
		If {col} is greater than the number of bytes in the line,
		the cursor will be positioned at the last character in the
		line.
		If {col} is zero, the cursor will stay in the current column.
		If {curswant} is given it is used to set the preferred column
		for vertical movement.  Otherwise {col} is used.

		When 'virtualedit' is used {off} specifies the offset in
		screen columns from the start of the character.  E.g., a
		position within a <Tab> or after the last character.
		Returns 0 when the position could be set, -1 otherwise.

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

                Return: ~
                  (`any`)

debugbreak({pid})                                                 *debugbreak()*
		Specifically used to interrupt a program being debugged.  It
		will cause process {pid} to get a SIGTRAP.  Behavior for other
		processes is undefined. See |terminal-debug|.
		(Sends a SIGINT to a process {pid} other than MS-Windows)

		Returns |TRUE| if successfully interrupted the program.
		Otherwise returns |FALSE|.

                Parameters: ~
                  • {pid} (`integer`)

                Return: ~
                  (`any`)

deepcopy({expr} [, {noref}])                                   *deepcopy()* *E698*
		Make a copy of {expr}.  For Numbers and Strings this isn't
		different from using {expr} directly.
		When {expr} is a |List| a full copy is created.  This means
		that the original |List| can be changed without changing the
		copy, and vice versa.  When an item is a |List|, a copy for it
		is made, recursively.  Thus changing an item in the copy does
		not change the contents of the original |List|.

		When {noref} is omitted or zero a contained |List| or
		|Dictionary| is only copied once.  All references point to
		this single copy.  With {noref} set to 1 every occurrence of a
		|List| or |Dictionary| results in a new copy.  This also means
		that a cyclic reference causes deepcopy() to fail.
								*E724*
		Nesting is possible up to 100 levels.  When there is an item
		that refers back to a higher level making a deep copy with
		{noref} set to 1 will fail.
		Also see |copy()|.

                Parameters: ~
                  • {expr} (`T`)
                  • {noref} (`boolean?`)

                Return: ~
                  (`T`)

delete({fname} [, {flags}])                                           *delete()*
		Without {flags} or with {flags} empty: Deletes the file by the
		name {fname}.

		This also works when {fname} is a symbolic link.  The symbolic
		link itself is deleted, not what it points to.

		When {flags} is "d": Deletes the directory by the name
		{fname}.  This fails when directory {fname} is not empty.

		When {flags} is "rf": Deletes the directory by the name
		{fname} and everything in it, recursively.

Title: Vimscript Functions: Context Size, Cursor Positioning, Debug Break, Deep Copy, and File Deletion
Summary
This section details several Vimscript functions. It covers ctxsize(), which returns the size of the context stack. Then it explains the cursor() function, which positions the cursor at a specific line and column. debugbreak() interrupts a program being debugged by sending a SIGTRAP signal. deepcopy() creates a full copy of a List or Dictionary, recursively. Finally, delete() deletes a file or directory, with options for recursive deletion.