Skip to content

Instantly share code, notes, and snippets.

@Bergiu
Created February 7, 2025 15:38
Show Gist options
  • Save Bergiu/6acb9ac92c3e20d4d5b9b220eb57cac7 to your computer and use it in GitHub Desktop.
Save Bergiu/6acb9ac92c3e20d4d5b9b220eb57cac7 to your computer and use it in GitHub Desktop.
Copy and paste to clipboard in vim in wsl
" ~/.config/nvim/init.vim
" copy to clipboard in WSL
let g:clipboard = {
\ 'name': 'win32-clipboard',
\ 'copy': {
\ '+': 'clip.exe',
\ },
\ 'paste': {
\ '+': '/home/CHANGEME/.config/nvim/paste.sh',
\ },
\ }
#!/bin/bash
# ~/.config/nvim/paste.sh
# You need to make this file executable: chmod +x ~/.config/nvim/paste.sh
powershell.exe -command "Get-Clipboard" | tr -d '\r'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment