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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:08:34+00:00 2026-06-09T10:08:34+00:00

In Vim, I keep finding myself desiring a keystroke to rewrite the rest of

  • 0

In Vim, I keep finding myself desiring a keystroke to rewrite the rest of some parameter list. For example, in the following Python function:

def myfun(a, b=12, c=(1,2,3), d=15):
    pass

I wish to replace the c=(1,2,3), d=15 with e=12. The keystroke ci( allows me to replace everything inside the entire parameter list, but I find that I often want to retain some prefix of the Vim text-object. In general, I’d assume this keystroke I’m searching for would be useful in the context of replacing final parameters of function calls as well as definitions.

A desirable answer to this question would apply to quoted strings, [] blocks and other text objects too. Note that I understand all about text-objects as answered in “How to select between brackets (or quotes or …) in Vim?“.

Both @pb2q and @romainl give good search shortcuts, but they require me to visually find the end of the enclosing block to devise a search which is unambiguous in terms of any other garbage which is in the block (e.g. think nested function calls). In particular, I often find myself wanting this when I have nested parenthesis inside the parenthesis set I want to manipulate. The answer I really want is analogous to ci) or ca) which is entirely conceptually based on the nearest enclosing bracketing ) and deals entirely gracefully with other nested ) blocks.

  • 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-06-09T10:08:35+00:00Added an answer on June 9, 2026 at 10:08 am

    There are a bunch of commands starting with ] that go to the end of some kind of structure, and respect nesting. ]) to go to the end of a parenthesized block, ]} to go to the end of a braced block, ]/ to go to the end of a C comment (/*...*/ style). Use [ in place of ] to go to the beginning instead of the end.

    So to do the replacement of your c=(1,2,3), d=15 type c]).

    The complete list of these commands is listed under :help various-motions. Unfortunately there isn’t one for blocks delimited by brackets, because [[ and ]] already had a different meaning in classical vi, and vim has defined ][ and [] to fit nicely with those.

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

Sidebar

Related Questions

I keep on forgetting which file I'm editing. In Vim 7.x, how can I
I keep my vim configuration files on github to keep them synched across multiple
I have a vim macro that I keep mistyping, usually when I'm trying to
While using Vim I'll sometimes want to look at a function definition or a
I keep getting this log entries on ubuntu 10.04 lts: # vim /var/log/apache2/error.log [Sun
Is there a way to keep the cusror location off-screen in Vim / gVim
When I open Vim from a terminal, copy some text to the system clipboard,
Vim is acting slow when I scroll. The cursor skips some lines when I'm
I want to keep my Vim plugins up-to-date with git by using github repos
I'm using this vim plugin for coffeescript and I want to keep all 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.