Configuring an "Edit with VIM" context menu in Windows 10 WSL using Registry Editor

Solution 1:

Add an escape character (\) like this:

wslpath '%1' | sed 's| |\\ |g' | xargs vim

What this does is replace all blank with \blank (meaning with \ ).

This way the blank is escaped and no longer serves as a separator, but just as a normal character within the string.