Skip to content

Instantly share code, notes, and snippets.

@blockloop
Last active August 29, 2015 14:05
Show Gist options
  • Save blockloop/f7f91e5eedc064b235f9 to your computer and use it in GitHub Desktop.
Save blockloop/f7f91e5eedc064b235f9 to your computer and use it in GitHub Desktop.
Launch gvim with cygwin like it should (reuse windows for files)
#!/usr/bin/env ruby
args=''
filepath=''
files=ARGV[0..-1]
if files
for file in files do
if File.exist? file
fp=`cygpath -w '#{file}'`.strip.gsub '\\', '/'
filepath+=" '#{fp.gsub ' ', '\ '}' "
if File.file? file
args="--remote-tab-silent "
end
end
end
else
end
exe = 'C:/Program Files (x86)/vim/vim73/gvim.exe'
spawn "cygstart '#{exe}' #{args} '#{filepath}'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment