Skip to content

Instantly share code, notes, and snippets.

@RyanJeong
Created July 24, 2020 02:29
Show Gist options
  • Save RyanJeong/829af1676fa99a71259efd22c8f8fabc to your computer and use it in GitHub Desktop.
Save RyanJeong/829af1676fa99a71259efd22c8f8fabc to your computer and use it in GitHub Desktop.
Windows Subsystem Linux - Make VIM use the clipboard?

Put the following in your .vimrc

" WSL yank support
let s:clip = '/mnt/c/Windows/System32/clip.exe'  " change this path according to your mount point
if executable(s:clip)
    augroup WSLYank
        autocmd!
        autocmd TextYankPost * if v:event.operator ==# 'y' | call system(s:clip, @0) | endif
    augroup END
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment