Repository: marktext/marktext
File: src/main/shortcutHandler.js (JavaScript)

Code before:
      ['paragraphHeading1', 'CmdOrCtrl+1'],
      ['paragraphHeading2', 'CmdOrCtrl+2'],
      ['paragraphHeading3', 'CmdOrCtrl+3'],
      ['paragraphHeading4', 'CmdOrCtrl+4'],
      ['paragraphHeading5', 'CmdOrCtrl+5'],
      ['paragraphHeading6', 'CmdOrCtrl+6'],
      ['paragraphUpgradeHeading', 'CmdOrCtrl+='],
      ['paragraphDegradeHeading', 'CmdOrCtrl+-'],
      ['paragraphTable', 'CmdOrCtrl+T'],
      ['paragraphCodeFence', 'CmdOrCtrl+Alt+C'],
      ['paragraphQuoteBlock', 'CmdOrCtrl+Alt+Q'],
      ['paragraphMathBlock', 'CmdOrCtrl+Alt+M'],
      ['paragraphHtmlBlock', isOsx ? 'CmdOrCtrl+Alt+J' : 'CmdOrCtrl+Alt+H'],
      ['paragraphOrderList', 'CmdOrCtrl+Alt+O'],
      ['paragraphBulletList', 'CmdOrCtrl+Alt+U'],
      ['paragraphTaskList', 'CmdOrCtrl+Alt+X'],
      ['paragraphLooseListItem', 'CmdOrCtrl+Alt+L'],
      ['paragraphParagraph', 'CmdOrCtrl+0'],
      ['paragraphHorizontalLine', 'CmdOrCtrl+Alt+-'],
      ['paragraphYAMLFrontMatter', 'CmdOrCtrl+Alt+Y'],

      // format menu
      ['formatStrong', 'CmdOrCtrl+B'],
      ['formatEmphasis', 'CmdOrCtrl+I'],
      ['formatInlineCode', 'CmdOrCtrl+`'],
      ['formatStrike', 'CmdOrCtrl+D'],
      ['formatHyperlink', 'CmdOrCtrl+L'],
      ['formatImage', 'CmdOrCtrl+Shift+I'],
      ['formatClearFormat', 'Shift+CmdOrCtrl+R'],

      // window menu
      ['windowMinimize', 'CmdOrCtrl+M'],
      ['windowCloseWindow', 'CmdOrCtrl+Shift+W'],

      // view menu
      ['viewToggleFullScreen', isOsx ? 'Ctrl+Command+F' : 'F11'],
      ['viewChangeFont', 'CmdOrCtrl+.'],
      ['viewSourceCodeMode', 'CmdOrCtrl+Alt+S'],
      ['viewTypewriterMode', 'CmdOrCtrl+Alt+T'],
      ['viewFocusMode', 'CmdOrCtrl+Shift+F'],
      ['viewToggleSideBar', 'CmdOrCtrl+J'],
      ['viewToggleTabBar', 'CmdOrCtrl+Alt+B'],
      ['viewDevToggleDeveloperTools', isOsx ? 'Alt+Command+I' : 'Ctrl+Shift+I'],
      ['viewDevReload', 'CmdOrCtrl+R']
    ])

    // fix non-US keyboards
    this.mnemonics = new Map()
    this.fixLayout()

    // load user-defined keybindings

Review comment (suggestion):
I think the best option is to map it to another shortcut like: `isOsx ? 'Command+Shift+M' : 'Ctrl+M'`.

Code after:
      ['paragraphHeading1', 'CmdOrCtrl+1'],
      ['paragraphHeading2', 'CmdOrCtrl+2'],
      ['paragraphHeading3', 'CmdOrCtrl+3'],
      ['paragraphHeading4', 'CmdOrCtrl+4'],
      ['paragraphHeading5', 'CmdOrCtrl+5'],
      ['paragraphHeading6', 'CmdOrCtrl+6'],
      ['paragraphUpgradeHeading', 'CmdOrCtrl+='],
      ['paragraphDegradeHeading', 'CmdOrCtrl+-'],
      ['paragraphTable', 'CmdOrCtrl+T'],
      ['paragraphCodeFence', 'CmdOrCtrl+Alt+C'],
      ['paragraphQuoteBlock', 'CmdOrCtrl+Alt+Q'],
      ['paragraphMathBlock', 'CmdOrCtrl+Alt+M'],
      ['paragraphHtmlBlock', isOsx ? 'CmdOrCtrl+Alt+J' : 'CmdOrCtrl+Alt+H'],
      ['paragraphOrderList', 'CmdOrCtrl+Alt+O'],
      ['paragraphBulletList', 'CmdOrCtrl+Alt+U'],
      ['paragraphTaskList', 'CmdOrCtrl+Alt+X'],
      ['paragraphLooseListItem', 'CmdOrCtrl+Alt+L'],
      ['paragraphParagraph', 'CmdOrCtrl+0'],
      ['paragraphHorizontalLine', 'CmdOrCtrl+Alt+-'],
      ['paragraphYAMLFrontMatter', 'CmdOrCtrl+Alt+Y'],

      // format menu
      ['formatStrong', 'CmdOrCtrl+B'],
      ['formatEmphasis', 'CmdOrCtrl+I'],
      ['formatInlineCode', 'CmdOrCtrl+`'],
      ['formatInlineMath', 'Ctrl+M'],
      ['formatStrike', 'CmdOrCtrl+D'],
      ['formatHyperlink', 'CmdOrCtrl+L'],
      ['formatImage', 'CmdOrCtrl+Shift+I'],
      ['formatClearFormat', 'Shift+CmdOrCtrl+R'],

      // window menu
      // ['windowMinimize', 'CmdOrCtrl+M'], deprecated for math.
      ['windowCloseWindow', 'CmdOrCtrl+Shift+W'],

      // view menu
      ['viewToggleFullScreen', isOsx ? 'Ctrl+Command+F' : 'F11'],
      ['viewChangeFont', 'CmdOrCtrl+.'],
      ['viewSourceCodeMode', 'CmdOrCtrl+Alt+S'],
      ['viewTypewriterMode', 'CmdOrCtrl+Alt+T'],
      ['viewFocusMode', 'CmdOrCtrl+Shift+F'],
      ['viewToggleSideBar', 'CmdOrCtrl+J'],
      ['viewToggleTabBar', 'CmdOrCtrl+Alt+B'],
      ['viewDevToggleDeveloperTools', isOsx ? 'Alt+Command+I' : 'Ctrl+Shift+I'],
      ['viewDevReload', 'CmdOrCtrl+R']
    ])

    // fix non-US keyboards
    this.mnemonics = new Map()
    this.fixLayout()