Auto_close curly quotes: how to set up?

Post Reply
dajare
Posts: 3
Joined: 03.11.2022 16:15
Location: UK

Auto_close curly quotes: how to set up?

Post by dajare »

I would like CudaText to automatically insert the appropriate `rquo` when I type the `lquo`: so `“` would be paired with `”`, and `‘` with `’`.

I'm guessing this could be done in the `auto_close_brackets` user setting, but I can't seem to get this to work. Any help would be appreciated!
main Alexey
Posts: 2788
Joined: 25.08.2021 18:15

Re: Auto_close curly quotes: how to set up?

Post by main Alexey »

option "auto_close_brackets" don't support these chars: “ or ‘.
on usual keyboard we don't have chars “ or ‘.
so even if I add support for these 2 chars, people cannot type them. I can only copy/paste them or use the plugin Snippet_Panel which have these 2 chars.
do you have special keyboard with these 2 quotes?
main Alexey
Posts: 2788
Joined: 25.08.2021 18:15

Re: Auto_close curly quotes: how to set up?

Post by main Alexey »

asked the AI about keyboards which support such quotes. they exist. so I added support for these 2 pairs to the option "auto_close_brackets". will be in the update.

Code: Select all

  //Auto-pair some chars on typing.
  //Value must have some of supported chars without spaces:
  //  ( [ { < ' " ` ~ * # “ ‘
  //(Don't forget that JSON file needs "-char in escaped form.)
  //Auto-pairing doesn't work on backslash-escaped chars.
  //Auto-pairing doesn't work if after caret is a word char.
  "auto_close_brackets": "([{\"", 
dajare
Posts: 3
Joined: 03.11.2022 16:15
Location: UK

Re: Auto_close curly quotes: how to set up?

Post by dajare »

Thanks for adding this to the next update! (I'm still not sure how to tweak my user options to include this, but I can wait. :))

For info: I use both Ubuntu and MacOS: in Ubuntu I have set up with X-Compose enabled, so typing AltGr+b = “, AltGr+n = ”, and adding SHIFT gets single quotes.

On MacOS, ALT+[ = “ and ALT+SHIFT+[ = ”, the squos are on `]` with equivalent modifier keys. (Most OS's, I think, have shortcuts like this for other kinds of quotes: «», <>, etc.)
main Alexey
Posts: 2788
Joined: 25.08.2021 18:15

Re: Auto_close curly quotes: how to set up?

Post by main Alexey »

After update to 1.230.5 (or newer) you will write this option to user.json:

Code: Select all

  "auto_close_brackets": "([{\"\u201c\u2018\u00ab",
\u codes are for 3 new supported opening-chars, “ ‘ «

why I did not add chars by default? to not save these weird \u codes into default.json, seems they are needed because plugin Options_Editor_Lite wrote them for me.
main Alexey
Posts: 2788
Joined: 25.08.2021 18:15

Re: Auto_close curly quotes: how to set up?

Post by main Alexey »

here is beta version, linux-gtk2 (for Ubuntu better to use GTK2 version),
add 'x' permission for the 'cudatext' file.
https://github.com/Alexey-T/CudaText/di ... t-15174347
dajare
Posts: 3
Joined: 03.11.2022 16:15
Location: UK

Re: Auto_close curly quotes: how to set up?

Post by dajare »

main Alexey wrote: 05.12.2025 16:04 here is beta version, linux-gtk2 (for Ubuntu better to use GTK2 version),
add 'x' permission for the 'cudatext' file.
https://github.com/Alexey-T/CudaText/di ... t-15174347
Beautiful! :D Many thanks for adding this. For me (and I hope for others) it is a valuable enhancement.
Post Reply