I want to search some text and move the entire line where the text belongs to the beginning of the file. Just that.
A:
Well, what I'm gonna suggest is a primitive answer as primitive it can get. But nothing else springs to mind currently.
:g/A ... some text not including A, B or C.../d
(will tell you how many lines it has yanked)
and then you go to the beginning of the file and, for example
5P
Although, if cases are as simple as this, maybe sorting lines by first letter .... I've never done anything similar but look for older questions.
ldigas
2009-11-24 17:51:12
I must add that this is what I want: :g/regex/norm dd1GP (so it is moved above the first line. Thanks.
unkiwii
2009-11-24 17:59:16