Is it possible to modify Obsidian's default behavior with code?

Yes, that’s very easy. Turn on this option in Quick Switcher settings:

1 Like