-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Keyboard shortcut for switching focus between panes #10555
Comments
@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.
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. |
@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. |
@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 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]);
}
} |
Thank you guys so much, I'll get around to seeing if any of these suggestions work just as soon as I can. |
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. |
I haven't done anything with it, and I doubt anybody else has either. Go ahead and give it a shot. |
I've wrote extremly simple extension for toggling panes: You can install it through extension manager. |
I'd love to see this feature in the core too. Tagging as starter bug. |
Hi @petetnt , Can I try adding this feature in the core? Thank you! |
@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 |
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. |
* Added the feature to toggle between panes as requested by petetnt in issues #10555 * Added the feature to toggle between panes as requested by petetnt in issues #10555 * Bumping version Number to 1.9 * Edited the files and added a unit test for this feature as requested by petetnt and swmitra * Removed duplicate/unnecessary code in Pane.js * Removed additional duplicate/unnecessary code in Pane.js * Edited 'should switch pane when alt-w is pressed' function in MainViewManager-test.js and the test is now passing * Revert package.json and src/config.json to previous commit * Added the feature to toggle between panes as requested by petetnt in issues #10555 * Added the feature to toggle between panes as requested by petetnt in issues #10555 * Edited the files and added a unit test for this feature as requested by petetnt and swmitra * Removed duplicate/unnecessary code in Pane.js * Removed additional duplicate/unnecessary code in Pane.js * Edited 'should switch pane when alt-w is pressed' function in MainViewManager-test.js and the test is now passing * Revert package.json and src/config.json to previous commit * Modified test code to test CMD_SWITCH_PANE_FOCUS * Removed unnecessary code in MainViewManager-test.js
Fixed/added in #12853 |
It's not clear to me how or where this has been incorporated. Is there now a default shortcut for switching panes? |
Yeah, Brackets updated it so that it is included in the core package now. I believe the shortcut key is Alt + W |
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. |
@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. |
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.
The text was updated successfully, but these errors were encountered: