2

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?

8

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.

1

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.