Skip to content

feat(filetype): add razor filetype for .cshtml and .razor#19207

Open
tris203 wants to merge 1 commit intovim:masterfrom
tris203:razor
Open

feat(filetype): add razor filetype for .cshtml and .razor#19207
tris203 wants to merge 1 commit intovim:masterfrom
tris203:razor

Conversation

@tris203
Copy link
Contributor

@tris203 tris203 commented Jan 18, 2026

cshtml/razor is not html and is its own markup language

https://learn.microsoft.com/en-us/aspnet/core/mvc/views/razor?view=aspnetcore-10.0

Files containing Razor generally have a .cshtml file extension. Razor is also found in Razor component files (.razor). Razor syntax is similar to the templating engines of various JavaScript single-page application (SPA) frameworks, such as Angular, React, VueJs, and Svelte.

@chrisbra
Copy link
Member

okay, so it seems to be the intended filetype even back then when .cshtml support was initially merged #10212 . But I am afraid merging this now will leave people without syntax highlighting while currently they get html highlighting and I don't want to break this so short before a plugin. So this has to wait until after the 9.2 release.

@tris203
Copy link
Contributor Author

tris203 commented Jan 18, 2026

There is a highlighter here

https://github.com/jlcrochet/vim-razor

@chrisbra
Copy link
Member

yes, one needs an additional plugin then.

@tris203
Copy link
Contributor Author

tris203 commented Jan 19, 2026

yes, one needs an additional plugin then.

Appreciate that. Sorry I was too brief

I meant if we can get permission from the author to upstream the syntax would that alleviate your highlight concerns.

If not, or again that is too close to a release. Then obviously we wait.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants