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

  • SEARCH
  • Home
  • 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 6541117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:03:53+00:00 2026-05-25T11:03:53+00:00

I am trying to select multiple lines that are not in a continuous chunk.

  • 0

I am trying to select multiple lines that are not in a continuous chunk. E.g., I want to select line 1 and 3 simultaneously without selecting line 2:

 1. this is line 1 
 2. this is line 2 
 3. this is line 3

Initially I thought this would be a trivia task, but after spending quite some time googling around to no avail, I realized this might not be a simple/common task.

Many thanks in advance for your help.


Edit:
Thanks for the responses. I will provide a little more details on how I came up with the question.

I was trying to align a chunk code like the following, using Tabularize:

1. name1="Woof"
2. lucky_dog = lucky( "dog_one"= name1, 
3.                    "dog_two"= name1 )
4. name2="Howl"

I wanted it to align like this:

1. name1     = "Woof"
2. lucky_dog = lucky( "dog_one"= name1, 
3.                    "dog_two"= name1 )
4. name2     = "Howl"

But I cannot do so because Tabularize will take third line into consideration, and align everything into:

1.name1                        = "Woof"
2.lucky_dog                    = lucky( "dog_one"= name1,
3.                   "dog_two" = name1 )
4.name2                        = "Howl"

I believe I could think of some regex trick to archive the desired results, it just occurred to me at first that maybe I could simply select line 1,2,4 and make those align.

Then I realized this is not a easy task.

Hence the question.

Thanks for the responses!

  • 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-25T11:03:53+00:00Added an answer on May 25, 2026 at 11:03 am

    It’s not possible to select different chunks of text in vim.

    What you can do instead is identify a common, unique pattern that is shared by the lines you want to act on and use the ‘global’ ex-command or ‘g’ to do it like so:

    :g/shared unique pattern/ex or normal command here
    

    For example to copy the lines to a register, say the ‘a’ register:

    :g/shared unique pattern/normal "Ayy
    

    To paste them hit “ap

    The capital A that comes before yy tells vim that you want to copy and append the lines to the a register.

    Like sydill said if you can tell us what exactly you want to do with the lines then we can better help you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to write a query that would select data from multiple lines
I'm trying to SELECT fields with multiple dots ( . ) in their value.
Trying to select anchor tags that are a descendants of a div with a
In trying to select elements that have any attributes, the following throws a jQuery
I'm trying to set up a form with multiple dropdown lists, that will allow
I'm using some <select row=3 multiple=multiple> elements on a page. I've been trying to
I'm trying selecting multiple check edit boxes when added as a repository item in
I'm trying to get results from a MySQL database (for invoices) that includes multiple
I'm trying to read a text file with multiple lines and then display it
I'm trying to run multiple queries on my database using MySQLi. This is my

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.