sjl / learnvimscriptthehardway

Home Page:http://learnvimscriptthehardway.stevelosh.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ch5: Remap irony

sedm0784 opened this issue · comments

commented

In Chapter 5, we add the mapping :nmap dd O<esc>jddk, which creates an infinite recursion.

Then, slightly further down, we do:

:nmap x dd
:nnoremap \ x

If the reader decides to try out their x mapping before trying the \ mapping, then they will hit the infinite recursion that we mapped dd to above. I don't think this is what was intended.

On the other hand, as Chapter 5 is all about avoiding unintended consequences from mappings invoking other mappings, maybe this might actually be a good thing to leave in!

Nah, we shouldn't punish the user for following directions. Fixed in fbd83e2, thanks!