Advertisement
smeech

Add corrected spellings

Apr 5th, 2024
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.77 KB | Source Code | 0 0
  1.   # Trigger to add corrected spellings to my_spellings.yml
  2.   # Copy incorrect and correct words and type ":sp"
  3.   - trigger: :sp
  4.     replace: "{{output}}"
  5.     vars:
  6.       - name: clip
  7.         type: clipboard
  8.       - name: output
  9.         type: shell
  10.         params:
  11.           shell: bash
  12.           cmd: |
  13.            if [ $(echo "$ESPANSO_CLIP" | wc -w) -ne 2 ]; then exit 0; fi
  14.             first_word=$(echo "$ESPANSO_CLIP" | awk '{print $1}')
  15.             second_word=$(echo "$ESPANSO_CLIP" | awk '{print $2}')
  16.             echo "  - trigger: \"$first_word\"" >> $CONFIG/match/my_spellings.yml
  17.             echo "    replace: \"$second_word\"" >> $CONFIG/match/my_spellings.yml
  18.             echo "    word: true" >> $CONFIG/match/my_spellings.yml
  19.             echo $second_word
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement