How to have a single NeoVim instance

Questo articolo รจ stato scritto oltre 1 years, il contenuto potrebbe essere datato.

One of the most read article of my blog post is the one about Neovim and PHP (lsp). This time I want to talk to you about another tiny things I did for my setup.

alias vim.tiny="nvim -u NONE"
alias nvim.tiny="nvim -u NONE"

This one is just an alias to use nvim in the tiny version as it is often used on server, so I get to use that command but the part interesting is just a way to run neovim without anything like plugins or custom settings.

The real thing that you were looking for is this Python script that let you to open always a single neovim instance!

2024 Update: Now detects also a Venv environment and activate it before running nvim!

In my case I am using it for nvim-qt but can be used with any UI.

The first step is to configure an alias for nvim-qt like this:

alias nvim-qt="/home/mte90/Desktop/Prog/My-Scripts/misc/"

In this way you will use this script (wrapper) and put that script where you want with execute permissions.

The script automatically will check if nvim is already running in that case use the pynvim library to open in the running instance that new file otherwise will execute nvim-qt.

Just change the path where is needed to adapt on your system ๐Ÿ™‚

Liked it? Take a second to support Mte90 on Patreon!
Become a patron at Patreon!

Leave a Reply

Your email address will not be published. Required fields are marked *