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

Added Support for VScode keymap in Netbeans IDE for windows and mac #6458 #8200

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Keymaps/NetBeans55=NetBeans 5.5
Keymaps/NetBeans=NetBeans
Keymaps/Eclipse=Eclipse
Keymaps/Idea=Idea
Keymaps/VSCode=VSCode

# Coloring profile names
Editors/FontsColors/NetBeans55=NetBeans 5.5
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.

-->



<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE bindings PUBLIC "-//NetBeans//DTD Editor KeyBindings settings 1.1//EN" "http://www.netbeans.org/dtds/EditorKeyBindings-1_1.dtd">

<!--
IMPORTANT: This file modifies keybindings from VSCode-keybindings.xml to make them work on Mac OS.
-->

<bindings>
<!-- Things we add that replace standard keybindings -->

<!-- Basic Navigation -->
<bind key="C-HOME" remove="true"/>
<bind actionName="caret-begin" key="M-UP"/>

<bind key="C-END" remove="true"/>
<bind actionName="caret-end" key="M-DOWN"/>

<!-- Word Navigation -->
<bind key="C-LEFT" remove="true"/>
<bind key="A-LEFT" actionName="caret-previous-word"/>

<bind key="C-RIGHT" remove="true"/>
<bind key="A-RIGHT" actionName="caret-next-word"/>

<!-- Word Deletion -->
<bind key="C-DELETE" remove="true"/>
<bind actionName="remove-word-next" key="A-DELETE"/>

<bind key="C-BACK_SPACE" remove="true"/>
<bind actionName="remove-word-previous" key="A-BACK_SPACE"/>

<!-- Selection -->
<bind key="CS-LEFT" remove="true"/>
<bind key="AS-LEFT" actionName="selection-previous-word"/>

<bind key="CS-RIGHT" remove="true"/>
<bind key="AS-RIGHT" actionName="selection-next-word"/>

<!-- Mac-specific bindings -->
<bind actionName="copy-to-clipboard" key="D-C"/>
<bind actionName="cut-to-clipboard" key="D-X"/>
<bind actionName="paste-from-clipboard" key="D-V"/>
<bind actionName="select-all" key="D-A"/>

<!-- Find and Replace -->
<bind key="C-F" remove="true"/>
<bind actionName="find" key="D-F"/>

<bind key="C-H" remove="true"/>
<bind actionName="replace" key="D-H"/>

<bind key="F3" remove="true"/>
<bind key="D-G" actionName="find-next"/>

<bind key="S-F3" remove="true"/>
<bind key="DS-G" actionName="find-previous"/>

<!-- Line Operations -->
<bind actionName="move-selection-else-line-down" key="A-DOWN"/>
<bind actionName="move-selection-else-line-up" key="A-UP"/>
<bind actionName="copy-selection-else-line-down" key="SA-DOWN"/>
<bind actionName="copy-selection-else-line-up" key="SA-UP"/>

<!-- Code Folding -->
<bind actionName="collapse-fold" key="MA-LEFT"/>
<bind actionName="expand-fold" key="MA-RIGHT"/>
<bind actionName="collapse-all-folds" key="D-K D-0"/>
<bind actionName="expand-all-folds" key="D-K D-J"/>

<!-- Comments -->
<bind actionName="toggle-comment" key="D-SLASH"/>
<bind actionName="toggle-block-comment" key="SA-A"/>

<!-- Multi-cursor -->
<bind actionName="select-next-parameter" key="D-D"/>
<bind actionName="selection-grow" key="CS-RIGHT"/>
<bind actionName="selection-shrink" key="CS-LEFT"/>

<!-- Editor Management -->
<bind actionName="close" key="D-W"/>
<bind actionName="split-editor" key="D-BACK_SLASH"/>

<!-- Rich Language Features -->
<bind actionName="completion-show" key="C-SPACE"/>
<bind actionName="completion-show" key="D-I"/>
<bind actionName="format" key="SA-F"/>

<!-- Debug -->
<bind actionName="toggle-breakpoint" key="F9"/>
<bind actionName="debug" key="F5"/>
<bind actionName="debug-step-over" key="F10"/>
<bind actionName="debug-step-into" key="F11"/>
<bind actionName="debug-step-out" key="S-F11"/>

<!-- Terminal -->
<bind actionName="terminal-show" key="C-BACK_QUOTE"/>
<bind actionName="terminal-new" key="CS-BACK_QUOTE"/>

<!-- Settings and Command Palette -->
<bind actionName="show-command-palette" key="DS-P"/>
<bind actionName="preferences-show" key="D-COMMA"/>
</bindings>

112 changes: 112 additions & 0 deletions ide/defaults/src/org/netbeans/modules/defaults/VSCode-keybindings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.

-->



