targets.vim
targets.vim copied to clipboard
[RFC] Add mappings for first and last text objects in current line?
Inspired by #80.
It could be useful to have mappings like
-
ciF"
to change inside the first quotes in the current line -
ciL"
to change inside the last quotes in the current line
This should not be confused with the current word last
meaning previous
.
I think the current L
and N
mappings are not really useful, so I think we could use F
and L
for this.
Any comments?
Also a count could be used to select the second c2iF"
or penultimate c2iL"
text object in the current line.
A slight tangent, but I think I would prefer l
and n
to always select the next proper quote, similar to the functionality of L
and N
. I almost never want the pseudo-quote. Ideally I could then do:
cin'[some changes]
cin'[some changes]
cin'[some changes]
... to change every quoted string on a line.
This would better free up L
and N
so that you can implement the F
and L
functionality described above, without removing the utility of L
and N
.
I do think that the F
and L
mappings would be useful, but I don't anticipate using them very much. It's one of those things where if I have it available, it might creep into my Vim workflow, but it might take a while. It's not much harder to type $cil'
instead of ciL'
. It's also less to memorize.
Solid points. Thinking about it I can't remember using any quote text objects to operate on pseudo quotes. I will consider your suggestion. :+1: