Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1042521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:31:18+00:00 2026-05-16T15:31:18+00:00

Is there a command to delete a line (or several lines) that is immediately

  • 0

Is there a command to delete a line (or several lines) that is immediately below current line?
Currently I’m doing it as:
jdd and then . to repeat as needed.
Is there a command that would combine all these?

UPDATE: The reason I would like to have such command is that I don’t like to move away from current position, yet be able to delete lines below.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:31:19+00:00Added an answer on May 16, 2026 at 3:31 pm

    The delete ex command will work nicely.

    :+,$d
    

    This will delete all the lines from current +1 till the end ($)

    To delete the next 2 lines the follow range would work, +1,+2 or shorthand +,+2

    :+,+2d
    

    As @ib mentioned the :delete or :d command will move the cursor to the start of the line next to the deleted text. (Even with nostartofline set). To overcome this we can issue the `` normal mode command. `` will jump back to the exact position before the last jump, in this case the :d command. Our command is now

    :+,+2denter``

    Or as one ex command

    :+,+2d|norm! ``
    

    To make this easier we wrap this all up in a command:

    command! -count=1 -register D :+,+<count>d <reg><bar>norm! ``
    

    Now to delete the next following 3 lines:

    :3D
    

    This command can also take a {reg} like :delete and :yank do. So deleting the next 4 lines into register a would be:

    :4D a
    

    For more information

    :h :d
    :h :command
    :h :command-register
    :h :command-count
    :h ``
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.