0

Run vim --clean, :nnoremap K ko, and press K -> Nothing happens.

Run vim --clean and press ko -> Vim enters insert mode on second line.

Why?

(I know about big-O, this is just out of curiousity, it appeared in debugging a more complicated map)

1
  • I guess the mapping is canceled, as the kin the first line is an error. Depending on your settings Vim might beep or flash.
    – Ralf
    Dec 17, 2018 at 13:44

1 Answer 1

2

This happens, because a macro usually aborts, if not all of the typed keys work. In your case, the k in the first line is an error, so the macro won't try to run the o command.

1
  • Ah, I didn't realize that k counts as an error
    – Bananach
    Dec 17, 2018 at 14:39

Your Answer

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

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