I'm a long time vi
/vim
user from college days in the 90s, but never considered myself a power user. I'd like to improve at it and the other day I was staring at something in an Ansible playbook like this:
- name: Execute a shell command
shell: "do-this && do-that && this-other-thing && echo 'Done'"
Now imagine deciding that we don't want do that or the other thing, so if I go the space before do-that
and set a mark, and then use search to quickly move over to echo
, how can I either:
- set another mark and then zap the text between the first and second
- zap everything between the first mark and where the cursor is now
In other words, quickly remove everything highlighted here:
- name: Execute a shell command
shell: "do-this && do-that && this-other-thing && echo 'Done'"
# --------------------------------
Normal (command) mode is preferred as this is an open file, make quick edit, and close exercise.