syl20bnr / evil-escape Goto Github PK
View Code? Open in Web Editor NEWCustomizable key sequence to escape from insert state and everything else in Emacs.
License: GNU General Public License v3.0
Customizable key sequence to escape from insert state and everything else in Emacs.
License: GNU General Public License v3.0
I use a different keyboard layout (dvorak) and what would be jk
in Qwerty is ht
for me.
The documentation says h
can be used to start the escape sequence, but after implemented, h
no longer works to move left.
I'm fairly new to Github, and I've tried to find a similar issue but couldn't (although I've seen people complaining about this in the Spacemacs gitter), so if I missed it, I'm sorry.
Steps to reproduce:
f a
In the linked issue disabling evil-escape cleared up this problem for me, so it seems like an issue with this package and not spacemacs.
For users that have <ESC>
swapped with a more convenient key (e.g. Caps Lock) at the OS level and, in any event, for vi(m) users who have <ESC>
firmly ingrained in their muscle memory, it would be handy if <ESC>
behave as fd
for the purposes of evil-escape
.
I am using org-mode and would like to exit from insert mode by fd
while my input-method is alternative. I'v tested russian escape sequence, but it doesn't work.
How to reproduce:
(setq-default evil-escape-key-sequence "ав")
(set-input-method)
to cyrilic-jis-russian
C-\
and try to exit by pressing keys fd
(it will be ав
in russian)Probably there should be a way to define unique escape sequence for each language to make in infrequent.
Enter replace mode with R, most keys behave as expected (overwrite), but f
inserts itself.
With sequence set as "jk", evil-escape eats my "j" keypress in dired so I can't move down.
(unscroll auto-completion xkcd emacs-lisp git gtags dash yaml github javascript html markdown extra-langs python ruby org osx python django syntax-checking spell-checking version-control lua colors eyebrowse perspectives vimscript
(c-c++ :variables c-c++-enable-clang-support t)
(shell :variables shell-default-height 30 shell-default-position 'bottom))
I am using the default fd
, with a delay of 0.2
. I changed it to 0.2
trying to fix this problem, but it doesn't seem to have helped.
This usually happens when I press enter to go to another line and then immediately type fd
. It's almost as if I'm typing it too quickly - like flycheck/flyspell
are in the middle of rechecking the buffer, and during that time, I can type fd
and it won't exit. I will have to retype it again, and then remove the fd:w
that I inevitably end up typing.
It doesn't seem to be limited to flyspell/flycheck
or auto-complete
- if I turn them all off I can still get it to happen occasionally.
I haven't seen it happen in elisp mode, but I use that far less than python mode.
See abo-abo/lispy#137 for details.
is there an inherent reason why evil-escape doesn't support movement keys? i am using vim/evil for years and this key combo is the most efficient i found yet.
I'm using 'jk' as the escape sequence. When using evil-repeat directly after 'jk', I have to reload evil-escape-mode for it to work again. Steps to reproduce this are:
ijk.ijk
The second jk will not escape insert mode.
I tested this with 'fd' as well and the same thing happens.
In most cases, I only want to escape from insert-mode, emacs-mode, and ex-mode. Is it possible to make only those modes escaped with the current system? I understand we are also allowing escape from multiple packages that use motion state, but it slows down motion when using existing movement sequences (like "j" and "k").
I try to overwrite j and k in those modes, but certain modes using normal-state or motion-state are still escaped (dired / undo-tree).
(define-key evil-normal-state-map "j" 'evil-next-line)
(define-key evil-normal-state-map "k" 'evil-previous-line)
(define-key evil-motion-state-map "j" 'evil-next-line)
(define-key evil-motion-state-map "k" 'evil-previous-line)
(define-key evil-visual-state-map "j" 'evil-next-visual-line)
(define-key evil-visual-state-map "k" 'evil-previous-visual-line)
Hi, I write in both spanish and english, and the evil escape sequence I use ( 'nj'). The process I use to change for input methods is the default,
M-x set-input method RET latin-1-prefix
this disables my evil-escape-key :( I don't what is causing this.
Recent code change introduced a dependency on cl.el
(the function reduce
), but you didn't add a require
.
To reproduce:
$ emacs -Q -L ~/path/to/evil-directory/ -l ~/path/to/evil-escape.el
M-x evil-mode
M-x evil-escape-mode
Error in pre-command-hook (evil-escape-pre-command-hook): (void-function reduce)
It used to, but doesn't now.
I have jk
as my evil-escape sequence.
In the magit status buffer, if I hold down either j
or k
it exits the magit-status buffer after a short delay of about 0.3 seconds or so.
evil-escape in ibuffer gives the error message:
evil-escape: Wrong type argument: commandp, ibuffer-quit
it should probably use quit-window
instead of ibuffer-quit
.
Emacs uses quit-window
to quit ibuffer.
To reproduce:
$ emacs -Q -L ~/path/to/evil-directory/ -l ~/path/to/evil-escape.el
M-: (require 'cl)
(because of #42)M-x evil-mode
M-x evil-escape-mode
Error in pre-command-hook (evil-escape-pre-command-hook): (wrong-number-of-arguments (lambda (x y) (or x y)) 0)
Selecting a line by pressing V and then pressing j to select a second line does not work anymore (since the 11/19 release, as far as I can tell); the cursor briefly moves downward and then quickly jumps back into the first line. I am using "jk" as an escape key replacement, must be related to that (the error doesn't show up using the default "fd" setup).
When running in a terminal evil-escape
is causing some non-escape-sequence combinations to behave badly.
With evil-escape
turned on (i.e. evil-escape-inhibit
is set to nil
):
fd
-> ESC
fö
-> fÃ\266
When I turn off evil-escape
(i.e. evil-escape-inhibit
is set to t
) I don't see this behaviour.
Emacs 24.5 on Archlinux, with Spacemacs (develop
branch). I'm running Emacs in a Gnome Terminal when I see this behaviour, I've not checked it in any other terminal, and I never see it in the X Window.
now I have set
(setq-default evil-escape-key-sequence "jj")
but I have some trouble in visual-state and neotree,I could't use 'j' to choice a file quickly.when I select text in visual-state,I need to wait a few second to select next line.
I understand that fd shouldn't shadow f, and the function usually bound to f should be executed after a delay, which is 0.1 seconds by default.
However, in magit-log-mode
I can't trigger magit-fetch-popup
with evil-escape active.
(I'm using spacemacs. Which is great! Thank you for it! I'm seeing the elisp light after vimscript darkness.)
step to reproduce,
(setq evil-escape-key-sequence (kbd "kj")
V
, press j
to select several linesk
When I press f
key in insert mode, I get:
Symbol's value as variable is void: hl-line-mode
.
If hl-line-mode
is enabled, all works as expected.
Probably it broke after this commit: e556c7a
registers that don't work :
"fp
".p
All others seem to work
With a bare-bones Emacs installation (started with -Q
) and just evil and evil-escape loaded, the new version seems to be broken. I can't get an escape sequence of jk to work, but anything else, e.g., io works. Using j in normal mode just gives me j is undefined
.
I have to pressed c-g
before call fd
to escape to normal mode.
The evil-escape works like a charm for evil-iedit-state.
Hope it could be fixed for multiple-cursors.
Thanks.
This is just a minor request: as a vimmer using jk as an escape sequence, it would be very helpful to allow defining multiple evil-escape-key-sequences that would ease the transition to the Spacemacs's default fd.
Changing the evil-escape-key-sequence was one of the first things I've learned and done after starting Spacemacs. As I leaned more into Spacemacs spc prefix combined with spc f s I felt tempted to give a 2nd chance to fd. As a newbie, going the key-chord route sounds a bit scary/too complicated (maybe because what I have read was not very conclusive)
_Note: originally reported syl20bnr/spacemacs#5445 and with a workaround based on key-chord
.
To reproduce:
Start emacs with a very simple .emacs such as:
(require 'evil)
(require 'evil-escape)
(evil-mode)
(evil-escape-mode)
So if we define another command that uses f
and behaves diferently in another state (like iedit state) we will get the functionality of the motion state and not of the current state we are in (iedit state)
Pressing fd quickly in normal state should take no effect or find d?
Of course I don't want to find d. Is any configure provided for this?
When evil-escape is set to fd
, deleting with df)
does not delete )
.
The package seems to load and work OK but should I worry about this warning:
Warning (initialization): An error occurred while loading `/Users/fintel/.emacs.d/init.el':
Symbol's value as variable is void: isearch-abort
To ensure normal operation, you should investigate and remove the cause of the error in your initialization file. Start Emacs with the `--debug-init' option to view a complete error backtrace.
? Kind of annoying to be dropped into a warning window.
Very easy to reproduce in Spacemacs:
fd
ESC
or Ctrl-[
to truly escapeI had a quick go at adding this to evil-escape.el, but it didn't seem to work:
;; replace-state
(eval `(evil-escape-define-escape "replace-state" evil-replace-state-local-map abort-recursive-edit
:insert-func evil-escape--default-insert-func
:delete-func evil-escape--default-delete-func))
When playing back a macro with , if the evil escape sequence occurs in the macro then evil-escape stops working. I can restore evil-escape by calling the function (evil-escape--define-keys).
This also seems to happen occasionally when switching to/fro the emacs state in some buffers with . This seems to happen the most with terminal-like modes such as ielm, multi-term, and python-shell. I'm not sure of the exact circumstances that cause this to happen so I can't reproduce the problem. Likewise, I can restore functionality with (evil-escape--define-keys).
I'm aware that the README mentions that using evil-escape during macro definition is not supported but I'm not sure this behaviour is expected. Muscle memory causes me to tend to use the evil-escape while defining macros, so it would be nice if simply didn't work instead of "breaking" evil-escape.
Do you think it would be possible to eliminate this behaviour? If you don't want to change it, could you suggest a hook I could add (evil-escape--define-keys) to so that it will be automatically called as needed?
I use jk as my sequence, but I hit kj about 20% of the time. A feature to support a reversed key sequence would be really handy.
Would it be possible to specify multiple key sequences? That way I could use both "jk"
and "kj"
and not have to think so much about the order I press them in.
When evil-escape is on, with 'jk' as the escape sequence, there is a noticeable lag (about a quarter second) when moving down a line in visual mode with 'j'. This doesn't happen when I switch the sequence to 'fd'.
To reproduce:
M-x evil-escape-mode
to disable it.fd
fast. It still switches to insert mode.The following code should reproduce the problem.
(setq-default evil-escape-key-sequence "C-c C-g")
(require 'package)
(add-to-list 'package-archives '("MELPA" . "http://melpa.org/packages/"))
;; M-x eval-buffer
;; M-x package-install RET evil-escape
;; M-x evil-mode
;; M-x evil-escape-mode
;; now try "C-c C-g" from either normal or insert mode. I expect you to see "C-c C-g is undefined" in the minibuffer.
Hello, my current configuration (in spacemacs) is
(global-set-key (kbd "C-f") 'evil-escape)
(setq-default evil-escape-key-sequence "qq")
I would like to remove the second line and completely disable the key-sequence.
I have tried ""
and nil
-- both of which cause problems in the command buffer, where I am getting errors like evil-escape: Error (wrong-type-argument characterp nill)
How can I completely disable evil-escape?
For the duration of evil-escape-delay, when the first key of evil-escape-sequence is pressed, the line highlighting disappears.
Just a thought I had. I think the typical thing to do in vim would be
imap fd <Esc>
which is actually pretty limited compared to what evil-escape tries to accomplish. What do you think about offering the option of specifying the states you want to escape from and then ignoring anything not in that list? You could still have the current behavior as default, but for someone like me I think being able to specify the situations I want to use evil-escape in would help me better predict its behavior.
Related to syl20bnr/spacemacs#933
If I'm in insert mode in a multi-term buffer, escaping with fd
works and doesn't leave any visible letters. However, if I reenter insert mode and type a letter (for example, a
), the output is fa
, showing that the f
from the previous escape was left behind.
Diagram (|
is cursor in insert mode, _
is curser in normal mode):
>|
-- fd
>_
-- i
>|
-- a
>fa|
I've been trying to use kj
as an esc sequence today and it hasn't been working.
Things seem to run slower in general, and it has maimed the functionality of the k
key.
I can't use 8k
for example.
There is a lag if I press k
I can't activate this setting at startup because of this error. But if I activate it with M-x I get this in the * Messages * buffer::
Debugger entered--Lisp error: (void-variable isearch-abort)
evil-escape--define-keys()
evil-escape-mode()
eval((evil-escape-mode) nil)
eval-last-sexp-1(nil)
eval-last-sexp(nil)
#(eval-last-sexp nil nil)
ad-Advice-call-interactively(# eval-last-sexp nil nil)
apply(ad-Advice-call-interactively # (eval-last-sexp nil nil))
call-interactively(eval-last-sexp nil nil)
command-execute(eval-last-sexp)
However after this error the mode works as expected or it seems to. Don't know what's wrong I want to just enable it by default on startup.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.