Replace osc52yank.vim with autoload script

This commit is contained in:
2021-03-03 20:54:56 +00:00
parent 41a0658cf2
commit 837aa12f9f
4 changed files with 36 additions and 9 deletions

View File

@@ -95,8 +95,14 @@ nnoremap <leader>tm :tabmove<Space>
" Clear search highlights
nnoremap <leader><Space> :nohlsearch<CR>
if exists('loaded_oscyank')
noremap <leader>y :Oscyank<CR>
if tmux#isOption('set-clipboard', 'on') || $SSH_CONNECTION !=# ''
" When connected to a remote session the + selection register is not
" available and the unnamed register is used instead. Add mappings using the
" z register instead.
noremap <leader>y "zy
noremap <leader>Y "zY
" Enable OSC 52 copy on yank.
call osc52#autocmd()
else
" System clipboard yank/put
noremap <leader>y "+y