How do I open a blank new file in a split in Vim?












90















Must be something super obvious, but I can't figure out, and Google is not helping out either.










share|improve this question





























    90















    Must be something super obvious, but I can't figure out, and Google is not helping out either.










    share|improve this question



























      90












      90








      90


      12






      Must be something super obvious, but I can't figure out, and Google is not helping out either.










      share|improve this question
















      Must be something super obvious, but I can't figure out, and Google is not helping out either.







      vim






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 5 at 14:09









      rominf

      1506




      1506










      asked Nov 18 '10 at 10:33









      hakanensarihakanensari

      747279




      747279






















          4 Answers
          4






          active

          oldest

          votes


















          115














          :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.






          share|improve this answer



















          • 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



















          42














          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






          share|improve this answer


























          • 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, but Ctrl+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





















          1














          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






          share|improve this answer

































            0














            I used the Vim menu under File - Split Open. You will have to give a name for your new blank file though.






            share|improve this answer
























            • 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











            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
            });


            }
            });














            draft saved

            draft discarded


















            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









            115














            :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.






            share|improve this answer



















            • 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
















            115














            :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.






            share|improve this answer



















            • 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














            115












            115








            115







            :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.






            share|improve this answer













            :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.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            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














            • 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













            42














            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






            share|improve this answer


























            • 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, but Ctrl+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


















            42














            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






            share|improve this answer


























            • 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, but Ctrl+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
















            42












            42








            42







            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






            share|improve this answer















            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







            share|improve this answer














            share|improve this answer



            share|improve this answer








            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, but Ctrl+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






            • 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








            • 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













            1














            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






            share|improve this answer






























              1














              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






              share|improve this answer




























                1












                1








                1







                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






                share|improve this answer















                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







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Oct 3 '16 at 23:11









                n.st

                1,322924




                1,322924










                answered Sep 24 '16 at 20:06









                edWedW

                1112




                1112























                    0














                    I used the Vim menu under File - Split Open. You will have to give a name for your new blank file though.






                    share|improve this answer
























                    • 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
















                    0














                    I used the Vim menu under File - Split Open. You will have to give a name for your new blank file though.






                    share|improve this answer
























                    • 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














                    0












                    0








                    0







                    I used the Vim menu under File - Split Open. You will have to give a name for your new blank file though.






                    share|improve this answer













                    I used the Vim menu under File - Split Open. You will have to give a name for your new blank file though.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    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



















                    • 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


















                    draft saved

                    draft discarded




















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Список кардиналов, возведённых папой римским Каликстом III

                    Deduzione

                    Mysql.sock missing - “Can't connect to local MySQL server through socket”