Calling external command via Vim system command
Suppose that you want to call external git commit
command and pass commit message from Vim register. If register contains ‘hello world’ string, system
will treat each word as a separate command. To fix that issue I dug into Vim docs and found that this works as expected:
echo system("git ci ". '-m ' . string(@t))
Written by Wojtek Ryrych
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#