From ff7161c298410d4bbbaaf8fae8dd302601d739f6 Mon Sep 17 00:00:00 2001 From: Paul Seyfert Date: Fri, 27 Jan 2023 18:08:09 +0100 Subject: [PATCH 1/2] set comments and commentstring These variables are documented e.g. [here](https://vimhelp.org/options.txt.html#%27comments%27). For comparison other language plugins also set these two variables [vim-go](https://github.com/fatih/vim-go/blob/master/ftplugin/go.vim#L22) or [vim-toml](https://github.com/cespare/vim-toml/blob/main/ftplugin/toml.vim#L18). I used these variables through the [tcomment](https://github.com/tomtom/tcomment_vim) plugin. e.g. `gcc` toggles whether the current line is commented in or out. --- ftplugin/hjson.vim | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 ftplugin/hjson.vim diff --git a/ftplugin/hjson.vim b/ftplugin/hjson.vim new file mode 100644 index 0000000..ab9bc21 --- /dev/null +++ b/ftplugin/hjson.vim @@ -0,0 +1,2 @@ +setlocal commentstring=#\ %s +setlocal comments=:# From 8af3ee885f484ac0a180a56b5f06e9d792872729 Mon Sep 17 00:00:00 2001 From: Paul Seyfert Date: Wed, 15 Feb 2023 09:32:55 +0100 Subject: [PATCH 2/2] add // and /* */ comment support --- ftplugin/hjson.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ftplugin/hjson.vim b/ftplugin/hjson.vim index ab9bc21..58a944f 100644 --- a/ftplugin/hjson.vim +++ b/ftplugin/hjson.vim @@ -1,2 +1,2 @@ setlocal commentstring=#\ %s -setlocal comments=:# +setlocal comments=:#,://,s1:/*,m:*,ex:*/