Skip to content

Instantly share code, notes, and snippets.

@xu-cheng
Last active December 14, 2015 22:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xu-cheng/5160065 to your computer and use it in GitHub Desktop.
Save xu-cheng/5160065 to your computer and use it in GitHub Desktop.
Handle Cygwin Path in Sublime
import os
import re
import sublime
cygwin_drive_regex = re.compile(r"^/cygdrive/([a-zA-Z])/")
def cygwin_path_handle(path):
"""Cygwin Path Support"""
if sublime.platform() == "windows":
return os.path.normcase(re.sub(cygwin_drive_regex, lambda m: "%s:/" % m.groups()[0], path))
else:
return path # do nothing if it is not under windows.
@floodkoff
Copy link

Could you tell me how to use this. I suppose this is exactly what I'm searching for, but I don't know how to use this code in sublime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment