From deef4f6d68deb7c3df2505acbfecdfd85529939e Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 7 Feb 2017 16:53:12 +0100 Subject: Create new filetype plugin 'htmlerb' I want the HTML matchit command to be available in *.html.erb files. Normally, these files get loaded as `filetype=eruby`. The trouble with that is that not all eruby is HTML, so I can't load the matcher in the 'eruby' filetype because it might not make sense. Create a new special filetype for *.html.erb files that uses the normal eruby syntax, but includes the HTML matchit command. --- ftdetect/htmlerb.vim | 1 + ftplugin/htmlerb.vim | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 ftdetect/htmlerb.vim create mode 100644 ftplugin/htmlerb.vim diff --git a/ftdetect/htmlerb.vim b/ftdetect/htmlerb.vim new file mode 100644 index 0000000..d0a08ee --- /dev/null +++ b/ftdetect/htmlerb.vim @@ -0,0 +1 @@ +autocmd BufRead,BufNewFile *.html.erb set filetype=htmlerb syntax=eruby diff --git a/ftplugin/htmlerb.vim b/ftplugin/htmlerb.vim new file mode 100644 index 0000000..23c7c0b --- /dev/null +++ b/ftplugin/htmlerb.vim @@ -0,0 +1,4 @@ +" Ruby/Rails HTML ERB settings + +" Inherit HTML settings +runtime! ftplugin/html.vim -- cgit v1.2.3