-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Add support for Vim text objects like caq and ciq in Vim mode #18295
Comments
Are you using a plugin for The objects we currently support: Lines 373 to 396 in 44b1399
|
You're right, daq is not a default Vim command. The behavior I was referring to typically comes from the popular plugin vim-surround for Vim or nvim-surround for Neovim, which adds more flexible and powerful manipulation of surrounding text like quotes, brackets, and other delimiters. I was wondering if there's a way to replicate this behavior manually in Zed, or if you have any suggestions on how I could implement something similar. Thanks again for your consideration! |
If I want to implement this via keymaps/vim.json, is it possible to add something like vim::AnyQuotes? AnyQuotes would refer to any of the following: Quotes, BackQuotes, or DoubleQuotes. Could something similar be done for brackets as well? Thanks again for your consideration! |
This is especially useful when using the English international layout, where entering double quotes (") requires pressing three keys: Shift + " + Space. Instead, I prefer using Vim commands like ciq, caq, diq, and daq for greater efficiency. |
Hi @OrlovAlexei and @ConradIrwin, I’ve created a PR to add support for the AnyQuotes text object: #22263. I tested it locally, and it seems to work well, but since I’m not experienced in Rust, I relied heavily on ChatGPT for assistance. 😅 Any advice, suggestions, or feedback to improve this would be greatly appreciated. Thank you for your time and support! If you want to test it locally just clone my fork and then run |
Check for existing issues
Describe the feature
Please add support for the following Vim commands:
caq: Change around quotes — Changes the entire text inside and around quotes, putting the user in insert mode.
ciq: Change inside quotes — Changes only the text inside the quotes, without affecting the quotes themselves.
cab: Change around brackets — Changes the entire text inside and around brackets ( ), { }, or [ ], switching to insert mode.
cib: Change inside brackets — Changes only the text inside the brackets, keeping the brackets intact.
daq / diq: Delete around / inside quotes — Deletes the text around or inside quotes.
dab / dib: Delete around / inside brackets — Deletes text inside or around different types of brackets.
If applicable, add mockups / screenshots to help present your vision of the feature
No response
The text was updated successfully, but these errors were encountered: