3

Today, I learnt a bit of vim normal command, and below is my experiment:

:normal i Insert ^[ yyp
:normal A Append ^[ yyp


# RESULT OF EXECUTE FIRST COMMAND FOR SEVERAL TIMES
 Insert Insert  
  Insert Insert Insert  
   Insert Insert Insert Insert  
    Insert Insert Insert Insert Insert  
    Insert Insert Insert Insert Insert  


 # RESULT OF EXECUTE SECOND COMMAND FOR SEVERAL TIMES
 Append  Append  Append  Append  Append  Append 

Why the second command ignored the yyp part? How to fix it?

  • May I know what you are trying to do? – SibiCoder Apr 25 '16 at 7:02
  • (By the way, you can directly press a to append , instead of going through normal mode. Also, you are trying to change the purpose of append. If you want any new functionality or map yyp to some key , you can do that way. Your example isn't a good way of doing things. If you have any doubts, you can ask them as questions or learn more ) – SibiCoder Jun 7 '16 at 7:28
0

You have given a space after ^[ in second part. If you put the command without a space, it works in the way you wanted.

    :normal A Append^[yyp

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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