7

Opening the vim terminal using :term, creates a horizontal split with the terminal placed at the top half of the window. Is there a way to open the terminal at the bottom half instead?

I know I can use set splitbelow to make all horizontal splits open below the current one. However, I only want the set splitbelow behaviour to apply when opening :term. I want all other horizontal splits to open above as usual.

1
  • Apparently "splitbelow" is default set Maybe split refers to the current page, split splits the screen, splitbelow splits the current screen putting it below, nosplitbelow means it's not okay to split the current screen putting it below If the split family refers to the current screen, this is the logic
    – Matheu
    May 28 at 0:57

1 Answer 1

10

Use :belowright:

:belowright terminal

Or, more succinctly:

:bel term

This command is a modifier and affects the command run right after it.

(Another useful modifier here is :vertical, to split vertically instead.)

3
  • 1
    @filbranden Thank you for the answer but how to modify the behavior permanently. What entry will go in .vimrc file ?
    – ankitj
    Jan 15, 2020 at 14:28
  • 2
    @ankitj You have set splitbelow that you can add to your vimrc, but that will affect any splits, not just the :terminal.
    – filbranden
    Jan 15, 2020 at 16:30
  • 1
    @ankitj You can add cnoremap term bel term to your .vimrc to permanently remap :term to :bel term. If you do that and find yourself wanting to type just term in the command line, you can pause for a moment after typing the t or the e to get Vim to stop looking at it as a potential start to the remap.
    – 8bittree
    Jan 17, 2020 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.