robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

robinmerge: 1dc9728daa1d8a2702

master
47.7 KiB1336 linesraw
1*filetype.txt*  Nvim
2
3
4		  VIM REFERENCE MANUAL	  by Bram Moolenaar
5
6
7Filetypes						*filetype* *file-type*
8
9Also see |autocmd.txt|.
10
11                                      Type |gO| to see the table of contents.
12
13==============================================================================
141. Filetypes					*filetypes* *file-types*
15
16Vim can detect the type of file that is edited.  This is done by checking the
17file name and sometimes by inspecting the contents of the file for specific
18text.
19
20							*:filetype* *:filet*
21To enable file type detection, use this command in your vimrc: >
22	:filetype on
23Each time a new or existing file is edited, Vim will try to recognize the type
24of the file and set the 'filetype' option.  This will trigger the FileType
25event, which can be used to set the syntax highlighting, set options, etc.
26
27Detail: The ":filetype on" command will load these files:
28		$VIMRUNTIME/filetype.lua
29		$VIMRUNTIME/filetype.vim
30	filetype.lua creates an autocommand that fires for all BufNewFile and
31	BufRead events. It tries to detect the filetype based off of the
32	file's extension or name.
33
34	filetype.vim is a Vim script that defines autocommands for the
35	BufNewFile and BufRead events. In contrast to filetype.lua, this
36	file creates separate BufNewFile and BufRead events for each filetype
37	pattern.
38
39	If the file type is not found by the name, the file
40	$VIMRUNTIME/scripts.vim is used to detect it from the contents of the
41	file.
42	When the GUI is running or will start soon, the |menu.vim| script is
43	also sourced.
44
45To add your own file types, see |new-filetype| below.  To search for help on a
46filetype prepend "ft-" and optionally append "-syntax", "-indent" or
47"-plugin".  For example: >
48	:help ft-vim-indent
49	:help ft-vim-syntax
50	:help ft-man-plugin
51
52If the file type is not detected automatically, or it finds the wrong type,
53you can either set the 'filetype' option manually, or add a modeline to your
54file.  Example, for an IDL file use the command: >
55	:set filetype=idl
56
57or add this |modeline| to the file: >
58	/* vim: set filetype=idl : */
59<
60						*:filetype-plugin-on*
61You can enable loading the plugin files for specific file types with: >
62	:filetype plugin on
63If filetype detection was not switched on yet, it will be as well.
64This actually loads the file "ftplugin.vim" in 'runtimepath'.
65The result is that when a file is edited its plugin file is loaded (if there
66is one for the detected filetype). |filetype-plugin|
67
68						*:filetype-plugin-off*
69You can disable it again with: >
70	:filetype plugin off
71The filetype detection is not switched off then.  But if you do switch off
72filetype detection, the plugins will not be loaded either.
73This actually loads the file "ftplugof.vim" in 'runtimepath'.
74
75						*:filetype-indent-on*
76You can enable loading the indent file for specific file types with: >
77	:filetype indent on
78If filetype detection was not switched on yet, it will be as well.
79This actually loads the file "indent.vim" in 'runtimepath'.
80The result is that when a file is edited its indent file is loaded (if there
81is one for the detected filetype). |indent-expression|
82
83						*:filetype-indent-off*
84You can disable it again with: >
85	:filetype indent off
86The filetype detection is not switched off then.  But if you do switch off
87filetype detection, the indent files will not be loaded either.
88This actually loads the file "indoff.vim" in 'runtimepath'.
89This disables auto-indenting for files you will open.  It will keep working in
90already opened files.  Reset 'autoindent', 'cindent', 'smartindent' and/or
91'indentexpr' to disable indenting in an opened file.
92
93						*:filetype-off*
94To disable file type detection, use this command: >
95	:filetype off
96This will keep the flags for "plugin" and "indent", but since no file types
97are being detected, they won't work until the next ":filetype on".
98
99
100Overview:					*:filetype-overview*
101
102command				detection	plugin		indent ~
103:filetype on			on		unchanged	unchanged
104:filetype off			off		unchanged	unchanged
105:filetype plugin on		on		on		unchanged
106:filetype plugin off		unchanged	off		unchanged
107:filetype indent on		on		unchanged	on
108:filetype indent off		unchanged	unchanged	off
109:filetype plugin indent on	on		on		on
110:filetype plugin indent off	unchanged	off		off
111
112To see the current status, type: >
113	:filetype
114The output looks something like this: >
115	filetype detection:ON  plugin:ON  indent:OFF
116
117The file types are also used for syntax highlighting.  If the ":syntax on"
118command is used, the file type detection is installed too.  There is no need
119to do ":filetype on" after ":syntax on".
120
121To disable one of the file types, add a line in your filetype file, see
122|remove-filetype|.
123
124							*filetype-detect*
125To detect the file type again: >
126	:filetype detect
127Use this if you started with an empty file and typed text that makes it
128possible to detect the file type.  For example, when you entered this in a
129shell script: "#!/bin/csh".
130   When filetype detection was off, it will be enabled first, like the "on"
131argument was used.
132
133							*filetype-overrule*
134When the same extension is used for multiple filetypes, Vim tries to guess
135what kind of file it is.  This doesn't always work.  A number of global
136variables can be used to overrule the filetype used for certain extensions:
137
138	file name	variable ~
139	`*.al`		g:filetype_al
140	`*.app`		g:filetype_app
141	`*.as`		g:filetype_as
142	`*.asa`		g:filetype_asa		|ft-aspperl-syntax|
143						|ft-aspvbs-syntax|
144	`*.asm`		g:asmsyntax		|ft-asm-syntax|
145	`*.asp`		g:filetype_asp		|ft-aspperl-syntax|
146						|ft-aspvbs-syntax|
147	`*.bas`		g:filetype_bas		|ft-basic-syntax|
148	`*.cfg`		g:filetype_cfg
149	`*.cls`		g:filetype_cls
150	`*.csh`		g:filetype_csh		|ft-csh-syntax|
151	`*.dat`		g:filetype_dat
152	`*.def`		g:filetype_def
153	`*.dsp`		g:filetype_dsp
154	`*.f`		g:filetype_f		|ft-forth-syntax|
155	`*.frm`		g:filetype_frm		|ft-form-syntax|
156	`*.fs`		g:filetype_fs		|ft-forth-syntax|
157	`*.h`		g:c_syntax_for_h	|ft-c-syntax|	(deprecated)
158	`*.h`		g:ch_syntax_for_h	|ft-ch-syntax|	(deprecated)
159	`*.h`		g:filetype_h		|ft-c-syntax|
160						|ft-ch-syntax|
161						|ft-cpp-syntax|
162	`*.i`		g:filetype_i		|ft-progress-syntax|
163	`*.inc`		g:filetype_inc
164	`*.int`		g:filetype_int
165	`*.lsl`		g:filetype_lsl
166	`*.m`		g:filetype_m		|ft-mathematica-syntax|
167	`*.mm`		g:filetype_mm
168	`*.mac`		g:filetype_mac
169	`*[mM]makefile,*.mk,*.mak,[mM]akefile*`
170			g:make_flavor		|ft-make-syntax|
171	`*.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md`
172			g:filetype_md		|ft-pandoc-syntax|
173	`*.mod`		g:filetype_mod
174	`*.p`		g:filetype_p		|ft-pascal-syntax|
175	`*.pl`		g:filetype_pl
176	`*.pp`		g:filetype_pp		|ft-pascal-syntax|
177	`*.prg`		g:filetype_prg
178	`*.r`		g:filetype_r
179	`*.sig`		g:filetype_sig
180	`*.sql`		g:filetype_sql		|ft-sql-syntax|
181	`*.src`		g:filetype_src
182	`*.sys`		g:filetype_sys
183	`*.sh`		g:bash_is_sh		|ft-sh-syntax|
184	`*.tex`		g:tex_flavor		|ft-tex-plugin|
185	`*.tf`		g:filetype_tf
186	`*.typ`		g:filetype_typ
187	`*.v`		g:filetype_v
188	`*.w`		g:filetype_w		|ft-cweb-syntax|
189
190For a few filetypes the global variable is used only when the filetype could
191not be detected:
192	`*.r`		g:filetype_r	|ft-rexx-syntax|
193
194							*filetype-ignore*
195To avoid that certain files are being inspected, the g:ft_ignore_pat variable
196is used.  The default value is set like this: >
197	:let g:ft_ignore_pat = '\.\(Z\|gz\|bz2\|zip\|tgz\)$'
198This means that the contents of compressed files are not inspected.
199
200							*new-filetype*
201If a file type that you want to use is not detected yet, there are a few ways
202to add it.  The recommended way is to use |vim.filetype.add()| to add it to
203Nvim's builtin filetype detection mechanism.  If you want to handle the
204detection manually, proceed as follows:
205
206A. If you want to overrule all default file type checks.
207   This works by writing one file for each filetype.  The disadvantage is that
208   there can be many files.  The advantage is that you can simply drop this
209   file in the right directory to make it work.
210							*ftdetect*
211   1. Create your user runtime directory.  You would normally use the first
212      item of the 'runtimepath' option.  Then create the directory "ftdetect"
213      inside it.  Example for Unix: >
214	:!mkdir -p ~/.config/nvim/ftdetect
215<
216   2. Create a file that contains an autocommand to detect the file type.
217      Example: >
218	au BufRead,BufNewFile *.mine		set filetype=mine
219<     Note that there is no "augroup" command, this has already been done
220      when sourcing your file.  You could also use the pattern "*" and then
221      check the contents of the file to recognize it.
222      Write this file as "mine.vim" in the "ftdetect" directory in your user
223      runtime directory.  For example, for Unix: >
224	:w ~/.config/nvim/ftdetect/mine.vim
225
226<  3. To use the new filetype detection you must restart Vim.
227
228   The files in the "ftdetect" directory are used after all the default
229   checks, thus they can overrule a previously detected file type.  But you
230   can also use |:setfiletype| to keep a previously detected filetype.
231
232B. If you want to detect your file after the default file type checks.
233
234   This works like A above, but instead of setting 'filetype' unconditionally
235   use ":setfiletype".  This will only set 'filetype' if no file type was
236   detected yet.  Example: >
237	au BufRead,BufNewFile *.txt		setfiletype text
238<
239   You can also use the already detected file type in your command.  For
240   example, to use the file type "mypascal" when "pascal" has been detected: >
241	au BufRead,BufNewFile *		if &ft == 'pascal' | set ft=mypascal
242								       | endif
243
244C. If your file type can be detected by the file name or extension.
245   1. Create your user runtime directory.  You would normally use the first
246      item of the 'runtimepath' option.  Example for Unix: >
247	:!mkdir -p ~/.config/nvim
248<
249   2. Create a file that contains autocommands to detect the file type.
250      Example: >
251	" my filetype file
252	if exists("did_load_filetypes")
253	  finish
254	endif
255	augroup filetypedetect
256	  au! BufRead,BufNewFile *.mine		setfiletype mine
257	  au! BufRead,BufNewFile *.xyz		setfiletype drawing
258	augroup END
259<
260      Write this file as "filetype.vim" in your user runtime directory.  For
261      example, for Unix: >
262	:w ~/.config/nvim/filetype.vim
263
264<   3. To use the new filetype detection you must restart Vim.
265
266   Your filetype.vim will be sourced before the default FileType autocommands
267   have been installed.  Your autocommands will match first, and the
268   ":setfiletype" command will make sure that no other autocommands will set
269   'filetype' after this.
270							*new-filetype-scripts*
271D. If your filetype can only be detected by inspecting the contents of the
272   file.
273
274   1. Create your user runtime directory.  You would normally use the first
275      item of the 'runtimepath' option.  Example for Unix: >
276	:!mkdir -p ~/.config/nvim
277<
278   2. Create a Vim script file for doing this.  Example: >
279	if did_filetype()	" filetype already set..
280	  finish		" ..don't do these checks
281	endif
282	if getline(1) =~ '^#!.*\<mine\>'
283	  setfiletype mine
284	elseif getline(1) =~? '\<drawing\>'
285	  setfiletype drawing
286	endif
287<     See $VIMRUNTIME/scripts.vim for more examples.
288      Write this file as "scripts.vim" in your user runtime directory.  For
289      example, for Unix: >
290	:w ~/.config/nvim/scripts.vim
291<
292   3. The detection will work right away, no need to restart Vim.
293
294   Your scripts.vim is loaded before the default checks for file types, which
295   means that your rules override the default rules in
296   $VIMRUNTIME/scripts.vim.
297
298							*remove-filetype*
299If a file type is detected that is wrong for you, you can set 'filetype' to
300a non-existing name such as `ignored` to avoid that it will be set later anyway.
301
302						     *g:did_load_filetypes*
303The builtin filetype detection provided by Nvim can be disabled by setting
304the `did_load_filetypes` global variable. If this variable exists, the default
305`$VIMRUNTIME/filetype.lua` will not run.
306
307							*plugin-details*
308The "plugin" directory can be in any of the directories in the 'runtimepath'
309option.  All of these directories will be searched for plugins and they are
310all loaded.  For example, if this command: >
311
312	set runtimepath
313
314produces this output: >
315
316	runtimepath=/etc/vim,~/.config/nvim,/usr/local/share/vim/vim82
317
318then Vim will load all plugins in these directories and below: >
319
320	/etc/vim/plugin/
321	~/.config/nvim/plugin/
322	/usr/local/share/vim/vim82/plugin/
323
324Note that the last one is the value of $VIMRUNTIME which has been expanded.
325
326Note that when using a plugin manager or |packages| many directories will be
327added to 'runtimepath'.  These plugins each require their own directory, don't
328put them directly in ~/.config/nvim/plugin.
329
330What if it looks like your plugin is not being loaded?  You can find out what
331happens when Vim starts up by using the |-V| argument: >
332
333	vim -V2
334
335You will see a lot of messages, in between them is a remark about loading the
336plugins.  It starts with: >
337
338	Searching for "plugin/**/*.vim" in
339
340There you can see where Vim looks for your plugin scripts.
341
342==============================================================================
3432. Filetype plugin					*filetype-plugins*
344
345When loading filetype plugins has been enabled |:filetype-plugin-on|, options
346will be set and mappings defined.  These are all local to the buffer, they
347will not be used for other files.
348
349Defining mappings for a filetype may get in the way of the mappings you
350define yourself.  There are a few ways to avoid this:
3511. Set the "maplocalleader" variable to the key sequence you want the mappings
352   to start with.  Example: >
353	:let maplocalleader = ","
354<  All mappings will then start with a comma instead of the default, which
355   is a backslash.  Also see |<LocalLeader>|.
356
3572. Define your own mapping.  Example: >
358	:map ,p <Plug>MailQuote
359<  You need to check the description of the plugin file below for the
360   functionality it offers and the string to map to.
361   You need to define your own mapping before the plugin is loaded (before
362   editing a file of that type).  The plugin will then skip installing the
363   default mapping.
364					*no_mail_maps* *g:no_mail_maps*
3653. Disable defining mappings for a specific filetype by setting a variable,
366   which contains the name of the filetype.  For the "mail" filetype this
367   would be: >
368	:let no_mail_maps = 1
369<					*no_plugin_maps* *g:no_plugin_maps*
3704. Disable defining mappings for all filetypes by setting a variable: >
371	:let no_plugin_maps = 1
372<
373
374							*ftplugin-overrule*
375If a global filetype plugin does not do exactly what you want, there are three
376ways to change this:
377
3781. Add a few settings.
379   You must create a new filetype plugin in a directory early in
380   'runtimepath'.  For Unix, for example you could use this file: >
381	vim ~/.config/nvim/ftplugin/fortran.vim
382<   You can set those settings and mappings that you would like to add.  Note
383   that the global plugin will be loaded after this, it may overrule the
384   settings that you do here.  If this is the case, you need to use one of the
385   following two methods.
386
3872. Make a copy of the plugin and change it.
388   You must put the copy in a directory early in 'runtimepath'.  For Unix, for
389   example, you could do this: >
390	cp $VIMRUNTIME/ftplugin/fortran.vim ~/.config/nvim/ftplugin/fortran.vim
391<   Then you can edit the copied file to your liking.  Since the b:did_ftplugin
392   variable will be set, the global plugin will not be loaded.
393   A disadvantage of this method is that when the distributed plugin gets
394   improved, you will have to copy and modify it again.
395
3963. Overrule the settings after loading the global plugin.
397   You must create a new filetype plugin in a directory from the end of
398   'runtimepath'.  For Unix, for example, you could use this file: >
399	vim ~/.config/nvim/after/ftplugin/fortran.vim
400<   In this file you can change just those settings that you want to change.
401
402==============================================================================
4033.  Docs for the default filetype plugins.		*ftplugin-docs*
404
405
406					*plugin_exec* *g:plugin_exec*
407Enable executing of external commands.  This was done historically for e.g.
408the perl filetype plugin (and a few others) to set the search path.
409Disabled by default for security reasons: >
410	:let g:plugin_exec = 1
411It is also possible to enable this only for certain filetypes: >
412	:let g:<filetype>_exec = 1
413So to enable this only for ruby, set the following variable: >
414	:let g:ruby_exec = 1
415
416If both, the global `plugin_exec` and the `<filetype>_exec` specific variable
417are set, the filetype specific variable should have precedent.
418
419
420ADA
421
422Documentation for this plugin is here: |ft_ada.txt|.
423
424
425ASCIIDOC						*ft-asciidoc-plugin*
426
427To enable |folding| use this: >
428	let g:asciidoc_folding = 1
429
430To disable nesting of folded headers use this: >
431	let g:asciidoc_foldnested = 0
432
433To disable folding everything under the title use this: >
434	let asciidoc_fold_under_title = 0
435
436
437ARDUINO							*ft-arduino-plugin*
438
439By default the following options are set, in accordance with the default
440settings of Arduino IDE: >
441
442	setlocal expandtab tabstop=2 softtabstop=2 shiftwidth=2
443
444To disable this behavior, set the following variable in your vimrc: >
445
446	let g:arduino_recommended_style = 0
447
448
449AWK							*ft-awk-plugin*
450
451Support for features specific to GNU Awk, like @include, can be enabled by
452setting: >
453	:let g:awk_is_gawk = 1
454
455BEANCOUNT						*ft-beancount-plugin*
456
457Beancount omni-completion |compl-omni| is provided by beancountcomplete.vim,
458if enabled with g:beancount_completion_enable.
459
460To enable completion of account names, set: >
461	let g:beancount_completion_enable = 1
462<
463Note: Enabling this may cause beancount to load additional plugin files.  Only
464enable for code you trust.
465
466Variables:
467g:beancount_account_completion
468			Specify the completion pattern format for the account
469			name.  Can be either "default" or "chunks".
470			Default value: "default"
471
472g:beancount_completion_enable
473			Enable omni-completion |compl-omni| for accounts.
474			Default value: 0
475
476g:beancount_detailed_first
477			If non-zero, accounts higher down the hierarchy will
478			be listed first as completions.
479			Default value: 0
480
481g:beancount_separator_col
482			The column that the decimal separator is aligned to.
483			Default value: 50
484
485b:beancount_root
486			Set the root Beancount file.  This is used to gather
487			values for the completion.
488			If not set (default), the current file will be used.
489
490
491Commands:
492:AlignCommodity		Adds spaces between an account and commodity so that
493			the decimal points of the commodities all occur in the
494			column given by g:beancount_separator_col.  If an
495			amount has no decimal point, the imaginary decimal
496			point to the right of the least significant digit will
497			align.
498
499			The command acts on a range, with the default being
500			the current line.  If the cursor happens to be inside
501			that range and to the right of the account name, the
502			cursor will be pushed to the right the appropriate
503			amount, so that it remains on the same character.
504
505			The script assumes the use of spaces for alignment.
506			It does not understand tabs.
507
508:GetContext		Uses bean-doctor context to display the context of the
509			current line.
510
511CHANGELOG						*ft-changelog-plugin*
512
513Allows for easy entrance of Changelog entries in Changelog files.  There are
514some commands, mappings, and variables worth exploring:
515
516Options:
517'comments'		is made empty to not mess up formatting.
518'textwidth'		is set to 78, which is standard.
519'formatoptions'		the 't' flag is added to wrap when inserting text.
520
521Commands:
522NewChangelogEntry	Adds a new Changelog entry in an intelligent fashion
523			(see below).
524
525Local mappings:
526<Leader>o		Starts a new Changelog entry in an equally intelligent
527			fashion (see below).
528
529Global mappings:
530			NOTE: The global mappings are accessed by sourcing the
531			ftplugin/changelog.vim file first, e.g. with >
532				runtime ftplugin/changelog.vim
533<			in your |init.vim|.
534<Leader>o		Switches to the ChangeLog buffer opened for the
535			current directory, or opens it in a new buffer if it
536			exists in the current directory.  Then it does the
537			same as the local <Leader>o described above.
538
539Variables:
540g:changelog_timeformat  Deprecated; use g:changelog_dateformat instead.
541g:changelog_dateformat	The date (and time) format used in ChangeLog entries.
542			The format accepted is the same as for the
543			|strftime()| function.
544			The default is "%Y-%m-%d" which is the standard format
545			for many ChangeLog layouts.
546g:changelog_username	The name and email address of the user.
547			The default is deduced from environment variables and
548			system files.  It searches /etc/passwd for the comment
549			part of the current user, which informally contains
550			the real name of the user up to the first separating
551			comma.  then it checks the $NAME environment variable
552			and finally runs `whoami` and `hostname` to build an
553			email address.  The final form is >
554				Full Name  <user@host>
555<
556g:changelog_new_date_format
557			The format to use when creating a new date-entry.
558			The following table describes special tokens in the
559			string:
560				%%	insert a single '%' character
561				%d	insert the date from above
562				%u	insert the user from above
563				%p	insert result of
564					b:changelog_entry_prefix
565				%c	where to position cursor when done
566			The default is "%d  %u\n\n\t* %p%c\n\n", which
567			produces something like (| is where cursor will be,
568			unless at the start of the line where it denotes the
569			beginning of the line) >
570				|2003-01-14  Full Name  <user@host>
571				|
572				|        * prefix|
573<
574g:changelog_new_entry_format
575			The format used when creating a new entry.
576			The following table describes special tokens in the
577			string:
578				%p	insert result of
579					b:changelog_entry_prefix
580				%c	where to position cursor when done
581			The default is "\t*%c", which produces something
582			similar to >
583				|        * prefix|
584<
585g:changelog_date_entry_search
586			The search pattern to use when searching for a
587			date-entry.
588			The same tokens that can be used for
589			g:changelog_new_date_format can be used here as well.
590			The default is '^\s*%d\_s*%u' which finds lines
591			matching the form >
592				|2003-01-14  Full Name  <user@host>
593<			and some similar formats.
594
595g:changelog_date_end_entry_search
596			The search pattern to use when searching for the end
597			of a date-entry.
598			The same tokens that can be used for
599			g:changelog_new_date_format can be used here as well.
600			The default is '^\s*$' which finds lines that contain
601			only whitespace or are completely empty.
602
603b:changelog_name					*b:changelog_name*
604			Name of the ChangeLog file to look for.
605			The default is 'ChangeLog'.
606
607b:changelog_path
608			Path of the ChangeLog to use for the current buffer.
609			The default is empty, thus looking for a file named
610			|b:changelog_name| in the same directory as the
611			current buffer.  If not found, the parent directory of
612			the current buffer is searched.  This continues
613			recursively until a file is found or there are no more
614			parent directories to search.
615
616b:changelog_entry_prefix
617			Name of a function to call to generate a prefix to a
618			new entry.  This function takes no arguments and
619			should return a string containing the prefix.
620			Returning an empty prefix is fine.
621			The default generates the shortest path between the
622			ChangeLog's pathname and the current buffers pathname.
623			In the future, it will also be possible to use other
624			variable contexts for this variable, for example, g:.
625
626The Changelog entries are inserted where they add the least amount of text.
627After figuring out the current date and user, the file is searched for an
628entry beginning with the current date and user and if found adds another item
629under it.  If not found, a new entry and item is prepended to the beginning of
630the Changelog.
631
632
633DIRECTORY					*ft-directory*
634
635The "directory" filetype is used for directory listing buffers, such as those
636opened by |:edit| with a directory path.  See |dir| for mappings and behavior.
637
638Directory entries end in "/" and use the |hl-Directory| highlight group.
639
640
641FORTRAN							*ft-fortran-plugin*
642
643Options:
644'expandtab'	is switched on to avoid tabs as required by the Fortran
645		standards unless the user has set fortran_have_tabs in vimrc.
646'textwidth'	is set to 80 for fixed source format whereas it is set to 132
647		for free source format.  Setting the
648		fortran_extended_line_length variable increases the width to
649		132 for fixed source format.
650'formatoptions' is set to break code and comment lines and to preserve long
651		lines.  You can format comments with |gq|.
652For further discussion of fortran_have_tabs and the method used for the
653detection of source format see |ft-fortran-syntax|.
654
655
656FREEBASIC						*ft-freebasic-plugin*
657
658This plugin aims to treat the four FreeBASIC dialects, "fb", "qb", "fblite"
659and "deprecated", as distinct languages.
660
661The dialect will be set to the first name found in g:freebasic_forcelang, any
662#lang directive or $lang metacommand in the file being edited, or finally
663g:freebasic_lang.  These global variables conceptually map to the fbc options
664-forcelang and -lang.  If no dialect is explicitly specified "fb" will be
665used.
666
667For example, to set the dialect to a default of "fblite" but still allow for
668any #lang directive overrides, use the following command: >
669
670	let g:freebasic_lang = "fblite"
671
672
673GDSCRIPT						*ft-gdscript-plugin*
674
675By default the following options are set, based on Godot official docs: >
676
677	setlocal noexpandtab softtabstop=0 shiftwidth=0
678
679To disable this behavior, set the following variable in your vimrc: >
680
681	let g:gdscript_recommended_style = 0
682
683
684GIT COMMIT						*ft-gitcommit-plugin*
685
686One command, :DiffGitCached, is provided to show a diff of the current commit
687in the preview window.  It is equivalent to calling "git diff --cached" plus
688any arguments given to the command.
689
690The length of the first line of the commit message used for
691syntax highlighting can be configured via `g:gitcommit_summary_length`.
692The default is 50.  Example: >
693
694        let g:gitcommit_summary_length = 70
695
696GIT REBASE						*ft-gitrebase-plugin*
697
698The gitrebase filetype defines the following buffer-local commands, to help
699with interactive `git rebase`: >
700
701	:Drop   " to discard this commit
702	:Edit   " to stop for editing this commit
703	:Fixup  " to squash (but discard the message) into the previous one
704	:Pick   " to pick this commit (the cursor is on)
705	:Reword " to pick this commit, but change the commit message
706	:Squash " to squash this commit into the previous one
707
708In addition, the following command can be used to cycle between the different
709possibilities: >
710
711	:Cycle  " to cycle between the previous commands
712<
713The `:Cycle` command is also mapped to the CTRL-A and CTRL-X keys.
714For details, see `git-rebase --help`.
715
716GLEAM						*ft-gleam-plugin*
717
718By default the following options are set for the recommended gleam style: >
719
720	setlocal expandtab shiftwidth=2 softtabstop=2
721
722To disable this behavior, set the following variable in your vimrc: >
723
724	let g:gleam_recommended_style = 0
725
726GO							*ft-go-plugin*
727
728By default the following options are set, based on Golang official docs: >
729
730	setlocal noexpandtab softtabstop=0 shiftwidth=0
731
732To disable this behavior, set the following variable in your vimrc: >
733
734	let g:go_recommended_style = 0
735
736
737GPROF							*ft-gprof-plugin*
738
739The gprof filetype plugin defines a mapping <C-]> to jump from a function
740entry in the gprof flat profile or from a function entry in the call graph
741to the details of that function in the call graph.
742
743The mapping can be disabled with: >
744	let g:no_gprof_maps = 1
745
746
747HARE							*ft-hare*
748
749Since the text for this plugin is rather long it has been put in a separate
750file: |ft_hare.txt|.
751
752HTML							*ft-html-plugin*
753
754Tag folding poses a few difficulties.  Many elements, e.g. `blockquote`, are
755always delimited by start and end tags; end tags for some elements, e.g. `p`,
756can be omitted in certain contexts; void elements, e.g. `hr`, have no end tag.
757Although the rules for supporting omissible end tags are ad-hoc and involved
758[0], they apply to elements in scope.  Assuming syntactical wellformedness, an
759end tag can be associated with its nearest matching start tag discoverable in
760scope [1] and towards the beginning of a file, whereas all unbalanced tags and
761inlined tags can be disregarded.  Having syntax highlighting in effect, tag
762folding using the |fold-expr| method can be enabled with: >
763	let g:html_expr_folding = 1
764<
765By default, tag folding will be redone from scratch after each occurrence of
766a |TextChanged| or an |InsertLeave| event.  Such frequency may not be desired,
767especially for large files, and this recomputation can be disabled with: >
768	let g:html_expr_folding_without_recomputation = 1
769        doautocmd FileType
770<
771To force another recomputation, do: >
772	unlet! b:foldsmap
773	normal zx
774<
775[0] https://html.spec.whatwg.org/multipage/syntax.html#optional-tags
776[1] https://en.wikipedia.org/wiki/Dangling_else
777
778ICALENDAR			    *ft-icalendar-plugin* *g:icalendar_folding*
779
780You can enable folding of iCalendar components (BEGIN: and END: pairs)
781using |fold-expr| by: >
782
783	let g:icalendar_folding = 1
784<
785Nested components, such as a VALARM inside a VEVENT, produce nested folds.
786
787IDRIS2							*ft-idris2-plugin*
788
789By default the following options are set: >
790
791	setlocal shiftwidth=2 tabstop=2 expandtab
792	setlocal comments=s1:{-,mb:-,ex:-},:\|\|\|,:--
793	setlocal commentstring=--\ %s
794	setlocal wildignore+=*.ibc
795
796To use tabs instead of spaces for indentation, set the following variable
797in your vimrc: >
798
799	let g:idris2#allow_tabchar = 1
800
801JAVA							*ft-java-plugin*
802
803						*g:ftplugin_java_source_path*
804Whenever the variable "g:ftplugin_java_source_path" is defined and its value
805is a filename whose extension is either ".jar" or ".zip", e.g.: >
806	let g:ftplugin_java_source_path = '/path/to/src.jar'
807	let g:ftplugin_java_source_path = '/path/to/src.zip'
808<
809and a zip plugin has already been sourced, the |gf| command can be used to open
810the selected entry.
811
812Note that the effect of using the "gf" command WITHIN a buffer loaded with the
813Zip plugin depends on the version of the Zip plugin.  For the Zip plugin
814versions that do not support Jar type archives, consider creating symbolic
815links with the ".zip" extension for each Jar archive of interest and assigning
816any such file to the variable from now on.
817
818Otherwise, for the defined variable "g:ftplugin_java_source_path", the local
819value of the 'path' option will be further modified by prefixing the value of
820the variable, e.g.: >
821	let g:ftplugin_java_source_path = $JDK_SRC_PATH
822	let &l:path = g:ftplugin_java_source_path .. ',' .. &l:path
823<
824and the "gf" command can be used on a fully-qualified type to look for a file
825in the "path" and to try to load it.
826
827Remember to manually trigger the |FileType| event from a buffer with a Java
828file loaded in it each time after assigning a new value to the variable: >
829	doautocmd FileType
830<
831Markdown documentation comments may contain common runs of vertical leading
832whitespace following the comment marks (`///`) for aesthetic reasons; however,
833some horizontal runs of leading whitespace are significant in Markdown because
834they denote code blocks etc.  For convenience, a 'formatexpr' function is
835provided for the |gq| operator.  As long as neither "g:java_ignore_javadoc"
836nor "g:java_ignore_markdown" is defined, the reformatting of Markdown comments
837can be enabled on demand with: >
838	setlocal formatexpr=g:javaformat#RemoveCommonMarkdownWhitespace()
839<
840Or for Vim versions less than `7.4.265`, with: >
841	setlocal formatexpr=javaformat#RemoveCommonMarkdownWhitespace()
842<
843This function accepts a range of lines, removes a common run of vertical
844leading whitespace, and rewrites the lines of the range.  Depending on the
845author's layout style and the comment contents, which lines to select for
846reformatting can vary from the whole comment to only some portion of it.
847To enable the recognition of Markdown comments each time after removing
848"g:java_ignore_markdown" or "g:java_ignore_javadoc", remember to manually
849re-source "javaformat.vim" for Vim versions greater than `8.2.1397`: >
850	runtime autoload/javaformat.vim
851<
852LUA							*ft-lua-plugin*
853
854					*g:lua_version* *g:lua_subversion*
855Lua filetype's 'includeexpr' and |ft-lua-syntax| highlighting use the global
856variables "g:lua_version" and "g:lua_subversion" to determine the version of
857Lua to use (5.3 is the default)
858
859For example, to use Lua 5.1, set the variables like this: >
860
861	let g:lua_version = 5
862	let g:lua_subversion = 1
863<
864LUAU					*ft-luau-plugin* *g:luau_folding*
865
866You can enable folding of Luau block constructs using |fold-expr| by: >
867
868	let g:luau_folding = 1
869<
870MAIL							*ft-mail-plugin*
871
872Options:
873'modeline'	is switched off to avoid the danger of trojan horses, and to
874		avoid that a Subject line with "Vim:" in it will cause an
875		error message.
876'textwidth'	is set to 72.  This is often recommended for e-mail.
877'formatoptions'	is set to break text lines and to repeat the comment leader
878		in new lines, so that a leading ">" for quotes is repeated.
879		You can also format quoted text with |gq|.
880
881Local mappings:
882<LocalLeader>q   or   \MailQuote
883	Quotes the text selected in Visual mode, or from the cursor position
884	to the end of the file in Normal mode.  This means "> " is inserted in
885	each line.
886
887MAN					*ft-man-plugin* *:Man* *man.lua*
888
889View manpages in Nvim. Supports highlighting, completion, locales, and
890navigation. Also see |find-manpage|.
891
892man.lua will always attempt to reuse the closest man window (above/left) but
893otherwise create a split.
894
895The case sensitivity of completion is controlled by 'fileignorecase'.
896
897Commands:
898Man {name}                Display the manpage for {name}.
899Man {sect} {name}         Display the manpage for {name} and section {sect}.
900Man {name}({sect})        Same as above.
901Man {sect} {name}({sect}) Used during completion to show the real section of
902                          when the provided section is a prefix, e.g. 1m vs 1.
903Man {path}                Open the manpage at {path}. Prepend "./" if {path}
904                          is relative to the current directory.
905Man                       Open the manpage for the <cWORD> (man buffers)
906                          or <cword> (non-man buffers) under the cursor.
907Man!                      Display the current buffer contents as a manpage.
908
909|:Man| accepts command modifiers. For example, to use a vertical split: >vim
910    :vertical Man printf
911To reuse the current window: >vim
912    :hide Man printf
913
914Local mappings:
915K or CTRL-]               Jump to the manpage for the <cWORD> under the
916                          cursor. Takes a count for the section.
917CTRL-T                    Jump back to the location that the manpage was
918                          opened from.
919gO                        Show the manpage outline. |gO|
920q                         :quit if invoked as $MANPAGER, otherwise :close.
921
922Variables:
923*g:no_man_maps*             Do not create mappings in manpage buffers.
924*g:ft_man_folding_enable*   Fold manpages with foldmethod=indent foldnestmax=1.
925*b:man_default_sects*       Comma-separated, ordered list of preferred sections.
926                          For example in C one usually wants section 3 or 2: >
927                               :let b:man_default_sections = '3,2'
928*g:man_hardwrap*            Hard-wrap to $MANWIDTH or window width if $MANWIDTH is
929                          empty or larger than the window width. Enabled by
930                          default. Set |FALSE| to enable soft wrapping.
931
932To use Nvim as a manpager: >bash
933    export MANPAGER='nvim +Man!'
934
935Note: when running `man` from the shell with Nvim as `$MANPAGER`, `man` will
936pre-format the manpage using `groff`, and Nvim will display the manual page as
937it was received from stdin (it can't "undo" the hard-wrap caused by
938man/groff). To prevent man/groff from hard-wrapping the manpage, you can set
939`$MANWIDTH=999` in your environment.
940
941To disable bold highlighting: >vim
942    :highlight link manBold Normal
943
944Troubleshooting:
945
946If you see an error like: >
947    fuse: mount failed: Permission denied
948this may be caused by AppArmor sandboxing. To fix this, add a local override
949in e.g. `/etc/apparmor.d/local/usr.bin.man`: >bash
950    mount fstype=fuse.nvim options=(ro, nosuid, nodev) -> /tmp/**,
951    /usr/bin/fusermount Ux,
952See also https://github.com/neovim/neovim/issues/30268 .
953
954MARKDOWN						*ft-markdown-plugin*
955
956To enable folding use this: >
957	let g:markdown_folding = 1
958
959'expandtab' will be set by default.  If you do not want that use this: >
960	let g:markdown_recommended_style = 0
961
962
963ORG							*ft-org-plugin*
964
965To enable folding use this: >
966	let g:org_folding = 1
967<
968
969PDF							*ft-pdf-plugin*
970
971Two maps, <C-]> and <C-T>, are provided to simulate a tag stack for navigating
972the PDF.  The following are treated as tags:
973
974- The byte offset after "startxref" to the xref table
975- The byte offset after the /Prev key in the trailer to an earlier xref table
976- A line of the form "0123456789 00000 n" in the xref table
977- An object reference like "1 0 R" anywhere in the PDF
978
979These maps can be disabled with >
980	:let g:no_pdf_maps = 1
981
982PLSQL							*ft-plsql-plugin*
983
984To enable syntax folding in PL/SQL filetypes, set the following variable: >
985
986	:let g:plsql_fold = 1
987<
988
989PYTHON						*ft-python-plugin* *PEP8*
990
991By default the following options are set, in accordance with PEP8: >
992
993	setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8
994
995To disable this behavior, set the following variable in your vimrc: >
996
997	let g:python_recommended_style = 0
998<
999Python omni-completion |compl-omni| is provided by python3complete.vim (or
1000pythoncomplete.vim) for Nvim with the |python3| provider.
1001By default it does not inspect the import / from statements found in the
1002buffer. This means completion of names defined in the buffer itself (classes,
1003functions, variables) works, but completion of members of imported modules is
1004not offered.
1005
1006To enable completion of imported module members, set: >
1007	let g:pythoncomplete_allow_import = 1
1008<
1009WARNING: enabling this causes omni-completion to execute the import statements
1010found in the buffer through Python's import machinery, which runs the imported
1011modules' top-level code. Only enable this for code you trust.
1012
1013POWERSHELL
1014
1015Documentation for this plugin is here: |ft_ps1.txt|.
1016
1017
1018QUERY					                *ft-query-plugin*
1019
1020
1021Linting of treesitter queries for installed parsers using
1022|vim.treesitter.query.lint()| is disabled by default. To enable
1023linting when opening and writing buffers, add >lua
1024
1025	vim.g.query_lint_on = { 'BufEnter', 'BufWrite' }
1026<
1027to your config. To update diagnostics when editing, use >lua
1028
1029	vim.g.query_lint_on = { 'InsertLeave', 'TextChanged' }
1030<
1031For a dedicated language server, see https://github.com/ribru17/ts_query_ls.
1032
1033QF QUICKFIX					    *qf.vim* *ft-qf-plugin*
1034
1035The "qf" filetype is used for the quickfix window, see |quickfix-window|.
1036
1037The quickfix filetype plugin includes configuration for displaying the command
1038that produced the quickfix list in the |status-line|.  To disable this setting,
1039configure as follows: >
1040	:let g:qf_disable_statusline = 1
1041
1042
1043R MARKDOWN						*ft-rmd-plugin*
1044
1045By default ftplugin/html.vim is not sourced.  If you want it sourced, add to
1046your |vimrc|: >
1047	let rmd_include_html = 1
1048
1049The 'formatexpr' option is set dynamically with different values for R code
1050and for Markdown code.  If you prefer that 'formatexpr' is not set, add to
1051your |vimrc|: >
1052	let rmd_dynamic_comments = 0
1053
1054
1055R RESTRUCTURED TEXT					*ft-rrst-plugin*
1056
1057The 'formatexpr' option is set dynamically with different values for R code
1058and for ReStructured text.  If you prefer that 'formatexpr' is not set, add to
1059your |vimrc|: >
1060	let rrst_dynamic_comments = 0
1061
1062
1063RESTRUCTUREDTEXT					*ft-rst-plugin*
1064
1065The following formatting setting are optionally available: >
1066	setlocal expandtab shiftwidth=3 softtabstop=3 tabstop=8
1067
1068To enable this behavior, set the following variable in your vimrc: >
1069	let g:rst_style = 1
1070
1071
1072RNOWEB							*ft-rnoweb-plugin*
1073
1074The 'formatexpr' option is set dynamically with different values for R code
1075and for LaTeX code.  If you prefer that 'formatexpr' is not set, add to your
1076|vimrc|: >
1077	let rnw_dynamic_comments = 0
1078
1079
1080RAKU
1081
1082Documentation for this plugin is here: |ft_raku.txt|.
1083
1084
1085RPM SPEC						*ft-spec-plugin*
1086
1087Since the text for this plugin is rather long it has been put in a separate
1088file: |pi_spec.txt|.
1089
1090
1091SHADA							*ft-shada*
1092
1093Allows editing binary |shada-file|s in a nice way.  Opened binary files are
1094displayed in the following format: >
1095
1096    Type with timestamp YYYY-mm-ddTHH:MM:SS:
1097      % Key__  Description___  Value
1098      + fooba  foo bar baz fo  {msgpack-value}
1099      + abcde  abc def ghi jk  {msgpack-value}
1100    Other type with timestamp YYYY-mm-ddTHH:MM:SS:
1101      @ Description__  Value
1102      - foo bar baz t  {msgpack-value}
1103      # Expected more elements in list
1104    Some other type with timestamp YYYY-mm-ddTHH:MM:SS:
1105      # Unexpected type: type instead of map
1106      = {msgpack-value}
1107
1108Filetype plugin defines all |Cmd-event|s.  Defined |SourceCmd| event makes
1109"source file.shada" be equivalent to "|:rshada| file.shada".  |BufWriteCmd|,
1110|FileWriteCmd| and |FileAppendCmd| events are affected by the following
1111settings:
1112
1113*g:shada#keep_old_header*	Boolean, if set to false all header entries
1114				are ignored when writing.  Defaults to 1.
1115*g:shada#add_own_header*	Boolean, if set to true first written entry
1116				will always be header entry with two values in
1117				a map with attached data: |v:version| attached
1118				to "version" key and "shada.vim" attached to
1119				"generator" key.  Defaults to 1.
1120
1121Format description:
1122
11231. `#` starts a comment.  Lines starting with space characters and then `#`
1124   are ignored.  Plugin may only add comment lines to indicate some errors in
1125   ShaDa format.  Lines containing no non-whitespace characters are also
1126   ignored.
11272. Each entry starts with line that has format "{type} with timestamp
1128   {timestamp}:". {timestamp} is |strftime()|-formatted string representing
1129   actual Unix timestamp value. First strftime() argument is equal to
1130   `%Y-%m-%dT%H:%M:%S`.  When writing this timestamp is parsed using
1131   |msgpack#strptime()|, with caching (it remembers which timestamp produced
1132   particular strftime() output and uses this value if you did not change
1133   timestamp). {type} is one of
1134    1 - Header
1135    2 - Search pattern
1136    3 - Replacement string
1137    4 - History entry
1138    5 - Register
1139    6 - Variable
1140    7 - Global mark
1141    8 - Jump
1142    9 - Buffer list
1143   10 - Local mark
1144   11 - Change
1145    * - Unknown (0x{type-hex})
1146
1147   Each type may be represented using Unknown entry: "Jump with timestamp ..."
1148   is the same as "Unknown (0x8) with timestamp ....".
11493. After header there is one of the following lines:
1150   1. "  % Key__  Description__  Value": map header.  After mapping header
1151      follows a table which may contain comments and lines consisting of
1152      "  +", key, description and |{msgpack-value}|.  Key is separated by at
1153      least two spaces with description, description is separated by at least
1154      two spaces with the value.  Each key in the map must be at most as wide
1155      as "Key__" header: "Key" allows at most 3-byte keys, "Key__" allows at
1156      most 5-byte keys.  If keys actually occupy less bytes then the rest is
1157      filled with spaces.  Keys cannot be empty, end with spaces, contain two
1158      consequent spaces inside of them or contain multibyte characters (use
1159      "=" format if you need this).  Descriptions have the same restrictions
1160      on width and contents, except that empty descriptions are allowed.
1161      Description column may be omitted.
1162
1163      When writing description is ignored.  Keys with values |msgpack#equal|
1164      to default ones are ignored.  Order of keys is preserved.  All keys are
1165      treated as strings (not binary strings).
1166
1167      Note: specifically for buffer list entries it is allowed to have more
1168      then one map header.  Each map header starts a new map entry inside
1169      buffer list because ShaDa buffer list entry is an array of maps.  I.e. >
1170
1171        Buffer list with timestamp 1970-01-01T00:00:00:
1172          % Key  Description  Value
1173          + f    file name    "/foo"
1174          + l    line number  1
1175          + c    column       10
1176<
1177      is equivalent to >
1178
1179        Buffer list with timestamp 1970-01-01T00:00:00:
1180          = [{="f": "/foo", ="c": 10}]
1181<
1182      and >
1183
1184        Buffer list with timestamp 1970-01-01T00:00:00:
1185          % Key  Description  Value
1186          + f    file name    "/foo"
1187
1188          % Key  Description  Value
1189          + f    file name    "/bar"
1190<
1191      is equivalent to >
1192
1193        Buffer list with timestamp 1970-01-01T00:00:00:
1194          = [{="f": "/foo"}, {="f": "/bar"}]
1195<
1196      Note 2: specifically for register entries special syntax for arrays was
1197      designed: >
1198
1199        Register with timestamp 1970-01-01T00:00:00:
1200          % Key  Description  Value
1201          + rc   contents     @
1202          | - "line1"
1203          | - "line2"
1204<
1205      This is equivalent to >
1206
1207        Register with timestamp 1970-01-01T00:00:00:
1208          % Key  Description  Value
1209          + rc   contents     ["line1", "line2"]
1210<
1211      Such syntax is automatically used if array representation appears to be
1212      too lengthy.
1213   2. "  @  Description__  Value": array header.  Same as map, but key is
1214      omitted and description cannot be omitted.  Array entries start with
1215      "  -". Example: >
1216
1217        History entry with timestamp 1970-01-01T00:00:00:
1218          @ Description_  Value
1219          - history type  SEARCH
1220          - contents      "foo"
1221          - separator     '/'
1222<
1223      is equivalent to >
1224
1225        History entry with timestamp 1970-01-01T00:00:00:
1226          = [SEARCH, "foo", '/']
1227<
1228      Note: special array syntax for register entries is not recognized here.
1229   3. "  = {msgpack-value}": raw values.  |{msgpack-value}| in this case may
1230      have absolutely any type.  Special array syntax for register entries is
1231      not recognized here as well.
1232
1233
1234RUST							*ft-rust*
1235
1236Since the text for this plugin is rather long it has been put in a separate
1237file: |ft_rust.txt|.
1238
1239
1240SQL							*ft-sql*
1241
1242Since the text for this plugin is rather long it has been put in a separate
1243file: |ft_sql.txt|.
1244
1245
1246TEX						*ft-tex-plugin* *g:tex_flavor*
1247
1248If the first line of a `*.tex` file has the form >
1249	%&<format>
1250then this determined the file type:  plaintex (for plain TeX), context (for
1251ConTeXt), or tex (for LaTeX).  Otherwise, the file is searched for keywords to
1252choose context or tex.  If no keywords are found, it defaults to plaintex.
1253You can change the default by defining the variable g:tex_flavor to the format
1254(not the file type) you use most.  Use one of these: >
1255	let g:tex_flavor = "plain"
1256	let g:tex_flavor = "context"
1257	let g:tex_flavor = "latex"
1258Currently no other formats are recognized.
1259
1260TYPST							*ft-typst-plugin*
1261
1262						   *g:typst_recommended_style*
1263By default, the Typst filetype plugin enables the following options: >
1264	setlocal expandtab shiftwidth=2 softtabstop=2
1265
1266To disable this, set the following variable: >
1267	let g:typst_recommended_style = 0
1268<
1269							*g:typst_conceal*
1270When |TRUE| the Typst filetype plugin will set the 'conceallevel' option to 2.
1271
1272							*g:typst_folding*
1273When |TRUE| the Typst filetype plugin will fold headings. (default: |FALSE|)
1274
1275To enable: >
1276	let g:typst_folding = 1
1277<
1278							*g:typst_foldnested*
1279When |TRUE| the Typst filetype plugin will fold nested heading under their
1280parents. (default: |TRUE|)
1281
1282To disable: >
1283	let g:typst_foldnested = 0
1284<
1285VIM							*ft-vim-plugin*
1286
1287The Vim filetype plugin defines mappings to move to the start and end of
1288functions with [[ and ]].  Move around comments with ]" and [".
1289
1290The mappings can be disabled with: >
1291	let g:no_vim_maps = 1
1292
1293YAML							*ft-yaml-plugin*
1294By default, the YAML filetype plugin enables the following options: >
1295	setlocal shiftwidth=2 softtabstop=2
1296
1297To disable this, set the following variable: >
1298	let g:yaml_recommended_style = 0
1299
1300
1301ZIG							*ft-zig-plugin*
1302
1303						*g:zig_recommended_style*
1304By default the following indentation options are set, in accordance with Zig's
1305recommended style (https://ziglang.org/documentation/master/): >
1306
1307	setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8
1308<
1309To disable this behavior, set |g:zig_recommended_style| to 0: >
1310
1311	let g:zig_recommended_style = 0
1312<
1313							*g:zig_std_dir*
1314The path to the Zig standard library.  The Zig |ftplugin| reads |g:zig_std_dir|
1315and appends it to the 'path' for Zig files.  Where the Zig standard library
1316is located is system and installation method dependent.
1317
1318One can automatically set |g:zig_std_dir| using `zig env`: >
1319
1320	let g:zig_std_dir = json_decode(system('zig env'))['std_dir']
1321<
1322This can, for example, be put in a FileType |:autocmd| or user |ftplugin| to
1323only load when a Zig file is opened.
1324
1325
1326ZIMBU							*ft-zimbu-plugin*
1327
1328The Zimbu filetype plugin defines mappings to move to the start and end of
1329functions with [[ and ]].
1330
1331The mappings can be disabled with: >
1332	let g:no_zimbu_maps = 1
1333<
1334
1335
1336 vim:tw=78:ts=8:noet:ft=help:norl: