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

Change default keyboard shortcuts for macOS #10854

Open
goanpeca opened this issue Nov 26, 2019 · 8 comments
Open

Change default keyboard shortcuts for macOS #10854

goanpeca opened this issue Nov 26, 2019 · 8 comments

Comments

@goanpeca
Copy link
Member

goanpeca commented Nov 26, 2019

On a macbook pro some of the default keyboard shortcuts of Spyder collide with "normal" functions on OSX.

Home/End (Command+Up, Command+Down) are taken by Move to previous/next cell.

Also, moving to the start and end of a file (Command+Left, Command+Right) is taken by move to next/previous word, which on Mac make more sense to use Opt/Alt+Left, Opt/Alt+Right, instead of command.

I suggest changing this default shortcuts to things that make sense on Mac

Document shortcuts
The behavior of these shortcuts may vary with the app you're using.

Command-B: Boldface the selected text, or turn boldfacing on or off. 
Command-I: Italicize the selected text, or turn italics on or off.
Command-K: Add a web link.
Command-U: Underline the selected text, or turn underlining on or off.
Command-T: Show or hide the Fonts window.
Command-D: Select the Desktop folder from within an Open dialog or Save dialog.
Control-Command-D: Show or hide the definition of the selected word.
Shift-Command-Colon (:): Display the Spelling and Grammar window.
Command-Semicolon (;): Find misspelled words in the document.
Option-Delete: Delete the word to the left of the insertion point.
Control-H: Delete the character to the left of the insertion point. Or use Delete.
Control-D: Delete the character to the right of the insertion point. Or use Fn-Delete.
Fn-Delete: Forward delete on keyboards that don't have a Forward Delete   key. Or use Control-D.
Control-K: Delete the text between the insertion point and the end of the line or paragraph.
Fn–Up Arrow: Page Up: Scroll up one page. 
Fn–Down Arrow: Page Down: Scroll down one page.
Fn–Left Arrow: Home: Scroll to the beginning of a document.
Fn–Right Arrow: End: Scroll to the end of a document.
Command–Up Arrow: Move the insertion point to the beginning of the document.
Command–Down Arrow: Move the insertion point to the end of the document.
Command–Left Arrow: Move the insertion point to the beginning of the current line.
Command–Right Arrow: Move the insertion point to the end of the current line.
Option–Left Arrow: Move the insertion point to the beginning of the previous word.
Option–Right Arrow: Move the insertion point to the end of the next word.
Shift–Command–Up Arrow: Select the text between the insertion point and the beginning of the document.
Shift–Command–Down Arrow: Select the text between the insertion point and the end of the document.
Shift–Command–Left Arrow: Select the text between the insertion point and the beginning of the current line.
Shift–Command–Right Arrow: Select the text between the insertion point and the end of the current line.
Shift–Up Arrow: Extend text selection to the nearest character at the same horizontal location on the line above.
Shift–Down Arrow: Extend text selection to the nearest character at the same horizontal location on the line below.
Shift–Left Arrow: Extend text selection one character to the left.
Shift–Right Arrow: Extend text selection one character to the right.
Option–Shift–Up Arrow: Extend text selection to the beginning of the current paragraph, then to the beginning of the following paragraph if pressed again.
Option–Shift–Down Arrow: Extend text selection to the end of the current paragraph, then to the end of the following paragraph if pressed again.
Option–Shift–Left Arrow: Extend text selection to the beginning of the current word, then to the beginning of the following word if pressed again.
Option–Shift–Right Arrow: Extend text selection to the end of the current word, then to the end of the following word if pressed again.
Control-A: Move to the beginning of the line or paragraph.
Control-E: Move to the end of a line or paragraph.
Control-F: Move one character forward.
Control-B: Move one character backward.
Control-L: Center the cursor or selection in the visible area.
Control-P: Move up one line.
Control-N: Move down one line.
Control-O: Insert a new line after the insertion point.
Control-T: Swap the character behind the insertion point with the character in front of the insertion point.
Command–Left Curly Bracket ({): Left align.
Command–Right Curly Bracket (}): Right align.
Shift–Command–Vertical bar (|): Center align.
Option-Command-F: Go to the search field. 
Option-Command-T: Show or hide a toolbar in the app.
Option-Command-C: Copy Style: Copy the formatting settings of the selected item to the Clipboard.
Option-Command-V: Paste Style: Apply the copied style to the selected item.
Option-Shift-Command-V: Paste and Match Style: Apply the style of the surrounding content to the item pasted within that content.
Option-Command-I: Show or hide the inspector window.
Shift-Command-P:  Page setup: Display a window for selecting document settings.
Shift-Command-S: Display the Save As dialog, or duplicate the current document.
Shift–Command–Minus sign (-): Decrease the size of the selected item.
Shift–Command–Plus sign (+): Increase the size of the selected item. Command–Equal sign (=) performs the same function.
Shift–Command–Question mark (?): Open the Help menu.
@ccordoba12
Copy link
Member

