Home Explore Blog CI



neovim

13th chunk of `runtime/doc/vimfn.txt`
b49271fcdb76ee4eb38aa29deed00e0f7fd3e678d00953a30000000100000fb4
 returns 2
<

                Parameters: ~
                  • {string} (`string`)
                  • {idx} (`integer`)
                  • {countcc} (`boolean?`)
                  • {utf16} (`boolean?`)

                Return: ~
                  (`integer`)

chdir({dir})                                                           *chdir()*
		Change the current working directory to {dir}.  The scope of
		the directory change depends on the directory of the current
		window:
			- If the current window has a window-local directory
			  (|:lcd|), then changes the window local directory.
			- Otherwise, if the current tabpage has a local
			  directory (|:tcd|) then changes the tabpage local
			  directory.
			- Otherwise, changes the global directory.
		{dir} must be a String.
		If successful, returns the previous working directory.  Pass
		this to another chdir() to restore the directory.
		On failure, returns an empty string.

		Example: >vim
			let save_dir = chdir(newdir)
			if save_dir != ""
			   " ... do some work
			   call chdir(save_dir)
			endif
<

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

                Return: ~
                  (`string`)

cindent({lnum})                                                      *cindent()*
		Get the amount of indent for line {lnum} according the
		|C-indenting| rules, as with 'cindent'.
		The indent is counted in spaces, the value of 'tabstop' is
		relevant.  {lnum} is used just like in |getline()|.
		When {lnum} is invalid -1 is returned.

		To get or set indent of lines in a string, see |vim.text.indent()|.

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

                Return: ~
                  (`integer`)

clearmatches([{win}])                                           *clearmatches()*
		Clears all matches previously defined for the current window
		by |matchadd()| and the |:match| commands.
		If {win} is specified, use the window with this number or
		window ID instead of the current window.

                Parameters: ~
                  • {win} (`integer?`)

cmdcomplete_info()                                          *cmdcomplete_info()*
		Returns a |Dictionary| with information about cmdline
		completion.  See |cmdline-completion|.
		The items are:
		   cmdline_orig	The original command-line string before
				completion began.
		   pum_visible	|TRUE| if popup menu is visible.
				See |pumvisible()|.
		   matches	List of all completion candidates. Each item
				is a string.
		   selected	Selected item index.  First index is zero.
				Index is -1 if no item is selected (showing
				typed text only, or the last completion after
				no item is selected when using the <Up> or
				<Down> keys)

		Returns an empty |Dictionary| if no completion was attempted,
		if there was only one candidate and it was fully completed, or
		if an error occurred.

                Return: ~
                  (`table<string,any>`)

col({expr} [, {winid}])                                                  *col()*
		The result is a Number, which is the byte index of the column
		position given with {expr}.
		For accepted positions see |getpos()|.
		When {expr} is "$", it means the end of the cursor line, so
		the result is the number of bytes in the cursor line plus one.
		Additionally {expr} can be [lnum, col]: a |List| with the line
		and column number. Most useful when the column is "$", to get
		the last column of a specific line.  When "lnum" or "col" is
		out of range then col() returns zero.

		With the optional {winid} argument the values are obtained for
		that window instead of the current window.

		To get the line number use |line()|.  To get both use
		|getpos()|.

		For the screen column position use |virtcol()|.  For the
		character position use |charcol()|.

		Note that only marks in the current file can be used.

		Examples: >vim
			echo col(".")			" column of cursor
			echo col("$")			" length of cursor line plus one
			echo col("'t")

Title: Vimscript Built-in Functions: Chdir, Cindent, Clearmatches, Cmdcomplete_info, Col
Summary
This section details Vimscript functions: `chdir()` for changing the working directory, `cindent()` for getting indent amount based on 'cindent' rules, `clearmatches()` for clearing matches set by `matchadd()` and `:match`, `cmdcomplete_info()` for getting info about cmdline completion, and `col()` for returning byte index of a column position.