7

I often Ctrl-Z to the command line. Is there a way to do that in response to hitting Ctrl-Z in insert mode?

The iabbrev command does not seem to work.

2
  • 1
    How does this work for you: inoremap <c-z> <esc>:stop<cr> ? Or inoremap <c-z> <esc><c-z> See :h CTRL-Z
    – VanLaser
    Commented Jan 15, 2016 at 17:14
  • Works great. Please make this into an answer
    – Yossi Gil
    Commented Jan 15, 2016 at 19:17

1 Answer 1

6

Using :h CTRL-Z as inspiration, the following solutions can be cooked:

:inoremap <c-z> <esc>:stop<cr>

or (shorter & literally closer):

:inoremap <c-z> <esc><c-z>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.