Hi: I am trying to send a command to shell that invoke cleartools to
checkout/in files that I am currently working on. unfortunatly, I am
pretty new to vim and I've tried searching throught the man pages, but
I cant' seem to figure out how to do so. Any help would be
appreciated. Thanks!
I have this in my _vimrc file:
function! CHANGE_CURR_DIR()
let _dir = expand("%:p:h")
let _filename = expand("%") //I added this line
exec "cd " . _dir
unlet _dir
endfunction
autocmd BufEnter * call CHANGE_CURR_DIR()
I think the above code automatically sets the current working
directory to the file that I am editing at the moment and also sets _dir and
_filename.
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>
The "filename" is the current file name that I am editing. I can't
seem to figure out how to expand the variable "_filename" into string
to be put into the ex command. Can anyone help me? I've tried
many things, but nothing will work....
--
View this message in context:
http://www.nabble.com/current-file-name-to-apped-to-an-ex-command-tf3618091.html#a10102666
Sent from the Vim - General mailing list archive at Nabble.com.