diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-07-23 00:24:49 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-07-23 00:26:00 +1200 |
commit | 0eaaaf932d033e332e9955e97171741d5356f800 (patch) | |
tree | 8165a1d1bf7aff7c7efbb11374c25bcd30cb823f | |
parent | Do nothing if the filetype won't change (diff) | |
download | vim-alternate-filetypes-0eaaaf932d033e332e9955e97171741d5356f800.tar.gz vim-alternate-filetypes-0eaaaf932d033e332e9955e97171741d5356f800.zip |
Add first run at documentation
-rw-r--r-- | README.md | 13 | ||||
-rw-r--r-- | doc/alternate_filetypes.txt | 45 |
2 files changed, 58 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..a3c4871 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +alternate\_filetypes.vim +======================== + +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. + +License +------- + +Copyright (c) [Tom Ryder][1]. Distributed under the same terms as Vim itself. +See `:help license`. + +[1]: https://sanctum.geek.nz/ diff --git a/doc/alternate_filetypes.txt b/doc/alternate_filetypes.txt new file mode 100644 index 0000000..bee538e --- /dev/null +++ b/doc/alternate_filetypes.txt @@ -0,0 +1,45 @@ +*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: |