8

Currently when I use :terminal to quickly open a terminal in vim, it opens in a new pane. Is it possible to change this behaviour so that it replaces the current one? I realise this would be undesirable for most, but I would rather open the new pane and get it where I want it first (maybe I'll need it open for a little while on the far right of the screen, but if I call :terminal it'll split horizontally and put the terminal on the bottom. It's also much quicker and easier to resize the pane with shortcuts before calling :terminal)

Is this possible?

hiqwertyhi
  • 83
  • 4
  • I did'nt know about :terminal (and in fact it still is'nt available in my current vim version). But I use my own screen based approach that, at least for me, is even better. Maybe it could be interesting to you: https://github.com/bitifet/dotfiles/blob/master/.vim/vimrc_files/screen.vim – bitifet Apr 29 '18 at 21:47

1 Answers1

7

You can replace the current window with a terminal using

:terminal ++curwin
:ter ++curwin     " shorter form

You can create a mapping or command for convenience

nnoremap \t :terminal ++curwin<cr>
command! Terminal terminal ++curwin
Mass
  • 14,080
  • 1
  • 22
  • 47