Vim: Use :.! ls
to pull the directory listing into your file. This works with any command line command. That period’s a nifty trick.
Vim: Use :.! ls
to pull the directory listing into your file. This works with any command line command. That period’s a nifty trick.
Great trick – didn’t know this, thanks for sharing!
Experimenting with this, I found out you can use any line number instead of the period if you want to insert the output elsewhere.
That makes sense. The ‘.’ just means here, so putting a number would indicate the line number otherwise. I didn’t think about that, but it’s a nifty trick to have, too. Thanks!