neovim-remote icon indicating copy to clipboard operation
neovim-remote copied to clipboard

Bring neovim-qt to front

Open MartyLake opened this issue 3 years ago • 4 comments

Hello, Not sure if correct repo to kindly ask for a new feature (or maybe I can't read the manual?).

Would it be possible to bring neovim-qt (win32) to the front when calling nvr ? It would save me one alt-tab at each context switch :) Best

MartyLake avatar Apr 06 '21 11:04 MartyLake

I use neither neovim-qt nor Windows and I assume bringing a GUI application to the front requires some kind of Windows-specific scripting (batch file or powershell script).

Also I'm not sure if it should be part of neovim-remote in the first place. It sounds as if you wanted a wrapper script that first calls nvr and then does some magic to bring the application to the front.

So, this won't happen unless someone else makes a PR for it. :)

mhinz avatar Apr 06 '21 13:04 mhinz

Makes sense ! =) At least this wish is registered now, maybe someone with strong win32-fu can make it happen eventually.

MartyLake avatar Apr 06 '21 13:04 MartyLake

Is there any gui of neovim for which this works?

newptcai avatar Nov 13 '21 02:11 newptcai

The following script should work

#!/bin/bash                                                                                                                                                                                   
                                                                                                                                                                                              
                                                                                                                                                                                              
# Check if neovim-qt is running                                                                                                                                                               
if pgrep -x "nvim-qt" > /dev/null                                                                                                                                                             
then                                                                                                                                                                                          
    # echo "nvim-qt is running"                                                                                                                                                               
    # If it is, use nvr to connect to it and bring it to front                                                                                                                                
    nvr --remote-tab-silent "$@"                                                                                                                                                              
    wmctrl -a Neovim                                                                                                                                                                          
else                                                                                                                                                                                          
    # echo "nvim-qt is not running"                                                                                                                                                           
    # If not, start a new one                                                                                                                                                                 
    nvim-qt -- --listen /tmp/nvimsocket "$@"                                                                                                                                                  
fi                                                                                                                                                                                            

newptcai avatar Nov 13 '21 03:11 newptcai