DEV Community

roughnemezis
roughnemezis

Posted on

neovim: server mode

personnal note

Impressing neovim feature!

source SOF (see Martin Tournoij's answer)

within neovim: :call serverstart('/tmp/nvim-remote')
(:h serverstart)

and then merely from a python environment

import neovim
nvim = neovim.attach('socket', path='/tmp/nvim-remote')
nvim.command(':echom hello from client')
nvim.command(':echom "hello from client"')
nvim.command(':%s/foo/bar/g')
nvim.command(':e some_file') # can prove useful!!
Enter fullscreen mode Exit fullscreen mode

Practical use case: when navigating in ANY terminal (or tmux) write a function that sends opened files to a single running neovim instance instead of spreading opened vim instances all around
like neovim remote does, but works for any terminal

Top comments (0)