mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-27 15:30:11 +01:00
This will allow us to automatically create and maintain specific repos based on the main repository here, pulling key files like the license and other infrastructure and pushing them systematically to a narrow repo. Things like editor plugins that are best packaged and installed from a separate repos can still be developed in a central place, even potentially sharing common things like grammars where useful. Currently this will maintain a Vim plugin repository out of the `utils/vim` directory, but can be easily expanded for other systems.
45 lines
1.5 KiB
Markdown
45 lines
1.5 KiB
Markdown
# Carbon Syntax Highlighting for Vim & Neovim
|
|
|
|
<!--
|
|
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
|
|
-->
|
|
|
|
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](https://github.com/carbon-language/carbon-lang/tree/trunk/utils/vim) of
|
|
the [Carbon Language](https://github.com/carbon-language/carbon-lang) project.
|
|
Everything is then automatically mirrored into a dedicated
|
|
[repository](https://github.com/carbon-language/vim-carbon-lang).
|
|
|
|
If you would like to contribute, please follow the normal
|
|
[Carbon contributing guide](https://github.com/carbon-language/carbon-lang/blob/trunk/CONTRIBUTING.md)
|
|
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/
|
|
```
|