> I would like to map <F12> to execute the following code within the
> shell. This si what I have so far:
> 
> map <F12> :!cleartool co -c . "filename"<CR>


You might try

        nnoremap <f12> :!cleartool co -c . "%"<cr>

The percent is expanded to be the current file name.

        :help :_%

has more details on some of these.  You even use it in your
previous mapping (the "%:p:h").  If needed, you can even use the
same modifiers as in

        ... -c . "%:p"<cr>

to specify the full filename-cum-path

You might also use "lcd" ("local-cd") instead of "cd" in your
other mapping:

        :help :lcd

in comparison to the help found above it at

        :help :cd

-tim




Reply via email to