hsuanxyz opened a new pull request #3517: [ZEPPELIN-4321] Support shortcuts for 
the paragraphs
URL: https://github.com/apache/zeppelin/pull/3517
 
 
   ### What is this PR for?
   
   
   We are using Angular Latest to refactor Zeppelin's front-end. When 
implementing the features of the shortcuts, we found that the current shortcuts 
is somewhat complicated and did not distinguish the Command/Ctrl key between 
Mac and Windows.
   
   So we compared the following applications:
   
   - [Jupyter](https://github.com/jupyter/jupyter)
   - [JupyterLab](https://github.com/jupyterlab/jupyterlab)
   - [Google Colaboratory](https://colab.research.google.com/)
   
   They can distinguish between edit-mode and command-mode, which will simplify 
the shortcuts complexity. Meanwhile, we use the [Monaco 
editor](https://github.com/microsoft/monaco-editor) in the refactor version, it 
is the core library of [VSCode](https://github.com/microsoft/vscode). We think 
it is a good choice to use its shortcuts design.
   
   Therefore, for the above reasons, we proposed to redesign Zeppelin's 
shortcuts according to the table following.
   
   | Actions                                               | Mode    | Mac      
        | Windows / Linux       | Old(Mac)         |
   
|-------------------------------------------------------|---------|------------------|-----------------------|------------------|
   | Command mode                                          | Edit    | ESC      
        | ESC                   | -                |
   | Edit mode                                             | Command | Enter    
        | Enter                 | -                |
   | Run                                                   | -       | ⇧ + 
Enter        | ⇧ + Enter             | ⇧ + Enter        |
   | Run all below                                         | -       | ⇧ + ⌘ + 
Enter    | ⇧ + Ctrl + Enter      | ⇧ + Ctrl + Enter |
   | Run all above                                         | -       | ⇧ + ⌥ + 
Enter    | ⇧ + Alt + Enter       | ⇧ + Ctrl + Enter |
   | Cancel                                                | -       | ⇧ + ⌘ + 
C        | ⇧ + Ctrl + C          | ⌥ + Ctrl + C     |
   | Switch all line number                                | -       | ⇧ + ⌘ + 
L        | ⇧ + Ctrl + L          | -                |
   | Show / Hide all output                                | -       | ⇧ + ⌘ + 
O        | ⇧ + Ctrl + O          | -                |
   | Show / Hide all title                                 | -       | ⇧ + ⌘ + 
T        | ⇧ + Ctrl + T          | -                |
   | Clear output                                          | -       | ⌘ + ⌥ + 
L        | Ctrl + Alt + L        | ⌥ + Ctrl + L     |
   | Enable/Disable                                        | -       | ⌘ + ⌥ + 
R        | Ctrl + Alt + R        | ⌥ + Ctrl + R     |
   | Reduce width                                          | -       | ⌘ + ⌥ + 
+        | Ctrl + Alt + -        | ⇧ + Ctrl + -     |
   | Increase width                                        | -       | ⌘ + ⌥ + 
-        | Ctrl + Alt + +        | ⇧ + Ctrl + +     |
   | Delete                                                | Command | D, D     
        | D, D                  | ⌥ + Ctrl + D     |
   | Move to up                                            | Command | ⌘ + K / 
Up       | Ctrl + K / Up         | ⌥ + Ctrl + K     |
   | Move to down                                          | Command | ⌘ + J / 
Down     | Ctrl + J / Down       | ⌥ + Ctrl + J     |
   | Select above                                          | Command | K / Up   
        | K / Up                | -                |
   | Select below                                          | Command | J / Down 
        | J / Down              | -                |
   | Switch line number                                    | Command | L        
        | L                     | ⌥ + Ctrl + M     |
   | Show / Hide title                                     | Command | T        
        | T                     | ⌥ + Ctrl + T     |
   | Show / Hide output                                    | Command | O        
        | O                     | ⌥ + Ctrl + O     |
   | Show / Hide editor                                    | Command | E        
        | E                     | ⌥ + Ctrl + E     |
   | Insert above                                          | Command | A        
        | A                     | ⌥ + Ctrl + A     |
   | Insert below                                          | Command | B        
        | B                     | ⌥ + Ctrl + B     |
   | Search                                                | Edit    | ⌘ + F    
        | Ctrl + F              | ⌥ + Ctrl + F     |
   | Increase Indent                                       | Edit    | Tab      
        | Tab                   | -                |
   | Decrease Indent                                       | Edit    | ⇧ + Tab  
        | ⇧ + Tab               | -                |
   | Comment Out / In                                      | Edit    | ⌘ + /    
        | Ctrl + /              | Ctrl + /         |
   | Undo                                                  | Edit    | ⌘ + Z    
        | Ctrl + Z              | Ctrl + Z         |
   | Redo                                                  | Edit    | ⇧ + ⌘ + 
Z        | Ctrl + Y              | -                |
   | Increase font size                                    | Edit    | ⌘ + .    
        | Ctrl + .              | -                |
   | Decrease font size                                    | Edit    | ⌘ + ,    
        | Ctrl + ,              | -                |
   | Decrease Indent                                       | Edit    | ⌘ + [    
        | Ctrl + [              | -                |
   | Increase Indent                                       | Edit    | ⌘ + ]    
        | Ctrl + ]              | -                |
   | Move the line down                                    | Edit    | ⌥ + Down 
        | Alt + Down            | ⌥ + Down         |
   | Move the line up                                      | Edit    | ⌥ + Up   
        | Alt + Up              | ⌥ + Down         |
   | Replace                                               | Edit    | ⌘ + ⌥ + 
F        | Ctrl + F              | -                |
   | Select all                                            | Edit    | ⌘ + A    
        | Ctrl + A              | ⌘ + A            |
   | Select downward                                       | Edit    | ⇧ + Down 
        | ⇧ + Down              | ⇧ + Down         |
   | Select right                                          | Edit    | ⇧ + 
Right        | ⇧ + Right             | ⇧ + Right        |
   | Select left                                           | Edit    | ⇧ + Left 
        | ⇧ + Left              | ⇧ + Left         |
   | Select upward                                         | Edit    | ⇧ + Up   
        | ⇧ + Up                | ⇧ + Up           |
   | Select to the end                                     | Edit    | ⌘ + ⇧ + 
Right    | Alt + ⇧ + Right       | ⌘ + ⇧ + Right    |
   | Select to the start                                   | Edit    | ⌘ + ⇧ + 
Left     | Alt + ⇧ + Left        | ⌘ + ⇧ + Left     |
   | Align text right                                      | Edit    | ⌥ + 
Right        | Ctrl + ⇧ + Right      | ⌥ + Right        |
   | Align text left                                       | Edit    | ⌥ + Left 
        | Ctrl + ⇧ + Left       | ⌥ + Left         |
   | Add multi-cursor above                                | Edit    | ⌘ + ⌥ + 
Up       | Ctrl + Alt + Up       | -                |
   | Add multi-cursor below                                | Edit    | ⌘ + ⌥ + 
Down     | Ctrl + Alt + Down     | -                |
   | Move multi-cursor from current line to the line above | Edit    | ⌘ + ⌥ + 
⇧ + Up   | Ctrl + Alt + ⇧ + Up   | -                |
   | Move multi-cursor from current line to the line below | Edit    | ⌘ + ⌥ + 
⇧ + Down | Ctrl + Alt + ⇧ + Down | -                |
   
   
   ### What type of PR is it?
   [Feature]
   
   ### Todos
   * [ ] - Task
   
   ### What is the Jira issue?
   
   https://issues.apache.org/jira/browse/ZEPPELIN-4402
   
   ### How should this be tested?
   * First time? Setup Travis CI as described on 
https://zeppelin.apache.org/contribution/contributions.html#continuous-integration
   * Strongly recommended: add automated unit tests for any new or changed 
behavior
   * Outline any manual steps to test the PR here.
   
   ### Screenshots (if appropriate)
   
   ### Questions:
   * Does the licenses files need update? No
   * Is there breaking changes for older versions? No
   * Does this needs documentation? No
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to