Tip 21Avoiding Nested Neovim Instances
images/neovim-only.png

Any command that you can launch in an external shell can also be run in a terminal buffer. That includes the nvim command itself, meaning you can start a new instance of Neovim inside an existing instance. This scenario is best avoided. In this tip, you’ll learn how the neovim-remote tool allows you to open files in the existing Neovim instance. You’ll also see how to set up a shell alias to prevent you from accidentally creating nested instances of Neovim.

How Can Neovim Run Inside of Neovim?

Use this command to start a fresh instance of Neovim and start a terminal buffer inside:

=> $ nvim +terminal ...

Get Modern Vim now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.