search

Home  >  Q&A  >  body text

How to choose the key binding of ESC in vim

Except hijk, the most frequently pressed key in vim is probably Esc. I already have some signs of Esc obsessive-compulsive disorder. The default Esc key is far away, and it is too troublesome to press. How to deal with it?

With the help of Google experts, I found two solutions:

In addition, the solution I am currently using is: Right ALT (Command) => ESC
Firstly, the right Alt key has very little typing rate, so it’s just a good idea to use the unused keys; secondly, it’s just a thumb movement when pressed, and the palm doesn’t need to move. Moreover, among the ten fingers on the keyboard, the right thumb is the easiest to type, so it’s just a good time for him to find some. Things to do.

How do you bind this ESC key?

阿神阿神2775 days ago1808

reply all(11)I'll reply

  • 巴扎黑

    巴扎黑2017-05-16 16:43:18

    CTRL + [
    

    ESC is really far away on modern keyboards, It is believedthat on keyboards long, long ago, ESC was very close.

    This is a keyboard from a long time ago, pay attention to the ESC position and HJKL (and CTRL)

    reply
    0
  • PHP中文网

    PHP中文网2017-05-16 16:43:18

    If you don’t want to bind it, try CTRL + C

    Generally, you can press CTRL + C to exit from insert mode to normal mode

    If you are editing multiple lines vertically, press ESC.

    Also CAPS LOCK changes CTRL

    reply
    0
  • 阿神

    阿神2017-05-16 16:43:18

    Caps Lock and Esc are not interchangeable, and they are not true love for Vim.

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-16 16:43:18

    I am currently using inoremap jj <ESC>. I have been using it for a while and it feels good.

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-16 16:43:18

    imap jj <Esc>
    nmap ;; <Esc>
    vmap ;; <Esc>
    

    reply
    0
  • 黄舟

    黄舟2017-05-16 16:43:18

    ctrl-] also has the esc function by default. This key combination is quite convenient

    reply
    0
  • ringa_lee

    ringa_lee2017-05-16 16:43:18

    Because the ESC is too far away, unless it is a relatively good keyboard, such as HHKB, KBC Poker2, etc., the ESC is relatively close.
    So I generally don’t use ESC to exit insert mode, but use Ctrl+C, or Ctrl + [

    reply
    0
  • 世界只因有你

    世界只因有你2017-05-16 16:43:18

    When I press the ESC key, it is always sent directly with the palm of my hand. It is accurate and the effect is great!

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-16 16:43:18

    c-o大多数时候都够用了, 实在不够用就c-[

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-16 16:43:18

    I will share mine:
    OS:
    Change capslock to ctrl
    Change the right alt to capslock

    vim:
    Change ctrl-c to Esc

    reply
    0
  • Cancelreply