plugin Brackets Hilite

Plugins for SynWrite and CudaText...
Post Reply
qwerky
Posts: 172
Joined: 21.10.2013 00:58

plugin Brackets Hilite

Post by qwerky »

Very useful plugin. Might be nice to highlight between quotes (") and ('), but it is understandable if this would be difficult, since both the opening and closing character are the same.

Suggestion: It presently has three hotkeys: Goto Matching Bracket, Select Between Brackets (it is inclusive), and Select Inside Brackets (non-inclusive). The last two hotkeys could be combined, so that the first press selects inside the brackets, another press extends the selection to include the brackets, another press goes back to first selection, etc. This could be an additional hotkey, or it could replace the existing two.

It would be great if, when the hotkey is pressed and the cursor is not on a bracket, it would search left/right for the first matching pair, and select that, so that the cursor could be anywhere within a block/string. But understand if this is too complicated.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

Between quotes: often quotes exist in escaped form "test\"string", very often, so not good to make it (and make option: allow escape or not).
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

2) Not too complicated, but what apps have such command (jump to bracket, and then select inside)?
User avatar
kvichans
Posts: 203
Joined: 07.10.2012 05:45

Post by kvichans »

qwerky
See two commands from cuda_ext:
- Expand selection to word or "expression" or (expression)
- Expand and Copy selection to word or "expression" or (expression)

I often use both to do something likes you wish.

Note. The command expand any selection to next level. So its select 1st word, then whole phrase in quotas, then phrase with quotas and so on.
CudaText 1.163, TC9.51x32, Win10x64(1920x1080)
qwerky
Posts: 172
Joined: 21.10.2013 00:58

Post by qwerky »

Alexey wrote:Between quotes: often quotes exist in escaped form "test\"string", very often, so not good to make it (and make option: allow escape or not).
Okay, understood.
qwerky
Posts: 172
Joined: 21.10.2013 00:58

Post by qwerky »

Alexey wrote:2) Not too complicated, but what apps have such command (jump to bracket, and then select inside)?
Don't know of any apps that do this, it was just a thought. Not sure I was clear enough. Not suggesting jump-to and select be combined. Presently there are these three hotkeys:
1. Jump to matching bracket
2. Select between (inside) brackets
3. Select between (including) brackets

My suggestion was to combine 2 and 3 and make it a toggle:
1. Jump to matching bracket
2. Select between (inside) brackets, next press include brackets, next press exclude brackets, etc.
But it's a very small wish. The idea was to save a hotkey, but still have same functionality.
qwerky
Posts: 172
Joined: 21.10.2013 00:58

Post by qwerky »

kvichans wrote:qwerky
See two commands from cuda_ext:
- Expand selection to word or "expression" or (expression)
- Expand and Copy selection to word or "expression" or (expression)

I often use both to do something likes you wish.

Note. The command expand any selection to next level. So its select 1st word, then whole phrase in quotas, then phrase with quotas and so on.
Thanks, kvichans. Yes, that does do it! Select first inside brackets, then expand to include brackets.
Alexey
Posts: 1633
Joined: 05.10.2012 22:10

Post by Alexey »

now plugin shows (with new CudaText 1.61+) current brackets also on gutter.
it shows "(" and ")" on lines, or "()" if both brackets on the same line.

2 screenshots.

this is what Sublime plugins could do but CudaText cannot do for the very long time.
Attachments
bra2.png
bra1.png
Post Reply