by larkinrichards · 5y ago · 0 comments
When it comes to examples like that posted by the OP, I like the combination of piping/pasting to mate and multi-caret editing for most scenarios where others would reach for awk/xargs.
Here's me following the same example scenario but with multi-caret editing (slowed down slightly):
https://user-images.githubusercontent.com/226503/101993951-6...
Step by step:
1. git status -s | mate
2. select " D" with arrow keys + shift
3. command-E macos default for "use selection to find"
4. option-command-F to find all (multi-caret editing starts)
5. type "git checkout" to replace " D"
6. command-left to move cursor to start of line, then shift-command-right to select to end of line.
7. copy
8. select all + delete (clear document)
9. paste,
10. press return to insert newlines
11. select all + copy
12. switch back to terminal
13. paste
To me, this is many small steps, but each step is more mechanical and flows naturally, and the general flexibility of multi-caret editing means it is applicable more often in my daily work.