Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vim: Support ranges in command #15985

Merged
merged 2 commits into from
Aug 8, 2024
Merged

vim: Support ranges in command #15985

merged 2 commits into from
Aug 8, 2024

Conversation

ConradIrwin
Copy link
Member

@ConradIrwin ConradIrwin commented Aug 8, 2024

Closes #9428
Closes #13535

The most requested feature here is "search and replace in visual mode",
but as a happy side effect we can now support things like :2,12j to join
those lines, and much much more.

Release Notes:

  • vim: Added support for range syntax in command (#9428).
  • vim: Prefill command with :'<,'> from visual mode (#13535).

The most requested feature here is "search and replace in visual mode",
but as a happy side effect we can now support things like :2,12j to join
those lines, and much much more.
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Aug 8, 2024
@mrnugget
Copy link
Member

mrnugget commented Aug 8, 2024

Haha, someone's having a good vacation!

Comment on lines 706 to 731
// let (name, action) = if query.starts_with('/') || query.starts_with('?') {
// (
// query,
// FindCommand {
// query: query[1..].to_string(),
// backwards: query.starts_with('?'),
// }
// .boxed_clone(),
// )
// } else if query.starts_with('%') {
// (
// query,
// ReplaceCommand {
// query: query.to_string(),
// }
// .boxed_clone(),
// )
// } else if range_regex().is_match(query) {
// (
// query,
// ReplaceCommand {
// query: query.to_string(),
// }
// .boxed_clone(),
// )
// } else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🫨

@ConradIrwin
Copy link
Member Author

Was a fun plane ride over, finally had time to push it up!

@ConradIrwin ConradIrwin merged commit bd59af1 into main Aug 8, 2024
8 of 9 checks passed
@ConradIrwin ConradIrwin deleted the vim-command-ranges branch August 8, 2024 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vim: :s with visual select should replace within selection Vim mode: add :s/search/replace command
2 participants