original ↗
chrisdeluca.me·18h·
Discuss: Hacker News
Flag this post
git status -s | awk '{print $2}' | xargs your-editor

Replace your-editor with the command to launch, well, your editor. If you use a terminal editor, like Neovim, you’re all set. If you use a graphical editor, there may be some more setup.

The command breakdown:

  1. git status -s: Show all the modified files. The -s flag shortens the output to a single line per file. e.g. M path/to/your/file.js.
  2. awk '{print $2}': we pass each line to AWK, which…

Similar Posts

Loading similar posts...