[Windows] WSL 2 vim clipboard 동기화

문연수·2022년 2월 15일
0

Windows

목록 보기
5/9

WSL 2vimyank 내용을 Windowsclipboard 로 가져오려면 아래의 설정을 vim conf 파일 내에 기입한다:

" -------------------------------------------------------------
" WSL 2 사용 시 yank 내용을 
" -------------------------------------------------------------
let s:clip = '/mnt/c/Windows/System32/clip.exe'
if executable(s:clip)
    augroup WSLYank
        autocmd!
        autocmd TextYankPost * call system('echo '.
		\shellescape(
			\join(v:event.regcontents, "\<CR>")
		\).' | '.s:clip
	\)
    augroup END
end

출처

[사이트] https://hidekuma.github.io/vim/wsl/synchronize-system-clipboard-vim-on-WSL/

profile
2000.11.30

0개의 댓글