I\'m able to get the cursor position with getpos()
, but I want to retrieve the selected text within a line, that is \'<,\'>
.
Overview:
visually select, press mapping, reselect original selection with gv and copy it to a register, finally paste from the register
Use case:
function! Test() range
exe 'sp temp.tmp'
exe 'norm p'
endfunction