Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring neovim-qt to front #164

Open
MartyLake opened this issue Apr 6, 2021 · 4 comments
Open

Bring neovim-qt to front #164

MartyLake opened this issue Apr 6, 2021 · 4 comments

Comments

@MartyLake
Copy link

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

@mhinz
Copy link
Owner

mhinz commented Apr 6, 2021

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. :)

@MartyLake
Copy link
Author

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

@newptcai
Copy link

Is there any gui of neovim for which this works?

@newptcai
Copy link

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                                                                                                                                                                                            

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants