I would like to create two commands for vim:
1 -
example code:
var a = "My string to be replaced";
So imagine that the cursor is on top of any letter inside the ". I would use the command ds" and it would do the equivalent of
T"
dt"
i
so it would delete everything inside the string and enter in insert mode automatically. If it is a function it would use the character used to call the command inside it, so dt" would delete everything inside " and dt'would delete everything inside ''.
2 -
example code:
class SomeClassNameHere {
so now imagine the cursor is somewhere on top of 'Name' and I would like to use a command that would put the cursor on the first uppercase character on the left of the current position and after that delete everything till the first uppercase character on the right (non including the character itself) and enter insert mode. This command is similar to the first one but it will look for an uppercase letter which probably is means the commands will need to use some regular expression like [A-Z]. After the command the code would look like that:
class SomeClassHere {
I would like those be some kind of map that I can add to my .vimrc file.
di'anddi"to delete everything inside single and double quotes respectively. It will not enter insert mode automatically though.ds"you actually meanci".