You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 lines
335 B
Plaintext

2 years ago
# 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
}