Skip to content

Commit c9855c4

Browse files
authored
Update syntax files for vim (carbon-language#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).
1 parent 90babcd commit c9855c4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

utils/vim/ftplugin/carbon.vim

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
" Part of the Carbon Language project, under the Apache License v2.0 with LLVM
2+
" Exceptions. See /LICENSE for license information.
3+
" SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
5+
setlocal commentstring=//\ %s
6+
setlocal comments=://

0 commit comments

Comments
 (0)