Opening files in new windows

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Opening files in new windows

Ven Tadipatri
So I'm in vim currently looking at a file that has another filename
and I want to be able to open that particular file in a new, I guess
'buffer'. I tried ctrl+w then gf, but that opens it up into something
that looks like a tab. The only way I could figure out how to navigate
to it is by clicking on the tab at the top of the screen. First of
all, I'm quite confused between tabs, windows, buffers, and viewports.
Normally when I have a file open, I can do :new or :sp and look at
another file and jump to it using ctrl+w, but the behavior for ctrl+w,
then gf seems to be different. Furthermore I can't seem to get to the
other 'tabs' using ctrl+w or :next or :bn. Is there some other command
for navigating these tabs or whatever they're called?
   Could someone help clarify things? All I want to do is be able to
highlight the name of a file, and open it up in the
buffer/window/viewport/tab/whatever that I get when I do :new, so I
can navigate to it using ctrl+w.

Thanks,
Ven

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Opening files in new windows

David Kahn


On Wed, May 18, 2011 at 4:18 PM, Ven Tadipatri <[hidden email]> wrote:
So I'm in vim currently looking at a file that has another filename
and I want to be able to open that particular file in a new, I guess
'buffer'. I tried ctrl+w then gf, but that opens it up into something
that looks like a tab. The only way I could figure out how to navigate
to it is by clicking on the tab at the top of the screen. First of
all, I'm quite confused between tabs, windows, buffers, and viewports.
Normally when I have a file open, I can do :new or :sp and look at
another file and jump to it using ctrl+w, but the behavior for ctrl+w,
then gf seems to be different. Furthermore I can't seem to get to the
other 'tabs' using ctrl+w or :next or :bn. Is there some other command
for navigating these tabs or whatever they're called?
  Could someone help clarify things? All I want to do is be able to
highlight the name of a file, and open it up in the
buffer/window/viewport/tab/whatever that I get when I do :new, so I
can navigate to it using ctrl+w.

One simple way to open in a horizontal split would be

:sp file_path_here
 

Thanks,
Ven

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Opening files in new windows

Ven Tadipatri
In reply to this post by Ven Tadipatri
Ah, ok, so they are 'tabs'. But why should ctrl+w, gf open a new tab
as opposed to a new window? And I can see that gt navigates through
tabs, but is there a way I can navigate forward 3 tabs, like :b3 for
buffers? I could yank the filename into a register, then do :sp and
paste it from the register, but it's a bit cumbersome.

Thanks,
Ven

On Wed, May 18, 2011 at 5:18 PM, Ven Tadipatri <[hidden email]> wrote:

> So I'm in vim currently looking at a file that has another filename
> and I want to be able to open that particular file in a new, I guess
> 'buffer'. I tried ctrl+w then gf, but that opens it up into something
> that looks like a tab. The only way I could figure out how to navigate
> to it is by clicking on the tab at the top of the screen. First of
> all, I'm quite confused between tabs, windows, buffers, and viewports.
> Normally when I have a file open, I can do :new or :sp and look at
> another file and jump to it using ctrl+w, but the behavior for ctrl+w,
> then gf seems to be different. Furthermore I can't seem to get to the
> other 'tabs' using ctrl+w or :next or :bn. Is there some other command
> for navigating these tabs or whatever they're called?
>   Could someone help clarify things? All I want to do is be able to
> highlight the name of a file, and open it up in the
> buffer/window/viewport/tab/whatever that I get when I do :new, so I
> can navigate to it using ctrl+w.
>
> Thanks,
> Ven
>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Opening files in new windows

David Kahn


On Wed, May 18, 2011 at 4:28 PM, Ven Tadipatri <[hidden email]> wrote:
Ah, ok, so they are 'tabs'. But why should ctrl+w, gf open a new tab
as opposed to a new window? And I can see that gt navigates through
tabs, but is there a way I can navigate forward 3 tabs, like :b3 for
buffers? I could yank the filename into a register, then do :sp and
paste it from the register, but it's a bit cumbersome.

