0

How could I execute the entitled command, as is (I give a pseudo version)? My current workaround is to G to get the eof line number itself, then execute the command.

2
  • 2
    Sorry, what do you mean? Do you want to delete the last line of the buffer? You can do that with :$d, with $ meaning the last line. Do you want to delete from the current line to the end? Then you can use :.,$d. From line 10 to the end? :10,$d. Please edit the question to make it clear what it is you're trying to accomplish.
    – filbranden
    Jul 29 '21 at 16:21
  • 1
    :10,$d was what I was referring to. Thanks Jul 29 '21 at 18:10
2

If you want to delete from line 10 to the end of the file, you can use:

:10,$d

(Assuming the first line in the range is line 10, adjust for a different numbered line.)

The $ address means the last line in the current buffer. See :help :range for other valid addresses in a range.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.