Writing Shell Scripts in Vim

Make an empty script:

1echo '#!/bin/sh' > ${file}.sh chmod u+x !$ vim !$

Open a terminal in Vim:

1:vert term

Inside that terminal, run the script on repeat:

1watch -d ./${file}.sh

Switch back to editing the script with Control+w h.

Try out a command like ls, then look up the manual for ls by putting the cursor over the word and pressing K.