New vs split

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

New vs split

Ven Tadipatri
Is there a difference between new and split? If they're the same, is
one considered more 'standard'? Or if they're different, when would
you use one versus the other? I think both have vertical equivalents
right (vnew and vsplit)?

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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|

Re: New vs split

Jürgen Krämer-4

Hi,

Ven Tadipatri wrote:
> Is there a difference between new and split? If they're the same, is
> one considered more 'standard'? Or if they're different, when would
> you use one versus the other? I think both have vertical equivalents
> right (vnew and vsplit)?

their behavior is the same if you provide both commands with a file name.

If you don't, :split creates a new window for the current buffer, while
:new creates a new buffer and a new window for this buffer.

Regards,
Jürgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|

Re: New vs split

Charles Campbell
In reply to this post by Ven Tadipatri
Ven Tadipatri wrote:
> Is there a difference between new and split? If they're the same, is
> one considered more 'standard'? Or if they're different, when would
> you use one versus the other? I think both have vertical equivalents
> right (vnew and vsplit)?
>
They are not the same at all.

new/vnew creates an empty window
split/vsplit splits the current window, showing the same buffer in both

Regards,
Chip Campbell

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|

Re: New vs split

Charles Campbell
In reply to this post by Ven Tadipatri
Ven Tadipatri wrote:
> Is there a difference between new and split? If they're the same, is
> one considered more 'standard'? Or if they're different, when would
> you use one versus the other? I think both have vertical equivalents
> right (vnew and vsplit)?
>

These commands are definitely not the same.

new/vnew : split the window, but edit a new (empty) buffer
split/vsplit : split the window, but edit the same buffer

Regards,
C Campbell

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|

Re: New vs split

Benjamin Fritz
In reply to this post by Ven Tadipatri
On Monday, February 4, 2013 9:48:40 AM UTC-6, vtadipatri wrote:
> Is there a difference between new and split? If they're the same, is
>
> one considered more 'standard'? Or if they're different, when would
>
> you use one versus the other? I think both have vertical equivalents
>
> right (vnew and vsplit)?
>

I *think* the only difference is when you don't specify a file name, :new and :vnew give you an empty buffer, but :split and :vsplit use the current buffer.

I'm not 100% certain on that however.

:help :split_f is the entry for both :split and :new commands, so probably this is the case.

I normally use :new or :e when creating a new file and :sp or CTRL-W_S to create new splits on an existing buffer, but I don't *need* to do it that way.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.