Terminal within Vim (vim movements inside terminal)

Introduction

Imagine, the power of terminal combined with the flexibility of Vim keybindings. Guess What! You don't have to imagine it anymore. Nor do you have to add anything extra other than having the latest version of Vim installedd in your machine. You can operate on the terminal, as you would with any other document, once you enter the Normal mode we're all familiar with.

Opening a Terminal inside Vim

You can open up a terminal inside vim, and you can interact with the VIM way!

Inside vim, just type, :terminal or :term Boom! You're in! You would notice that there's a terminal, but you can't really interact with it except for writing commands. It would feel like a normal terminal, in-fact, except you won't be able to scroll up! Wait.. What?! Not to worry! You just have to enter 'Nomral' mode Press: <ctrl><\>+<ctrl>+<n> (control backslash followed by control n)

Now, you are IN NORMAL MODE! Inside a terminal!!

Here, you can go do whatever you could do in a document inside vim.

Feel free to move around using h-j-k-l, jump to top using gg, back to the bottom G.

  • Tip: One of the most useful things I found was, you could jump directly to the stack trace location
  • Say, in the terminal you have an error,

  • Now, once you go into normal mode, move to that error line, and press

  • It will take you directly to the line where the error occured!

Thank the author. Fork this blog.


Tagged in gvim