Re: how to open an already opened file into an new tab?

2007-05-10 Thread lin q

Great, this works.

Another question, :tabe % can open the same file, is there an easy way to 
open another file which locates in the same or very similar directory of the 
current file?


For example, I am viewing f2 now, and I want to open f3 which is of same 
directory of f2 and to open f4 whose path is f2 location/../i/f4.


Any trick to do this?



From: Taylor Venable [EMAIL PROTECTED]
To: lin q [EMAIL PROTECTED]
CC: vim@vim.org
Subject: Re: how to open an already opened file into an new tab?
Date: Tue, 8 May 2007 17:54:57 -0400

On Tue, 08 May 2007 15:45:40 -0600
lin q [EMAIL PROTECTED] wrote:

   This causes that on the tabline, the full path of f2 shows after
 some abbreviation. Now I want to open f2 into another tab, but I do
 not find an easy way to do that.

   If use :tabe, I need to type in the full path of f2, for my case,
 it is very long.

You can substitute the full path of the current file with the character
% in an ex-command.  So, assuming you're already viewing f2, you can
do the following:

:tabe %

And it will re-open the current file in another tab.

--
Taylor Venable
[EMAIL PROTECTED]
http://www.metasyntax.net/


_
PC Magazine’s 2007 editors’ choice for best Web mail—award-winning Windows 
Live Hotmail. 
http://imagine-windowslive.com/hotmail/?locale=en-usocid=TXT_TAGHM_migration_HM_mini_pcmag_0507




Re: how to open an already opened file into an new tab?

2007-05-10 Thread Micah Cowan
lin q wrote:
 Great, this works.
 
 Another question, :tabe % can open the same file, is there an easy way
 to open another file which locates in the same or very similar directory
 of the current file?
 
 For example, I am viewing f2 now, and I want to open f3 which is of same
 directory of f2 and to open f4 whose path is f2 location/../i/f4.
 
 Any trick to do this?

:tabe %:p:h/f2 | tabe %:p:h/../i/f4

See :he :_%  and  :h filename-modifiers.

-- 
HTH,
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/




signature.asc
Description: OpenPGP digital signature


Re: how to open an already opened file into an new tab?

2007-05-10 Thread Franco Saliola

On 5/10/07, lin q [EMAIL PROTECTED] wrote:

Great, this works.

Another question, :tabe % can open the same file, is there an easy way to
open another file which locates in the same or very similar directory of the
current file?

For example, I am viewing f2 now, and I want to open f3 which is of same
directory of f2 and to open f4 whose path is f2 location/../i/f4.

Any trick to do this?


I justed started reading the tips. Check out tip 2. (As I said, I just
started ging through them.)

http://www.vim.org/tips/tip.php?tip_id=2

Franco


Re: how to open an already opened file into an new tab?

2007-05-08 Thread Taylor Venable
On Tue, 08 May 2007 15:45:40 -0600
lin q [EMAIL PROTECTED] wrote:

   This causes that on the tabline, the full path of f2 shows after
 some abbreviation. Now I want to open f2 into another tab, but I do
 not find an easy way to do that.
 
   If use :tabe, I need to type in the full path of f2, for my case,
 it is very long.

You can substitute the full path of the current file with the character
% in an ex-command.  So, assuming you're already viewing f2, you can
do the following:

:tabe %

And it will re-open the current file in another tab.

-- 
Taylor Venable
[EMAIL PROTECTED]
http://www.metasyntax.net/


Re: how to open an already opened file into an new tab?

2007-05-08 Thread A.J.Mechelynck

lin q wrote:

Hi,
 Let us say VIM already have f1 and f2 opened in 2 tabs, when I opened 
f2 I use this command:


  vim --servername GVIM1 --remote-tab f2

 This causes that on the tabline, the full path of f2 shows after some 
abbreviation. Now I want to open f2 into another tab, but I do not find 
an easy way to do that.


 If use :tabe, I need to type in the full path of f2, for my case, it is 
very long.


 Any suggestion?

_
PC Magazine’s 2007 editors’ choice for best Web mail—award-winning 
Windows Live Hotmail. 
http://imagine-windowslive.com/hotmail/?locale=en-usocid=TXT_TAGHM_migration_HM_mini_pcmag_0507 





1. Open the tab where the file is already open (e.g. by clicking on the tabs).
2. If there are split windows in this tab, make sure the one you want is 
current.
3. :tab split

See :help :tab


Best regards,
Tony.
--
What are we going to do?

Me, I'm examining the major Western religions.  I'm looking for
something that's soft on morality, generous with holidays, and has a
short initiation period.