Skip to content

Option to let brackets end words, or add spaces when autocompleting brackets #2311

@cauchy-schwartz

Description

@cauchy-schwartz

Describe the feature and the current behavior/state

I heavily use a shortcut (Tab) for 'Next placeholder or one word right'. However, if I use another shortcut to autocomplete brackets, I end up with this taking me outside the bracket, which often interrupts my flow because I have to move back inside the bracket.

For example, if I want to type \abs{x_{1}+x_{2}}, I want to do it like this:

  1. \abs + enter (selects from drop-down menu, creates \abs{} and moves cursor in between the brackets)
  2. x + Ctrl+Shift+D+1 (to type subscript)
  3. Tab (move cursor out of curly subscript bracket)
  4. + + x + Ctrl+Shift+D+2

However, right now, at step 3, where I've typed \abs{x_{1}} and my cursor is inside both brackets, pressing Tab will take me out of both brackets, since there is no space between them. In principle, I could skip to next character in the cases where there is no space, but in some other cases like the math mode shortcuts, TeXStudio automatically adds spaces, so there I really need to skip to next word and not just next character. Having to think constantly about which to use is heavily disruptive.

One of the two following additions would solve this issue for me:

  1. a variant of 'Next placeholder or one word right' which considers any end bracket, i.e. (, [ or {, word-ending, or
  2. an option to automatically insert spaces on each side of brackets (and symbols enclosing expressions like brackets, e.g. $) when they're added in math mode.

Maybe this could also be solved with a macro, but I'm not really familiar with what is possible with macros in TeXstudio. Please tell me if you can think of some such macro.

Who will benefit with this feature?

Anyone using the 'Next placeholder or one word right' shortcut and TeXStudio's intelligent typing functions extensively

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions