Skip to content

File Types ​

Cosmoscope supports 270+ file types auto-discovered from the Chroma v2 lexer registry. Coverage is determined by Chroma's lexer database — no manual configuration needed.

How It Works ​

The renderer queries Chroma's lexer registry at runtime:

  1. Filename match — lexers.Match("Dockerfile") → Docker lexer
  2. Extension match — lexers.Get(".go") → Go lexer
  3. Content analysis — for unnamed markdown code blocks, Chroma heuristically detects the language

If no lexer matches, the file is shown as plain text with proper formatting.

Supported Languages (Partial List) ​

The full list includes 270+ languages. Here are the most popular:

Web & Frontend ​

HTML, CSS, JavaScript, TypeScript, JSX, TSX, Vue, Svelte, SCSS, Sass, Less, Handlebars

Systems & Backend ​

Go, Rust, C, C++, Swift, Objective-C, Java, Kotlin, Scala, Ruby, Python, PHP, Perl, Erlang, Elixir, Haskell, OCaml, F#, Dart, Zig, Nim, Crystal

Data & Config ​

JSON, YAML, TOML, XML, SQL, GraphQL, Protocol Buffers, Terraform, HCL, INI, dotenv

Markup & Docs ​

Markdown, reStructuredText, TeX/LaTeX, BibTeX, Org Mode

Shell & Scripting ​

Bash, Zsh, Fish, PowerShell, Batch, AWK, Tcl, Lua, Vim Script

DevOps & Infra ​

Dockerfile, CMake, Makefile, Nginx, ApacheConf, systemd, Puppet, Bicep

Hardware & Assembly ​

ARM Assembly, NASM, Verilog, VHDL, SystemVerilog, GLSL, OpenSCAD

Scientific & Academic ​

R, Julia, Fortran, MATLAB, Mathematica, SAS

Full List ​

Run cosmoscope list to see every supported language and its file patterns.

Adding New Types ​

When Chroma adds new languages (it ships with 292 stable lexers), Cosmoscope automatically picks them up at init time — no code changes needed. To check what's available:

bash
cosmoscope list
cosmoscope check .ext