Exiting automatic pairing with the tab key

In some text editors, the tab key completes a string or action for you. In Obsidian it would be fluid for this to happen:

  • Type a [
  • A closing bracket is automatically appended and the cursor remains between the brackets
  • The user types within the brackets
  • When the user is done the user can type the Tab key which places the cursor outside of the closing bracket

The same would apply to other similar auto pairing patterns, like **. “”, and so on. I believe it’s easy for the Tab key action to deviate from normal behavior by analyzing the context.

16 Likes

Want to second this request. It would really help with not having to move hands out to the arrow section while typing.

1 Like

Sorry for the slight diversion of discussion, but I just realized that when Obsidian automatically pairs parentheses, brackets, asterisks, quotes, etc, you can still manually close them yourself and it will simply type right over the generated auto paired characters. Just thought I’d share that since it is somewhat relevant here. Unfortunately I couldn’t find the topic where someone like myself was a little frustrated with having to resist manually closing them on their own. Hope this helps another person with stubborn muscle memory that has yet to realize this yet.

Thanks.

2 Likes

Someone in the Obsidian community told me about this plugin that might help: GitHub - phibr0/obsidian-tabout: A port of VSCode's Tabout for Obsidian.

It allows you to use Tab to jump to the end of an automatic pair.

1 Like

This plugin doesn’t work for parentheses ( ) for example, as the detection requires a CodeMirror token for the environment (like “strong” for xyz, “hmd-internal-link” for [[xyz]] etc.).

Parentheses however seem to just be in the Document environment, so trying to enable tabout for parentheses using this plugin would cause any tab keypress outside of a link or “open and closed” Markdown formatting to skip to the next closing bracket, not ideal :scream:

This seems like a very basic feature to add alongside auto pair brackets. It should be a part of the core functionality IMO.

3 Likes

yeah, the Tabout plugin no longer works and hasn’t been updated in two years, which is a shame.

It would be great if this was just a built-in feature in Obsidian.
This thread has seen over 1K views, but not enough people are “liking” it to push it up.

2 Likes

I’m going to amend my comment above.

The plugin does work, it just doesn’t work straight out of the box.

You need to delete all the existing rules and re-add them using the “Add Rule for this Environment” command.

Of course, we’d still run into the issue mentioned by joelmurphy444, but in a pinch this is better than nothing.

1 Like

Thanks for all the comments and suggestions. I am well aware of the competition for new features but this one seems like such an elementary and simple and productive feature to add as default to the app. Those who like the existing behavior, well, a preference can naturally be set for that.

1 Like

The way it currently works actually seems more difficult since you have to find the arrow keys. So somehow its actually easier to just type the closing key yourself. Glad that works just fine and doesn’t add repeated end brackets. But then it makes me wonder what the original use case was for in the first place? Is it something helpful with code only? Some type of universal TAB out would make it all make sense to me though.

1 Like

+1 on this: when you go to link a note via “[[”, it would be great if clicking tab on the note you’re trying to link not only filled in the rest of the title of the note, but also placed the cursor outside the closing brackets.

1 Like

Use enter for this purpose.
With tab you complete but are still inside so you can add # or ^ for heading or block links and | for alias

1 Like