Skip to content

Commit 383e7fa

Browse files
committed
feature: create menhir filetype for mly files
1 parent 91b0b06 commit 383e7fa

File tree

5 files changed

+34
-3
lines changed

5 files changed

+34
-3
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ Plugin 'ocaml/vim-ocaml'
1616
NeoBundleInstall ocaml/vim-ocaml'
1717
1818
" or use NeoBundleLazy
19-
NeoBundleLazy 'rgrinberg/vim-ocaml', {'autoload' : {'filetypes' :
20-
\ ['ocaml', 'ocamlinterface', 'ocamllex', 'dune', 'opam', 'oasis', 'omake', 'ocamlbuild_tags', 'sexplib']}}
19+
NeoBundleLazy 'ocaml/vim-ocaml', {'autoload' : {'filetypes' : [
20+
\ 'ocaml', 'ocamlinterface', 'ocamllex', 'menhir', 'dune', 'opam',
21+
\ 'oasis', 'omake', 'ocamlbuild_tags', 'sexplib']}}
2122
```
2223

2324
## History

ftdetect/menhir.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
au BufNewFile,BufRead *.mly setf menhir

ftdetect/ocaml.vim

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

ftplugin/menhir.vim

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
" Language: Menhir / OCamlYACC
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
10+
runtime! ftplugin/ocaml_*.vim ftplugin/ocaml/*.vim
11+
12+
" vim:sw=2 fdm=indent

syntax/menhir.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: Markus Mottl <[email protected]>
5+
" URL: https://github.com/ocaml/vim-ocaml
6+
" Last Change:
7+
" 2021 May 19 - Creation (Pau Ruiz Safont)
8+
9+
" Quit when a syntax file was already loaded
10+
if exists("b:current_syntax") && b:current_syntax == "ocaml"
11+
finish
12+
endif
13+
14+
runtime! syntax/ocaml.vim
15+
runtime! syntax/ocaml_*.vim syntax/ocaml/*.vim
16+
17+
" vim:sw=2 fdm=indent

0 commit comments

Comments
 (0)