How do I open a blank new file in a split in Vim?
Multi tool use
Must be something super obvious, but I can't figure out, and Google is not helping out either.
vim
add a comment |
Must be something super obvious, but I can't figure out, and Google is not helping out either.
vim
add a comment |
Must be something super obvious, but I can't figure out, and Google is not helping out either.
vim
Must be something super obvious, but I can't figure out, and Google is not helping out either.
vim
vim
edited Jan 5 at 14:09
rominf
1506
1506
asked Nov 18 '10 at 10:33
hakanensarihakanensari
747279
747279
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
:help new
:help vnew
should bring you on course.
you will have a new buffer then, obviously. that buffer becomes a file only if you :w
it to the disk.
5
And:set splitright
puts the new split on the right. Awesome, thanks
– hakanensari
Nov 18 '10 at 13:56
2
Also:set splitbelow
is the corresponding command to make the new split appear on the bottom when splitting horizontally.
– dsaxton
Apr 22 '16 at 14:10
add a comment |
another way is to do a <CTRL + W> n
in normal mode. This will create a new split.
EDIT:
You can also do <CTRL + W> v
in normal mode to create a vertical split (the previous one will do a horizontal split.
And just to be complete, you move to the different splits by doing <CTRL + W> <direction>
with the direction being any h
, j
, k
, or l
To close a buffer, do <CTRL + W> q
fyi: these open the current buffer in a new split, not a new file in a new split.
– Emile 81
May 10 '17 at 8:44
1
For me,Ctrl+w n
opens a split with a new buffer, butCtrl+w v
just splits the current buffer. Strange.
– c24w
Aug 4 '17 at 8:46
1
if you're looking to create a vertical split with a new file, check out this question/answer vi.stackexchange.com/questions/2811/…
– g19fanatic
Aug 4 '17 at 11:42
add a comment |
vim myfile.txt # open one file in one window
:buffers " shows one buffer with "myfile.txt" in it
:sp " create split window; we now have one buffer with two windows.
:e newfile.txt " create new buffer with new filename in first window
:buffers " shows two buffers (myfile.txt & newfile.txt), each in own window
This is a good link: http://vim.wikia.com/wiki/Easier_buffer_switching
add a comment |
I used the Vim menu under File - Split Open. You will have to give a name for your new blank file though.
Vim has a menu?
– frabjous
Nov 18 '10 at 16:23
gvim or macvim are able to display a menu, yes. what did you expect? :)
– akira
Nov 18 '10 at 16:26
It seems that :sp also can work -- for those not using the gvim version.
– Rolnik
Nov 18 '10 at 18:58
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f212257%2fhow-do-i-open-a-blank-new-file-in-a-split-in-vim%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
:help new
:help vnew
should bring you on course.
you will have a new buffer then, obviously. that buffer becomes a file only if you :w
it to the disk.
5
And:set splitright
puts the new split on the right. Awesome, thanks
– hakanensari
Nov 18 '10 at 13:56
2
Also:set splitbelow
is the corresponding command to make the new split appear on the bottom when splitting horizontally.
– dsaxton
Apr 22 '16 at 14:10
add a comment |
:help new
:help vnew
should bring you on course.
you will have a new buffer then, obviously. that buffer becomes a file only if you :w
it to the disk.
5
And:set splitright
puts the new split on the right. Awesome, thanks
– hakanensari
Nov 18 '10 at 13:56
2
Also:set splitbelow
is the corresponding command to make the new split appear on the bottom when splitting horizontally.
– dsaxton
Apr 22 '16 at 14:10
add a comment |
:help new
:help vnew
should bring you on course.
you will have a new buffer then, obviously. that buffer becomes a file only if you :w
it to the disk.
:help new
:help vnew
should bring you on course.
you will have a new buffer then, obviously. that buffer becomes a file only if you :w
it to the disk.
answered Nov 18 '10 at 13:19
akiraakira
48.8k15112152
48.8k15112152
5
And:set splitright
puts the new split on the right. Awesome, thanks
– hakanensari
Nov 18 '10 at 13:56
2
Also:set splitbelow
is the corresponding command to make the new split appear on the bottom when splitting horizontally.
– dsaxton
Apr 22 '16 at 14:10
add a comment |
5
And:set splitright
puts the new split on the right. Awesome, thanks
– hakanensari
Nov 18 '10 at 13:56
2
Also:set splitbelow
is the corresponding command to make the new split appear on the bottom when splitting horizontally.
– dsaxton
Apr 22 '16 at 14:10
5
5
And
:set splitright
puts the new split on the right. Awesome, thanks– hakanensari
Nov 18 '10 at 13:56
And
:set splitright
puts the new split on the right. Awesome, thanks– hakanensari
Nov 18 '10 at 13:56
2
2
Also
:set splitbelow
is the corresponding command to make the new split appear on the bottom when splitting horizontally.– dsaxton
Apr 22 '16 at 14:10
Also
:set splitbelow
is the corresponding command to make the new split appear on the bottom when splitting horizontally.– dsaxton
Apr 22 '16 at 14:10
add a comment |
another way is to do a <CTRL + W> n
in normal mode. This will create a new split.
EDIT:
You can also do <CTRL + W> v
in normal mode to create a vertical split (the previous one will do a horizontal split.
And just to be complete, you move to the different splits by doing <CTRL + W> <direction>
with the direction being any h
, j
, k
, or l
To close a buffer, do <CTRL + W> q
fyi: these open the current buffer in a new split, not a new file in a new split.
– Emile 81
May 10 '17 at 8:44
1
For me,Ctrl+w n
opens a split with a new buffer, butCtrl+w v
just splits the current buffer. Strange.
– c24w
Aug 4 '17 at 8:46
1
if you're looking to create a vertical split with a new file, check out this question/answer vi.stackexchange.com/questions/2811/…
– g19fanatic
Aug 4 '17 at 11:42
add a comment |
another way is to do a <CTRL + W> n
in normal mode. This will create a new split.
EDIT:
You can also do <CTRL + W> v
in normal mode to create a vertical split (the previous one will do a horizontal split.
And just to be complete, you move to the different splits by doing <CTRL + W> <direction>
with the direction being any h
, j
, k
, or l
To close a buffer, do <CTRL + W> q
fyi: these open the current buffer in a new split, not a new file in a new split.
– Emile 81
May 10 '17 at 8:44
1
For me,Ctrl+w n
opens a split with a new buffer, butCtrl+w v
just splits the current buffer. Strange.
– c24w
Aug 4 '17 at 8:46
1
if you're looking to create a vertical split with a new file, check out this question/answer vi.stackexchange.com/questions/2811/…
– g19fanatic
Aug 4 '17 at 11:42
add a comment |
another way is to do a <CTRL + W> n
in normal mode. This will create a new split.
EDIT:
You can also do <CTRL + W> v
in normal mode to create a vertical split (the previous one will do a horizontal split.
And just to be complete, you move to the different splits by doing <CTRL + W> <direction>
with the direction being any h
, j
, k
, or l
To close a buffer, do <CTRL + W> q
another way is to do a <CTRL + W> n
in normal mode. This will create a new split.
EDIT:
You can also do <CTRL + W> v
in normal mode to create a vertical split (the previous one will do a horizontal split.
And just to be complete, you move to the different splits by doing <CTRL + W> <direction>
with the direction being any h
, j
, k
, or l
To close a buffer, do <CTRL + W> q
edited Aug 4 '17 at 11:43
answered Nov 22 '10 at 15:32
g19fanaticg19fanatic
1,116813
1,116813
fyi: these open the current buffer in a new split, not a new file in a new split.
– Emile 81
May 10 '17 at 8:44
1
For me,Ctrl+w n
opens a split with a new buffer, butCtrl+w v
just splits the current buffer. Strange.
– c24w
Aug 4 '17 at 8:46
1
if you're looking to create a vertical split with a new file, check out this question/answer vi.stackexchange.com/questions/2811/…
– g19fanatic
Aug 4 '17 at 11:42
add a comment |
fyi: these open the current buffer in a new split, not a new file in a new split.
– Emile 81
May 10 '17 at 8:44
1
For me,Ctrl+w n
opens a split with a new buffer, butCtrl+w v
just splits the current buffer. Strange.
– c24w
Aug 4 '17 at 8:46
1
if you're looking to create a vertical split with a new file, check out this question/answer vi.stackexchange.com/questions/2811/…
– g19fanatic
Aug 4 '17 at 11:42
fyi: these open the current buffer in a new split, not a new file in a new split.
– Emile 81
May 10 '17 at 8:44
fyi: these open the current buffer in a new split, not a new file in a new split.
– Emile 81
May 10 '17 at 8:44
1
1
For me,
Ctrl+w n
opens a split with a new buffer, but Ctrl+w v
just splits the current buffer. Strange.– c24w
Aug 4 '17 at 8:46
For me,
Ctrl+w n
opens a split with a new buffer, but Ctrl+w v
just splits the current buffer. Strange.– c24w
Aug 4 '17 at 8:46
1
1
if you're looking to create a vertical split with a new file, check out this question/answer vi.stackexchange.com/questions/2811/…
– g19fanatic
Aug 4 '17 at 11:42
if you're looking to create a vertical split with a new file, check out this question/answer vi.stackexchange.com/questions/2811/…
– g19fanatic
Aug 4 '17 at 11:42
add a comment |
vim myfile.txt # open one file in one window
:buffers " shows one buffer with "myfile.txt" in it
:sp " create split window; we now have one buffer with two windows.
:e newfile.txt " create new buffer with new filename in first window
:buffers " shows two buffers (myfile.txt & newfile.txt), each in own window
This is a good link: http://vim.wikia.com/wiki/Easier_buffer_switching
add a comment |
vim myfile.txt # open one file in one window
:buffers " shows one buffer with "myfile.txt" in it
:sp " create split window; we now have one buffer with two windows.
:e newfile.txt " create new buffer with new filename in first window
:buffers " shows two buffers (myfile.txt & newfile.txt), each in own window
This is a good link: http://vim.wikia.com/wiki/Easier_buffer_switching
add a comment |
vim myfile.txt # open one file in one window
:buffers " shows one buffer with "myfile.txt" in it
:sp " create split window; we now have one buffer with two windows.
:e newfile.txt " create new buffer with new filename in first window
:buffers " shows two buffers (myfile.txt & newfile.txt), each in own window
This is a good link: http://vim.wikia.com/wiki/Easier_buffer_switching
vim myfile.txt # open one file in one window
:buffers " shows one buffer with "myfile.txt" in it
:sp " create split window; we now have one buffer with two windows.
:e newfile.txt " create new buffer with new filename in first window
:buffers " shows two buffers (myfile.txt & newfile.txt), each in own window
This is a good link: http://vim.wikia.com/wiki/Easier_buffer_switching
edited Oct 3 '16 at 23:11
n.st
1,322924
1,322924
answered Sep 24 '16 at 20:06
edWedW
1112
1112
add a comment |
add a comment |
I used the Vim menu under File - Split Open. You will have to give a name for your new blank file though.
Vim has a menu?
– frabjous
Nov 18 '10 at 16:23
gvim or macvim are able to display a menu, yes. what did you expect? :)
– akira
Nov 18 '10 at 16:26
It seems that :sp also can work -- for those not using the gvim version.
– Rolnik
Nov 18 '10 at 18:58
add a comment |
I used the Vim menu under File - Split Open. You will have to give a name for your new blank file though.
Vim has a menu?
– frabjous
Nov 18 '10 at 16:23
gvim or macvim are able to display a menu, yes. what did you expect? :)
– akira
Nov 18 '10 at 16:26
It seems that :sp also can work -- for those not using the gvim version.
– Rolnik
Nov 18 '10 at 18:58
add a comment |
I used the Vim menu under File - Split Open. You will have to give a name for your new blank file though.
I used the Vim menu under File - Split Open. You will have to give a name for your new blank file though.
answered Nov 18 '10 at 13:44
RolnikRolnik
1,19721225
1,19721225
Vim has a menu?
– frabjous
Nov 18 '10 at 16:23
gvim or macvim are able to display a menu, yes. what did you expect? :)
– akira
Nov 18 '10 at 16:26
It seems that :sp also can work -- for those not using the gvim version.
– Rolnik
Nov 18 '10 at 18:58
add a comment |
Vim has a menu?
– frabjous
Nov 18 '10 at 16:23
gvim or macvim are able to display a menu, yes. what did you expect? :)
– akira
Nov 18 '10 at 16:26
It seems that :sp also can work -- for those not using the gvim version.
– Rolnik
Nov 18 '10 at 18:58
Vim has a menu?
– frabjous
Nov 18 '10 at 16:23
Vim has a menu?
– frabjous
Nov 18 '10 at 16:23
gvim or macvim are able to display a menu, yes. what did you expect? :)
– akira
Nov 18 '10 at 16:26
gvim or macvim are able to display a menu, yes. what did you expect? :)
– akira
Nov 18 '10 at 16:26
It seems that :sp also can work -- for those not using the gvim version.
– Rolnik
Nov 18 '10 at 18:58
It seems that :sp also can work -- for those not using the gvim version.
– Rolnik
Nov 18 '10 at 18:58
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f212257%2fhow-do-i-open-a-blank-new-file-in-a-split-in-vim%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Vhd4YU6qBIDOLR4i8VE0WnxMPoJ,IHg GyzjeCCXtzecitQ,dNlQIcyUcsaT9mtO