Add OSC 52 escape sequence yank
If the `tmux` `set-clipboard` option is set to `on` add the `osc52yank` plugin and change `<leader>y` mapping to use it.
This commit is contained in:
parent
72316785d5
commit
8fac5fb74f
@ -76,11 +76,15 @@ nnoremap <leader>tm :tabmove<Space>
|
|||||||
" Clear search highlights
|
" Clear search highlights
|
||||||
nnoremap <leader><Space> :nohlsearch<CR>
|
nnoremap <leader><Space> :nohlsearch<CR>
|
||||||
|
|
||||||
" System clipboard yank/put
|
if g:use_osc52
|
||||||
noremap <leader>y "+y
|
noremap <leader>y :Oscyank<CR>
|
||||||
noremap <leader>Y "+Y
|
else
|
||||||
noremap <leader>p "+p
|
" System clipboard yank/put
|
||||||
noremap <leader>P "+P
|
noremap <leader>y "+y
|
||||||
|
noremap <leader>Y "+Y
|
||||||
|
noremap <leader>p "+p
|
||||||
|
noremap <leader>P "+P
|
||||||
|
endif
|
||||||
|
|
||||||
" Quickly access spelling menu
|
" Quickly access spelling menu
|
||||||
inoremap <C-s> <C-g>u<C-X>s
|
inoremap <C-s> <C-g>u<C-X>s
|
||||||
|
7
vimrc
7
vimrc
@ -199,3 +199,10 @@ Pack 'mustache/vim-mustache-handlebars'
|
|||||||
Pack 'joshglendenning/vim-caddyfile'
|
Pack 'joshglendenning/vim-caddyfile'
|
||||||
Pack 'kbenzie/vim-khr'
|
Pack 'kbenzie/vim-khr'
|
||||||
Pack 'jrozner/vim-antlr'
|
Pack 'jrozner/vim-antlr'
|
||||||
|
|
||||||
|
" Plugins for remote integrations
|
||||||
|
Pack 'greymd/oscyank.vim', {'type': 'opt'}
|
||||||
|
let g:use_osc52 = trim(system('tmux show-options -g set-clipboard')) ==# 'set-clipboard on'
|
||||||
|
if g:use_osc52
|
||||||
|
packadd oscyank.vim
|
||||||
|
endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user