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-gitignore() { | |
| local api="https://www.toptal.com/developers/gitignore/api" | |
| local gi=$(curl -sfL $api/list | tr "," "\n" | sk --query="$1" -m --preview "curl -sfLw '\n' $api/{} | bat --style=numbers --color=always --language='Git Ignore'") | |
| if [[ $gi ]]; then | |
| for prog in $(echo $gi); do; | |
| curl -sfLw '\n' "$api/$prog" >> .gitignore; | |
| echo "Added $prog to .gitignore"; | |
| done; | |
| fi |
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
| #!/usr/bin/env zsh | |
| keybind_as_widget() { | |
| local hash=$(echo $2 | md5) | |
| local widget_name="__widget_$hash" | |
| eval "function $widget_name() { $2; }" | |
| zle -N $widget_name | |
| bindkey $1 $widget_name | |
| } |
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
| #!/usr/bin/env zsh | |
| # helper functions for https://github.com/Aloxaf/gencomp | |
| clean-gencomp() { | |
| for file in $GENCOMP_DIR/*; do | |
| local cmd=$(basename $file | sed 's/^_//') | |
| command -v $cmd &>/dev/null && continue | |
| echo "Remove completion for $cmd? [y/N]" | |
| read -q |
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; | |
| } |
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
| #!/usr/bin/env python3 | |
| """ | |
| Text Style Converter - Convert plain text to Unicode styled text | |
| Similar to PlainStyle (https://www.shapoco.net/plainstyle/) | |
| """ | |
| import sys | |
| import argparse | |
| from typing import Dict, Callable, Optional, List, Tuple |
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
| # skim-tab: Replace zsh's default completion selection menu with skim! | |
| # Based on fzf-tab by Aloxaf | |
| # temporarily change options | |
| 'builtin' 'local' '-a' '_stb_opts' | |
| [[ ! -o 'aliases' ]] || _stb_opts+=('aliases') | |
| [[ ! -o 'sh_glob' ]] || _stb_opts+=('sh_glob') | |
| [[ ! -o 'no_brace_expand' ]] || _stb_opts+=('no_brace_expand') | |
| 'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand' |
OlderNewer