Skip to content

Instantly share code, notes, and snippets.

@Milly
Last active April 13, 2020 08:11
Show Gist options
  • Save Milly/69d4aaaad1d4bd596f3ba43f5498374d to your computer and use it in GitHub Desktop.
Save Milly/69d4aaaad1d4bd596f3ba43f5498374d to your computer and use it in GitHub Desktop.
Open file with existence vim instance.
@echo off
setlocal
set target=%~1
if "" == "%target%" set target=.
if not "" == "%VIM_TERMINAL%" (
echo | set /p=]51;["drop","%target:\=\\%"]
) else if not "" == "%VIM_SERVERNAME%" (
gvim --servername %VIM_SERVERNAME% --remote-silent "%target%"
) else (
gvim --remote-silent "%target%"
)
endlocal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment