From c9855c4e019ba0adeb07fcf128a06ced12ebdc91 Mon Sep 17 00:00:00 2001 From: pseyfert Date: Tue, 16 Aug 2022 00:06:01 +0200 Subject: [PATCH] Update syntax files for vim (#2039) 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. Also standard vim folding (mark a section and hit zf appears affected by these settings). --- utils/vim/ftplugin/carbon.vim | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 utils/vim/ftplugin/carbon.vim diff --git a/utils/vim/ftplugin/carbon.vim b/utils/vim/ftplugin/carbon.vim new file mode 100644 index 000000000000..6f751d6f26dd --- /dev/null +++ b/utils/vim/ftplugin/carbon.vim @@ -0,0 +1,6 @@ +" Part of the Carbon Language project, under the Apache License v2.0 with LLVM +" Exceptions. See /LICENSE for license information. +" SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +setlocal commentstring=//\ %s +setlocal comments=://