Language Support - lukelex/railscasts.nvim GitHub Wiki
Language Support
Railscasts works with every Neovim filetype. The languages below have parser-backed fixtures in the project and deliberate Tree-sitter mappings. They extend the original TextMate/Vim theme's intent to modern scopes without adding colors or redefining the palette.
Guiding rules
The original theme distinguishes language control flow, callable names, types, quoted text, comments, and preprocessing. Modern grammars expose more precise roles, so Railscasts maps them back to those existing roles:
- Function (
light_orange) for declarations, calls, and component tags. - Keyword (
dark_orange) for control flow, directives, and language words. - Type (
red) for types and type-like declarations. - PreProc (
dark_orange) for annotations, decorators, attributes, macros, and other compile-time directives. - Label (
purple, soft lavender) for properties, object keys, and member fields. - Identifier (
red) for namespaces and markup attributes. - String (
light_green) for literal and expansion-like data.
These are semantic extensions—not assertions that the original grammars had these Tree-sitter captures. Where a language has no special mapping below, its standard captures inherit Railscasts' generic syntax hierarchy.
Tree-sitter @property, @variable.member, and legacy @field share the
lavender member role, as does LSP @lsp.type.property. Existing language-specific
key overrides are preserved. See Properties and object keys
for the design rationale.
Python
Decorators and attributes use PreProc, reflecting their declarative,
pre-execution role. Types use Type. This makes @dataclass visible as a
structural declaration without making it compete with methods or strings.
JavaScript, TypeScript, and TSX
Functions use Function, while properties and interface keys use the lavender Label role, distinct from red types/constants. LSP property tokens follow the same mapping instead of overriding keys with red. JSX/TSX tags also use Function, treating components as callable UI units; this is the only markup-specific choice beyond the original theme's generic HTML treatment.
Go
Types use Type and functions use Function. Struct fields use the lavender member role, making them distinct from named types and constants.
Rust
Types and functions use their normal Type and Function roles. Attributes, macros, and lifetimes use PreProc: all three modify or qualify compilation rather than functioning as ordinary runtime identifiers.
SQL
SQL keywords use Keyword and built-in function-like constructs use Function. Tables and columns stay identifiers, so statement structure is clear without turning schema names into a separate color family.
TOML
TOML keys use Function. This follows the theme's existing YAML convention: keys name a configuration entry and should be easy to scan, while values retain their normal literal colors.
Dockerfile and Makefile
Dockerfile and Makefile directives use Keyword; function-like build syntax uses Function. Docker and Make variable expansions use String, because they resolve to data injected into commands rather than ordinary source-code variables.
C and C++
Types use Type and functions use Function. Preprocessor captures retain
the existing PreProc treatment, which closely matches the original
Railscasts Vim theme's #include and macro hierarchy.
Java and C#
Types and functions inherit the generic object-oriented mappings. Java and C# attributes/annotations use PreProc, separating declarative metadata from classes, members, and executable calls.
Vue and Svelte
Component and HTML-like tags use Function, attributes use Identifier, and framework-language keywords use Keyword. This adapts the original HTML-oriented tag distinction for component-driven templates while preserving normal script highlighting within their embedded languages.
Git commit messages
Git commit buffers have both Neovim runtime-syntax and Tree-sitter support. The subject is a Title so it remains the first visual anchor; conventional commit types and Git metadata headers use Keyword; trailer tokens use the purple Label role; paths use String; and status entries use the existing added, changed, and deleted diff roles. Branch names are underlined links.
BREAKING CHANGE is intentionally mapped to DiagnosticError. It is a
high-attention compatibility signal rather than ordinary comment text. This is
a modern semantic extension: classic Railscasts predates Conventional Commits,
but its existing diagnostic and diff language expresses the same priority
without adding a new color.
Man pages and roff
Rendered :Man buffers use Neovim's man syntax. Page headers use Title;
section headings retain the Keyword hierarchy; subheadings, commands, and
option descriptions use Function; references such as nvim(1) are
underlined; and footer metadata is muted as Comment.
Roff/groff source extends that language: request names are PreProc, escaped and special characters are Special, quoted strings are String, and numeric values are Number. Invalid roff spacing and syntax use the existing error role. These choices clarify document structure without introducing colors beyond the Railscasts palette.
Neovim help files
Help headlines and headers use Title, help tags are underlined links, and options use Function. Notes and warnings use the existing information and warning diagnostics; deprecated text remains muted. This prioritizes scanning commands and following help links in documentation-dense buffers.
Git configuration and rebase plans
Git configuration sections use Keyword, setting names use Function, and comments, escapes, and invalid escapes follow their established comment, special, and error roles.
Interactive rebase plans visualize the effect of each action: pick is an
addition, reword/squash/fixup are changes, and drop is a deletion.
Commit IDs and labels remain identifiers, while summaries are strings. This
extends Railscasts' diff language to a Git workflow where the action itself is
more important than the command spelling.
Diff and patch files
Patch index metadata uses PreProc; old and new paths use String; and no-newline, binary, and comparison notices are muted comments. Added, changed, and deleted lines retain Railscasts' stable diff roles.
Terraform and HCL
HCL block types use Type, attribute names and functions use Function, and braces remain delimiters. This follows the configuration-file convention used for TOML and YAML: named settings should be easy to scan, while values keep their normal literal roles.
ERB, Jinja, and Liquid templates
ERB delimiters and Jinja/Liquid template delimiters use PreProc, clearly separating embedded logic from HTML. Template statements use Keyword; filters, blocks, and helpers use Function; variables and attributes use Identifier; and template comments remain muted. The treatment makes the language boundary visible without assigning templates a new palette.
Parser-backed workflow and template fixtures
Railscasts verifies representative help, Git configuration, interactive rebase, diff, HCL, ERB, Jinja, Liquid, and embedded Vue/Svelte template files with pinned Tree-sitter parsers. The runtime syntax mappings remain the visual contract; parser fixtures ensure these common file formats load correctly in the supported Neovim versions.
Elixir and Erlang
Elixir module attributes and macros use PreProc, separating compile-time metadata from ordinary calls. Erlang types use Type and functions use Function. Both languages otherwise retain the standard Railscasts treatment for atoms, strings, numbers, comments, and pattern-matching operators.
GraphQL
GraphQL schema types use Type, fields use Function, schema keywords use Keyword, and directives use PreProc. Fields are callable schema entry points in the same visual role as functions; directives modify schema behavior rather than being ordinary identifiers.
Protocol Buffers
Protocol Buffer message and scalar types use Type, fields use Function, keywords use Keyword, and options/annotations use PreProc. This keeps a schema readable as structure first, with field names easy to scan and generated or declarative metadata visibly subordinate.
Kmonad
Railscasts natively detects .kbd keyboard configuration files and provides
Kmonad syntax groups. Declarations and modifiers use Keyword, alias names
and configuration options use Function, alias references use the purple
Label role, device backends use Type, and strings, booleans, and comments
retain their established Railscasts roles. No additional syntax plugin or theme configuration is needed.
Nix, Clojure, Kotlin, Swift, Zig, and Dart
These languages use the standard Railscasts semantic grammar: declarations and control flow are Keyword, types are Type, callable definitions are Function, and annotations map to PreProc. Pinned parser fixtures cover Nix expressions, Clojure forms, Kotlin and Swift declarations, Zig functions, and Dart/Flutter-style classes so the theme's portable semantic links remain verified across supported Neovim versions.