aboutsummaryrefslogtreecommitdiff
path: root/vim/autoload
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-22 16:59:28 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-22 17:06:36 +1200
commit9929ca9ec20867cc910bf6b17839ee20dcd35f46 (patch)
tree9d0803f2fb8401832589d378fbf16cf5567fb63e /vim/autoload
parentBeginnings of new alternate_filetypes.vim plugin (diff)
downloaddotfiles-9929ca9ec20867cc910bf6b17839ee20dcd35f46.tar.gz
dotfiles-9929ca9ec20867cc910bf6b17839ee20dcd35f46.zip
Round out and apply alternate filetypes plugin
This is a good one.
Diffstat (limited to 'vim/autoload')
-rw-r--r--vim/autoload/alternate_filetypes.vim14
1 files changed, 14 insertions, 0 deletions
diff --git a/vim/autoload/alternate_filetypes.vim b/vim/autoload/alternate_filetypes.vim
new file mode 100644
index 00000000..26c2a0d5
--- /dev/null
+++ b/vim/autoload/alternate_filetypes.vim
@@ -0,0 +1,14 @@
+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
+ set filetype?
+endfunction