Re: current file name to apped to an ex command

2007-04-20 Thread Gary Johnson
On 2007-04-20, darkwalk <[EMAIL PROTECTED]> wrote:
> 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!

If you're using ClearCase, I'd recommend Doug Potts's ccase.vim 
script,

http://vim.sourceforge.net/scripts/script.php?script_id=15

HTH,
Gary

-- 
Gary Johnson | Agilent Technologies
[EMAIL PROTECTED] | Mobile Broadband Division
 | Spokane, Washington, USA


Re: current file name to apped to an ex command (2)

2007-04-20 Thread Tim Chase
> 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()

You may also want to investigate the 'autochdir' option

:help 'autochdir'

which exploits Vim's builtin ability to do what you're describing
above.

-tim







Re: current file name to apped to an ex command

2007-04-20 Thread Tim Chase
> I would like to map  to execute the following code within the
> shell. This si what I have so far:
> 
> map  :!cleartool co -c . "filename"


You might try

nnoremap  :!cleartool co -c . "%"

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"

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






current file name to apped to an ex command

2007-04-20 Thread darkwalk

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  to execute the following code within the
shell. This si what I have so far:

map  :!cleartool co -c . "filename"

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.