June 30, 2020
How to copy text to the clipboard in Neovim
If you want to copy text to the clipboard in Neovim you can do so with xclip. The command is a bit complicated so I highly recommend you binding it to a shortcut.
This is what I have in my Neovim configuration to let me copy marked text using
vmap <C-c> y:call system("xclip -i -selection clipboard", getreg("\""))<CR>:call system("xclip -i", getreg("\""))<CR>
Just make sure to install the tool
xclip if you don’t already have it.
- Tagged in: Neovim | xclip
- Previous post: How to automatically change the current working directory in Neovim
- Next post: Why I follow few users and why it's not personal