aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-22 16:44:12 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-22 16:44:12 +1200
commit2c7a5c37dec9b7321c2206c6cadb071eb0e84b20 (patch)
tree2a28ae8bd408f43a230d2b7fa4234765970a2a2a
parent723785c6901d6b71f52e057bdfbb730d66aa193d (diff)
downloaddotfiles-2c7a5c37dec9b7321c2206c6cadb071eb0e84b20.tar.gz
dotfiles-2c7a5c37dec9b7321c2206c6cadb071eb0e84b20.zip
Beginnings of new alternate_filetypes.vim plugin
-rw-r--r--vim/plugin/alternate_filetypes.vim13
1 files changed, 13 insertions, 0 deletions
diff --git a/vim/plugin/alternate_filetypes.vim b/vim/plugin/alternate_filetypes.vim
new file mode 100644
index 00000000..6e765feb
--- /dev/null
+++ b/vim/plugin/alternate_filetypes.vim
@@ -0,0 +1,13 @@
+function! s:AlternateFileType() abort
+ let filetypes = get(b:, 'alternate_filetypes', [&filetype])
+ if &filetype !=# filetypes[0]
+ let &filetype = filetypes[0]
+ endif
+ set filetype?
+endfunction
+command -bar AlternateFileType
+ \ call s:AlternateFileType()
+nnoremap <Plug>(AlternateFileType)
+ \ :<C-U>AlternateFileType<CR>
+nmap <Leader># <Plug>(AlternateFileType)
+nmap <Leader>3 <Leader>#