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

remote: open file at line:column in existing or new nvim #28825

Open
paul-hansen opened this issue May 17, 2024 · 0 comments
Open

remote: open file at line:column in existing or new nvim #28825

paul-hansen opened this issue May 17, 2024 · 0 comments
Labels
enhancement feature request remote remote UI, --remote commands, p2p / peer-to-peer
Milestone

Comments

@paul-hansen
Copy link

paul-hansen commented May 17, 2024

Request

I'd like to have an external program trigger opening neovim for a file at the given line and column, reusing any open instances of neovim or creating a new one.

Example integrations that would be benefit from this:
Godot
Unity3d
Wezterm

What I tried

Failed Attempt 1

Currently you can open a file in an existing instance or open a new instance with that file using:

nvim --server --remote-silent "/home/paul/test.txt" 

Problem: This does not support line numbers

Failed Attempt 2

Currently you can open a file at the given line:column in an existing nvim instance using:

nvim --listen ~/.cache/nvim/server.pipe
nvim --server --remote-send ":e /home/paul/test.txt|100G20|<CR>" 

Problem: This does nothing if there isn't an existing instance.

Expected behavior

Vim supported this with

vim --server --remote-silent +"normal 100G5|" "/home/paul/test.txt" 

So I expected that to work, but the [+{cmd]] part of --remote-silent is unimplemented in Neovim as mentioned by the documentation. I don't need it to be implemented the same way as Vim though.

@paul-hansen paul-hansen added the enhancement feature request label May 17, 2024
@zeertzjq zeertzjq added the remote remote UI, --remote commands, p2p / peer-to-peer label May 17, 2024
@justinmk justinmk added this to the backlog milestone May 21, 2024
@justinmk justinmk changed the title Open file at line:column in existing or new nvim instance remote: ppen file at line:column in existing or new nvim May 21, 2024
@justinmk justinmk changed the title remote: ppen file at line:column in existing or new nvim remote: open file at line:column in existing or new nvim May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature request remote remote UI, --remote commands, p2p / peer-to-peer
Projects
None yet
Development

No branches or pull requests

3 participants