Commit Graph
5 Commits
Author SHA1 Message Date
Chandler Carruth 013a417ea5 Add the static keyword to various syntax highlighting (#7026)
This follows #7016 which suggests using `static var` for non-instance
class data members.

Assisted-by: Antigravity with Gemini
2026-04-06 19:32:24 +00:00
maan2003 7f4cf794cf neovim: add treesitter and lsp config (#3129)
see utils/nvim/README.md
2023-08-22 22:05:46 +00:00
pseyfert c9855c4e01 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).
2022-08-15 15:06:01 -07:00
Chandler Carruth a4a3cf0136 Create a sync-repos action. (#1863)
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.
2022-08-06 15:42:41 -07:00
x2wandJon Ross-Perkins 52f80c25ab Add syntax highlighting for vim and neovim (#1740)
PR to add a vim syntax file to support syntax highlighting for .carbon files. Since the Carbon language specification is still in progress, a single syntax file is easier to maintain and adapt to design changes in Carbon. After the language syntax has matured and stabilized, advanced tooling such as Treesitter and Language Servers can take over the syntax highlighting in neovim.

### Highlighting Support
- comments and preprocessors (RUN, CHECK, etc)
- string and numeric literals
- primitive type names, classes, aliases
- control flow constructs
- identifier names
- package and library declarations
- most keywords mentioned in `docs/design/README.md`

### With a Dark Colorscheme:
![carbon01](https://user-images.githubusercontent.com/78875280/181017032-e2c140c8-e98a-46d3-8f94-b8dc0f28ce49.png)

This image is longer than I thought, so I'm not posting what it looks like in a light colorscheme, but it should look fine as long as vim highlight-groups are properly defined.

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
2022-07-31 08:32:00 -07:00