Skip to content

Feature enhancement: support :range c (multiline change) in ex command mode #9729

@kiing-dom

Description

@kiing-dom

Is your feature request related to a problem? Please describe.
In Vim the ex command :range c (e.g. :1,14c) changes lines in the specified range, deleting them and entering insert mode.
VSCodeVim supports :range for commands like delete (:d) and yank (:y) but not change (:c), so users can't perform multiline changes in ex mode. This is a missing core feature.

Describe the solution you'd like
Implementation of full support for :range c in ex command mode

  • Accept range syntax (:1,14c, %c,:.,.+c, etc).
  • Delete the lines in the specified range
  • Place the cursor at the start of the first line in the range
  • Enter insert mode
  • Ensure undo (u) is possible after changes are made

Describe alternatives you've considered

  • Manually selecting lines and using c in normal mode (works but is slow and inefficient for large ranges)
  • Using :range d followed by i (works but could be more efficient since it requires two separate steps)

Additional context

  • The command is a standard part of Vim's ex command set and improves similarity
  • The implementation could likely reuse the :range d logic and add a transition into insert mode at the end

Note: I’m happy to take this on and submit a PR if I have the go ahead

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions