5

I am new to vim, and I learn that you can interact with the terminal two ways while in vim. The first is to type: ! . The second is :term, when you have a terminal side by side with your source code. As soon as I press :term, my cursor is in the terminal. How do I switch back to the my source code and vice versa? The answer over here does not really help. I tried the key combinations C-W, and then :bn but it only exits terminal, then back to terminal again.

(How do I run a terminal inside of Vim?)

mle0312
  • 365
  • 5
  • 17
  • 2
    You should ask vim questions here: https://vi.stackexchange.com/ – Martin York Feb 19 '19 at 00:21
  • 1
    I'm voting to close this question as off-topic because it belongs on https://vi.stackexchange.com/ – Martin York Feb 19 '19 at 00:24
  • @MartinYork vi.stackexchange.com might be a better forum, but I don't think it's off-topic as it's a tool software developers use all the time which is clearly allowed in this forum. Just my 2 cents. :-) – John Szakmeister Feb 19 '19 at 00:39
  • Sounds like you need practice with split screen navigation. When one enters `:term`, vim defaults to a horizontal split screen. If you read through the entry, `:help :split`, and practice moving between split screens, I think you will be good to go. – Patrick Bacon Feb 19 '19 at 21:36

2 Answers2

7

As :help :terminal says, you can always exit to normal mode using <Ctrl-\><Ctrl-N> (:help CTRL-\_CTRL-N). Use i to return to terminal interaction.

Amadan
  • 191,408
  • 23
  • 240
  • 301
3

You can swich terminal with :shell or :sh and turn back to Vim with exit. You can also use C-z and fg couple in same matter.