Home Explore Blog CI



neovim

22th chunk of `runtime/doc/vimfn.txt`
71763b6f46bbb40cdd73a2551fa09f1357b3d46619c5f8620000000100000fc8
 highlight ID can be used with |synIDattr()| to obtain
		syntax information about the highlighting.

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

                Return: ~
                  (`any`)

digraph_get({chars})                                       *digraph_get()* *E1214*
		Return the digraph of {chars}.  This should be a string with
		exactly two characters.  If {chars} are not just two
		characters, or the digraph of {chars} does not exist, an error
		is given and an empty string is returned.

		Also see |digraph_getlist()|.

		Examples: >vim
		" Get a built-in digraph
		echo digraph_get('00')		" Returns '∞'

		" Get a user-defined digraph
		call digraph_set('aa', 'あ')
		echo digraph_get('aa')		" Returns 'あ'
<

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

                Return: ~
                  (`string`)

digraph_getlist([{listall}])                                 *digraph_getlist()*
		Return a list of digraphs.  If the {listall} argument is given
		and it is TRUE, return all digraphs, including the default
		digraphs.  Otherwise, return only user-defined digraphs.

		Also see |digraph_get()|.

		Examples: >vim
		" Get user-defined digraphs
		echo digraph_getlist()

		" Get all the digraphs, including default digraphs
		echo digraph_getlist(1)
<

                Parameters: ~
                  • {listall} (`boolean?`)

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

digraph_set({chars}, {digraph})                                  *digraph_set()*
		Add digraph {chars} to the list.  {chars} must be a string
		with two characters.  {digraph} is a string with one UTF-8
		encoded character.  *E1215*
		Be careful, composing characters are NOT ignored.  This
		function is similar to |:digraphs| command, but useful to add
		digraphs start with a white space.

		The function result is v:true if |digraph| is registered.  If
		this fails an error message is given and v:false is returned.

		If you want to define multiple digraphs at once, you can use
		|digraph_setlist()|.

		Example: >vim
			call digraph_set('  ', 'あ')
<

                Parameters: ~
                  • {chars} (`string`)
                  • {digraph} (`string`)

                Return: ~
                  (`any`)

digraph_setlist({digraphlist})                               *digraph_setlist()*
		Similar to |digraph_set()| but this function can add multiple
		digraphs at once.  {digraphlist} is a list composed of lists,
		where each list contains two strings with {chars} and
		{digraph} as in |digraph_set()|. *E1216*
		Example: >vim
		    call digraph_setlist([['aa', 'あ'], ['ii', 'い']])
<
		It is similar to the following: >vim
		    for [chars, digraph] in [['aa', 'あ'], ['ii', 'い']]
			  call digraph_set(chars, digraph)
		    endfor
<		Except that the function returns after the first error,
		following digraphs will not be added.

                Parameters: ~
                  • {digraphlist} (`table<integer,string[]>`)

                Return: ~
                  (`any`)

empty({expr})                                                          *empty()*
		Return the Number 1 if {expr} is empty, zero otherwise.
		- A |List| or |Dictionary| is empty when it does not have any
		  items.
		- A |String| is empty when its length is zero.
		- A |Number| and |Float| are empty when their value is zero.
		- |v:false| and |v:null| are empty, |v:true| is not.
		- A |Blob| is empty when its length is zero.

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

                Return: ~
                  (`integer`)

environ()                                                            *environ()*
		Return all of environment variables as dictionary. You can
		check if an environment variable exists like this: >vim
			echo has_key(environ(), 'HOME')
<		Note that the variable name may be CamelCase; to ignore case
		use this: >vim
			echo index(keys(environ()),

Title: Vimscript Functions: Digraph Manipulation and Empty Value Checks
Summary
This section continues the documentation of Vimscript functions, focusing on digraphs and empty value checks. It describes digraph_getlist(), which retrieves a list of digraphs (either user-defined or all). It then details digraph_set() and digraph_setlist(), which are used to add single or multiple digraphs to the list, respectively. Finally, it defines empty(), which checks if a given expression is considered empty, and introduces environ(), which returns a dictionary of environment variables.