I might not be much help -- and you very well may be more experienced in vim than I -- but for me dealing with files I use NERDTree. Also tried FuzzyFinder which is pretty nice too, but have ended up just using NT. Otherwise kind of a pain to be typing or copying the file paths all the time, at least from what I have found.
 

Thanks,
Ven

On Wed, May 18, 2011 at 5:18 PM, Ven Tadipatri <[hidden email]> wrote:
> So I'm in vim currently looking at a file that has another filename
> and I want to be able to open that particular file in a new, I guess
> 'buffer'. I tried ctrl+w then gf, but that opens it up into something
> that looks like a tab. The only way I could figure out how to navigate
> to it is by clicking on the tab at the top of the screen. First of
> all, I'm quite confused between tabs, windows, buffers, and viewports.
> Normally when I have a file open, I can do :new or :sp and look at
> another file and jump to it using ctrl+w, but the behavior for ctrl+w,
> then gf seems to be different. Furthermore I can't seem to get to the
> other 'tabs' using ctrl+w or :next or :bn. Is there some other command
> for navigating these tabs or whatever they're called?
>   Could someone help clarify things? All I want to do is be able to
> highlight the name of a file, and open it up in the
> buffer/window/viewport/tab/whatever that I get when I do :new, so I
> can navigate to it using ctrl+w.
>
> Thanks,
> Ven
>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Opening files in new windows

Gary Johnson-4
In reply to this post by Ven Tadipatri
On 2011-05-18, Ven Tadipatri wrote:
> So I'm in vim currently looking at a file that has another filename
> and I want to be able to open that particular file in a new, I guess
> 'buffer'. I tried ctrl+w then gf, but that opens it up into something
> that looks like a tab.

Correct.  See

    :help CTRL-W_gf

You probably wanted Ctrl-W f, which opens the file under the cursor
in a split window.  See

    :help CTRL-W_f

> The only way I could figure out how to navigate to it is by
> clicking on the tab at the top of the screen. First of all, I'm
> quite confused between tabs, windows, buffers, and viewports.

    :help windows-intro

> Normally when I have a file open, I can do :new or :sp and look at
> another file and jump to it using ctrl+w, but the behavior for ctrl+w,
> then gf seems to be different. Furthermore I can't seem to get to the
> other 'tabs' using ctrl+w or :next or :bn. Is there some other command
> for navigating these tabs or whatever they're called?

    :help tab-page

>    Could someone help clarify things? All I want to do is be able to
> highlight the name of a file, and open it up in the
> buffer/window/viewport/tab/whatever that I get when I do :new, so I
> can navigate to it using ctrl+w.

HTH,
Gary

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Opening files in new windows

Jeroen Budts
In reply to this post by Ven Tadipatri
On 05/18/2011 11:28 PM, Ven Tadipatri wrote:
> Ah, ok, so they are 'tabs'. But why should ctrl+w, gf open a new tab
> as opposed to a new window? And I can see that gt navigates through
> tabs, but is there a way I can navigate forward 3 tabs, like :b3 for
> buffers?

The gt command accepts a count to go to a specific tab. So if you have 6
tabs, you can do '4gt' to go the tab 4. There is also the gT command to
go to the previous tab.

Jeroen


--
website: http://budts.be/ - twitter: @teranex
___________________________________
Registered Linux User #482240 - GetFirefox.com - ubuntu.com

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Opening files in new windows

Benjamin Fritz
In reply to this post by Ven Tadipatri


On May 18, 4:18 pm, Ven Tadipatri <[hidden email]> wrote:
>    Could someone help clarify things? All I want to do is be able to
> highlight the name of a file, and open it up in the
> buffer/window/viewport/tab/whatever that I get when I do :new, so I
> can navigate to it using ctrl+w.
>

You've got some answers (including advice for using a count with the
gt command). Here's a little more:

http://vim.wikia.com/wiki/Category:Tabs
http://vim.wikia.com/wiki/Using_tab_pages

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php