How can I use the output of an external command as an argument for tabnew?
In mine .bashrc
, I have the following short script to get the current date.
D(){ date +'%F'; }
In mine .vimrc
, I have the following two lines to do this so that I can use this function.
set shell=bash\ --login
set shellcmdflag=-ic
I have tested that the function works in vim
by checking that the following command will buffer the current date.
:r !D
However, I would like to use the output of this bash function as an argument for tabnew
so that I can open a file named current date in a new tab.
:tabnew !D
Unfortunately, the behavior of this command is to create a new tab with a literal filename !D
isntead of the output.
How can I get the output of an external command as an argument tabnew
instead?
source to share