1

I want to open and edit files in FileZilla with gvim without opening a new window every time.

I searched online and found this but it doesn't open in same gvim window.

In Filetype associations

. /usr/local/bin/gvim -p
thtml /usr/local/bin/gvim -p
php /usr/local/bin/gvim -p
html /usr/local/bin/gvim -p
css /usr/local/bin/gvim -p

Any help would be great there is little information about this online.

2

I believe gvim --remote is what you're looking for.

If no GVim is running, it will start a new instance of it, but if an instance is already running, gvim --remote will open the file on that instance and raise its window.

See :help --remote for details. You might also like --remote-tab to open the file in a new tab.

If you set your file associations to use gvim --remote, that should take care of opening files from FileZilla on a single GVim instance.

For the record, the gvim -p command you have in the sample file associations in your question will open many files one per tab, but only when you pass GVim multiple file names on the same command-line. It won't reuse an existing GVim window when one is already open.

4
  • 1
    Thanks for i am trying to figure out how that works – Sebastian Tramper Apr 4 '20 at 18:28
  • I can't up vote low rep. Thanks for your help! – Sebastian Tramper Apr 4 '20 at 18:35
  • @SebastianTramper No worries. If that works for you please accept the answer to let others know it worked for you! If it doesn't do exactly what you want, leave a comment, I'm glad to help further. – filbranden Apr 4 '20 at 18:50
  • 1
    I will, it worked only one strange bug happened in FileZilla: if you type "--remote" Filezilla changes the two dash characters into one. So I had to copy --remote from the page and paste it in order to work. – Sebastian Tramper Apr 4 '20 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.