From dcc30c667d8a7239ef726cad21209d19e3f90625 Mon Sep 17 00:00:00 2001 From: Pau Ruiz Safont Date: Thu, 10 Sep 2020 13:16:12 +0100 Subject: [PATCH 1/2] feature: create ocamlinterface filetype for mli files This is needed for supporting the tree-sitter parsers in ocaml because the interface parser is different from the implementation one one. --- README.md | 2 +- ftdetect/ocaml.vim | 2 +- ftdetect/ocamlinterface.vim | 1 + ftplugin/ocamlinterface.vim | 12 ++++++++++++ 4 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 ftdetect/ocamlinterface.vim create mode 100644 ftplugin/ocamlinterface.vim diff --git a/README.md b/README.md index d207a5c..077c334 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', 'dune', 'opam', 'oasis', 'omake', 'ocamlbuild_tags', 'sexplib']}} + \ ['ocaml', 'ocamlinterface', 'dune', 'opam', 'oasis', 'omake', 'ocamlbuild_tags', 'sexplib']}} ``` ## History diff --git a/ftdetect/ocaml.vim b/ftdetect/ocaml.vim index ecb8f43..a043d86 100644 --- a/ftdetect/ocaml.vim +++ b/ftdetect/ocaml.vim @@ -1 +1 @@ -au BufNewFile,BufRead *.ml,*.mli,*.mll,*.mly,.ocamlinit,*.mlt,*.mlp,*.mlip,*.mli.cppo,*.ml.cppo setf ocaml +au BufNewFile,BufRead *.ml,*.mll,*.mly,.ocamlinit,*.mlt,*.mlp,*.ml.cppo setf ocaml diff --git a/ftdetect/ocamlinterface.vim b/ftdetect/ocamlinterface.vim new file mode 100644 index 0000000..d67c48d --- /dev/null +++ b/ftdetect/ocamlinterface.vim @@ -0,0 +1 @@ +au BufNewFile,BufRead *.mli,*.mlip,*.mli.cppo setf ocamlinterface diff --git a/ftplugin/ocamlinterface.vim b/ftplugin/ocamlinterface.vim new file mode 100644 index 0000000..d7e2ae0 --- /dev/null +++ b/ftplugin/ocamlinterface.vim @@ -0,0 +1,12 @@ +" Language: OCaml Interface +" 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 From e9b95e03431155cca01dd312273c0e5581805d26 Mon Sep 17 00:00:00 2001 From: Pau Ruiz Safont Date: Mon, 28 Sep 2020 21:07:09 +0100 Subject: [PATCH 2/2] 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 a043d86..002f6f0 100644 --- a/ftdetect/ocaml.vim +++ b/ftdetect/ocaml.vim @@ -1 +1 @@ -au BufNewFile,BufRead *.ml,*.mll,*.mly,.ocamlinit,*.mlt,*.mlp,*.ml.cppo setf ocaml +au BufNewFile,BufRead *.ml,*.mly,.ocamlinit,*.mlt,*.mlp,*.ml.cppo setf ocaml diff --git a/ftdetect/ocamllex.vim b/ftdetect/ocamllex.vim new file mode 100644 index 0000000..cf35fd2 --- /dev/null +++ b/ftdetect/ocamllex.vim @@ -0,0 +1 @@ +au BufNewFile,BufRead *.mll setf 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