-
Notifications
You must be signed in to change notification settings - Fork 504
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
FR: CLI option to open new files in the existing instance of Neovide instead of creating a new one #1586
Comments
Breaking the current standard and messing up people's workflows is the easiest way to saturate this issues page with an angry mob. Instead of changing the default it would be better to expose an argument which does that, but otherwise I agree this would be a cool feature. |
As it is, Neovide does not seem to be able to run multiple windows in one instance, so doing this would definitely break expected behaviour? |
Yes, an option was what I meant. Edited for clarity. |
+1 To this. I'd be OK with a special CLI command for this, a la VSCode or VimR, or a flag. I'd expect it to open a new buffer, not a new macOS window. |
yep, would be grate feature to have. Solution in this case can be pretty trivial, since #!/bin/sh
NVIM_SOCKET=/tmp/neovide.socket
if [ ! -S $NVIM_SOCKET ]; then
neovide --noidle -- --listen $NVIM_SOCKET $@
else
nvim --server $NVIM_SOCKET --remote $@
fi |
I think it would be nice to have an option that makes it possible to reuse (open) the existing neovide window if you call neovide to open in the CWD that already was opened inside other neovide window. This feature makes it possible to comfortably use Neovide as part of Tmux workflow with sessions and its windows. So you open Neovide window in CWD that you want and continue to use terminal session. Then switch to the existing Neovide window easily calling Neovide again. For example, for me missing this kind of feature is a dealbreaker to use Neovide regularly. |
Agree |
Due to the PR #2395, the |
@fredizzimo sorry to bother you, but I do not think this issue is fully resolved. Just one case (opening via Other than not working on systems other than macOS, opening via |
Yes, re-opening this, I thought we had another cross-platform issue for it, since it's the same on all other platforms, we don't have a built-in way of re-using the same Neovide instance. We had this #1293, but it was closed in favour of this one. With a few shell commands it's easy to support though:
You can replace the port 9034, by any free TCP port on your system, I just selected a number randomly. If you want multiple instances you can use multiple ports Note, you need to full path to the file, if you started the instance in another folder, that's why I added If you use it much, then a shell alias could be created |
Yeah, I am using sth similar to that as a workaround currently, though it is quite cumbersome. It's also not very beginner friendly for people starting out with nvim. |
I've tried both alias nvim='open -a "Neovide"' and I've tried function nvim() {
local nvim_socket
nvim_socket=/tmp/neovide.socket
if [ ! -S $nvim_socket ]; then
nvim --server $nvim_socket --remote-edit $PWD/file.txt
else
nvim --headless --listen $nvim_socket &
neovide --server $nvim_socket
fi
} but both those options seem to have significantly worse performance for me than just running neovide $filename Scrolling is buttery smooth via Would anyone have any suggestions why that might be, or what else I might try to get the normal neovide performance, while being able to add new buffers to the same instance from the cli? |
Is your feature request related to a problem? Please describe.
When Neovide is already open, and I use
neovide
(the CLI) to open another file, another instance of Neovide is opened instead of opening neovide in a new buffer in the already existing instance.This is very impractical, since I often accidentally end up with several neovide instances, which cannot be dealt with properly via the OS (all have the same icon and same app name for app switchers), and also I cannot switch between them with things like
:buffer
.Describe the solution you'd like
a CLI option to open new files in the existing instance of Neovide instead of creating a new one
Describe alternatives you've considered
Only opening the first file via
neovide
and all other files from inside neovide? That is quite cumbersome to do though.As @bboles outlined in a different issue, if the
Neovide.app
would use the "open with" feature on mac properly, one could open files with the app and it would open in the same instance. If that is going to be implemented,open -a "Neovide" {filename}
could be a workaround for this.The text was updated successfully, but these errors were encountered: