diff --git a/vim/shortcuts.vim b/vim/shortcuts.vim index 3534b73..06ee6af 100644 --- a/vim/shortcuts.vim +++ b/vim/shortcuts.vim @@ -126,20 +126,9 @@ if g:uname ==? 'Darwin' "" Mac specific stuff elseif g:uname ==? 'Linux' "" Linux specific stuff - function! s:WaylandYank() - if v:event['regname'] ==# '+' || (v:event['regname'] ==# 'w' && s:plus_to_w) - call system('wl-copy', getreg(v:event['regname'])) - endif - endfunction - - " run s:WaylandYank() after every time text is yanked - augroup waylandyank - autocmd! - autocmd TextYankPost * call s:WaylandYank() - augroup END - + xnoremap "+y y:call system("wl-copy", @") map "+p :let @"=substitute(system('wl-paste --no-newline'), '', '', 'g') \| exec 'normal! ' . v:count1 . 'p' - map "+P :let @"=substitute(system('wl-paste --no-newline'), '', '', 'g') \| exec 'normal! ' . v:count1 . 'P' + map "*p :let @"=substitute(system('wl-paste --no-newline --primary'), '', '', 'g') \| exec 'normal! ' . v:count1 . 'P' else "" Unknown platform endif @@ -147,8 +136,7 @@ endif " Add shortcuts to yank/paste to unnamed/unnamedplus clipboards map y "+y map p "+P -map Y "+y -map P "+P +map P "*p map yp yankstack_substitute_older_paste map yn yankstack_substitute_newer_paste