Open MrVizious opened 4 years ago
Has anyone found the same problem as I did?
Yes, I was trying to find a solution to the same problem.
Yes, I was trying to find a solution to the same problem.
And did you have any luck with that?
Oh I didn't mean to leave that ambiguous. No, I haven't had any luck with it.
My guess is that the command/argument is just passed through to Vim so this would not be exactly a neovim-remote issue. Still there's probably a solution somewhere with custom command/expression to have this logic in and I'd like to know about it too :)
Edit: https://www.gilesorr.com/blog/vim-tab-drop.html
Edit2: Managed to do it here with 'remote-expr', in this example I was trying to configure Godot external editor, file opening script command:
/bin/bash -c "nvr --remote-expr $'execute(\'tab drop {file} +{line}\')'; wmctrl -a buzaga@buzaga-Dell-System-XPS"
Second command changes the focus to my terminal by the way
My guess is that the command/argument is just passed through to Vim so this would not be exactly a neovim-remote issue. Still there's probably a solution somewhere with custom command/expression to have this logic in and I'd like to know about it too :)
Edit: https://www.gilesorr.com/blog/vim-tab-drop.html Edit2: Managed to do it here with 'remote-expr', in this example I was trying to configure Godot external editor, file opening script command:
/bin/bash -c "nvr --remote-expr $'execute(\'tab drop {file} +{line}\')'; wmctrl -a buzaga@buzaga-Dell-System-XPS"
Second command changes the focus to my terminal by the way
This has only one problem. The +{line} does not seem to work in neovim. Probably a bug.
neovim-remote should provide drop option, see :h drop
My 5 cents on this in zsh
nvr -c "tab drop $argv"
or if you prefer
nvr -c "tab drop $argv | set bufhidden=delete"
in my .zshrc
export NVIM_LISTEN_ADDRESS=/tmp/nvimsocket
function v(){
if [[ -S $NVIM_LISTEN_ADDRESS ]]; then
nvr -c "tab drop $argv | set bufhidden=delete"
else
nvr -s $argv
fi
}
in bash (untested)
nvr -c "tab drop $@"
nvr -c "tab drop $@ | set bufhidden=delete"
Hello!
When I try to open a new file remotely with --remote-tab, and the target nvim instance already has such file being edited in a tab (even if it is the one being edited), it creates a new tab editing the same buffer.
Is this intended behaviour? I ask that because, from what I could gather, that's not the case in regular vim.
Do you know any workarounds?
Thanks!