[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Lisp error when using M-x
From: |
Robert Thorpe |
Subject: |
Re: Lisp error when using M-x |
Date: |
Mon, 11 Jan 2021 04:25:24 +0000 |
wael-zwaiter@gmx.com writes:
> I want to use C-i for ivy related commands.
>
> (global-set-key (kbd "C-i C-s") 'swiper)
> (global-set-key (kbd "C-i C-r") 'ivy-resume)
> (global-set-key (kbd "C-i C-i") 'ivy-resume)
> (global-set-key (kbd "C-i M-x") 'counsel-M-x)
> (global-set-key (kbd "C-i C-f") 'counsel-find-file)
Just a bit of general advice....
In Emacs if the keys beginning with C-c followed by an unescaped letter
are reserved for the user. For example "C-c a" or "C-c b". That prefix
is specifically for the user adding things. If you add thing there then
they certainly won't collide with other things. Note that the keys
beginning C-c and ending with another ctrl key are used by major modes.
So, although "C-c a" will always be free "C-c C-a" is probably used.
Secondly, if you want to use counsel then I suggest replacing the
standard keybindings. Replace M-x with counsel-M-x, there is no reason
to have both of them. The same is true of find-file, you may as well
just over-ride "C-x C-f" with counsel-find-file. So you may as well
just do:
(global-set-key (kbd "M-x") 'counsel-M-x)
(global-set-key (kbd "C-x C-f") 'counsel-find-file)
This is what the Ivy/counsel/swiper manual suggests. Try it out and see
if you like it. If you don't you can go back to the original in-built
version or try out the other alternatives.
For the other keys I would do this:
(global-set-key (kbd "C-c s") 'swiper)
(global-set-key (kbd "C-c r") 'ivy-resume)
Lastly, if you want to use Emacs in a terminal emulator then there's a
problem with C-i. In a terminal emulator (or a linux console screen)
C-i and tab always do the same thing. So, if you press tab it will do
the same thing as C-i. In your case that means it'll run your prefix
key. So, there will be no way to press tab in the terminal. This is
not an Emacs problem, it's a problem of the interface between
terminal-emulators and programs. For some of these keys it can be fixed
by changing terminal configuration.
BR,
Robert Thorpe
- Lisp error when using M-x, wael-zwaiter, 2021/01/10
- Re: Lisp error when using M-x, wael-zwaiter, 2021/01/10
- Re: Lisp error when using M-x, Óscar Fuentes, 2021/01/10
- Re: Lisp error when using M-x, Stefan Monnier, 2021/01/10
- Re: Lisp error when using M-x, wael-zwaiter, 2021/01/10
- Re: Lisp error when using M-x, wael-zwaiter, 2021/01/10
- Re: Lisp error when using M-x, Óscar Fuentes, 2021/01/10
- Re: Lisp error when using M-x, wael-zwaiter, 2021/01/10
- Re: Lisp error when using M-x, Óscar Fuentes, 2021/01/10
- Re: Lisp error when using M-x, wael-zwaiter, 2021/01/10
- Re: Lisp error when using M-x,
Robert Thorpe <=