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 6999137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:30:07+00:00 2026-05-27T20:30:07+00:00

I can use vi{ and va{ to select C++ code blocks. It helps me

  • 0

I can use vi{ and va{ to select C++ code blocks. It helps me a lot when I need to yank/delete them.

But Python uses indentation to indicate code blocks. I cannot find any better way. Any ideas?

  • 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-27T20:30:08+00:00Added an answer on May 27, 2026 at 8:30 pm

    I have not had much of an occasion to use it yet, but Michael Smith’s vim-indent-object sounds like it may be close to what you want.

    Example usage (line numbers shown as with set number active):

      1 This is
      2   some text
      3     with multiple
      4   levels of
      5   indentation.
      6 There is also
      7     another stanza.
    

    With the cursor on the line 2, 4 or 5, type Vii to select lines 2 through 5.
    With the cursor on line 3, type Vai to select lines 2 through 3.
    With the cursor on line 3, type Vaiii (or Viiii), to select lines 2 through 5 (in visual mode multiple uses of indentation objects extend the selection to the next level up/out).

    The text objects it defines are:

    • ai: the current indentation level plus the line above
      useful when you want to grab the introductory line (e.g. grab the if and its “then” block)
    • ii: the current indentation level
    • aI: the current indentation level plus the one line above and one line below
      useful for languages that use “end” statements: if/endif).
    • iI: the current indentation level (effectively, ii, and iI are the same)

    The objects can also be used with other commands that expect text objects (i.e. cii to delete the current indentation level and start inserting its replacement).

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

Sidebar

Related Questions

I can use: select * from sys.tables in mssql to show a list of
In SQL you can use SELECT * FROM INFORMATION_SCHEMA.TABLES etc to get information about
How can I use .NET DataSet.Select method to search records that match a DateTime?
How can I use XPath to select an XML-node based on its content? If
We can use solr range query like: http://localhost:8983/solr/select?q=queryStr&fq=x:[10 TO 100] AND y:[20 TO 300]
I would like to know how can I use jQuery to select multiple items
HTML Javascript question to get the selected value of a input-select I can use
WHERE gets processed before GROUP BY in the SELECT statement. How can I use
Can a select query use different indexes if a change the value of a
Can a JApplet use a JFileChooser so that the user can select a file

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.