Paste Hook

The paste hook lets you modify the pasted text:

  1. Open the View → Command Palette... p and search for "Open Paste Hook". This will create a hook that does nothing but passes the clipboard text as $1.
  2. Modify the hook and call echo to return the value that will be pasted inside Nota.

Here is an example that replaces the word "Nota" with "the awesome Nota":

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

@parameters

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

Multiple values should be separated by spaces: @parameters selectedText file workspace. This will make $1 the selected text, $2 the currently edited file, and $3 the path to the currently opened workspace.

Ideas for hooks

Related