The copy-paste functions in vim seem a bit inconsistent to me. The commands yy, dd and cc yank/delete the whole line. The commands D and C delete from the cursor to the end of line, but Y yanks the whole line instead. I want Y to work the same as D and C. So I put the following line in my .vimrc:
nmap Y y$
It doesn't seem to work though. My first idea was that it is because of some plugin interfering. I tried to put the command to both the beginning and the end of my .vimrc, but nothing helped. However, if I type the command manually (not from .vimrc), it works. Why is this? How do I make this work?