

		  VIM REFERENCE MANUAL	  by Bram Moolenaar
					  and Somebody Else
					  and Another Person


		  VIM USER MANUAL	  by Bram Moolenaar
					  and Somebody Else
					  and Another Person


VIM HELP FILE FORMAT


Issue #17721 (Strange >vim highlighting in help documentation?)~

				*restore-cursor* *last-position-jump*  >vim
    augroup RestoreCursor
      autocmd!
      autocmd BufReadPost *
        \ let line = line("'\"")
        \ | if line >= 1 && line <= line("$") && &filetype !~# 'commit'
        \      && index(['xxd', 'gitrebase'], &filetype) == -1
        \      && !&diff
        \ |   execute "normal! g`\""
        \ | endif
    augroup END


URLs~

						*g:zig_recommended_style*
By default the following indentation options are set, in accordance with Zig's
recommended style (https://ziglang.org/documentation/master/): >


NOTE, WARNING and DEPRECATED~

When you 'send a file to Vim', Vim changes to that file's directory.  Note,
however, that any long directory names will appear in their short (MS-DOS)
form on some Windows versions.  This is a limitation of the Windows "Send To"
mechanism.


EXAMPLE LANGUAGES~

Legacy Vim Script Headers~

							*vim9-comments*
 ...

syntax, so a quotation mark:
>vim9mix
	" legacy Vim script comment before vim9script
	vim9script
	# Vim9 script comment
<
You may think that looks peculiar.  Placing all comments after the `vim9script`

 ...

							*vim9-mix*
There is one way to use both legacy and Vim9 syntax in one script file:
>vim9mix
	" _legacy Vim script_ comments are placed here
	if !has('vim9script')
	  " _legacy Vim script_ comments and commands are placed here
	  finish
	endif
	vim9script
	# _Vim9 script_ commands/commands from here onwards
	echowindow $"has('vim9script') == {has('vim9script')}"
<
This allows for writing a script that takes advantage of the Vim9 script

 ...

patch 1232), a better condition is:
>vim9mix
	if !has('patch-9.1.1232')
	  echowindow $"Fail: Vim does not have patch 9.1.1232"
	  finish
	endif
	vim9script
	echowindow $"Pass: version {v:versionlong}.  Continuing ..."
<
Whichever vim-mix condition is used, it only works in one of two ways:


Builtin function highlighting~
							*vim9-ignored-argument*
The argument "_" (an underscore) can be used to ignore the argument.  This is
most useful in callbacks where you don't need it, but do need to give an
argument to match the call.  For example, when using |map()| with a list, two
arguments are passed, the index and the value.  The following script
first demonstrates ignoring the indexes, then ignoring the values:
>vim9
	vim9script
	final nl: list<number> = [1, 2, 4, 8]
	map(nl, (_, val) => val * 2)	# '_' ignores the indexes
	echo nl				# [2, 4, 8, 16]
	map(nl, (idx, _) => idx * 2)	# '_' ignores the values
	echo nl				# [0, 2, 4, 6]
<
The "_" argument can be used multiple times, and no type is needed.


 vim:tw=78:ts=8:noet:ft=help:norl:
