I'm defining my own command in my vimrc:
command! Tcs :normal lvf`hc
The aim is that I go on a backtick and it will delete the inner content from here to the next backtick. Like:
`hi there` -> ``
Problem is that is remains in normal mode, I would like to replicate the c command behaviour so that I can start typing immediately in insert mode.
I've tried command! Tcs :normal lvf`hc :startinsert but whatever I put after the last c will be typed directly in the editor.
Thanks
From :help :normal
>
:norm[al][!] {commands} *:norm* *:normal* (...) {commands} should be a complete command. If {commands} does not finish a command, the last one will be aborted as if <Esc> or <C-C> was typed.
This implies that an insert command must be completed.(...)
In your case the command normal has been aborted that's why you still in normal-mode. You can still try :normal! i
To get what you want instead you can do :
command! Tcs execute "normal lvf`hd" | :startinsert
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With