I wanted to paste the contents of the Windows clipboard when using WSL's VIM.
The WSL environment was determined to be Linux by the previous program.
So I change to determine the WSL environment and to save the clipboard contents
as an image with powershell.
In a WSL environment, C:\ will be written as /mnt/c/.
The difference between this WSL and Windows path is converted by the wslpath
command.
A newline is removed by substitute() because an extra newline is added at the
end.
This change would force the WSL environment to use the Windows clipboard
instead of the Linux clipboard.
WSL is used with Windows, so I don't think this change is a problem, but it
might be better to have the option to switch the behavior if necessary.
I wanted to paste the contents of the Windows clipboard when using WSL's VIM.
The WSL environment was determined to be Linux by the previous program. So I change to determine the WSL environment and to save the clipboard contents as an image with powershell.
In a WSL environment,
C:\
will be written as/mnt/c/
. The difference between this WSL and Windows path is converted by thewslpath
command.A newline is removed by
substitute()
because an extra newline is added at the end.This change would force the WSL environment to use the Windows clipboard instead of the Linux clipboard. WSL is used with Windows, so I don't think this change is a problem, but it might be better to have the option to switch the behavior if necessary.