aboutsummaryrefslogblamecommitdiff
path: root/doc/alternate_filetypes.txt
blob: bee538ec04a966202bf05422b7fd755c5318f864 (plain) (tree)












































                                                                                
*alternate_filetypes.txt*	For Vim version 7.0	Last change: 2019 Jul 23

DESCRIPTION				*alternate_filetypes*

This plugin allows switching the current buffer through a set of related
filetypes, e.g. HTML while editing PHP, or AWK/sed while editing shell script.

REQUIREMENTS				*alternate_filetypes-requirements*

This plugin only loads if 'compatible' is not set.

COMMANDS				*alternate_filetypes-commands*

					*:AlternateFileType*
The `:AlternateFileType` command switches to the next alternate filetype, if
one is available, and then displays the active filetype after the attempted
change.

MAPPINGS				*alternate_filetypes-mappings*

					*<Plug>AlternateFileType*
The `<Plug>AlternateFileType` normal mode map target simply executes the
`:AlternateFileType` command.

VARIABLES				*alternate_filetypes-variables*

					*b:alternate_filetypes*
Per-buffer |List| of filetypes through which the `:AlternateFileType` command
should iterate.  Setting these in |ftplugin| scripts is likely the best idea.
For example, for shell script, one could add in `after/ftplugin/sh.vim`:
>
	let b:alternate_filetypes = ['sh', 'awk', 'sed']

If this list does not exist, or is empty, or contains only one filetype, then
the `:AlternateFileType` command will do nothing.
<
AUTHOR					*alternate_filetypes-author*

Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.

LICENSE					*alternate_filetypes-license*

Licensed for distribution under the same terms as Vim itself (see |license|).

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