Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLOSED] Keyboard shortcut for switching focus between panes #9316

Open
core-ai-bot opened this issue Aug 30, 2021 · 16 comments
Open

[CLOSED] Keyboard shortcut for switching focus between panes #9316

core-ai-bot opened this issue Aug 30, 2021 · 16 comments

Comments

@core-ai-bot
Copy link
Member

Issue by TessaI159
Monday Feb 09, 2015 at 04:49 GMT
Originally opened as adobe/brackets#10555


I'm not sure if somebody else has already submitted this or not, the trello board won't load for me, and I'm not even sure if this the right place to do this but it can't hurt.
I would love to see a keyboard shortcut that would allow me to switch which view is active. I love the vertical split idea so I can see two documents at once, but it seems inconvenient that I need my mouse to switch focus between them.

@core-ai-bot
Copy link
Member Author

Comment by RaymondLim
Monday Feb 09, 2015 at 06:31 GMT


@Tessag159 You can assign them with User Key map easily. Just Select User Key Map from Debug menu and paste the following key bindings. Then, reassign the keys to whatever you want.

        "Ctrl-1": "cmd.splitViewNone",
        "Ctrl-2": "cmd.splitViewVertical",
        "Ctrl-3": "cmd.splitViewHorizontal"

Update: actually, the key bindings above only allow you to switch between different split views, but not to set focus from one view to the other. So we still don't have any command to switch focus between split views.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Monday Feb 09, 2015 at 08:03 GMT


@Tessag159 You can use Ctrl-Tab to navigate between recent documents, including switching across panes. There's also my File Navigation Shortcuts extension, which lets you switch to any open document quickly by typing a few characters of its name.

It should also be pretty easy for someone to write an extension that specifically jumps focus to a given pane (or toggles focus between the two panes -- unlike Ctrl-Tab regardless of whether the other pane's document was recently focused before or not). I'll mark this 'extension idea' in case anyone wants to implement that.

@core-ai-bot
Copy link
Member Author

Comment by JeffryBooher
Monday Feb 09, 2015 at 19:36 GMT


@Tessag159 you could also write an extension which registers a key to toggle between the two panes.

The code below should do it but I haven't tested it. You'll need to wire that up to a keyboard command. For that refer to the hello-world sample: https://github.com/adobe/brackets/wiki/Simple-%22Hello-World%22-extension

function switchPanes() {

    if (MainViewManager.getPaneCount() > 1) {
        var activePane = MainViewManager.getActivePaneId(),
            paneIds = MainViewManager.getPaneIdList(),
            index = paneIds.indexOf(activePane) + 1;

         if (index >= paneIds.length) {
            index = 0;
         }

         MainViewManager.setActivePaneId(paneIds[index]);
    }
}

@core-ai-bot
Copy link
Member Author

Comment by TessaI159
Monday Feb 23, 2015 at 13:37 GMT


Thank you guys so much, I'll get around to seeing if any of these suggestions work just as soon as I can.

@core-ai-bot
Copy link
Member Author

Comment by noragrossman
Monday Mar 09, 2015 at 21:08 GMT


Has anyone done any more work on this? I am a new developer and I thought I'd give this a try, but I don't want to duplicate efforts if an extension is already in progress.

@core-ai-bot
Copy link
Member Author

Comment by TessaI159
Wednesday Mar 11, 2015 at 06:05 GMT


I haven't done anything with it, and I doubt anybody else has either. Go ahead and give it a shot.

@core-ai-bot
Copy link
Member Author

Comment by alexeyoganezov
Tuesday Mar 17, 2015 at 06:42 GMT


I've wrote extremly simple extension for toggling panes:
https://github.com/ivan1810/moving-between-splitted-windows

You can install it through extension manager.
Does it solve your problem?

@core-ai-bot
Copy link
Member Author

Comment by petetnt
Friday Oct 07, 2016 at 13:05 GMT


I'd love to see this feature in the core too. Tagging as starter bug.

@core-ai-bot
Copy link
Member Author

Comment by arthur801031
Monday Oct 24, 2016 at 08:32 GMT


Hi@petetnt , Can I try adding this feature in the core? Thank you!

@core-ai-bot
Copy link
Member Author

Comment by petetnt
Monday Oct 24, 2016 at 08:35 GMT


@arthur801031 Sure thing!

See the article How to hack on Brackets to get started with the Brackets codebase. If you have any questions, feel free to post them here! We also have a Slack channel for day-to-day communication. (You can join by sending a mail to admin@brackets.io with the subject line slack registration request specifying the email addresses you would like to register).

@core-ai-bot
Copy link
Member Author

Comment by arthur801031
Wednesday Oct 26, 2016 at 01:47 GMT


Hi@petetnt I've added this feature in the core. Please let me know if I need to make any changes. Thank you very much.

@core-ai-bot
Copy link
Member Author

Comment by petetnt
Friday Oct 28, 2016 at 08:36 GMT


Fixed/added in #12853

@core-ai-bot
Copy link
Member Author

Comment by ronherrema
Sunday Mar 26, 2017 at 12:33 GMT


It's not clear to me how or where this has been incorporated. Is there now a default shortcut for switching panes?

@core-ai-bot
Copy link
Member Author

Comment by TessaI159
Monday Mar 27, 2017 at 16:21 GMT


Yeah, Brackets updated it so that it is included in the core package now. I believe the shortcut key is Alt + W

@core-ai-bot
Copy link
Member Author

Comment by ronherrema
Monday Mar 27, 2017 at 20:34 GMT


I'm on Mac. There are shortcuts for moving from one document to another in the document list, but I don't see anything for switching between the two open panes.

@core-ai-bot
Copy link
Member Author

Comment by petetnt
Thursday May 11, 2017 at 07:29 GMT


@ronherrema which version of Brackets are you using? Have you tried without extensions? Alt+W works for me on MacOSX with Brackets 1.9 (and latest master).

If it still doesn't work, check the developer tools (Debug -> Show Developer Tools -> Console) if there are any warnings of duplicate keyboard shortcuts. It might also be that another program is blocking the command, in which case you can update the keymap.json to change the shortcut.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant