Home Explore Blog CI



neovim

42th chunk of `runtime/doc/vimfn.txt`
c7d36afbe38c42c04deffa21115aa26cff9740a303ab00590000000100000faa
 the screen position of the cursor in the command line
		as a byte count.  The first column is 1.
		Instead of |getcmdpos()|, it adds the prompt position.
		Only works when editing the command line, thus requires use of
		|c_CTRL-\_e| or |c_CTRL-R_=| or an expression mapping.
		Returns 0 otherwise.
		Also see |getcmdpos()|, |setcmdpos()|, |getcmdline()| and
		|setcmdline()|.

                Return: ~
                  (`integer`)

getcmdtype()                                                      *getcmdtype()*
		Return the current command-line type. Possible return values
		are:
		    :	normal Ex command
		    >	debug mode command |debug-mode|
		    /	forward search command
		    ?	backward search command
		    @	|input()| command
		    `-`	|:insert| or |:append| command
		    =	|i_CTRL-R_=|
		Only works when editing the command line, thus requires use of
		|c_CTRL-\_e| or |c_CTRL-R_=| or an expression mapping.
		Returns an empty string otherwise.
		Also see |getcmdpos()|, |setcmdpos()| and |getcmdline()|.

                Return: ~
                  (`':'|'>'|'/'|'?'|'@'|'-'|'='`)

getcmdwintype()                                                *getcmdwintype()*
		Return the current |command-line-window| type. Possible return
		values are the same as |getcmdtype()|. Returns an empty string
		when not in the command-line window.

                Return: ~
                  (`':'|'>'|'/'|'?'|'@'|'-'|'='`)

getcompletion({pat}, {type} [, {filtered}])                    *getcompletion()*
		Return a list of command-line completion matches. The String
		{type} argument specifies what for.  The following completion
		types are supported:

		arglist		file names in argument list
		augroup		autocmd groups
		buffer		buffer names
		breakpoint	|:breakadd| and |:breakdel| suboptions
		cmdline		|cmdline-completion| result
		color		color schemes
		command		Ex command
		compiler	compilers
		custom,{func}	custom completion, defined via {func}
		customlist,{func} custom completion, defined via {func}
		diff_buffer	|:diffget| and |:diffput| completion
		dir		directory names
		dir_in_path	directory names in |'cdpath'|
		environment	environment variable names
		event		autocommand events
		expression	Vim expression
		file		file and directory names
		file_in_path	file and directory names in |'path'|
		filetype	filetype names |'filetype'|
		filetypecmd	|:filetype| suboptions
		function	function name
		help		help subjects
		highlight	highlight groups
		history		|:history| suboptions
		keymap		keyboard mappings
		locale		locale names (as output of locale -a)
		mapclear	buffer argument
		mapping		mapping name
		menu		menus
		messages	|:messages| suboptions
		option		options
		packadd		optional package |pack-add| names
		runtime		|:runtime| completion
		scriptnames	sourced script names |:scriptnames|
		shellcmd	Shell command
		shellcmdline	Shell command line with filename arguments
		sign		|:sign| suboptions
		syntax		syntax file names |'syntax'|
		syntime		|:syntime| suboptions
		tag		tags
		tag_listfiles	tags, file names
		user		user names
		var		user variables

		If {pat} is an empty string, then all the matches are
		returned.  Otherwise only items matching {pat} are returned.
		See |wildcards| for the use of special characters in {pat}.

		If the optional {filtered} flag is set to 1, then 'wildignore'
		is applied to filter the results.  Otherwise all the matches
		are returned. The 'wildignorecase' option always applies.

		If the 'wildoptions' option contains "fuzzy", then fuzzy
		matching is used to get the completion matches. Otherwise
		regular expression matching is used.  Thus this function
		follows the user preference, what happens on the command line.
		If you do not want this you can make 'wildoptions' empty
		before calling getcompletion() and restore it afterwards.

		If {type} is "cmdline", then the |cmdline-completion| result is
		returned.  For example, to complete the possible values after
		a ":call" command: >vim
			echo getcompletion('call

Title: Vimscript: getcmdtype(), getcmdwintype(), and getcompletion()
Summary
This section describes functions related to the Vim command-line interface and completion. `getcmdtype()` returns the current command-line type (e.g., Ex command, search command). `getcmdwintype()` retrieves the type of the command-line window. `getcompletion()` returns a list of command-line completion matches based on a pattern and type. The type argument specifies what to complete (e.g., file names, commands, options, functions). The optional filtered flag applies 'wildignore' to filter results. The function supports fuzzy matching based on the 'wildoptions' setting. If the type is "cmdline", the |cmdline-completion| result is returned.