|
@@ -105,7 +105,16 @@ nnoremap <LEADER>gid :read !date +\%Y-\%m-\%d<CR>kJ
|
|
|
function! RegisterSwapDefaultWith()
|
|
|
" Swap the default register with the contents of another
|
|
|
let l = nr2char(getchar())
|
|
|
- execute 'let @x=@' . l . '| let @' . l . '=@" | let @"=@x'
|
|
|
+ if exists('g:termux_clipboard__loaded') && l == '+'
|
|
|
+ silent call job_start(['termux-clipboard-set'] + [getreg('')], {
|
|
|
+ \ "in_io": "null",
|
|
|
+ \ "out_io": "null",
|
|
|
+ \ "err_io": "null",
|
|
|
+ \ "stoponexit": "",
|
|
|
+ \ })
|
|
|
+ else
|
|
|
+ execute 'let @x=@' . l . '| let @' . l . '=@" | let @"=@x'
|
|
|
+ endif
|
|
|
endfunction
|
|
|
nnoremap <Leader>c :call RegisterSwapDefaultWith()<CR>
|
|
|
nnoremap <Leader>C :call RegisterSwapDefaultWith()<CR>+
|