I am trying to figure out how to get my PBS scripts to highlight in bash format with vim. PBS scripts are just bash scripts that dont start with the clasic shebang but are used on a queuing system on a cluster computer. There must be a way to alias anything that looks like this to :set syntax=sh— without having to type that, right? Here is an example of a simple PBS script.
####Parameterized PBS Script ####
#PBS -S /bin/bash
#PBS -l walltime=00:05:00
#PBS -l nodes=1
#PBS -o /users/me/jobOuts/${PBS_JOBNAME}_${PBS_JOBID}.o
#PBS -j oe
#PBS -M my_email@my.org
#PBS -m abe
START=$(date +%s)
cd $PBS_O_WORKDIR
echo `pwd`
sleep 10
END=$(date +%s)
S=$(( $END - $START ))
((h=S/3600))
((m=S%3600/60))
((s=S%60))
TOTALTIME=`printf "%dh:%dm:%ds\n" $h $m $s`
Thanks!
Add these line to your
.vimrc:And read
:h autocommand, it worth the time.