Редактировать файлы из Cyberduck в существующем окне Vim

718
Eli Gundry

Я использую Cyberduck в качестве клиента перехода на FTP в Windows. У меня есть только одна жалоба, и каждый раз, когда я нажимаю кнопку редактирования, чтобы редактировать удаленный файл с локальной версией gVim, он открывается в новом окне / экземпляре Vim. Это приводит к перегруженности рабочего стола, а также к тому, что AutoComplPop не работает в полную силу.

То, что я хотел бы сделать, это автоматически открывать каждый файл в новом буфере внутри существующего буфера gVim вместо нового окна, что-то вроде версии gVim для Windows и того, как у него есть возможность редактировать файл в новый буфер. Есть ли способ сделать это в настройках Cyberduck / gVim?

1

1 ответ на вопрос

1
Ryan

I know I'm late to the party, but I found the question and want answers around for future generations.

A workaround can be found in this thread. I created a file called cybervim.bat that contains the following:

start "vim" /B "C:\Program Files (x86)\Vim\vim73\gvim.exe" --remote-tab-silent %* 

I placed that in the Vim folder, although it can go wherever you want. Select that bat file as the default text editor in Cyberduck, and voila! Any documents you open in Cyberduck will open as new tabs in the existing Gvim window. It will flash a slightly annoying command prompt window, but so far I think that's the only way to do this. If you would rather not open it as a new tab, replace --remote-tab-silent with --remote-silent.

If you want all your Cyberduck files open in a Cyberduck dedicated Gvim window, add --servername SOMENAME, replacing SOMENAME with whatever you want. That will create a Vim "server" and all Cyberduck files will open in that window.