Skip to content

Instantly share code, notes, and snippets.

@GeneralD
Created April 12, 2025 04:24
Show Gist options
  • Save GeneralD/9184e73dd75fa816cc889ec1ff2726d4 to your computer and use it in GitHub Desktop.
Save GeneralD/9184e73dd75fa816cc889ec1ff2726d4 to your computer and use it in GitHub Desktop.
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