Skip to content

Commit

Permalink
feature: create ocamllex filetype for mll files
Browse files Browse the repository at this point in the history
  • Loading branch information
undu committed Oct 11, 2020
1 parent 8475a52 commit dc4a92c
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ftdetect/ocaml.vim
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions ftdetect/ocamllex.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
au BufRead,BufNewFile *.mll set ft=ocamllex
11 changes: 11 additions & 0 deletions ftplugin/ocamllex.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
" 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 ftplugin/ocaml_*.vim ftplugin/ocaml/*.vim

" vim:sw=2 fdm=indent
17 changes: 17 additions & 0 deletions syntax/ocamllex.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
" Vim syntax file
" Language: OCamlLex
" Filenames: *.mll
" 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 = "ocamllex"

" vim: ts=8

0 comments on commit dc4a92c

Please sign in to comment.