over at https://hashrocket.com/blog/posts/8-great-vim-mappings I came across said mapping. While it is clear to me it yanks a paragraph, I'm having trouble decomposing this command. What does the a do there? Why the angled brackets? What is going on?
It's just a poor method of writing it out. In general, anything between <>
is understood to mean "Not literal keystrokes, but with modifiers". For example, if I was telling someone to press ctrl+a, I would write <C-a>
.
In this case, <S-}>
means shift+}
, which is a poor way of writing it out since this is the same thing as just }
, which (from :help }
) means
} [count] paragraphs forward. |exclusive| motion.
I would have written
nnoremap cp yap}p
and this would do the exact same thing. You can test this yourself. If you do:
nnoremap } <S-}>
and hit }
a couple of times, you can see that it does the same thing.
-
2On certain keyboards } is not created by using Shift at all. (E.g. norwegian keyboards where alt gr + 0 is used). In such a scenario the commands are not identical. – kinbiko May 12 '16 at 9:22