From 51e03f5a789202d130f223ac25f67867dcdf9b55 Mon Sep 17 00:00:00 2001 From: Pau Ruiz Safont Date: Mon, 28 Sep 2020 21:07:09 +0100 Subject: [PATCH] feature: create ocamllex filetype for mll files --- README.md | 2 +- ftdetect/ocaml.vim | 2 +- ftdetect/ocamllex.vim | 1 + ftplugin/ocamllex.vim | 12 ++++++++++++ 4 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 ftdetect/ocamllex.vim create mode 100644 ftplugin/ocamllex.vim diff --git a/README.md b/README.md index 077c334..ecb3512 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ NeoBundleInstall ocaml/vim-ocaml' " or use NeoBundleLazy NeoBundleLazy 'rgrinberg/vim-ocaml', {'autoload' : {'filetypes' : - \ ['ocaml', 'ocamlinterface', 'dune', 'opam', 'oasis', 'omake', 'ocamlbuild_tags', 'sexplib']}} + \ ['ocaml', 'ocamlinterface', 'ocamllex', 'dune', 'opam', 'oasis', 'omake', 'ocamlbuild_tags', 'sexplib']}} ``` ## History diff --git a/ftdetect/ocaml.vim b/ftdetect/ocaml.vim index 2194a9b..57da7a1 100644 --- a/ftdetect/ocaml.vim +++ b/ftdetect/ocaml.vim @@ -1 +1 @@ -au BufRead,BufNewFile *.ml,*.mll,*.mly,.ocamlinit,*.mlt,*.mlp,*.ml.cppo set ft=ocaml +au BufRead,BufNewFile *.ml,*.mly,.ocamlinit,*.mlt,*.mlp,*.ml.cppo set ft=ocaml diff --git a/ftdetect/ocamllex.vim b/ftdetect/ocamllex.vim new file mode 100644 index 0000000..6b34c61 --- /dev/null +++ b/ftdetect/ocamllex.vim @@ -0,0 +1 @@ +au BufRead,BufNewFile *.mll set ft=ocamllex diff --git a/ftplugin/ocamllex.vim b/ftplugin/ocamllex.vim new file mode 100644 index 0000000..f6b12f9 --- /dev/null +++ b/ftplugin/ocamllex.vim @@ -0,0 +1,12 @@ +" Language: OCamlLex +" Maintainer: vim-ocaml maintainers +" URL: http://www.github.com/ocaml/vim-ocaml + +if exists("b:did_ftplugin") + finish +endif + +runtime! ftplugin/ocaml.vim +runtime! ftplugin/ocaml_*.vim ftplugin/ocaml/*.vim + +" vim:sw=2 fdm=indent