Re: Remote command equivalent for -q command line option

2008-07-08 Fir de Conversatie Alexei Alexandrov

Ben Schmidt wrote:

 Is it possible to get what I want?
 
 With a little jiggerypokery it should be! Perhaps something like
 
 gvim --remote-send C-\C-N:cfile build.logCR:call foreground()CR
 
 You'd obviously want to wrap that in a shell script or alias...
 
 And there are other possibilities if that doesn't work... If you're on
 Windows, running remote_foreground() in the client might be better than
 running foreground() in the server, for instance; then you'd have to run
 a remote_send in the client, too, via a :call not using the
 --remote-send argument.
 

Err... I'll play with it, thanks! But I just realized that I don't like 
--remote-send since it doesn't create a new Vim instance in case when no 
server is running yet...

Keeping thinking and trying...

-- 
Alexei Alexandrov


--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Remote command equivalent for -q command line option

2008-07-08 Fir de Conversatie Ben Schmidt

Alexei Alexandrov wrote:
 Ben Schmidt wrote:
 Is it possible to get what I want?
 With a little jiggerypokery it should be! Perhaps something like

 gvim --remote-send C-\C-N:cfile build.logCR:call foreground()CR

 You'd obviously want to wrap that in a shell script or alias...

 And there are other possibilities if that doesn't work... If you're on
 Windows, running remote_foreground() in the client might be better than
 running foreground() in the server, for instance; then you'd have to run
 a remote_send in the client, too, via a :call not using the
 --remote-send argument.

 
 Err... I'll play with it, thanks! But I just realized that I don't like 
 --remote-send since it doesn't create a new Vim instance in case when no 
 server is running yet...
 
 Keeping thinking and trying...

If not on Windows, perhaps an autocommand to automatically raise Vim
whenever it opens a file? In .vimrc:

augroup AutoForeground
au!
au BufReadPost * :call foreground()
augroup END

Ben.



--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Remote command equivalent for -q command line option

2008-07-08 Fir de Conversatie Alexei Alexandrov

Ben Schmidt wrote:
 Alexei Alexandrov wrote:
 Err... I'll play with it, thanks! But I just realized that I don't like 
 --remote-send since it doesn't create a new Vim instance in case when no 
 server is running yet...

 Keeping thinking and trying...
 
 If not on Windows, perhaps an autocommand to automatically raise Vim
 whenever it opens a file? In .vimrc:
 
 augroup AutoForeground
 au!
 au BufReadPost * :call foreground()
 augroup END
 

I didn't mean raising, I meant creating a new Vim remote server if one 
doesn't exist yet. This is what silent means in the names of some of 
those command line arguments.

Anyway, I think I end up with

gvim --remote-tab-silent +cfile build.log build.log

for now. It seems to do what I need with a nice side effect of opening 
the build log in a separate tab. Well, maybe it's actually nice since I 
do need to take a look at the log itself sometimes...

We'll see. Thanks for your help, BTW!

-- 
Alexei Alexandrov


--~--~-~--~~~---~--~~
You received this message from the vim_dev maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---