简体   繁体   中英

How to disable `zN<CR>` mappings in Vim

zN<CR> is described as follows:

z{height}<CR>      redraw, make window {height} lines high

This has been bugging me for a long time, as I usually use z= to jump to the previous wrongly spelled word, and then press 1 and Enter to select the top suggestion. (That is, a z=1<CR> sequence.)

This process is not robust, as I may miss the = . Then, the z=1<CR> sequence falls to z1<CR> , which gives me a one-line window. This turns to be very distracting.

Is there a way to disable z1<CR> specifically? ( unmap z1<CR> does not work, upon simple testing.) Or, to disable zN<CR> completely?

So far, I am not using zN -functions at all, and would like to avoid the mishaps it triggers.

Currently, I am compromising to map the "correct previous wrongly spelled word by its first suggested correction" to KK in normal mode. ( nnoremap KK z=1<CR><ESC> , with <ESC> in the end to jump out of a message box.)

Thank you!

All the best,

-Linfeng

  • The first solution is, don't forget the = :-)
  • If you mostly only use z=1<cr> to jump, you can just disable z1<cr> by:

     map z1<cr> <nop> 

However if you pressed z2<cr> it will redraw the window anyway...

Hope it helps you a little.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM