News for hackers. Stuff that matters.
Re:Become Shell Literate by larkinrichards on Saturday December 12, 2020 @03:21PM (#25401336)
I spend many hours of each day ~programming~ wrangling text files and I use macos + zsh + textmate2 for my daily drivers. I see shell as an important proficiency because it helps maintain a lower-level understanding of how the "magical" GUI "works," which often helps in debugging obtuse errors, and I'm sad to encounter more engineers who are completely unfamiliar with it.

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.
Re:Become Shell Literate by doppioandante on Sunday December 13, 2020 @10:25AM (#25407159)
This is exactly how I would have done it, just using my editor of choice (kakoune) instead. I also wrote on Drew's mailing list in case anyone is interested: https://lists.sr.ht/~sircmpwn/public-inbox/%3CCAKW6382rV5iW2...