<!DOCTYPE bindings PUBLIC "-//NetBeans//DTD Editor KeyBindings settings 1.1//EN" "http://www.netbeans.org/dtds/EditorKeyBindings-1_1.dtd">
<bindings>
<!-- Basic editing -->
<bind actionName="cut-to-clipboard" key="C-X"/>
<bind actionName="copy-to-clipboard" key="C-C"/>
<bind actionName="paste-from-clipboard" key="C-V"/>
<bind actionName="move-selection-else-line-down" key="A-DOWN"/>
<bind actionName="move-selection-else-line-up" key="A-UP"/>
<bind actionName="copy-selection-else-line-down" key="SA-DOWN"/>
<bind actionName="copy-selection-else-line-up" key="SA-UP"/>
<bind actionName="remove-line" key="CS-K"/>
<bind actionName="start-new-line" key="C-ENTER"/>
<bind actionName="insert-break-above" key="CS-ENTER"/>
<bind actionName="match-brace" key="CS-BACK_SLASH"/>
<bind actionName="indent" key="C-CLOSE_BRACKET"/>
<bind actionName="unindent" key="C-OPEN_BRACKET"/>
<bind actionName="caret-begin-line" key="HOME"/>
<bind actionName="caret-end-line" key="END"/>
<bind actionName="caret-begin" key="C-HOME"/>
<bind actionName="caret-end" key="C-END"/>
<bind actionName="scroll-up" key="C-UP"/>
<bind actionName="scroll-down" key="C-DOWN"/>
<bind actionName="page-up" key="A-PAGE_UP"/>
<bind actionName="page-down" key="A-PAGE_DOWN"/>

<!-- Code folding -->
<bind actionName="collapse-fold" key="CS-OPEN_BRACKET"/>
<bind actionName="expand-fold" key="CS-CLOSE_BRACKET"/>
<bind actionName="collapse-all-folds" key="C-K C-OPEN_BRACKET"/>
<bind actionName="expand-all-folds" key="C-K C-CLOSE_BRACKET"/>

<!-- Comments -->
<bind actionName="toggle-comment" key="C-SLASH"/>
<bind actionName="toggle-comment" key="C-K C-C"/>
<bind actionName="remove-comment" key="C-K C-U"/>
<bind actionName="toggle-block-comment" key="SA-A"/>

<!-- Search and navigation -->
<bind actionName="find" key="C-F"/>
<bind actionName="replace" key="C-H"/>
<bind actionName="find-next" key="F3"/>
<bind actionName="find-previous" key="S-F3"/>
<bind actionName="find-selection" key="C-F3"/>
<bind actionName="goto" key="C-G"/>
<bind actionName="goto-declaration" key="F12"/>
<bind actionName="goto-source" key="A-F12"/>
<bind actionName="goto-implementation" key="C-F12"/>

<!-- Multi-cursor and selection -->
<bind actionName="select-word" key="C-D"/>
<bind actionName="select-next-parameter" key="C-L"/>
<bind actionName="select-all" key="C-A"/>
<bind actionName="selection-grow" key="SA-RIGHT"/>
<bind actionName="selection-shrink" key="SA-LEFT"/>

<!-- Editor management -->
<bind actionName="close" key="C-F4"/>
<bind actionName="close" key="C-W"/>
<bind actionName="split-editor" key="C-BACK_SLASH"/>

<!-- Rich language features -->
<bind actionName="completion-show" key="C-SPACE"/>
<bind actionName="completion-show" key="C-I"/>
<bind actionName="parameter-hints-show" key="CS-SPACE"/>
<bind actionName="format" key="SA-F"/>
<bind actionName="fix-imports" key="C-DOT"/>

<!-- Refactoring -->
<bind actionName="rename" key="F2"/>
<bind actionName="refactor-quickmenu" key="C-DOT"/>
Comment on lines +90 to +94
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C-DOT doesn't appear to be a valid keystroke, what would work is C-PERIOD

also: the same keystroke is used for two refactoring actions which is not ideal


<!-- Debug -->
<bind actionName="toggle-breakpoint" key="F9"/>
<bind actionName="debug" key="F5"/>
<bind actionName="debug-step-over" key="F10"/>
<bind actionName="debug-step-into" key="F11"/>
<bind actionName="debug-step-out" key="S-F11"/>

<!-- IDE features -->
<bind actionName="show-command-palette" key="CS-P"/>
<bind actionName="show-command-palette" key="F1"/>
<bind actionName="quick-open" key="C-P"/>
<bind actionName="preferences-show" key="C-COMMA"/>

<!-- Terminal -->
<bind actionName="terminal-show" key="C-BACK_QUOTE"/>
<bind actionName="terminal-new" key="CS-BACK_QUOTE"/>
</bindings>
Loading
Loading