Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Espanso trigger to autocomplete brackets etc. at the end of a string, on typing double-space.
- # It will fall over if there's a single-quote within the string, however.
- - regex: '(?P<delim>[\[\(\{<"])(?P<string>.+) '
- replace: "{{output}}"
- vars:
- - name: output
- type: script
- params:
- args:
- - python
- - -c
- - |
- closing_chars = { '[': ']',
- '{': '}',
- '(': ')',
- '<': '>',
- '"': '"',
- "'": "'" }
- input_delim = '{{delim}}'
- input_string = r'{{string}}'
- closing_char = closing_chars.get(input_delim)
- print(input_delim + input_string + closing_char)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement