Emacs keybinding with a slash

in emacs, I would like to reassign \C-/ from undo to my own function by commenting out the current region or current line (if no region is selected). When I try something like this:

 (global-set-key "\C-/" 'comment-or-uncomment-region-or-line) 

I get an error

 error: Invalid modifier in string 

I tried to use different keybinding methods, unfortunately, without success and googling for \C-/ also not very useful.

Thank you for your help.

+4
source share
1 answer
 (global-set-key (kbd "C-/") 'comment-or-uncomment-region-or-line) 
+4
source

Source: https://habr.com/ru/post/1437569/


All Articles