I just started learning VIM, as I want to enhance my editing skills and speed.
In the process.. I've been spending time trying to make VIM more like home... and much thanks to withgod bundle, it makes the process a lot easier.
For those whom like to compile either a single file or the whole directory.. VIM only has 1 makeprg as much as I can find. I had to create a map key so that I could do both.
I first got
https://github.com/embear/vim-localvimrc and used it to so i can have a local directory settings for each of my projects.
in my .lvimrc file:
Code:
let &l:makeprg="cd ".g:localvimrc_script_dir." && ./compile.sh"
syntax on
set nu
set autoindent
map <silent> <F8> :make<CR>
map <silent> <F9> :make %:p<CR>
So, if I press F8, it compiles the whole directory. If I press F9, it compiles on the single file I'm working on.
I hope this helps prevent you from having to look and search as hard as I did for this information.
Also..
for some reason VIM doesn't like partial paths for QucikFix. If you double click an error using the current compile.sh file, you won't open the file up.
Here is my compile.sh
Code:
#!/bin/bash
cd "$(dirname "$0")"
fullpath=${PWD};
test -e compiled || mkdir compiled
if [[ $# -ne 0 ]]
then
for i in "$@";
do
smxfile="`echo $i | sed -e 's/\.sp$/\.smx/'`";
echo -n "Compiling $i...";
./spcomp $i -ocompiled/$smxfile
done
else
for sourcefile in *.sp
do
fullpathsourcefile="`echo $fullpath/$sourcefile`";
smxfile="`echo $sourcefile | sed -e 's/\.sp$/\.smx/'`";
echo -n "Compiling $sourcefile ...";
./spcomp $fullpathsourcefile -ocompiled/$smxfile
done
fi
__________________