I have an alias alias new='misc.sh new'
that works fine in the shell. The script misc.sh has a few functions one is named 'new'. When the alias is called from vim :! new arg
I get this syntax error:
syntax error near unexpected token `('
This is the first function in the script misc.sh, the syntax error points to this function. I don't think the problem is this function though.
#!/usr/bin/env bash
updatem(){ #both
#update all python modules
echo 'Outdated packages are'
pip3 list --outdated
for p in $(pip3 list -o --format freeze); do pip3 install -U ${p%%=*}; done
}
OUT=$(date +%m-%d-%H-%M-%S)
tags(){ #both
echo 'Another function'
}
new(){
echo 'This is my function'
}
I have tried this and it does not work:
new(){ misc.sh new; }
I don't know why it works fine in the command line but not in vim.