Skip to content

Instantly share code, notes, and snippets.

@smeech
Last active March 13, 2025 17:55
Show Gist options
  • Save smeech/c1e37bb5419b3d4c60dcbf8c926a04b9 to your computer and use it in GitHub Desktop.
Save smeech/c1e37bb5419b3d4c60dcbf8c926a04b9 to your computer and use it in GitHub Desktop.
[HereDoc] Capture clipboard content, preserving quote characters contained, by using the Here-Document method #espanso #bash #sed
# Capture and process clipboard content, preserving quote characters contained,
# by using the Here-Document method.
- trigger: ":dwq"
replace: "{{MyShell}}"
vars:
- name: Clipb
type: clipboard
- name: MyShell
type: shell
params:
cmd: |
cat << 'EOF' | sed -e 's/^>/>>/; t' -e 's/^/> /'
{{Clipb}}
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment