diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-07-22 23:31:14 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-07-22 23:31:14 +1200 |
commit | 54081e4403b3c77d4c6f5fbd6c96539cedf25d55 (patch) | |
tree | 1c14ca9fce5a2863c495f3fdfa09d8e50117771b /autoload | |
download | vim-alternate-filetypes-54081e4403b3c77d4c6f5fbd6c96539cedf25d55.tar.gz vim-alternate-filetypes-54081e4403b3c77d4c6f5fbd6c96539cedf25d55.zip |
Add plugin in current state
Extracted directly from incubation in my dotfiles, v7.0.0.
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/alternate_filetypes.vim | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/autoload/alternate_filetypes.vim b/autoload/alternate_filetypes.vim new file mode 100644 index 0000000..08ac88d --- /dev/null +++ b/autoload/alternate_filetypes.vim @@ -0,0 +1,13 @@ +function! alternate_filetypes#() abort + if exists('b:alternate_filetypes') + let filetypes = b:alternate_filetypes + let index = index(filetypes, &filetype) + if index >= 0 + let &filetype = filetypes[ + \ (index + 1) % len(filetypes) + \] + else + unlet b:alternate_filetypes + endif + endif +endfunction |