Selecting your pasted text

2 Points

Timothée Gauthier Timothée Gauthier

11 years ago

After pasting some text you may want to reindent it.

This script select the whole pasted text when pressing gp.

It was taken here :

http://vim.wikia.com/wiki/Selecting_your_pasted_text

nnoremap <expr> gp '`[' . strpart(getregtype(), 0, 1) . '`]'