Skip to content

Commit

Permalink
feature: create menhir filetype for mly files
Browse files Browse the repository at this point in the history
  • Loading branch information
undu committed Jan 5, 2021
1 parent c494b97 commit c5ce8dd
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ Plugin 'ocaml/vim-ocaml'
NeoBundleInstall ocaml/vim-ocaml'
" or use NeoBundleLazy
NeoBundleLazy 'rgrinberg/vim-ocaml', {'autoload' : {'filetypes' :
\ ['ocaml', 'ocamlinterface', 'ocamllex', 'dune', 'opam', 'oasis', 'omake', 'ocamlbuild_tags', 'sexplib']}}
NeoBundleLazy 'ocaml/vim-ocaml', {'autoload' : {'filetypes' : [
\ 'ocaml', 'ocamlinterface', 'ocamllex', 'menhir', 'dune', 'opam',
\ 'oasis', 'omake', 'ocamlbuild_tags', 'sexplib']}}
```

## History
Expand Down
1 change: 1 addition & 0 deletions ftdetect/menhir.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
au BufNewFile,BufRead *.mly setf menhir
2 changes: 1 addition & 1 deletion ftdetect/ocaml.vim
Original file line number Diff line number Diff line change
@@ -1 +1 @@
au BufNewFile,BufRead *.ml,*.mly,.ocamlinit,*.mlt,*.mlp,*.ml.cppo setf ocaml
au BufNewFile,BufRead *.ml,.ocamlinit,*.mlt,*.mlp,*.ml.cppo setf ocaml
11 changes: 11 additions & 0 deletions ftplugin/menhir.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
" Language: Menhir
" Maintainer: vim-ocaml maintainers
" URL: http://www.github.com/ocaml/vim-ocaml

if exists("b:did_ftplugin")
finish
endif

runtime! ftplugin/ocaml.vim ftplugin/ocaml_*.vim ftplugin/ocaml/*.vim

" vim:sw=2 fdm=indent
17 changes: 17 additions & 0 deletions syntax/menhir.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
" Vim syntax file
" Language: OCaml Interface
" Filenames: *.mly
" Maintainers: vim-ocaml maintainers
" URL: http://www.github.com/ocaml/vim-ocaml

" Quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif

runtime! syntax/ocaml.vim
unlet b:current_syntax

let b:current_syntax = "menhir"

" vim: ts=8

0 comments on commit c5ce8dd

Please sign in to comment.