I'm using the following key binding to visually select the current paragraph.
nnoremap <leader>v }kV{j
Is works as follows:
}
Move below the current paragraph.k
Move one line up.V
Start line-based visual selection.{
Move above the current paragraph.j
Move one line down.
This works well except for the last paragraph in the file. If there is no empty line below the current paragraph }
stops at the last line inside the paragraph. The following k
results in the last line of the paragraph not being included in the selection. The same problem occurs with the very first paragraph in the file.
How can I make this key binding to also work for paragraphs at the top of bottom of the document?
Is there a text object for this?