Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unable to set keymap for key Ctrl-;

Tags:

emacs

elisp

I am trying to set the global key for the C-; key by placing the below code in init.el file.

(global-set-key "\C-;" 'backward-kill-word)

But this gives the following error in the *Warning* buffer

error "Invalid modifier in string"
like image 878
Talespin_Kit Avatar asked Apr 10 '12 11:04

Talespin_Kit


1 Answers

try this,

 (global-set-key [(control ?\;)] 'backward-kill-word)

another way and I guess most easiest way of doing is with kbd function

 (global-set-key (kbd "C-;") 'backward-kill-word)
like image 94
kindahero Avatar answered Oct 07 '22 23:10

kindahero