Skip to content

Commit eb5a196

Browse files
committed
feat: add custom catppuccin themes
1 parent 04e4daa commit eb5a196

5 files changed

Lines changed: 4248 additions & 4 deletions

File tree

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ charset = utf-8
88
trim_trailing_whitespace = true
99
insert_final_newline = true
1010

11-
[*.{yaml,json,svg}]
11+
[*.{yaml,json,svg,tmTheme}]
1212
indent_size = 2

build.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Copyright 2026 Columnar Technologies Inc.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
fn main() {
5+
println!("cargo:rerun-if-changed=themes/");
6+
}

src/highlighter.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
use nu_ansi_term::{Color, Style};
55
use reedline::{Highlighter, StyledText};
6+
use std::io::Cursor;
67
use syntect::easy::HighlightLines;
78
use syntect::highlighting::{FontStyle, Style as SyntectStyle, Theme, ThemeSet};
89
use syntect::parsing::SyntaxSet;
@@ -78,9 +79,14 @@ impl Highlighter for SyntectHighlighter {
7879
}
7980

8081
fn get_theme() -> Theme {
81-
let theme_set = ThemeSet::load_defaults();
82-
let dark_theme = theme_set.themes["base16-ocean.dark"].clone();
83-
let light_theme = theme_set.themes["base16-ocean.light"].clone();
82+
let dark_theme_bytes = include_bytes!("../themes/catppuccin-mocha.tmTheme");
83+
let light_theme_bytes = include_bytes!("../themes/catppuccin-latte.tmTheme");
84+
85+
let dark_theme = ThemeSet::load_from_reader(&mut Cursor::new(dark_theme_bytes))
86+
.expect("Failed to load Catppuccin Mocha theme");
87+
let light_theme = ThemeSet::load_from_reader(&mut Cursor::new(light_theme_bytes))
88+
.expect("Failed to load Catppuccin Latte theme");
89+
8490
match theme_mode(QueryOptions::default()) {
8591
Ok(ThemeMode::Dark) => dark_theme,
8692
Ok(ThemeMode::Light) => light_theme,

0 commit comments

Comments
 (0)