snippet fix

This commit is contained in:
Yax 2022-06-08 14:50:17 +02:00
parent 0284cdac52
commit d0f3684cd5
2 changed files with 11 additions and 0 deletions

View file

@ -0,0 +1,8 @@
# edit single line snippet
cfg-snippetrc() { $EDITOR ~/.snippetrc ;}
fzf-snippet() {
selected="$(cat ~/.snippetrc | sed '/^$/d' | sort -n | fzf -e -i )"
# remove tags, leading and trailing spaces, also no newline
echo "$selected" | sed -e s/\;\;\.\*\$// | sed 's/^[ \t]*//;s/[ \t]*$//' | tr -d '\n' | xclip -selection clipboard
}