1

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.

3

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

  • @filbranden Thank you for the answer but how to modify the behavior permanently. What entry will go in .vimrc file ? – ankitj Jan 15 at 14:28
  • @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 at 16:30
  • @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 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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