Hi again,
Well, I got most of the information from the help pages that come with vim (
:help map -> shows info about the map function). I do remember using this page as well (no explanations, but this one gave me the idea and the file to start with):
Map function keys to compile and run your code (Vim Wikia)
I'll give you a breakdown of the commands used in my .vimrc example in the previous post:
map <S-F8> :call Sim_Bash_Frame()<CR> This line assigns the SHIFT-F8 keycombo to a function call, the function name is Sim_Bash_Frame(). The carriage return (<CR>) must be added.
fun! Sim_Bash_Frame() and
endfun
This is the declaration of the function (the one called Sim_Bash_Frame that is run when SHIFT-F8 is pressed. All in between these tags is "exectued" when the keycombo is pressed.
: 0 r ~/_Kast/_simple_bash_frame.vim this loads the framework file into the current vim session.
sil exe "%s/PROGNAME/" .
\ expand("%")
sil tells vim to execute the next command silently (no extra messages are created, if it fails it will not tell you anything).
exe tells vim to executes the string that results from the evaluation of {expr1} as an Ex command. I.e: "%s/PROGNAME/" .
\ expand("%") is seen as en ex statement (in this case a substitution).
expand("%") this expands all between the double quotes, % is special, it means the current filename (example01 in this example).
exe "$d" this deletes the last line (an extra empty line is added while loading the framework file).
:set syntax=sh this sets syntax highlighting for shell files
exe ":20" this put the cursor on line 20.
Feed your search engine with these words: vim map execute function. There are enough examples (and some explanations) out there to get you going. And don't forget vim's help files.
Hope this clears things up a bit.