mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 20:20:10 +01:00
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).
Carbon Syntax Highlighting for Vim & Neovim
For Carbon developers using Vim or Neovim, this plugin provides syntax
highlighting for .carbon files found throughout explorer/testdata
Repository and contributing
This code is developed as part of the Carbon Language project. Everything is then automatically mirrored into a dedicated repository.
If you would like to contribute, please follow the normal Carbon contributing guide and submit pull requests to the main repository.
Manual Installation
Vim Users
From the current directory utils/vim, please run the following commands to
install the syntax file.
mkdir -p ~/.vim/syntax && cp syntax/carbon.vim ~/.vim/syntax/
mkdir -p ~/.vim/ftdetect && cp ftdetect/carbon.vim ~/.vim/ftdetect/
Neovim Users
Instead of copying to the ~/.vim directory, please use the ~/.config/nvim
directory, or your custom Neovim root directory.
mkdir -p ~/.config/nvim/syntax && cp syntax/carbon.vim ~/.config/nvim/syntax/
mkdir -p ~/.config/nvim/ftdetect && cp ftdetect/carbon.vim ~/.config/nvim/ftdetect/