Hope you're doing well.
Input:
let firstDate = src[0][0]|.toString();
^
cursor in Insert mode
Desired output:
let firstDate = |.toString();
^
cursor in Insert mode
So deleting src[0][0]
. Currently I always spam <C-w>
(in this case 6 times).
I found a similar question with the solution being, in Normal mode, cT<space>
. The problem is that after entering Normal mode, the cursor is here:
let firstDate = src[0][0].toString();
^
cursor in Normal mode
The result after jkcT<space>
(jk
is my remap to escape Insert mode)
let firstDate = |].toString();
^
cursor in Insert mode
It leaves the ]
behind, which is not what I want.
Also, is there any way I can do so without leaving Insert mode? I rarely use <C-U>
so any remapping is fine with me too. Remapping with <C-b>
in Insert mode seems appropriate. I'm open to use any vim/neovim plugin as well.
I thought I found the solution in this SO solution but the solution still requires 6 <C-b>
to delete till previous whitespace.
Thank you!
f.
orF.
depending on direction and typedT<space>
.