:t
copy the whole line, not the matchstr
to achieve what you want, you need matchstr()
function.
this line will do the similar thing, but in reverse order. Hope it is ok for you:
:'<,'>g/\/.*'/call append(1,matchstr(getline('.'),@/))
for example, if I just select the first two "Bundle" lines, and execute the cmd, I get:
1: Name:
/vim-endwise'
/vim-rails'
2:
3: Bundle 'tpope/vim-rails'
4: Bundle 'tpope/vim-endwise'
.... (other lines)
you see that the order was in reverse.
To keep the order you have options :
- write script with list
- select those "reversed" lines, and do
'<,'>g/.*/m1
- assign the matchstr to reg x, and
2put! x