Skip to content

Commit 8475a52

Browse files
committed
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.
1 parent acee4ad commit 8475a52

File tree

5 files changed

+31
-2
lines changed

5 files changed

+31
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ NeoBundleInstall ocaml/vim-ocaml'
1717
1818
" or use NeoBundleLazy
1919
NeoBundleLazy 'rgrinberg/vim-ocaml', {'autoload' : {'filetypes' :
20-
\ ['ocaml', 'dune', 'opam', 'oasis', 'omake', 'ocamlbuild_tags', 'sexplib']}}
20+
\ ['ocaml', 'ocamlinterface', 'dune', 'opam', 'oasis', 'omake', 'ocamlbuild_tags', 'sexplib']}}
2121
```
2222

2323
## History

ftdetect/ocaml.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
au BufRead,BufNewFile *.ml,*.mli,*.mll,*.mly,.ocamlinit,*.mlt,*.mlp,*.mlip,*.mli.cppo,*.ml.cppo set ft=ocaml
1+
au BufRead,BufNewFile *.ml,*.mll,*.mly,.ocamlinit,*.mlt,*.mlp,*.ml.cppo set ft=ocaml

ftdetect/ocamlinterface.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
au BufRead,BufNewFile *.mli,*.mlip,*.mli.cppo set ft=ocamlinterface

ftplugin/ocamlinterface.vim

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
" Language: OCaml Interface
2+
" Maintainer: vim-ocaml maintainers
3+
" URL: http://www.github.com/ocaml/vim-ocaml
4+
5+
if exists("b:did_ftplugin")
6+
finish
7+
endif
8+
9+
runtime! ftplugin/ocaml.vim ftplugin/ocaml_*.vim ftplugin/ocaml/*.vim
10+
11+
" vim:sw=2 fdm=indent

syntax/ocamlinterface.vim

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
" Vim syntax file
2+
" Language: OCaml Interface
3+
" Filenames: *.mli
4+
" Maintainers: vim-ocaml maintainers
5+
" URL: http://www.github.com/ocaml/vim-ocaml
6+
7+
" Quit when a syntax file was already loaded
8+
if exists("b:current_syntax")
9+
finish
10+
endif
11+
12+
runtime! syntax/ocaml.vim
13+
unlet b:current_syntax
14+
15+
let b:current_syntax = "ocamlinterface"
16+
17+
" vim: ts=8

0 commit comments

Comments
 (0)