Run bash commands on open file
Useful for making sure a script isn't breaking things, or piping in data from a command . Helps maintain flow ^^
Run the current file in Python/PHP/Etc.
: !python %
Source the current file:
: !source %
Write the output of the command into the file ( in this case, print the path to the file's directory)
:r !pwd
Legend:
: - Enter command mode
! - Run an external command
!! - Rerun the last external command
% - Refer to the current document
r - write the output of the external command into the file
Written by nick
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Related Tags
#vim
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#