~kiril/vimfiles

dc55cf198d9e910609b3d4e75161094594f793dc — Kiril Vladimirov 3 months ago 58dcb8e
Use easier mapping to copy and paste under Wayland
1 files changed, 2 insertions(+), 3 deletions(-)

M startup/mappings.vim
M startup/mappings.vim => startup/mappings.vim +2 -3
@@ 116,10 116,9 @@ map <leader>g :Git<CR>

if exists('$WAYLAND_DISPLAY')
  if executable('wl-copy')
    xnoremap "+y y:call system("wl-copy", @")<cr>
    xnoremap <leader>y y:call system("wl-copy", @")<cr>
  endif
  if executable('wl-paste')
    nnoremap "+p :let @"=substitute(system("wl-paste --no-newline"), '<C-v><C-m>', '', 'g')<cr>p
    nnoremap "*p :let @"=substitute(system("wl-paste --no-newline --primary"), '<C-v><C-m>', '', 'g')<cr>p
    nnoremap <leader>p :let @"=substitute(system("wl-paste --no-newline"), '<C-v><C-m>', '', 'g')<cr>p
  endif
endif