From ed5432641ae4d7599e2d6cd9b4861dadacaee11a Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sat, 28 Jun 2025 17:14:37 +0100 Subject: [PATCH] feat(keybindings): add cmd+shift+p and cmd+/ keybindings from VSCode Makes cmd+shift+p open the command palette and cmd+/ toggle comments, as they do in VSCode. This should ease my recent usage of Cursor/VSCode alongside Emacs, as certain keybindings I have in Emacs cannot be setup in VSCode to work in all contexts. Hence I've had to get used to cmd+shift+p instead of C-x C-m, as the later does not want to play ball when a terminal is active in VSCode. --- modules/core/siren-global-keybindings.el | 1 + modules/editor/siren-amx.el | 1 + modules/editor/siren-smex.el | 2 +- modules/text-editing/siren-toggle-comments.el | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/core/siren-global-keybindings.el b/modules/core/siren-global-keybindings.el index f33d308..c29a94c 100644 --- a/modules/core/siren-global-keybindings.el +++ b/modules/core/siren-global-keybindings.el @@ -9,6 +9,7 @@ (siren-general-define-key ;; Enable alternative to M-x. "C-x C-m" 'execute-extended-command + "s-P" 'execute-extended-command ;; Enable dabbrev-expand via custom keybinding. "C-x M-/" 'dabbrev-expand diff --git a/modules/editor/siren-amx.el b/modules/editor/siren-amx.el index 2142012..92f6cc6 100644 --- a/modules/editor/siren-amx.el +++ b/modules/editor/siren-amx.el @@ -12,6 +12,7 @@ :general ("M-x" 'amx) ("C-x C-m" 'amx) + ("s-P" 'amx) :custom (amx-backend 'ido) diff --git a/modules/editor/siren-smex.el b/modules/editor/siren-smex.el index 81c7644..6f47af4 100644 --- a/modules/editor/siren-smex.el +++ b/modules/editor/siren-smex.el @@ -9,7 +9,7 @@ (use-package smex :general ("C-x C-m" 'smex) - ("C-c C-m" 'smex) + ("s-P" 'smex) ("M-X" 'smex-major-mode-commands) ("C-c C-c M-x" 'execute-extended-command) diff --git a/modules/text-editing/siren-toggle-comments.el b/modules/text-editing/siren-toggle-comments.el index f4c657a..f2f7550 100644 --- a/modules/text-editing/siren-toggle-comments.el +++ b/modules/text-editing/siren-toggle-comments.el @@ -10,6 +10,7 @@ :straight (:type built-in) :general + ("s-/" 'comment-or-uncomment-region-or-line) ("C-c /" 'comment-or-uncomment-region-or-line) ("C-c C-/" 'comment-or-uncomment-region-or-line) ("C-c C-_" 'comment-or-uncomment-region-or-line)