by rgoulter · 4y ago · 0 comments
Reiterating point 3 from the article: e.g. if the cursor is at | in:
printf("Hello |World\n");
With vim, you could manipulate the text in different ways by using different motions, e.g.:`db` would give `printf("World\n");` (b for backwards),
`de` would give `printf("Hello \n");` (e for end-of-word),
`di"` would give `printf("");` (inside `"`),
`di(` would give `printf();` (inside `(`),
or instead of deleting, some actions could be useful, like changing to uppercase: e.g.
`gUi"` would give `printf("HELLO WORLD\n");`
I always at least whip through such articles about vim as there may be something I don't use daily, but could. There always is such a thing.
I love to use all the zero-configuration things that are already present in Vi/Vim at work. IDE's are cool for devs or people who do everything from a stable workstation. I rarely have such comfort, jumping from one server to another, from one image to another. And Vi or Vim are always there. Thanks for all those hints.
ctrl+backspace: `printf("World\n");`
ctrl+delete: `printf("Hello \n");`
alt+shift+right, alt+shift+right, delete: `printf();`