amVim-for-VSCode
amVim-for-VSCode copied to clipboard
Support for Text Objects
I'm creating an issue to track this feature. See Text objects (only in Visual mode or after an operator) in issue #1
These are a few of my commonly used ones:
-
ciw
- change in word -
viw
- visual select in word- I typically use this followed with yank and paste
-
ci(
orci)
- change in parens- Useful to change function arguments or if/switch conditions, etc
-
ci<
orci>
- change in angle brackets- Useful to change html, for example, change
<div>
to<span>
- Useful to change html, for example, change
-
cit
- change in tag- Example
<p>Some | text</p>
: If cursor isl
,ciw
will replaceSome text
inside<p></p>
- Example
Support text objects needs some refactoring. I'll get to this one later.
Desperately want this. I'll name my first born after you if you do it.
Don't foget:
-
ct
X - change till X, moves forward -
cT
X - change till X, moves backward -
cf
X - change till X (including X), moves forward -
cF
X - change till X (including X), moves backward
Parts of text objects are supported in 1.3.1. See #1 - "Text objects (only in Visual mode or after an operator)" for detail.
@Beatusvir "Till" is not a "text object" and is supported several versions before.
Just want to say thanks for the partial support for text objects, the stuff that is in there seems to work well.
I'll add another vote for the visual select stuff which is still missing like viB
, vi(
, etc.
Useful for confirming the operation in some situations instead of going straight ahead with c
or d
.
@gentius Yes, visual mode support and word/sentence/paragraph support is missing now. Going to add them soon.
I like to use vip
and vap
which prevents me from using this particular extension.
Version 1.31.0 has just been released today which enables tag-style text objects (cit
, dit
etc). Please give it a test run and let us know how it works for you.