I think this depends on the second set of shortcuts @jnsebgosselin is working on, right?

Or do you prefer to have the shortcuts above as the primary ones in macOS?

@goanpeca
Copy link
Member Author

Or do you prefer to have the shortcuts above as the primary ones in macOS?

I think they should be the primary one, because the point is to have the "normal" mac commands first. Also having an additional set of shortcuts would not help as they are currently colliding with the default Mac actions.

Any thoughts here @impact27 ?

@goanpeca
Copy link
Member Author

As in it is very annoying not being able to move to the start or end of file with Cmd+Up/Cmd+Down as in any other IDE/TexteEditor on mac

@ccordoba12 ccordoba12 modified the milestones: future, 4.1.0 Nov 27, 2019
@impact27
Copy link
Contributor

I agree that we should follow the guidlines for shortcuts (https://developer.apple.com/design/human-interface-guidelines/macos/user-interaction/keyboard/) and user expectations as a default. The Windows shortcuts should be an option.

For example, from the guidelines for Up arrow:

Shift-Control-Up arrow | ● | Extend selection upward in the next semantic unit, typically the beginning of the document.

  • Doesn't do anything

Shift-Up arrow | ● | Extend selection to the line above, to the nearest character boundary at the same horizontal location.

  • Works

Option-Shift-Up arrow | ● | Extend selection to the beginning of the current paragraph, then to the beginning of the next paragraph.

  • duplicates the current line

Control-Up arrow | ● | Move focus to another value or cell within a view, such as a table.

  • Moves to the beginning of the document

And not in the guidelines, but present in apple apps such as textedit:
Cmd+Up : Move to the beginning of the document

  • Moves to the previous cell

@ccordoba12
Copy link
Member

Ok, then I agree with this. @goanpeca, please evaluate if we can do this for 4.1 or we should leave it for 5.

@ccordoba12 ccordoba12 changed the title Default shortcuts for mac Change default keyboard shortcuts for macOS Nov 27, 2019
@goanpeca goanpeca self-assigned this Nov 30, 2019
@goanpeca goanpeca removed this from the v4.2.0 milestone Feb 19, 2020
@goanpeca goanpeca removed their assignment Jul 20, 2020
@johnduva
Copy link

Hey guys,
Any reason this wasn't followed through on? I'm using 5.0.2 and Cmd+Left Arrow still doesn't move to the beginning of the word (nor does Cmd+Up move to the beginning of the doc). Is there user setting I can change to override this or something?
Thanks!

@shenghxie
Copy link

I am also curious about the progress, as this is the single most reason I switched back to VSCode, which their interactive window I personally dislike.

@ccordoba12
Copy link
Member

@7hx1e, unfortunately we haven't had time to work on this.

@impact27, any chance you have some free time to help us this one? If not, I'm afraid it'll have to wait until Spyder 6.

@ccordoba12 ccordoba12 added this to the important milestone Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants