1

I could create a terminal with vim by running :term in the vim normal mode. However, this terminal is opened at the top of the window and I would like to open it in the bottom. How could I open it at the bottom? By the way, how could I change the height of this window?

  • 1
    Have a look at the great documentation: :help window-resize and read up on the comand modifiers, start reading at :help :vertical – Christian Brabandt Jul 19 '18 at 6:33
  • In neovim :term doesn't open terminals in split buffer; I don't know about vim. And you could look at splitbelow option. – klaus Jul 19 '18 at 7:25
4

In your ~/.vimrc add the line

set splitbelow

This will cause all splits to happen below (including term)

  • Thanks a lot, how could I change the height of the terminal, and I seem to observe that I could not copy contents in the vim-terminal as I did in pure terminal ? – coin cheung Jul 20 '18 at 3:35
  • Read :help termwinsize to answer the first question. It will tell you how to modify that. You can always look up things by :help command in this case term and scroll. For the second I don't actually know the answer but the help page would likely help. – Steven Walton Jul 20 '18 at 14:08
  • I tried but failed before I asked. I simply add the following lines in my vimrc: set termwinsize = "10*0" and when I open vim and run command :ter, the terminal still occupies half the screen. What mistake did I made then? – coin cheung Jul 21 '18 at 2:34
  • 2
    See also the :below command, e.g. :below terminal – Rich Sep 13 '18 at 13:15
  • @coincheung 10*0 means at least ten rows high. If you want 10 rows exactly, try :set termwinsize=10x0. – Rich Sep 13 '18 at 13:17

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.