Docs

Paste Hook

The paste hook lets you modify the pasted text:

  1. Open the Go → Command Palette... ⇧⌘p and search for "Open Paste Hook". This will create a hook that does nothing but passes the clipboard text as a first argument $1.
  2. Modify the hook and call printf "%s" "with the text that you want inserted". Using printf instead of echo because echo causes problems in some edge cases.

Here is a sample paste hook that replaces the word "Nota" with "the awesome Nota":

#!/bin/bash
# @parameters clipboardText
printf "%s" "${1/Nota/the awesome Nota}"

Paste hook is located at path/to/your/workspace/.nota/hooks/paste.extension (e.g. ~/Dropbox/Nota/.nota/hooks/paste.js).

@parameters

If you aren't familiar with the @parameters syntax, read the article first.

@parameters tells Nota which values to pass to the script:

Ideas for hooks