I'm often editing files where i have to delete everything except the five first and the three last rows. I do that by moving to row six and type ":,.$-3 d". Is there any way accomplish the same using d and some kind of motion?
To delete the first five and last three rows, assuming you've just opened the file and are on the first line, it would be:
Edit: Just reread the question and saw I got your intentions backwards - you want to keep the first five/last three, not delete them. In that case, it's: