-
-
Notifications
You must be signed in to change notification settings - Fork 801
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add module to map nerd font symbol names to codepoints
I generated nerdfonts_data.rs with this shell script; it uses `i_all.sh` from the nerdfonts repo to get the base mapping: ``` source ./lib/i_all.sh echo "//! Data mapping nerd font symbol names to their char codepoints" echo "pub const NERD_FONT_GLYPHS: &[(&str, char)] = &[" for var in "${!i@}"; do # trim 'i_' prefix glyph_name=${var#*_} glyph_char=${!var} glyph_code=$(printf "%x" "'$glyph_char'") echo "(\"$glyph_name\", '\u{$glyph_code}'), // $glyph_char" done echo "];" ``` Then intent is to use it in wezterm: ``` local wezterm = require 'wezterm' wezterm.log_info(wezterm.nerdfonts.dev_mozilla) ```
- Loading branch information
Showing
4 changed files
with
3,856 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use std::collections::HashMap; | ||
|
||
lazy_static::lazy_static! { | ||
pub static ref NERD_FONTS: HashMap<&'static str, char> = build_map(); | ||
} | ||
|
||
fn build_map() -> HashMap<&'static str, char> { | ||
crate::nerdfonts_data::NERD_FONT_GLYPHS | ||
.iter() | ||
.map(|tuple| *tuple) | ||
.collect() | ||
} |
Oops, something went wrong.