From a81756029291d6e21295687515a3e58499c19b33 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Fri, 1 Jan 2021 17:09:30 +0100 Subject: Add support for gleam, closes #655 Co-authored-by: Jeff Kreeftmeijer --- ftplugin/dune.vim | 10 ++++++++++ ftplugin/gleam.vim | 32 ++++++++++++++++++++++++++++++++ ftplugin/ocaml.vim | 2 +- ftplugin/sexplib.vim | 3 ++- 4 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 ftplugin/gleam.vim (limited to 'ftplugin') diff --git a/ftplugin/dune.vim b/ftplugin/dune.vim index 970c9825..92c471f4 100644 --- a/ftplugin/dune.vim +++ b/ftplugin/dune.vim @@ -2,6 +2,14 @@ if has_key(g:polyglot_is_disabled, 'ocaml') finish endif +" Language: Dune buildsystem +" Maintainer: Markus Mottl +" Anton Kochkov +" URL: https://github.com/ocaml/vim-ocaml +" Last Change: +" 2018 Nov 3 - Added commentstring (Markus Mottl) +" 2017 Sep 6 - Initial version (Etienne Millon) + if exists("b:did_ftplugin") finish endif @@ -12,3 +20,5 @@ set lisp " Comment string setl commentstring=;\ %s setl comments=:; + +setl iskeyword+=#,?,.,/ diff --git a/ftplugin/gleam.vim b/ftplugin/gleam.vim new file mode 100644 index 00000000..58f39f03 --- /dev/null +++ b/ftplugin/gleam.vim @@ -0,0 +1,32 @@ +if has_key(g:polyglot_is_disabled, 'gleam') + finish +endif + + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +compiler gleam + +setlocal commentstring=//%s +setlocal formatoptions-=t formatoptions+=croqnl + +setlocal comments=s0:/*!,ex:*/,s1:/*,mb:*,ex:*/,:////,:///,:// + +" j was only added in 7.3.541, so stop complaints about its nonexistence +silent! setlocal formatoptions+=j + +" smartindent will be overridden by indentexpr if filetype indent is on, but +" otherwise it's better than nothing. +setlocal smartindent nocindent + +setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab +setlocal textwidth=79 + +setlocal suffixesadd=.gleam + +augroup gleam.vim +autocmd! +augroup END diff --git a/ftplugin/ocaml.vim b/ftplugin/ocaml.vim index 183b5318..84be233e 100644 --- a/ftplugin/ocaml.vim +++ b/ftplugin/ocaml.vim @@ -9,7 +9,7 @@ endif " Pierre Vittet " Stefano Zacchiroli " Vincent Aravantinos -" URL: http://www.ocaml.info/vim/ftplugin/ocaml.vim +" URL: https://github.com/ocaml/vim-ocaml " Last Change: " 2013 Oct 27 - Added commentstring (MM) " 2013 Jul 26 - load default compiler settings (MM) diff --git a/ftplugin/sexplib.vim b/ftplugin/sexplib.vim index ebd322ad..7b36d631 100644 --- a/ftplugin/sexplib.vim +++ b/ftplugin/sexplib.vim @@ -2,9 +2,10 @@ if has_key(g:polyglot_is_disabled, 'ocaml') finish endif +" Vim filetype plugin file " Language: Sexplib " Maintainer: Markus Mottl -" URL: http://www.ocaml.info/vim/ftplugin/sexplib.vim +" URL: https://github.com/ocaml/vim-ocaml " Last Change: " 2017 Apr 12 - First version (MM) -- cgit v1.2.3