Emacs - Keyword Questions

I have successfully used. Ctrl+Shift+Up' Ctrl+Shift+down'

Ctrl+Shift+left' Ctrl+Shift+Rightfor different teams. But when I

tried to use Ctrl+sin the command save buffer and Ctrl+Shift+swhich

equivalent Ctrl+sto another team, he has some problems.

save-buffer works fine, but when I type Ctrl+Shift+s, it excute

command save buffer. I used Ctrl+qto search for escape sequences

Ctrl+sand Ctrl+Shift+s, I get the same result, which is equal ^S.

I expect what I get ^Sfor Ctrl+s, but it is not.

Does anyone know the reason?

One more question: I use Ctrl+ckill-ring-save for the command. In that

all commands (which have a large number) begin with Ctrl+c, now do not work.

Is there a way to replace the prefix with Ctrl+canother configured prefix?


I can ask my question in the wrong direction. I use Ctrl+cas

killing ring conservation. It works great in emacs (no mode). But if I open the .c file (C-mode), then

when I type Ctrl+c, he waits for me to dial another key. I think in this case

Ctrl+ctreated as a prefix. In this case, I need the following modifications:

Using a custom defined prefix, let's say Ctrl+ahow Ctrl+c; Remove

prefix Ctrl+c; Using Ctrl+cas kill-ring-save.

I am adding the following to my ~ / .emacs:

(global key set (kbd "Ca") mode-specific map)

( - (kbd "C-c" ) "kill-ring-save"

(-set-key (kbd "C-f" ) 'isearch-forward)

( - (kbd "C-v" ) 'yank)

( - (kbd "C-s" ) 'save-buffer)

(defun my-c-initialization-hook()

(define-key c-mode-base-map (kbd "C-a" )).

(define-key c-mode-base-map (kbd "C-c" ) 'kill-ring-save))

(add-hook 'c-initialization-hook' my-c-initialization-hook)

. Ctrl+c - ,

kill-ring-save. , Ctrl+a Ctrl+c, ,

. ( , , Ctrl+c Ctrl+c)

+3
3

C-c , CUA , kill-ring-save, .

+3

emacs , shift-ctl-c . stty stop undef, emacs , . , , shift-ctl-

0

-, Control-S ASCII - ^s ^s .

- , Emacs , C-s C-S-s. - Control-Shift-s.

The problem you are facing is that if you are not explicitly binding the shifted version of the letter key, then the shifted letter uses the un-moved key binding. This is a "feature."

Therefore, you need to bind both C-s, and C-S-s.

(global-set-key (kbd "C-s") 'save-buffer)
(global-set-key (kbd "C-S-s") 'another-command)
0
source

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


All Articles