Skip to content

Instantly share code, notes, and snippets.

@blue7wings
Created April 19, 2022 13:43
Show Gist options
  • Save blue7wings/ae0eab7b47a2c6243ee0ab88f6731570 to your computer and use it in GitHub Desktop.
Save blue7wings/ae0eab7b47a2c6243ee0ab88f6731570 to your computer and use it in GitHub Desktop.
How to enable Neovim's Clipboard in Majanro
-- install xsel at first: `yay -S xsel`
-- add the bellow code in your config file
vim.opt.clipboard = vim.opt.clipboard + {'unnamed','unnamedplus'}
vim.cmd([[
let g:clipboard = {
\ 'name': 'myClipboard',
\ 'copy': {
\ '+': ['xsel', '--nodetach', '-i', '-b'],
\ '*': ['xsel', '--nodetach', '-i', '-p'],
\ },
\ 'paste': {
\ '+': ['xsel', '-o', '-b'],
\ '*': ['xsel', '-o', '-p'],
\ },
\ 'cache_enabled': 1,
\ }
]])
-- restart neovim, clipboard will be fine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment