필터 지우기
필터 지우기

Change keyboard shortcut for "Duplicate Line(s)"

조회 수: 3 (최근 30일)
ed
ed 2022년 3월 24일
답변: Simar 2023년 10월 4일
If I select a section of text and right-click on it I get the option to "Duplicate Line(s)", and it has a keyboard shortcut (on mac it's "shift-command-c"). How can I change this shortcut? I want the shortcut to be the same as my other software. I can't find this option under Preferences > Keyboard > Shortcuts.
I'm using 2022a.

답변 (1개)

Simar
Simar 2023년 10월 4일
Hi ed,
It is my understanding that you want to change Duplicate Lines Shortcut.
In MATLAB 2022a, the ability to customize keyboard shortcuts for specific editor actions is not available in the Preferences menu. However, you can achieve this customization by manually modifying the MATLAB keyboard shortcut configuration file. Here is how you can do it:
1.Locate the MATLAB keyboard shortcut configuration file. On macOS, the file is typically located at: /Applications/MATLAB_R2022a.app/toolbox/matlab/ide/keyboard_shortcuts.json
2. Open the ‘keyboard_shortcuts.json’ file in a text editor.
3.Search for the section that contains the "Duplicate Line(s)" action. It should look something like this:
{
"Category": "Editor",
"Action": "EditorDuplicateLines",
"Shortcut": "Shift + Command + C"
}
4. Modify the "Shortcut" field to your desired keyboard shortcut. For example, if you want to change it to "Shift+ Command + D", update the line to:
"Shortcut": "Shift + Command + D"
5.Save the ‘keyboard_shortcuts.json’ file.
6. Restart MATLAB for the changes to take effect.
After following these steps, the "Duplicate Line(s)" action should now have your desired keyboard shortcut.
Please note that modifying keyboard shortcuts configuration file is an advanced customization technique, and it is always a good idea to make a backup of the original file before making any changes.
You can also refer to the following links below:
Best Regards,
Simar

카테고리

Help CenterFile Exchange에서 Desktop에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by