Skip to content

[FEATURE]: add hotkeys to set up custom actions inside code editor #175

Description

@Falcion

Contact details

No response

What the essence of your feature request

Currently, there are multiple hotkeys to be "fixed" - we already have "force vanilla paste" feature which forces Ctrl+V, we hard-code "Shift+INSERT" hotkey and etc. In the last issue #171, it is revealed that some of the hotkeys (Ctrl+F to "Find" i.e.) work with ALT command (Ctrl+ALT+F).

const modEnabled = event.ctrlKey || event.metaKey;

const KEYMAP = new Map<string, string>([
    ['f', 'actions.find'],
    ['h', 'editor.action.startFindReplaceAction'],
    ['/', 'editor.action.commentLine'],
    ['Enter', 'editor.action.insertLineAfter'],
    ['[', 'editor.action.outdentLines'],
    [']', 'editor.action.indentLines'],
    ['d', 'editor.action.copyLinesDownAction'],
]);

if (modEnabled) {
    const trigger_name = KEYMAP.get(event.key);
    // ...

Currently, all commands are "hard-coded" to trigger:

// Bind custom paste handler to Ctrl+V (or Cmd+V on Mac)
if (this.plugin.settings.code_editor_settings.force_vanilla_paste) {
    this.monacoEditor.addCommand(
        monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyV,
        () => this.customHandlePaste()
    );
}

// Bind custom paste handler to Shift+Insert
this.monacoEditor.addCommand(
    monaco.KeyMod.Shift | monaco.KeyCode.Insert,
    () => this.customHandlePaste()
);

On what OS you want to maintain your request.

Windows, Linux

Code of conduct

  • I agree to follow this project's code of conduct

Issue policy

  • I agree to follow this project's issue policy

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions