Created
April 12, 2025 04:24
-
-
Save GeneralD/9184e73dd75fa816cc889ec1ff2726d4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function skim-nerdfont() { | |
(( $+commands[ascii2uni] )) || { echo "ascii2uni is not installed"; return 1; } | |
(( $+commands[rg] )) || { echo "rg is not installed"; return 1; } | |
local list=$(curl -s https://www.nerdfonts.com/cheat-sheet | rg '^ *\"(.+)\"\: ?\"([a-f0-9]{4})\",?$' --color=never --replace '\u$2 $1' | ascii2uni -a U -q) | |
local select=$(echo $list | sk --query="$1" --multi) | |
echo $select | awk '{print $1}' | tr '\n' ' ' | pbcopy | |
zle reset-prompt; | |
} | |
zle -N skim-nerdfont | |
bindkey '^zn' skim-nerdfont |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment