Archived post: posted sometime between 2016 and 2022.

Vim: execute the current file

:!%:p

or

:! sh %

Explanation:

See also: https://stackoverflow.com/questions/15449591/vim-execute-current-file