Opening a vertical terminal in Vim 8.1

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
4
down vote

favorite
1












Vim 8.1 added the :terminal command, which opens up a new bash terminal as a split. However, it always seems to be a horizontal split, and I prefer vertical splits. Is there a way to open a terminal as a vertical split without using:



:vsp
:terminal
<c-w>j
:q


Alternatively, is there a way I could add it as a command in my .vimrc, like so:



command Vterm :vsp | :terminal | <c-w>j | :q



The command above chokes on trying to execute <c-w>j, opens a new vim split with the following:




executing job failed: No such file or directory




Just having:



command Vterm :vsp | :terminal



Works fine, but leaves the original split.







share|improve this question

























    up vote
    4
    down vote

    favorite
    1












    Vim 8.1 added the :terminal command, which opens up a new bash terminal as a split. However, it always seems to be a horizontal split, and I prefer vertical splits. Is there a way to open a terminal as a vertical split without using:



    :vsp
    :terminal
    <c-w>j
    :q


    Alternatively, is there a way I could add it as a command in my .vimrc, like so:



    command Vterm :vsp | :terminal | <c-w>j | :q



    The command above chokes on trying to execute <c-w>j, opens a new vim split with the following:




    executing job failed: No such file or directory




    Just having:



    command Vterm :vsp | :terminal



    Works fine, but leaves the original split.







    share|improve this question























      up vote
      4
      down vote

      favorite
      1









      up vote
      4
      down vote

      favorite
      1






      1





      Vim 8.1 added the :terminal command, which opens up a new bash terminal as a split. However, it always seems to be a horizontal split, and I prefer vertical splits. Is there a way to open a terminal as a vertical split without using:



      :vsp
      :terminal
      <c-w>j
      :q


      Alternatively, is there a way I could add it as a command in my .vimrc, like so:



      command Vterm :vsp | :terminal | <c-w>j | :q



      The command above chokes on trying to execute <c-w>j, opens a new vim split with the following:




      executing job failed: No such file or directory




      Just having:



      command Vterm :vsp | :terminal



      Works fine, but leaves the original split.







      share|improve this question













      Vim 8.1 added the :terminal command, which opens up a new bash terminal as a split. However, it always seems to be a horizontal split, and I prefer vertical splits. Is there a way to open a terminal as a vertical split without using:



      :vsp
      :terminal
      <c-w>j
      :q


      Alternatively, is there a way I could add it as a command in my .vimrc, like so:



      command Vterm :vsp | :terminal | <c-w>j | :q



      The command above chokes on trying to execute <c-w>j, opens a new vim split with the following:




      executing job failed: No such file or directory




      Just having:



      command Vterm :vsp | :terminal



      Works fine, but leaves the original split.









      share|improve this question












      share|improve this question




      share|improve this question








      edited May 19 at 9:37









      Thomas

      3,38741023




      3,38741023









      asked May 18 at 18:49









      Schiem

      1234




      1234




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          I'm not sure about regular vim, but the help says the ++curwin option doesn't split the current window. So you should be able to do something like:



          :vs|:term ++curwin


          Or you could use Neovim and just do :vs|:terminal or :vs term://bash :)






          share|improve this answer

















          • 1




            Perfect, works like a charm as a command.
            – Schiem
            May 18 at 21:15

















          up vote
          5
          down vote













          You can use the :vert[ical] command modifier:



          :vert term


          :vertical works with any command that splits a window, for example:



          :vert copen
          :vert help vert





          share|improve this answer























          • This should be the accepted answer; way more straightforward
            – Alex Garcia
            Jun 21 at 21:18










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f444682%2fopening-a-vertical-terminal-in-vim-8-1%23new-answer', 'question_page');

          );

          Post as a guest






























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote



          accepted










          I'm not sure about regular vim, but the help says the ++curwin option doesn't split the current window. So you should be able to do something like:



          :vs|:term ++curwin


          Or you could use Neovim and just do :vs|:terminal or :vs term://bash :)






          share|improve this answer

















          • 1




            Perfect, works like a charm as a command.
            – Schiem
            May 18 at 21:15














          up vote
          2
          down vote



          accepted










          I'm not sure about regular vim, but the help says the ++curwin option doesn't split the current window. So you should be able to do something like:



          :vs|:term ++curwin


          Or you could use Neovim and just do :vs|:terminal or :vs term://bash :)






          share|improve this answer

















          • 1




            Perfect, works like a charm as a command.
            – Schiem
            May 18 at 21:15












          up vote
          2
          down vote



          accepted







          up vote
          2
          down vote



          accepted






          I'm not sure about regular vim, but the help says the ++curwin option doesn't split the current window. So you should be able to do something like:



          :vs|:term ++curwin


          Or you could use Neovim and just do :vs|:terminal or :vs term://bash :)






          share|improve this answer













          I'm not sure about regular vim, but the help says the ++curwin option doesn't split the current window. So you should be able to do something like:



          :vs|:term ++curwin


          Or you could use Neovim and just do :vs|:terminal or :vs term://bash :)







          share|improve this answer













          share|improve this answer



          share|improve this answer











          answered May 18 at 20:56









          m0dular

          63115




          63115







          • 1




            Perfect, works like a charm as a command.
            – Schiem
            May 18 at 21:15












          • 1




            Perfect, works like a charm as a command.
            – Schiem
            May 18 at 21:15







          1




          1




          Perfect, works like a charm as a command.
          – Schiem
          May 18 at 21:15




          Perfect, works like a charm as a command.
          – Schiem
          May 18 at 21:15












          up vote
          5
          down vote













          You can use the :vert[ical] command modifier:



          :vert term


          :vertical works with any command that splits a window, for example:



          :vert copen
          :vert help vert





          share|improve this answer























          • This should be the accepted answer; way more straightforward
            – Alex Garcia
            Jun 21 at 21:18














          up vote
          5
          down vote













          You can use the :vert[ical] command modifier:



          :vert term


          :vertical works with any command that splits a window, for example:



          :vert copen
          :vert help vert





          share|improve this answer























          • This should be the accepted answer; way more straightforward
            – Alex Garcia
            Jun 21 at 21:18












          up vote
          5
          down vote










          up vote
          5
          down vote









          You can use the :vert[ical] command modifier:



          :vert term


          :vertical works with any command that splits a window, for example:



          :vert copen
          :vert help vert





          share|improve this answer















          You can use the :vert[ical] command modifier:



          :vert term


          :vertical works with any command that splits a window, for example:



          :vert copen
          :vert help vert






          share|improve this answer















          share|improve this answer



          share|improve this answer








          edited May 19 at 14:17


























          answered May 19 at 14:12









          Daniel Díaz Carrete

          1936




          1936











          • This should be the accepted answer; way more straightforward
            – Alex Garcia
            Jun 21 at 21:18
















          • This should be the accepted answer; way more straightforward
            – Alex Garcia
            Jun 21 at 21:18















          This should be the accepted answer; way more straightforward
          – Alex Garcia
          Jun 21 at 21:18




          This should be the accepted answer; way more straightforward
          – Alex Garcia
          Jun 21 at 21:18












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f444682%2fopening-a-vertical-terminal-in-vim-8-1%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          Peggy Mitchell

          Palaiologos

          The Forum (Inglewood, California)